U
    ^g%ih                     @   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eeeef e	e d fddZ
eddd	d
ZedddZedddZd dddZd dddZejfeeeeef d dddZejfeeeeef d dddZedddZ  ZS )CustomOperatorInstancec                   @   s$   e Zd ZdZdZdZdZdZdZdS )#CustomOperatorInstance.AvailabilityZinternalbetapublicZretiredzgeneral-availability
deprecatedN)	__name__
__module____qualname__ZINTERNALZBETAZPUBLICZRETIREDZGENERAL_AVAILABILITYZ
DEPRECATED r   r   j/var/www/html/api-medvista/venv/lib/python3.8/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&   Ziso8601_datetimer'   r(   r)   	_solution_context)selfr   r   r   	__class__r   r   r+   2   s,     zCustomOperatorInstance.__init__CustomOperatorContextreturnc                 C   s&   | j dk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   )r/   r3   _versionr.   r0   r   r   r   _proxyO   s    
zCustomOperatorInstance._proxyc                 C   s
   | j  S )q
        Deletes the CustomOperatorInstance


        :returns: True if delete succeeds, False otherwise
        )r9   deleter8   r   r   r   r;   ^   s    zCustomOperatorInstance.deletec                    s   | j  I dH S )
        Asynchronous coroutine that deletes the CustomOperatorInstance


        :returns: True if delete succeeds, False otherwise
        N)r9   delete_asyncr8   r   r   r   r=   g   s    z#CustomOperatorInstance.delete_asyncc                 C   s
   | j  S )i
        Fetch the CustomOperatorInstance


        :returns: The fetched CustomOperatorInstance
        )r9   fetchr8   r   r   r   r?   p   s    zCustomOperatorInstance.fetchc                    s   | j  I dH S )
        Asynchronous coroutine to fetch the CustomOperatorInstance


        :returns: The fetched CustomOperatorInstance
        N)r9   fetch_asyncr8   r   r   r   rA   y   s    z"CustomOperatorInstance.fetch_asyncr!   r&   if_matchr5   c                 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&   rC   )r9   updater0   r!   r&   rC   r   r   r   rF      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
        rE   N)r9   update_asyncrG   r   r   r   rI      s
    z#CustomOperatorInstance.update_asyncc                 C   s$   d dd | j D }d|S )f
        Provide a friendly representation

        :returns: Machine friendly representation
         c                 s   s   | ]\}}d  ||V  qdS z{}={}Nformat.0kvr   r   r   	<genexpr>   s     z2CustomOperatorInstance.__repr__.<locals>.<genexpr>z2<Twilio.Intelligence.V2.CustomOperatorInstance {}>joinr.   itemsrN   r0   contextr   r   r   __repr__   s    zCustomOperatorInstance.__repr__)N)r   r   r   objectr   r   r   strr   r   r+   propertyr9   boolr;   r=   r?   rA   r   unsetr   rF   rI   rY   __classcell__r   r   r1   r   r      s8     
 			

r   c                       s   e Zd Zeed fddZedddZedddZe	dd	d
Z
e	dddZejfeeeeef e	dddZejfeeeeef e	dddZedddZ  ZS )r3   )r   r   c                    s*   t  | d|i| _djf | 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}N)r*   r+   r.   rN   _uri)r0   r   r   r1   r   r   r+      s
     zCustomOperatorContext.__init__r4   c                 C   s   t i }| jjd| j|dS )r:   DELETEmethoduriheaders)r   ofr7   r;   r`   r0   re   r   r   r   r;      s    
zCustomOperatorContext.deletec                    s$   t i }| jjd| j|dI dH S )r<   ra   rb   N)r   rf   r7   r=   r`   rg   r   r   r   r=      s    
  z"CustomOperatorContext.delete_asyncc                 C   s<   t i }d|d< | jjd| j|d}t| j|| jd dS )r>   application/jsonAcceptGETrb   r   r6   )r   rf   r7   r?   r`   r   r.   r0   re   r   r   r   r   r?      s    
zCustomOperatorContext.fetchc                    sB   t i }d|d< | jjd| j|dI dH }t| j|| jd dS )r@   rh   ri   rj   rb   Nr   r6   )r   rf   r7   rA   r`   r   r.   rk   r   r   r   rA      s    
  z!CustomOperatorContext.fetch_asyncrB   c                 C   s|   t |t|d}t i }|t jks@t|tr8|r@||d< d|d< d|d< | jjd| j	||d}t
| j|| jd	 d
S )rD   FriendlyNameConfigIf-Match!application/x-www-form-urlencodedContent-Typerh   ri   POSTrc   rd   datare   r   r6   )r   rf   r   rZ   r^   
isinstancer[   r7   rF   r`   r   r.   r0   r!   r&   rC   rt   re   r   r   r   r   rF     s,    
   zCustomOperatorContext.updatec                    s   t |t|d}t i }|t jks@t|tr8|r@||d< d|d< d|d< | jjd| j	||dI d	H }t
