o
    /i&~                     @   s   d Z ddlmZ ddlmZmZmZmZmZmZm	Z	 ddl
mZmZ ddlmZ ddlmZ ddlmZ ddlmZ dd	lmZ G d
d deZG dd deZG dd deZG dd deZdS )a  
    This code was generated by
   ___ _ _ _ _ _    _ ____    ____ ____ _    ____ ____ _  _ ____ ____ ____ ___ __   __
    |  | | | | |    | |  | __ |  | |__| | __ | __ |___ |\ | |___ |__/ |__|  | |  | |__/
    |  |_|_| | |___ | |__|    |__| |  | |    |__] |___ | \| |___ |  \ |  |  | |__| |  \

    Twilio - Intelligence
    This is the public Twilio REST API.

    NOTE: This class is auto generated by OpenAPI Generator.
    https://openapi-generator.tech
    Do not edit the class manually.
    )datetime)AnyDictListOptionalUnionIteratorAsyncIterator)deserializevalues)InstanceContext)InstanceResource)ListResource)Version)Pagec                       s  e Zd ZG dd deZ	 	d&dedeeef de	e f fddZ
ed'ddZd	efddZd	efddZd(ddZd(ddZejejejejejejejejejejf
deeef deeef deeef deeef deeef deeef deeef deeef deeef dedef d	d fd d!Zejejejejejejejejejejf
deeef deeef deeef deeef deeef deeef deeef deeef deeef dedef d	d fd"d#Zd	efd$d%Z  ZS ))ServiceInstancec                   @   s   e Zd ZdZdZdZdS )ServiceInstance.HttpMethodGETPOSTNULLN)__name__
__module____qualname__r   r   r    r   r   ^/var/www/html/philips/venv/lib/python3.10/site-packages/twilio/rest/intelligence/v2/service.py
HttpMethod   s    r   Nversionpayloadsidc                    s   t  | |d| _|d| _|d| _|d| _|d| _t	|d| _
t	|d| _|d| _|d	| _|d
| _|d| _|d| _|d| _|d| _t|d| _d
|pn| ji| _d | _d S )Naccount_sidauto_redactionmedia_redactionauto_transcribedata_loggingdate_createddate_updatedfriendly_namelanguage_coder   unique_nameurlwebhook_urlwebhook_http_methodr   )super__init__getr   r    r!   r"   r#   r
   iso8601_datetimer$   r%   r&   r'   r   r(   r)   r*   r+   integerr   	_solution_context)selfr   r   r   	__class__r   r   r-   2   s2   

zServiceInstance.__init__returnServiceContextc                 C   s&   | j du rt| j| jd d| _ | j S )z
        Generate an instance context for the instance, the context is capable of
        performing various actions. All instance actions are proxied to the context

        :returns: ServiceContext for this ServiceInstance
        Nr   r   )r2   r7   _versionr1   r3   r   r   r   _proxyR   s   
zServiceInstance._proxyc                 C   
   | j  S )j
        Deletes the ServiceInstance


        :returns: True if delete succeeds, False otherwise
        )r;   deleter:   r   r   r   r>   a      
zServiceInstance.deletec                       | j  I dH S )
        Asynchronous coroutine that deletes the ServiceInstance


        :returns: True if delete succeeds, False otherwise
        N)r;   delete_asyncr:   r   r   r   rB   j      zServiceInstance.delete_asyncc                 C   r<   )[
        Fetch the ServiceInstance


        :returns: The fetched ServiceInstance
        )r;   fetchr:   r   r   r   rE   s   r?   zServiceInstance.fetchc                    r@   )u
        Asynchronous coroutine to fetch the ServiceInstance


        :returns: The fetched ServiceInstance
        N)r;   fetch_asyncr:   r   r   r   rG   |   rC   zServiceInstance.fetch_asyncif_matchr"   r#   r&   r'   r(   r    r!   r*   r+   r   c                 C   s    | j j|||||||||	|
