o
    f>hHh                     @   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fdededeeef d	d fddZejfdededeeef d	d fddZd	efddZ  ZS )!CustomOperatorInstancec                   @   s   e Zd ZdZdZdZdZdS )#CustomOperatorInstance.AvailabilityinternalbetapublicretiredN)__name__
__module____qualname__INTERNALBETAPUBLICRETIRED r   r   ^/var/www/html/venv/lib/python3.10/site-packages/twilio/rest/intelligence/v2/custom_operator.pyAvailability   s
    r!   Nversionpayloadsidc                    s   t  | |d| _|d| _|d| _|d| _|d| _|d| _t	
|d| _|d| _|d	| _t	|d
| _t	|d| _|d| _d|p\| ji| _d | _d S )Naccount_sidr$   friendly_namedescriptionauthoroperator_typer"   availabilityconfigdate_createddate_updatedurl)super__init__getr%   r$   r&   r'   r(   r)   r
   integerr"   r*   r+   iso8601_datetimer,   r-   r.   	_solution_context)selfr"   r#   r$   	__class__r   r    r0   0   s*   

zCustomOperatorInstance.__init__returnCustomOperatorContextc                 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: CustomOperatorContext for this CustomOperatorInstance
        Nr$   r$   )r5   r:   _versionr4   r6   r   r   r    _proxyM   s   
zCustomOperatorInstance._proxyc                 C   
   | j  S )q
        Deletes the CustomOperatorInstance


        :returns: True if delete succeeds, False otherwise
        )r>   deleter=   r   r   r    rA   \      
zCustomOperatorInstance.deletec                       | j  I dH S )
        Asynchronous coroutine that deletes the CustomOperatorInstance


        :returns: True if delete succeeds, False otherwise
        N)r>   delete_asyncr=   r   r   r    rE   e      z#CustomOperatorInstance.delete_asyncc                 C   r?   )i
        Fetch the CustomOperatorInstance


        :returns: The fetched CustomOperatorInstance
        )r>   fetchr=   r   r   r    rH   n   rB   zCustomOperatorInstance.fetchc                    rC   )
        Asynchronous coroutine to fetch the CustomOperatorInstance


        :returns: The fetched CustomOperatorInstance
        N)r>   fetch_asyncr=   r   r   r    rJ   w   rF   z"CustomOperatorInstance.fetch_asyncr&   r+   if_matchc                 C   s   | j j|||dS )a  
        Update the CustomOperatorInstance

        :param friendly_name: A human-readable name of this resource, up to 64 characters.
        :param config: Operator configuration, following the schema defined by the Operator Type.
        :param if_match: The If-Match HTTP request header

        :returns: The updated CustomOperatorInstance
        r&   r+   rK   )r>   updater6   r&   r+   rK   r   r   r    rN      s
   zCustomOperatorInstance.updatec                    s   | j j|||dI dH S ){  
        Asynchronous coroutine to update the CustomOperatorInstance

        :param friendly_name: A human-readable name of this resource, up to 64 characters.
        :param config: Operator configuration, following the schema defined by the Operator Type.
        :param if_match: The If-Match HTTP request header

        :returns: The updated CustomOperatorInstance
        rM   N)r>   update_asyncrO   r   r   r    rQ      s   z#CustomOperatorInstance.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>       z2CustomOperatorInstance.__repr__.<locals>.<genexpr>z2<Twilio.Intelligence.V2.CustomOperatorInstance {}>joinr4   itemsrX   r6   contextr   r   r    __repr__      
zCustomOperatorInstance.__repr__N)r9   r:   )r9   r   )r   r   r   objectr!   r   r   strr   r   r0   propertyr>   boolrA   rE   rH   rJ   r   unsetr   rN   rQ   rd   __classcell__r   r   r7   r    r      sL    
	
	
	



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fdededeeef de	fddZejfdededeeef de	fddZdefddZ  ZS )r:   r"   r$   c                    s.   t  | d|i| _djdi | j| _dS )z
        Initialize the CustomOperatorContext

        :param version: Version that contains the resource
        :param sid: A 34 character string that uniquely identifies this Custom Operator.
        r$   z/Operators/Custom/{sid}Nr   )r/   r0   r4   rX   _uri)r6   r"   r$   r7   r   r    r0      s   zCustomOperatorContext.__init__r9   c                 C   s   t i }| jjd| j|dS )r@   DELETEmethoduriheaders)r   ofr<   rA   rm   r6   rr   r   r   r    rA      s   
zCustomOperatorContext.deletec                    s&   t i }| jjd| j|dI dH S )rD   rn   ro   N)r   rs   r<   rE   rm   rt   r   r   r    rE      s
   
