o
    f>hw                     @   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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	serialize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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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   V/var/www/html/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| _|d| _t|d| _d
|pt| 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_method read_only_attached_operator_sidsr   )super__init__getr    r!   r"   r#   r$   r
   iso8601_datetimer%   r&   r'   r(   r   r)   r*   r+   r,   r-   integerr   	_solution_context)selfr   r   r   	__class__r   r   r/   3   s8   

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   )r4   r9   _versionr3   r5   r   r   r   _proxyV   s   
zServiceInstance._proxyc                 C   
   | j  S )j
        Deletes the ServiceInstance


        :returns: True if delete succeeds, False otherwise
        )r=   deleter<   r   r   r   r@   e      
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   rD   n      zServiceInstance.delete_asyncc                 C   r>   )[
        Fetch the ServiceInstance


        :returns: The fetched ServiceInstance
        )r=   fetchr<   r   r   r   rG   w   rA   zServiceInstance.fetchc                    rB   )u
        Asynchronous coroutine to fetch the ServiceInstance


        :returns: The fetched ServiceInstance
        N)r=   fetch_asyncr<   r   r   r   rI      rE   zServiceInstance.fetch_asyncif_matchr#   r$   r'   r)   r!   r"   r+   r,   r   c
           
      C   s   | j j|||||||||	d	S )Y  
        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 & language understanding services through using customer data to refine, fine tune and evaluate machine learning models. Note: Data logging cannot be activated via API, only via www.twilio.com, as it requires additional consent.
        :param friendly_name: A human readable description of this resource, up to 64 characters.
        :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   r#   r$   r'   r)   r!   r"   r+   r,   )r=   update
r5   rJ   r#   r$   r'   r)   r!   r"   r+   r,   r   r   r   rM      s   zServiceInstance.updatec
           
         s&   | j j|||||||||	d	I dH S )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 & language understanding services through using customer data to refine, fine tune and evaluate machine learning models. Note: Data logging cannot be activated via API, only via www.twilio.com, as it requires additional consent.
        :param friendly_name: A human readable description of this resource, up to 64 characters.
        :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
        rL   N)r=   update_asyncrN   r   r   r   rP      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 {}>joinr3   itemsrW   r5   contextr   r   r   __repr__      
zServiceInstance.__repr__N)r8   r9   )r8   r   )r   r   r   objectr   r   r   strr   r   r/   propertyr=   boolr@   rD   rG   rI   r   unsetr   rM   rP   rc   __classcell__r   r   r6   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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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 )r9   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/   r3   rW   _uri)r5   r   r   r6   r   r   r/      s   zServiceContext.__init__r8   c                 C   s   t i }| jjd| j|dS )r?   DELETEmethoduriheaders)r   ofr;   r@   rl   r5   rq   r   r   r   r@      s   
zServiceContext.deletec                    s&   t i }| jjd| j|dI dH S )rC   rm   rn   N)r   rr   r;   rD   rl   rs   r   r   r   rD      s
   
zServiceContext.delete_asyncc                 C   s<   t i }d|d< | jjd| j|d}t| j|| jd dS )rF   application/jsonAcceptr   rn   r   r:   )r   rr   r;   rG   rl   r   r3   r5   rq   r   r   r   r   rG     s   
zServiceContext.fetchc                    sD   t i }d|d< | jjd| j|dI dH }t| j|| jd dS )rH   rt   ru   r   rn   Nr   r:   )r   rr   r;   rI   rl   r   r3   rv   r   r   r   rI      s   
zServiceContext.fetch_asyncrJ   r#   r$   r'   r)   r!   r"   r+   r,   r   c
                 C   s   t t|t|||t|t|||	d}
t i }|t ju s/t|tr+|r/||d< d|d< d|d< | jjd| j	|
|d}t
| j|| jd	 d
S )rK   AutoTranscribeDataLoggingFriendlyName
UniqueNameAutoRedactionMediaRedaction
WebhookUrlWebhookHttpMethodIf-Match!application/x-www-form-urlencodedContent-Typert   ru   r   ro   rp   datarq   r   r:   )r   rr   r   boolean_to_stringrj   
isinstancerg   r;   rM   rl   r   r3   r5   rJ   r#   r$   r'   r)   r!   r"   r+   r,   r   rq   r   r   r   r   rM   6  s(   

zServiceContext.updatec
                    s   t t|t|||t|t|||	d}