| j|| jd
 dS )rH   rl   ro   rp   rq   rh   ri   rr   rs   Nr   r6   )r   rf   r   rZ   r^   ru   r[   r7   rI   r`   r   r.   rv   r   r   r   rI   2  s,    
   z"CustomOperatorContext.update_asyncc                 C   s$   d dd | j D }d|S )rJ   rK   c                 s   s   | ]\}}d  ||V  qdS rL   rM   rO   r   r   r   rS   _  s     z1CustomOperatorContext.__repr__.<locals>.<genexpr>z1<Twilio.Intelligence.V2.CustomOperatorContext {}>rT   rW   r   r   r   rY   Y  s    zCustomOperatorContext.__repr__)r   r   r   r   r[   r+   r]   r;   r=   r   r?   rA   r   r^   rZ   r   rF   rI   rY   r_   r   r   r1   r   r3      s(   
+
'r3   c                   @   s2   e Zd Zeeef edddZedddZdS )CustomOperatorPage)r   r5   c                 C   s   t | j|S )zt
        Build an instance of CustomOperatorInstance

        :param payload: Payload response from the API
        )r   r7   )r0   r   r   r   r   get_instancee  s    zCustomOperatorPage.get_instancer4   c                 C   s   dS )rJ   z+<Twilio.Intelligence.V2.CustomOperatorPage>r   r8   r   r   r   rY   m  s    zCustomOperatorPage.__repr__N)	r   r   r   r   r[   r   r   rx   rY   r   r   r   r   rw   c  s   rw   c                       sD  e Zd Zed fddZeeeedddZeeeedddZ	e
je
jd	d	fed
ef eeef ee ee ee dddZe
je
jd	d	fed
ef eeef ee ee ee dddZe
je
jd	d	fed
ef eeef ee ee ee dddZe
je
jd	d	fed
ef eeef ee ee ee dddZe
je
je
je
je
jfed
ef eeef eeef eeef eeef edddZe
je
je
je
je
jfed
ef eeef eeef eeef eeef edddZeedddZeedddZeeddd Zeedd!d"Zed#d$d%Z  ZS )&CustomOperatorList)r   c                    s   t  | d| _dS )zp
        Initialize the CustomOperatorList

        :param version: Version that contains the resource

        z/Operators/CustomN)r*   r+   r`   )r0   r   r1   r   r   r+   x  s    zCustomOperatorList.__init__)r!   r$   r&   r5   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
        rm   ZOperatorTypern   rq   rp   rh   ri   rr   rs   )r   rf   r   rZ   r7   creater`   r   r0   r!   r$   r&   rt   re   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
        rz   rq   rp   rh   ri   rr   rs   N)r   rf   r   rZ   r7   create_asyncr`   r   r|   r   r   r   r}     s        zCustomOperatorList.create_asyncNr   )r%   language_codelimit	page_sizer5   c                 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   )r7   read_limitspagestreamr0   r%   r~   r   r   Z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   )r7   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   r0   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 )Nr   )rP   recordr   r   r   
<listcomp>D  s   z1CustomOperatorList.list_async.<locals>.<listcomp>r   N)r   r   r   r   r   
list_async+  s    
zCustomOperatorList.list_async)r%   r~   
page_tokenpage_numberr   r5   c           	      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   ZLanguageCodeZ	PageTokenr   ZPageSizerq   rp   rh   ri   rj   rc   rd   paramsre   )r   rf   r7   r   r`   rw   	r0   r%   r~   r   r   r   rt   re   responser   r   r   r   N  s"    
   zCustomOperatorList.pagec           	         sT   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   rq   rp   rh   ri   rj   r   N)r   rf   r7   r   r`   rw   r   r   r   r   r   w  s"    
   zCustomOperatorList.page_async)
target_urlr5   c                 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
        rj   )r7   domaintwiliorequestrw   r0   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
        rj   N)r7   r   r   Zrequest_asyncrw   r   r   r   r   get_page_async  s    	z!CustomOperatorList.get_page_async)r   r5   c                 C   s   t | j|dS z
        Constructs a CustomOperatorContext

        :param sid: A 34 character string that uniquely identifies this Custom Operator.
        r6   r3   r7   r0   r   r   r   r   r,     s    zCustomOperatorList.getc                 C   s   t | j|dS r   r   r   r   r   r   __call__  s    zCustomOperatorList.__call__r4   c                 C   s   dS )rJ   z+<Twilio.Intelligence.V2.CustomOperatorList>r   r8   r   r   r   rY     s    zCustomOperatorList.__repr__) r   r   r   r   r+   r[   rZ   r   r{   r}   r   r^   r   r   intr   r   r	   r   r   r   r   rw   r   r   r   r   r3   r,   r   rY   r_   r   r   r1   r   ry   v  s     !  $
'
'
&
'



-



)ry   N)__doc__r   typingr   r   r   r   r   r   r	   Ztwilio.baser
   r   r   Ztwilio.base.instance_contextr   Ztwilio.base.instance_resourcer   Ztwilio.base.list_resourcer   Ztwilio.base.versionr   Ztwilio.base.pager   r   r3   rw   ry   r   r   r   r   <module>   s   $  .