o
    f>hH                     @   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dedeeef de	e f fddZ
edddZdddZdddZd	efddZ  ZS )OperatorInstancec                   @   s   e Zd ZdZdZdZdZdS )OperatorInstance.AvailabilityinternalbetapublicretiredN)__name__
__module____qualname__INTERNALBETAPUBLICRETIRED r   r   W/var/www/html/venv/lib/python3.10/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*   iso8601_datetimer+   r,   r-   	_solution_context)selfr!   r"   r#   	__class__r   r   r/   0   s,   

zOperatorInstance.__init__returnOperatorContextc                 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: OperatorContext for this OperatorInstance
        Nr#   r#   )r4   r9   _versionr3   r5   r   r   r   _proxyM   s   
zOperatorInstance._proxyc                 C   s
   | j  S )]
        Fetch the OperatorInstance


        :returns: The fetched OperatorInstance
        )r=   fetchr<   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)r=   fetch_asyncr<   r   r   r   rA   e   s   zOperatorInstance.fetch_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>t       z,OperatorInstance.__repr__.<locals>.<genexpr>z,<Twilio.Intelligence.V2.OperatorInstance {}>joinr3   itemsrH   r5   contextr   r   r   __repr__n      
zOperatorInstance.__repr__N)r8   r9   )r8   r   )r   r   r   objectr    r   r   strr   r   r/   propertyr=   r?   rA   rT   __classcell__r   r   r6   r   r      s     


		r   c                       sP   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	  Z
S )r9   r!   r#   c                    s.   t  | d|i| _djdi | 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}Nr   )r.   r/   r3   rH   _uri)r5   r!   r#   r6   r   r   r/   z   s   zOperatorContext.__init__r8   c                 C   s<   t i }d|d< | jjd| j|d}t| j|| jd dS )r>   application/jsonAcceptGETmethoduriheadersr#   r:   )r   ofr;   r?   r[   r   r3   r5   rb   r"   r   r   r   r?      s   
zOperatorContext.fetchc                    sD   t i }d|d< | jjd| j|dI dH }t| j|| jd dS )r@   r\   r]   r^   r_   Nr#   r:   )r   rc   r;   rA   r[   r   r3   rd   r   r   r   rA      s   
zOperatorContext.fetch_asyncc                 C   rB   )rC   rD   c                 s   rE   rF   rG   rI   r   r   r   rM      rN   z+OperatorContext.__repr__.<locals>.<genexpr>z+<Twilio.Intelligence.V2.OperatorContext {}>rO   rR   r   r   r   rT      rU   zOperatorContext.__repr__)r   r   r   r   rX   r/   r   r?   rA   rT   rZ   r   r   r6   r   r9   x   s
    r9   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 )OperatorPager"   r8   c                 C   s   t | j|S )zn
        Build an instance of OperatorInstance

        :param payload: Payload response from the API
        )r   r;   )r5   r"   r   r   r   get_instance   s   zOperatorPage.get_instancec                 C      dS )rC   z%<Twilio.Intelligence.V2.OperatorPage>r   r<   r   r   r   rT         zOperatorPage.__repr__N)	r   r   r   r   rX   r   r   rf   rT   r   r   r   r   re      s    re   c                       sX  e Zd Zdef 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 )%OperatorListr!   c                    s   t  | d| _dS )zj
        Initialize the OperatorList

        :param version: Version that contains the resource

        z
/OperatorsN)r.   r/   r[   )r5   r!   r6   r   r   r/      s   
zOperatorList.__init__Nr)   r   language_codelimit	page_sizer8   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
        rl   r)   rj   rl   rk   )r;   read_limitspagestreamr5   r)   rj   rk   rl   limitsro   r   r   r   rp      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
        rl   rm   Nrk   )r;   rn   
page_asyncstream_asyncrq   r   r   r   rt      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)   rj   rk   rl   )listrp   r5   r)   rj   rk   rl   r   r   r   rv     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 rV   r   )rJ   recordr   r   r   
<listcomp>V  s
    z+OperatorList.list_async.<locals>.<listcomp>ru   N)rt   rw   r   r   r   
list_async?  s   
zOperatorList.list_async
page_tokenpage_numberc           	      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    LanguageCode	PageTokenr   PageSizeContent-Type!application/x-www-form-urlencodedr\   r]   r^   r`   ra   paramsrb   )r   rc   r;   ro   r[   re   	r5   r)   rj   r{   r|   rl   datarb   responser   r   r   ro   `  s   

zOperatorList.pagec           	         sV   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
        r}   r   r   r\   r]   r^   r   N)r   rc   r;   rs   r[   re   r   r   r   r   rs     s   

zOperatorList.page_async
target_urlc                 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
        r^   )r;   domaintwiliorequestre   r5   r   r   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
        r^   N)r;   r   r   request_asyncre   r   r   r   r   get_page_async  s   	zOperatorList.get_page_asyncr#   c                 C      t | j|dS z
        Constructs a OperatorContext

        :param sid: A 34 character string that uniquely identifies this Operator.
        r:   r9   r;   r5   r#   r   r   r   r0        zOperatorList.getc                 C   r   r   r   r   r   r   r   __call__  r   zOperatorList.__call__c                 C   rg   )rC   z%<Twilio.Intelligence.V2.OperatorList>r   r<   r   r   r   rT     rh   zOperatorList.__repr__)r   r   r   r   r/   r   unsetr   rW   rX   r   intr   r   rp   r	   rt   r   rv   rz   re   ro   rs   r   r   r9   r0   r   rT   rZ   r   r   r6   r   ri      s    


#


#


"


#





)





'ri   N)__doc__r   typingr   r   r   r   r   r   r	   twilio.baser
   r   twilio.base.instance_contextr   twilio.base.instance_resourcer   twilio.base.list_resourcer   twilio.base.versionr   twilio.base.pager   r   r9   re   ri   r   r   r   r   <module>   s    $_E