U
    hRfF                     @   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S )OperatorInstance.AvailabilityZinternalbetapublicZretiredN)__name__
__module____qualname__ZINTERNALZBETAZPUBLICZRETIRED r   r   H/tmp/pip-unpacked-wheel-74se_viw/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$   iso8601_datetimer%   r&   r'   	_solution_context)selfr   r   r   	__class__r   r   r)   0   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   _proxyM   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<   e   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>t   s     z,OperatorInstance.__repr__.<locals>.<genexpr>z,<Twilio.Intelligence.V2.OperatorInstance {}>joinr-   itemsrA   r/   contextr   r   r   __repr__n   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)   z   s
     zOperatorContext.__init__r3   c                 C   s(   | j jd| jd}t| j || jd dS )r9   GETmethodurir   r5   )r6   r:   rQ   r   r-   r/   r   r   r   r   r:      s    zOperatorContext.fetchc                    s.   | j jd| jdI dH }t| j || jd dS )r;   rR   rS   Nr   r5   )r6   r<   rQ   r   r-   rV   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   x   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   rV   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   rX   rL   r   r   r   r   rW      s   rW   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#   rZ   r\   r[   )r6   read_limitspagestreamr/   r#   rZ   r[   r\   Zlimitsr_   r   r   r   r`      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\   r]   Nr[   )r6   r^   
page_asyncstream_asyncra   r   r   r   rc      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#   rZ   r[   r\   )listr`   r/   r#   rZ   r[   r\   r   r   r   re     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>R  s   z+OperatorList.list_async.<locals>.<listcomp>rd   N)rc   rf   r   r   r   
list_async;  s    
zOperatorList.list_async)r#   rZ   
page_tokenpage_numberr\   r4   c                 C   s6   t |||||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PageSizerR   rT   rU   params)r   ofr6   r_   rQ   rW   r/   r#   rZ   rj   rk   r\   dataresponser   r   r   r_   \  s    
zOperatorList.pagec                    s<   t |||||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
        rl   rR   rm   N)r   ro   r6   rb   rQ   rW   rp   r   r   r   rb   }  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
        rR   )r6   domaintwiliorequestrW   r/   rs   rr   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
        rR   N)r6   rt   ru   Zrequest_asyncrW   rw   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 rz   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   Zunsetr   rM   rN   r   intr   r   r`   r	   rc   r   re   ri   rW   r_   rb   rx   ry   r2   r*   r}   rL   rP   r   r   r0   r   rY      s   

#

#

"

#




#




#rY   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   rW   rY   r   r   r   r   <module>   s   $_A