z"CustomOperatorContext.delete_asyncc                 C   s<   t i }d|d< | jjd| j|d}t| j|| jd dS )rG   application/jsonAcceptGETro   r$   r;   )r   rs   r<   rH   rm   r   r4   r6   rr   r#   r   r   r    rH      s   
zCustomOperatorContext.fetchc                    sD   t i }d|d< | jjd| j|dI dH }t| j|| jd dS )rI   ru   rv   rw   ro   Nr$   r;   )r   rs   r<   rJ   rm   r   r4   rx   r   r   r    rJ      s   
z!CustomOperatorContext.fetch_asyncr&   r+   rK   c                 C   s|   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 )rL   FriendlyNameConfigIf-Match!application/x-www-form-urlencodedContent-Typeru   rv   POSTrp   rq   datarr   r$   r;   )r   rs   r   rg   rk   
isinstancerh   r<   rN   rm   r   r4   r6   r&   r+   rK   r   rr   r#   r   r   r    rN   	  s   

zCustomOperatorContext.updatec                    s   t |t|d}t i }|t ju s!t|tr|r!||d< d|d< d|d< | jjd| j	||dI d	H }t
| j|| jd
 dS )rP   ry   r|   r}   r~   ru   rv   r   r   Nr$   r;   )r   rs   r   rg   rk   r   rh   r<   rQ   rm   r   r4   r   r   r   r    rQ   0  s   

z"CustomOperatorContext.update_asyncc                 C   rR   )rS   rT   c                 s   rU   rV   rW   rY   r   r   r    r]   ]  r^   z1CustomOperatorContext.__repr__.<locals>.<genexpr>z1<Twilio.Intelligence.V2.CustomOperatorContext {}>r_   rb   r   r   r    rd   W  re   zCustomOperatorContext.__repr__)r   r   r   r   rh   r0   rj   rA   rE   r   rH   rJ   r   rk   rg   r   rN   rQ   rd   rl   r   r   r7   r    r:      s6    

+

'r:   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 )CustomOperatorPager#   r9   c                 C   s   t | j|S )zt
        Build an instance of CustomOperatorInstance

        :param payload: Payload response from the API
        )r   r<   )r6   r#   r   r   r    get_instancec  s   zCustomOperatorPage.get_instancec                 C      dS )rS   z+<Twilio.Intelligence.V2.CustomOperatorPage>r   r=   r   r   r    rd   k     zCustomOperatorPage.__repr__N)	r   r   r   r   rh   r   r   r   rd   r   r   r   r    r   a  s    r   c                       s  e Zd Zdef fddZdedededefdd	Zdedededefd
dZ	e
je
jddfdedef deeef dee dee dee f
ddZe
je
jddfdedef deeef dee dee dee f
ddZe
je
jddfdedef deeef dee dee dee f
ddZe
je
jddfdedef deeef dee dee dee f
ddZe
je
je
je
je
jfdedef deee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e
je
jfdedef deee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 ),CustomOperatorListr"   c                    s   t  | d| _dS )zp
        Initialize the CustomOperatorList

        :param version: Version that contains the resource

        z/Operators/CustomN)r/   r0   rm   )r6   r"   r7   r   r    r0   v  s   
zCustomOperatorList.__init__r&   r)   r+   r9   c                 C   sX   t ||t|d}t ddi}d|d< d|d< | jjd| j||d}t| j|S )a  
        Create the CustomOperatorInstance

        :param friendly_name: A human readable description of the new Operator, up to 64 characters.
        :param operator_type: Operator Type for this Operator. References an existing Operator Type resource.
        :param config: Operator configuration, following the schema defined by the Operator Type.

        :returns: The created CustomOperatorInstance
        rz   OperatorTyper{   r~   r}   ru   rv   r   r   )r   rs   r   rg   r<   createrm   r   r6   r&   r)   r+   r   rr   r#   r   r   r    r     s   