d
S )  
        Update the ServiceInstance

        :param if_match: The If-Match HTTP request header
        :param auto_transcribe: Instructs the Speech Recognition service to automatically transcribe all recordings made on the account.
        :param data_logging: Data logging allows Twilio to improve the quality of the speech recognition through using customer data to refine its speech recognition models.
        :param friendly_name: A human readable description of this resource, up to 64 characters.
        :param language_code: The default language code of the audio.
        :param unique_name: Provides a unique and addressable name to be assigned to this Service, assigned by the developer, to be optionally used in addition to SID.
        :param auto_redaction: Instructs the Speech Recognition service to automatically redact PII from all transcripts made on this service.
        :param media_redaction: Instructs the Speech Recognition service to automatically redact PII from all transcripts media made on this service. The auto_redaction flag must be enabled, results in error otherwise.
        :param webhook_url: The URL Twilio will request when executing the Webhook.
        :param webhook_http_method:

        :returns: The updated ServiceInstance
        
rH   r"   r#   r&   r'   r(   r    r!   r*   r+   )r;   updater3   rH   r"   r#   r&   r'   r(   r    r!   r*   r+   r   r   r   rK      s   zServiceInstance.updatec                    s(   | j j|||||||||	|
d
I dH S )  
        Asynchronous coroutine to update the ServiceInstance

        :param if_match: The If-Match HTTP request header
        :param auto_transcribe: Instructs the Speech Recognition service to automatically transcribe all recordings made on the account.
        :param data_logging: Data logging allows Twilio to improve the quality of the speech recognition through using customer data to refine its speech recognition models.
        :param friendly_name: A human readable description of this resource, up to 64 characters.
        :param language_code: The default language code of the audio.
        :param unique_name: Provides a unique and addressable name to be assigned to this Service, assigned by the developer, to be optionally used in addition to SID.
        :param auto_redaction: Instructs the Speech Recognition service to automatically redact PII from all transcripts made on this service.
        :param media_redaction: Instructs the Speech Recognition service to automatically redact PII from all transcripts media made on this service. The auto_redaction flag must be enabled, results in error otherwise.
        :param webhook_url: The URL Twilio will request when executing the Webhook.
        :param webhook_http_method:

        :returns: The updated ServiceInstance
        rJ   N)r;   update_asyncrL   r   r   r   rN      s   zServiceInstance.update_asyncc                 C   $   d dd | j D }d|S )f
        Provide a friendly representation

        :returns: Machine friendly representation
         c                 s        | ]\}}d  ||V  qdS z{}={}Nformat.0kvr   r   r   	<genexpr>       z+ServiceInstance.__repr__.<locals>.<genexpr>z+<Twilio.Intelligence.V2.ServiceInstance {}>joinr1   itemsrU   r3   contextr   r   r   __repr__      
zServiceInstance.__repr__N)r6   r7   )r6   r   )r   r   r   objectr   r   r   strr   r   r-   propertyr;   boolr>   rB   rE   rG   r   unsetr   rK   rN   ra   __classcell__r   r   r4   r   r      s    
 	
	
	







	



,







	



*r   c                       s  e Zd Zdedef fddZdefddZdefdd	Zde	fd
dZ
de	fddZejejejejejejejejejejf
deeef deeef deeef deeef deeef deeef deeef deeef deeef dedef de	fddZejejejejejejejejejejf
deeef deeef deeef deeef deeef deeef deeef deeef deeef dedef de	fddZdefddZ  ZS )r7   r   r   c                    s.   t  | d|i| _djdi | j| _dS )z
        Initialize the ServiceContext

        :param version: Version that contains the resource
        :param sid: A 34 character string that uniquely identifies this Service.
        r   z/Services/{sid}Nr   )r,   r-   r1   rU   _uri)r3   r   r   r4   r   r   r-      s   zServiceContext.__init__r6   c                 C   s   | j jd| jdS )r=   DELETEmethoduri)r9   r>   rj   r:   r   r   r   r>      s   zServiceContext.deletec                    s   | j jd| jdI dH S )rA   rk   rl   N)r9   rB   rj   r:   r   r   r   rB      s
   zServiceContext.delete_asyncc                 C   s(   | j jd| jd}t| j || jd dS )rD   r   rl   r   r8   )r9   rE   rj   r   r1   r3   r   r   r   r   rE     s   zServiceContext.fetchc                    s0   | j jd| jdI dH }t| j || jd dS )rF   r   rl   Nr   r8   )r9   rG   rj   r   r1   ro   r   r   r   rG     s   zServiceContext.fetch_asyncrH   r"   r#   r&   r'   r(   r    r!   r*   r+   r   c                 C   sX   t ||||||||	|