t i }|t ju s0t|tr,|r0||d< d|d< d|d< | jjd| j	|
|dI d	H }t
| j|| jd
 dS )rO   rw   r   r   r   rt   ru   r   r   Nr   r:   )r   rr   r   r   rj   r   rg   r;   rP   rl   r   r3   r   r   r   r   rP   o  s*   

zServiceContext.update_asyncc                 C   rQ   )rR   rS   c                 s   rT   rU   rV   rX   r   r   r   r\     r]   z*ServiceContext.__repr__.<locals>.<genexpr>z*<Twilio.Intelligence.V2.ServiceContext {}>r^   ra   r   r   r   rc     rd   zServiceContext.__repr__)r   r   r   r   rg   r/   ri   r@   rD   r   rG   rI   r   rj   r   rf   rM   rP   rc   rk   r   r   r6   r   r9      s    







	

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


9r9   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   r8   c                 C   s   t | j|S )zm
        Build an instance of ServiceInstance

        :param payload: Payload response from the API
        )r   r;   )r5   r   r   r   r   get_instance  s   zServicePage.get_instancec                 C      dS )rR   z$<Twilio.Intelligence.V2.ServicePage>r   r<   r   r   r   rc        zServicePage.__repr__N)	r   r   r   r   rg   r   r   r   rc   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/   rl   )r5   r   r6   r   r   r/     s   
zServiceList.__init__r)   r#   r$   r'   r(   r!   r"   r+   r,   r   r8   c
                 C   sv   t |t|t|||t|t|||	d	}
t ddi}d|d< d|d< | jjd| j|
|d}t| j|S )aK  
        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 & language understanding services through using customer data to refine, fine tune and evaluate machine learning models. Note: Data logging cannot be activated via API, only via www.twilio.com, as it requires additional consent.
        :param friendly_name: A human readable description of this resource, up to 64 characters.
        :param language_code: The language code set during Service creation determines the Transcription language for all call recordings processed by that Service. The default is en-US if no language code is set. A Service can only support one language code, and it cannot be updated once it's set.
        :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{   rx   ry   rz   LanguageCoder|   r}   r~   r   r   r   rt   ru   r   r   )r   rr   r   r   r;   createrl   r   r5   r)   r#   r$   r'   r(   r!   r"   r+   r,   r   rq   r   r   r   r   r     s&   
zServiceList.createc
                    s~   t |t|t|||t|t|||	d	}
t ddi}d|d< d|d< | jjd| j|
|dI dH }t| j|S )	aZ  
        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 & language understanding services through using customer data to refine, fine tune and evaluate machine learning models. Note: Data logging cannot be activated via API, only via www.twilio.com, as it requires additional consent.
        :param friendly_name: A human readable description of this resource, up to 64 characters.
        :param language_code: The language code set during Service creation determines the Transcription language for all call recordings processed by that Service. The default is en-US if no language code is set. A Service can only support one language code, and it cannot be updated once it's set.
        :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   rt   ru   r   r   N)r   rr   r   r   r;   create_asyncrl   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   )r;   read_limitspagestreamr5   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   )r;   r   
page_asyncstream_asyncr   r   r   r   r   U  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   r5   r   r   r   r   r   r   n  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 re   r   )rY   recordr   r   r   
<listcomp>  s
    z*ServiceList.list_async.<locals>.<listcomp>r   N)r   r   r   r   r   
list_async  s   
zServiceList.list_async
page_tokenpage_numberc                 C   sJ   t |||d}t ddi}d|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   r   rt   ru   r   ro   rp   paramsrq   )r   rr   r;   r   rl   r   r5   r   r   r   r   rq   responser   r   r   r     s   
zServiceList.pagec                    sR   t |||d}t ddi}d|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   rt   ru   r   r   N)r   rr   r;   r   rl   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   )r;   domaintwiliorequestr   r5   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)r;   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.
        r:   r9   r;   r5   r   r   r   r   r0        zServiceList.getc                 C   r   r   r   r   r   r   r   __call__  r   zServiceList.__call__c                 C   r   )rR   z$<Twilio.Intelligence.V2.ServiceList>r   r<   r   r   r   rc     r   zServiceList.__repr__)NN)!r   r   r   r   r/   r   rj   rg   r   ri   rf   r   r   r   r   intr   r   r	   r   r   r   r   r   r   r   r   r   r9   r0   r   rc   rk   r   r   r6   r   r     s    






	

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

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