zCustomOperatorList.createc                    s`   t ||t|d}t ddi}d|d< d|d< | jjd| j||dI dH }t| j|S )	a  
        Asynchronously create the CustomOperatorInstance

        :param friendly_name: A human readable description of the new Operator, up to 64 characters.
        :param operator_type: Operator Type for this Operator. References an existing Operator Type resource.
        :param config: Operator configuration, following the schema defined by the Operator Type.

        :returns: The created CustomOperatorInstance
        r   r~   r}   ru   rv   r   r   N)r   rs   r   rg   r<   create_asyncrm   r   r   r   r   r    r     s   
zCustomOperatorList.create_asyncNr*   r   language_codelimit	page_sizec                 C   s4   | j ||}| j|||d d}| j ||d S )a  
        Streams CustomOperatorInstance 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 &quot;CustomOperatorInstance.Availability&quot; availability: Returns Custom Operators with the provided availability type. Possible values: internal, beta, public, retired.
        :param str language_code: Returns Custom Operators that support the provided language code.
        :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   r   )r<   read_limitspagestreamr6   r*   r   r   r   limitsr   r   r   r    r     s   zCustomOperatorList.streamc                    s<   | j ||}| j|||d dI dH }| j ||d S )a  
        Asynchronously streams CustomOperatorInstance 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 &quot;CustomOperatorInstance.Availability&quot; availability: Returns Custom Operators with the provided availability type. Possible values: internal, beta, public, retired.
        :param str language_code: Returns Custom Operators that support the provided language code.
        :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     s   zCustomOperatorList.stream_asyncc                 C   s   t | j||||dS )a"  
        Lists CustomOperatorInstance records from the API as a list.
        Unlike stream(), this operation is eager and will load `limit` records into
        memory before returning.

        :param &quot;CustomOperatorInstance.Availability&quot; availability: Returns Custom Operators with the provided availability type. Possible values: internal, beta, public, retired.
        :param str language_code: Returns Custom Operators that support the provided language code.
        :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   r   r   )listr   r6   r*   r   r   r   r   r   r    r     s   zCustomOperatorList.listc                    s*   dd | j ||||dI dH 2 I dH S )a1  
        Asynchronously lists CustomOperatorInstance records from the API as a list.
        Unlike stream(), this operation is eager and will load `limit` records into
        memory before returning.

        :param &quot;CustomOperatorInstance.Availability&quot; availability: Returns Custom Operators with the provided availability type. Possible values: internal, beta, public, retired.
        :param str language_code: Returns Custom Operators that support the provided language code.
        :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 rf   r   )rZ   recordr   r   r    
<listcomp>B  s
    z1CustomOperatorList.list_async.<locals>.<listcomp>r   N)r   r   r   r   r    
list_async)  s   
zCustomOperatorList.list_async
page_tokenpage_numberc           	      C   sN   t |||||d}t ddi}d|d< | jjd| j||d}t| j|S )an  
        Retrieve a single page of CustomOperatorInstance records from the API.
        Request is executed immediately

        :param availability: Returns Custom Operators with the provided availability type. Possible values: internal, beta, public, retired.
        :param language_code: Returns Custom Operators that support the provided language code.
        :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 CustomOperatorInstance
        r!   LanguageCode	PageTokenr   PageSizer~   r}   ru   rv   rw   rp   rq   paramsrr   )r   rs   r<   r   rm   r   	r6   r*   r   r   r   r   r   rr   responser   r   r    r   L  s   

zCustomOperatorList.pagec           	         sV   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 CustomOperatorInstance records from the API.
        Request is executed immediately

        :param availability: Returns Custom Operators with the provided availability type. Possible values: internal, beta, public, retired.
        :param language_code: Returns Custom Operators that support the provided language code.
        :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 CustomOperatorInstance
        r   r~   r}   ru   rv   rw   r   N)r   rs   r<   r   rm   r   r   r   r   r    r   u  s   

zCustomOperatorList.page_async
target_urlc                 C   s   | j jjd|}t| j |S )a  
        Retrieve a specific page of CustomOperatorInstance records from the API.
        Request is executed immediately

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

        :returns: Page of CustomOperatorInstance
        rw   )r<   domaintwiliorequestr   r6   r   r   r   r   r    get_page  s   	zCustomOperatorList.get_pagec                    s&   | j jjd|I dH }t| j |S )a  
        Asynchronously retrieve a specific page of CustomOperatorInstance records from the API.
        Request is executed immediately

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

        :returns: Page of CustomOperatorInstance
        rw   N)r<   r   r   request_asyncr   r   r   r   r    get_page_async  s   	z!CustomOperatorList.get_page_asyncr$   c                 C      t | j|dS z
        Constructs a CustomOperatorContext

        :param sid: A 34 character string that uniquely identifies this Custom Operator.
        r;   r:   r<   r6   r$   r   r   r    r1        zCustomOperatorList.getc                 C   r   r   r   r   r   r   r    __call__  r   zCustomOperatorList.__call__c                 C   r   )rS   z+<Twilio.Intelligence.V2.CustomOperatorList>r   r=   r   r   r    rd     r   zCustomOperatorList.__repr__) r   r   r   r   r0   rh   rg   r   r   r   r   rk   r   r   intr   r   r	   r   r   r   r   r   r   r   r   r   r:   r1   r   rd   rl   r   r   r7   r    r   t  s
   
 
$

'

'

&

'



	
-



	
)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   r:   r   r   r   r   r   r    <module>   s    $  .