d	}t d|i}| jjd| j||d}t| j|| jd dS )rI   	AutoTranscribeDataLoggingFriendlyNameLanguageCode
UniqueNameAutoRedactionMediaRedaction
WebhookUrlWebhookHttpMethodIf-Matchr   rm   rn   dataheadersr   r8   )r   ofr9   rK   rj   r   r1   r3   rH   r"   r#   r&   r'   r(   r    r!   r*   r+   r|   r}   r   r   r   r   rK   1  s(   
zServiceContext.updatec                    s`   t ||||||||	|
d	}t d|i}| jjd| j||dI dH }t| j|| jd dS )rM   rp   rz   r   r{   Nr   r8   )r   r~   r9   rN   rj   r   r1   r   r   r   r   rN   g  s*   
zServiceContext.update_asyncc                 C   rO   )rP   rQ   c                 s   rR   rS   rT   rV   r   r   r   rZ     r[   z*ServiceContext.__repr__.<locals>.<genexpr>z*<Twilio.Intelligence.V2.ServiceContext {}>r\   r_   r   r   r   ra     rb   zServiceContext.__repr__)r   r   r   r   re   r-   rg   r>   rB   r   rE   rG   r   rh   r   rd   rK   rN   ra   ri   r   r   r4   r   r7      s    







	



8







	



6r7   c                   @   s4   e Zd Zdeeef defddZdefddZdS )ServicePager   r6   c                 C   s   t | j|S )zm
        Build an instance of ServiceInstance

        :param payload: Payload response from the API
        )r   r9   ro   r   r   r   get_instance  s   zServicePage.get_instancec                 C      dS )rP   z$<Twilio.Intelligence.V2.ServicePage>r   r:   r   r   r   ra        zServicePage.__repr__N)	r   r   r   r   re   r   r   r   ra   r   r   r   r   r     s    r   c                       s  e Zd Zdef fddZejejejejejejejejfdedee	e
f dee	e
f deee
f deee
f d	ee	e
f d
ee	e
f deee
f dede
f defddZejejejejejejejejfdedee	e
f dee	e
f deee
f deee
f d	ee	e
f d
ee	e
f deee
f dede
f defddZ		d0dee dee dee fddZ		d0dee dee dee fddZ		d0dee dee dee fddZ		d0dee dee dee fddZejejejfdeee
f deee
f deee
f defd d!Zejejejfdeee
f deee
f deee
f defd"d#Zd$edefd%d&Zd$edefd'd(Zd)edefd*d+Zd)edefd,d-Zdefd.d/Z  Z S )1ServiceListr   c                    s   t  | d| _dS )zi
        Initialize the ServiceList

        :param version: Version that contains the resource

        z	/ServicesN)r,   r-   rj   )r3   r   r4   r   r   r-     s   
zServiceList.__init__r(   r"   r#   r&   r'   r    r!   r*   r+   r   r6   c
                 C   s>   t |||||||||	d	}
| jjd| j|
d}t| j|S )a  
        Create the ServiceInstance

        :param unique_name: Provides a unique and addressable name to be assigned to this Service, assigned by the developer, to be optionally used in addition to SID.
        :param auto_transcribe: Instructs the Speech Recognition service to automatically transcribe all recordings made on the account.
        :param data_logging: Data logging allows Twilio to improve the quality of the speech recognition through using customer data to refine its speech recognition models.
        :param friendly_name: A human readable description of this resource, up to 64 characters.
        :param language_code: The default language code of the audio.
        :param auto_redaction: Instructs the Speech Recognition service to automatically redact PII from all transcripts made on this service.
        :param media_redaction: Instructs the Speech Recognition service to automatically redact PII from all transcripts media made on this service. The auto_redaction flag must be enabled, results in error otherwise.
        :param webhook_url: The URL Twilio will request when executing the Webhook.
        :param webhook_http_method:

        :returns: The created ServiceInstance
        	ru   rq   rr   rs   rt   rv   rw   rx   ry   r   rm   rn   r|   )r   r~   r9   createrj   r   r3   r(   r"   r#   r&   r'   r    r!   r*   r+   r|   r   r   r   r   r     s$   zServiceList.createc
                    sF   t |||||||||	d	}
| jjd| j|
dI dH }t| j|S )a  
        Asynchronously create the ServiceInstance

        :param unique_name: Provides a unique and addressable name to be assigned to this Service, assigned by the developer, to be optionally used in addition to SID.
        :param auto_transcribe: Instructs the Speech Recognition service to automatically transcribe all recordings made on the account.
        :param data_logging: Data logging allows Twilio to improve the quality of the speech recognition through using customer data to refine its speech recognition models.
        :param friendly_name: A human readable description of this resource, up to 64 characters.
        :param language_code: The default language code of the audio.
        :param auto_redaction: Instructs the Speech Recognition service to automatically redact PII from all transcripts made on this service.
        :param media_redaction: Instructs the Speech Recognition service to automatically redact PII from all transcripts media made on this service. The auto_redaction flag must be enabled, results in error otherwise.
        :param webhook_url: The URL Twilio will request when executing the Webhook.
        :param webhook_http_method:

        :returns: The created ServiceInstance
        r   r   r   N)r   r~   r9   create_asyncrj   r   r   r   r   r   r     s&   zServiceList.create_asyncNlimit	page_sizec                 C   s0   | j ||}| j|d d}| j ||d S )a]  
        Streams ServiceInstance records from the API as a generator stream.
        This operation lazily loads records as efficiently as possible until the limit
        is reached.
        The results are returned as a generator, so this operation is memory efficient.

        :param limit: Upper limit for the number of records to return. stream()
                      guarantees to never return more than limit.  Default is no limit
        :param page_size: Number of records to fetch per request, when not set will use
                          the default value of 50 records.  If no page_size is defined
                          but a limit is defined, stream() will attempt to read the
                          limit with the most efficient page size, i.e. min(limit, 1000)

        :returns: Generator that will yield up to limit results
        r   r   r   )r9   read_limitspagestreamr3   r   r   limitsr   r   r   r   r   '  s   zServiceList.streamc                    s8   | j ||}| j|d dI dH }| j ||d S )al  
        Asynchronously streams ServiceInstance records from the API as a generator stream.
        This operation lazily loads records as efficiently as possible until the limit
        is reached.
        The results are returned as a generator, so this operation is memory efficient.

        :param limit: Upper limit for the number of records to return. stream()
                      guarantees to never return more than limit.  Default is no limit
        :param page_size: Number of records to fetch per request, when not set will use
                          the default value of 50 records.  If no page_size is defined
                          but a limit is defined, stream() will attempt to read the
                          limit with the most efficient page size, i.e. min(limit, 1000)

        :returns: Generator that will yield up to limit results
        r   r   Nr   )r9   r   
page_asyncstream_asyncr   r   r   r   r   @  s   zServiceList.stream_asyncc                 C   s   t | j||dS )a  
        Lists ServiceInstance records from the API as a list.
        Unlike stream(), this operation is eager and will load `limit` records into
        memory before returning.

        :param limit: Upper limit for the number of records to return. list() guarantees
                      never to return more than limit.  Default is no limit
        :param page_size: Number of records to fetch per request, when not set will use
                          the default value of 50 records.  If no page_size is defined
                          but a limit is defined, list() will attempt to read the limit
                          with the most efficient page size, i.e. min(limit, 1000)

        :returns: list that will contain up to limit results
        r   r   )listr   r3   r   r   r   r   r   r   Y  s   zServiceList.listc                    s&   dd | j ||dI dH 2 I dH S )a	  
        Asynchronously lists ServiceInstance records from the API as a list.
        Unlike stream(), this operation is eager and will load `limit` records into
        memory before returning.

        :param limit: Upper limit for the number of records to return. list() guarantees
                      never to return more than limit.  Default is no limit
        :param page_size: Number of records to fetch per request, when not set will use
                          the default value of 50 records.  If no page_size is defined
                          but a limit is defined, list() will attempt to read the limit
                          with the most efficient page size, i.e. min(limit, 1000)

        :returns: list that will contain up to limit results
        c                    s   g | z3 d H W }|q6 S rc   r   )rW   recordr   r   r   
<listcomp>  s
    z*ServiceList.list_async.<locals>.<listcomp>r   N)r   r   r   r   r   
list_asyncs  s   
zServiceList.list_async
page_tokenpage_numberc                 C   s2   t |||d}| jjd| j|d}t| j|S )as  
        Retrieve a single page of ServiceInstance records from the API.
        Request is executed immediately

        :param page_token: PageToken provided by the API
        :param page_number: Page Number, this value is simply for client state
        :param page_size: Number of records to return, defaults to 50

        :returns: Page of ServiceInstance
        	PageTokenr   PageSizer   rm   rn   params)r   r~   r9   r   rj   r   r3   r   r   r   r|   responser   r   r   r     s   zServiceList.pagec                    s:   t |||d}| jjd| j|dI dH }t| j|S )a  
        Asynchronously retrieve a single page of ServiceInstance records from the API.
        Request is executed immediately

        :param page_token: PageToken provided by the API
        :param page_number: Page Number, this value is simply for client state
        :param page_size: Number of records to return, defaults to 50

        :returns: Page of ServiceInstance
        r   r   r   N)r   r~   r9   r   rj   r   r   r   r   r   r     s   zServiceList.page_async
target_urlc                 C   s   | j jjd|}t| j |S )z
        Retrieve a specific page of ServiceInstance records from the API.
        Request is executed immediately

        :param target_url: API-generated URL for the requested results page

        :returns: Page of ServiceInstance
        r   )r9   domaintwiliorequestr   r3   r   r   r   r   r   get_page  s   	zServiceList.get_pagec                    s&   | j jjd|I dH }t| j |S )a  
        Asynchronously retrieve a specific page of ServiceInstance records from the API.
        Request is executed immediately

        :param target_url: API-generated URL for the requested results page

        :returns: Page of ServiceInstance
        r   N)r9   r   r   request_asyncr   r   r   r   r   get_page_async  s   	zServiceList.get_page_asyncr   c                 C      t | j|dS z
        Constructs a ServiceContext

        :param sid: A 34 character string that uniquely identifies this Service.
        r8   r7   r9   r3   r   r   r   r   r.        zServiceList.getc                 C   r   r   r   r   r   r   r   __call__  r   zServiceList.__call__c                 C   r   )rP   z$<Twilio.Intelligence.V2.ServiceList>r   r:   r   r   r   ra     r   zServiceList.__repr__)NN)!r   r   r   r   r-   r   rh   re   r   rg   rd   r   r   r   r   intr   r   r	   r   r   r   r   r   r   r   r   r   r7   r.   r   ra   ri   r   r   r4   r   r     s    






	


4






	


3











r   N)__doc__r   typingr   r   r   r   r   r   r	   twilio.baser
   r   twilio.base.instance_contextr   twilio.base.instance_resourcer   twilio.base.list_resourcer   twilio.base.versionr   twilio.base.pager   r   r7   r   r   r   r   r   r   <module>   s    $ J E