U
    ^g%i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eeeef e	e d fddZ
eddd	d
Zd dddZd dddZedddZ  ZS )OperatorInstancec                   @   s$   e Zd ZdZdZdZdZdZdZdS )OperatorInstance.AvailabilityZinternalbetapublic
deprecatedzgeneral-availabilityZretiredN)	__name__
__module____qualname__ZINTERNALZBETAZPUBLICZ
DEPRECATEDZGENERAL_AVAILABILITYZRETIRED r   r   c/var/www/html/api-medvista/venv/lib/python3.8/site-packages/twilio/rest/intelligence/v2/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OperatorInstance.__init__OperatorContext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: OperatorContext for this OperatorInstance
        Nr   r   )r.   r2   _versionr-   r/   r   r   r   _proxyO   s    
zOperatorInstance._proxyc                 C   s
   | j  S )]
        Fetch the OperatorInstance


        :returns: The fetched OperatorInstance
        )r8   fetchr7   r   r   r   r:   ^   s    zOperatorInstance.fetchc                    s   | j  I dH S )w
        Asynchronous coroutine to fetch the OperatorInstance


        :returns: The fetched OperatorInstance
        N)r8   fetch_asyncr7   r   r   r   r<   g   s    zOperatorInstance.fetch_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>v   s     z,OperatorInstance.__repr__.<locals>.<genexpr>z,<Twilio.Intelligence.V2.OperatorInstance {}>joinr-   itemsrA   r/   contextr   r   r   __repr__p   s    zOperatorInstance.__repr__)N)r   r   r   objectr   r   r   strr   r   r*   propertyr8   r:   r<   rL   __classcell__r   r   r0   r   r      s     
 		r   c                       sN   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	  Z
S )r2   )r   r   c                    s*   t  | d|i| _djf | j| _dS )z
        Initialize the OperatorContext

        :param version: Version that contains the resource
        :param sid: A 34 character string that uniquely identifies this Operator.
        r   z/Operators/{sid}N)r)   r*   r-   rA   _uri)r/   r   r   r0   r   r   r*   |   s
     zOperatorContext.__init__r3   c                 C   s<   t i }d|d< | jjd| j|d}t| j|| jd dS )r9   application/jsonAcceptGETmethoduriheadersr   r5   )r   ofr6   r:   rQ   r   r-   r/   rX   r   r   r   r   r:      s    
zOperatorContext.fetchc                    sB   t i }d|d< | jjd| j|dI dH }t| j|| jd dS )r;   rR   rS   rT   rU   Nr   r5   )r   rY   r6   r<   rQ   r   r-   rZ   r   r   r   r<      s    
  zOperatorContext.fetch_asyncc                 C   s$   d dd | j D }d|S )r=   r>   c                 s   s   | ]\}}d  ||V  qdS r?   r@   rB   r   r   r   rF      s     z+OperatorContext.__repr__.<locals>.<genexpr>z+<Twilio.Intelligence.V2.OperatorContext {}>rG   rJ   r   r   r   rL      s    zOperatorContext.__repr__)r   r   r   r   rN   r*   r   r:   r<   rL   rP   r   r   r0   r   r2   z   s   r2   c                   @   s2   e Zd Zeeef edddZedddZdS )OperatorPage)r   r4   c                 C   s   t | j|S )zn
        Build an instance of OperatorInstance

        :param payload: Payload response from the API
        )r   r6   )r/   r   r   r   r   get_instance   s    zOperatorPage.get_instancer3   c                 C   s   dS )r=   z%<Twilio.Intelligence.V2.OperatorPage>r   r7   r   r   r   rL      s    zOperatorPage.__repr__N)	r   r   r   r   rN   r   r   r\   rL   r   r   r   r   r[      s   r[   c                       s  e Zd Zed f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 )!OperatorList)r   c                    s   t  | d| _dS )zj
        Initialize the OperatorList

        :param version: Version that contains the resource

        z
/OperatorsN)r)   r*   rQ   )r/   r   r0   r   r   r*      s    zOperatorList.__init__Nr   )r$   language_codelimit	page_sizer4   c                 C   s4   | j ||}| j|||d d}| j ||d S )ak  
        Streams OperatorInstance 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;OperatorInstance.Availability&quot; availability: Returns Operators with the provided availability type. Possible values: internal, beta, public, retired.
        :param str language_code: Returns 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_   )r6   read_limitspagestreamr/   r$   r^   r_   r`   Zlimitsrc   r   r   r   rd      s    zOperatorList.streamc                    s:   | j ||}| j|||d dI dH }| j ||d S )az  
        Asynchronously streams OperatorInstance 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;OperatorInstance.Availability&quot; availability: Returns Operators with the provided availability type. Possible values: internal, beta, public, retired.
        :param str language_code: Returns 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`   ra   Nr_   )r6   rb   
page_asyncstream_asyncre   r   r   r   rg      s    zOperatorList.stream_asyncc                 C   s   t | j||||dS )a  
        Lists OperatorInstance records from the API as a list.
        Unlike stream(), this operation is eager and will load `limit` records into
        memory before returning.

        :param &quot;OperatorInstance.Availability&quot; availability: Returns Operators with the provided availability type. Possible values: internal, beta, public, retired.
        :param str language_code: Returns 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`   )listrd   r/   r$   r^   r_   r`   r   r   r   ri   !  s    zOperatorList.listc                    s(   dd | j ||||dI dH 2 I dH S )a  
        Asynchronously lists OperatorInstance records from the API as a list.
        Unlike stream(), this operation is eager and will load `limit` records into
        memory before returning.

        :param &quot;OperatorInstance.Availability&quot; availability: Returns Operators with the provided availability type. Possible values: internal, beta, public, retired.
        :param str language_code: Returns 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   )rC   recordr   r   r   
<listcomp>X  s   z+OperatorList.list_async.<locals>.<listcomp>rh   N)rg   rj   r   r   r   
list_asyncA  s    
zOperatorList.list_async)r$   r^   
page_tokenpage_numberr`   r4   c           	      C   sN   t |||||d}t ddi}d|d< | jjd| j||d}t| j|S )aT  
        Retrieve a single page of OperatorInstance records from the API.
        Request is executed immediately

        :param availability: Returns Operators with the provided availability type. Possible values: internal, beta, public, retired.
        :param language_code: Returns 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 OperatorInstance
        r   ZLanguageCodeZ	PageTokenr   ZPageSizeContent-Type!application/x-www-form-urlencodedrR   rS   rT   rV   rW   paramsrX   )r   rY   r6   rc   rQ   r[   	r/   r$   r^   rn   ro   r`   datarX   responser   r   r   rc   b  s"    
   zOperatorList.pagec           	         sT   t |||||d}t ddi}d|d< | jjd| j||dI dH }t| j|S )	ac  
        Asynchronously retrieve a single page of OperatorInstance records from the API.
        Request is executed immediately

        :param availability: Returns Operators with the provided availability type. Possible values: internal, beta, public, retired.
        :param language_code: Returns 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 OperatorInstance
        rp   rq   rr   rR   rS   rT   rs   N)r   rY   r6   rf   rQ   r[   ru   r   r   r   rf     s"    
   zOperatorList.page_async)
target_urlr4   c                 C   s   | j jjd|}t| j |S )z
        Retrieve a specific page of OperatorInstance records from the API.
        Request is executed immediately

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

        :returns: Page of OperatorInstance
        rT   )r6   domaintwiliorequestr[   r/   rx   rw   r   r   r   get_page  s    	zOperatorList.get_pagec                    s$   | j jjd|I dH }t| j |S )a  
        Asynchronously retrieve a specific page of OperatorInstance records from the API.
        Request is executed immediately

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

        :returns: Page of OperatorInstance
        rT   N)r6   ry   rz   Zrequest_asyncr[   r|   r   r   r   get_page_async  s    	zOperatorList.get_page_async)r   r4   c                 C   s   t | j|dS z
        Constructs a OperatorContext

        :param sid: A 34 character string that uniquely identifies this Operator.
        r5   r2   r6   r/   r   r   r   r   r+     s    zOperatorList.getc                 C   s   t | j|dS r   r   r   r   r   r   __call__  s    zOperatorList.__call__r3   c                 C   s   dS )r=   z%<Twilio.Intelligence.V2.OperatorList>r   r7   r   r   r   rL     s    zOperatorList.__repr__)r   r   r   r   r*   r   unsetr   rM   rN   r   intr   r   rd   r	   rg   r   ri   rm   r[   rc   rf   r}   r~   r2   r+   r   rL   rP   r   r   r0   r   r]      s   

#

#

"

#




)




'r]   N)__doc__r   typingr   r   r   r   r   r   r	   Ztwilio.baser
   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   r2   r[   r]   r   r   r   r   <module>   s   $aE