U
    ^g%iL                     @   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 )PrebuiltOperatorInstancec                   @   s    e Zd ZdZdZdZdZdZdS )%PrebuiltOperatorInstance.AvailabilityZinternalbetapublicZretiredzgeneral-availabilityN)__name__
__module____qualname__ZINTERNALZBETAZPUBLICZRETIREDZGENERAL_AVAILABILITY r   r   l/var/www/html/api-medvista/venv/lib/python3.8/site-packages/twilio/rest/intelligence/v2/prebuilt_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)   1   s,     z!PrebuiltOperatorInstance.__init__PrebuiltOperatorContext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: PrebuiltOperatorContext for this PrebuiltOperatorInstance
        Nr   r   )r-   r1   _versionr,   r.   r   r   r   _proxyN   s    
zPrebuiltOperatorInstance._proxyc                 C   s
   | j  S )m
        Fetch the PrebuiltOperatorInstance


        :returns: The fetched PrebuiltOperatorInstance
        )r7   fetchr6   r   r   r   r9   ]   s    zPrebuiltOperatorInstance.fetchc                    s   | j  I dH S )
        Asynchronous coroutine to fetch the PrebuiltOperatorInstance


        :returns: The fetched PrebuiltOperatorInstance
        N)r7   fetch_asyncr6   r   r   r   r;   f   s    z$PrebuiltOperatorInstance.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>u   s     z4PrebuiltOperatorInstance.__repr__.<locals>.<genexpr>z4<Twilio.Intelligence.V2.PrebuiltOperatorInstance {}>joinr,   itemsr@   r.   contextr   r   r   __repr__o   s    z!PrebuiltOperatorInstance.__repr__)N)r   r   r   objectr   r   r   strr   r   r)   propertyr7   r9   r;   rK   __classcell__r   r   r/   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 )r1   )r   r   c                    s*   t  | d|i| _djf | j| _dS )z
        Initialize the PrebuiltOperatorContext

        :param version: Version that contains the resource
        :param sid: A 34 character string that uniquely identifies this Pre-built Operator.
        r   z/Operators/PreBuilt/{sid}N)r(   r)   r,   r@   _uri)r.   r   r   r/   r   r   r)   {   s
     z PrebuiltOperatorContext.__init__r2   c                 C   s<   t i }d|d< | jjd| j|d}t| j|| jd dS )r8   application/jsonAcceptGETmethoduriheadersr   r4   )r   ofr5   r9   rP   r   r,   r.   rW   r   r   r   r   r9      s    
zPrebuiltOperatorContext.fetchc                    sB   t i }d|d< | jjd| j|dI dH }t| j|| jd dS )r:   rQ   rR   rS   rT   Nr   r4   )r   rX   r5   r;   rP   r   r,   rY   r   r   r   r;      s    
  z#PrebuiltOperatorContext.fetch_asyncc                 C   s$   d dd | j D }d|S )r<   r=   c                 s   s   | ]\}}d  ||V  qdS r>   r?   rA   r   r   r   rE      s     z3PrebuiltOperatorContext.__repr__.<locals>.<genexpr>z3<Twilio.Intelligence.V2.PrebuiltOperatorContext {}>rF   rI   r   r   r   rK      s    z PrebuiltOperatorContext.__repr__)r   r   r   r   rM   r)   r   r9   r;   rK   rO   r   r   r/   r   r1   y   s   r1   c                   @   s2   e Zd Zeeef edddZedddZdS )PrebuiltOperatorPage)r   r3   c                 C   s   t | j|S )zv
        Build an instance of PrebuiltOperatorInstance

        :param payload: Payload response from the API
        )r   r5   )r.   r   r   r   r   get_instance   s    z!PrebuiltOperatorPage.get_instancer2   c                 C   s   dS )r<   z-<Twilio.Intelligence.V2.PrebuiltOperatorPage>r   r6   r   r   r   rK      s    zPrebuiltOperatorPage.__repr__N)	r   r   r   r   rM   r   r   r[   rK   r   r   r   r   rZ      s   rZ   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 )!PrebuiltOperatorList)r   c                    s   t  | d| _dS )zr
        Initialize the PrebuiltOperatorList

        :param version: Version that contains the resource

        z/Operators/PreBuiltN)r(   r)   rP   )r.   r   r/   r   r   r)      s    zPrebuiltOperatorList.__init__Nr   )r#   language_codelimit	page_sizer3   c                 C   s4   | j ||}| j|||d d}| j ||d S )a  
        Streams PrebuiltOperatorInstance 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;PrebuiltOperatorInstance.Availability&quot; availability: Returns Pre-built Operators with the provided availability type. Possible values: internal, beta, public, retired.
        :param str language_code: Returns Pre-built 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^   )r5   read_limitspagestreamr.   r#   r]   r^   r_   Zlimitsrb   r   r   r   rc      s    zPrebuiltOperatorList.streamc                    s:   | j ||}| j|||d dI dH }| j ||d S )a  
        Asynchronously streams PrebuiltOperatorInstance 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;PrebuiltOperatorInstance.Availability&quot; availability: Returns Pre-built Operators with the provided availability type. Possible values: internal, beta, public, retired.
        :param str language_code: Returns Pre-built 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^   )r5   ra   
page_asyncstream_asyncrd   r   r   r   rf     s    z!PrebuiltOperatorList.stream_asyncc                 C   s   t | j||||dS )a,  
        Lists PrebuiltOperatorInstance records from the API as a list.
        Unlike stream(), this operation is eager and will load `limit` records into
        memory before returning.

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

        :param &quot;PrebuiltOperatorInstance.Availability&quot; availability: Returns Pre-built Operators with the provided availability type. Possible values: internal, beta, public, retired.
        :param str language_code: Returns Pre-built 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   )rB   recordr   r   r   
<listcomp>_  s   z3PrebuiltOperatorList.list_async.<locals>.<listcomp>rg   N)rf   ri   r   r   r   
list_asyncF  s    
zPrebuiltOperatorList.list_async)r#   r]   
page_tokenpage_numberr_   r3   c           	      C   sN   t |||||d}t ddi}d|d< | jjd| j||d}t| j|S )ax  
        Retrieve a single page of PrebuiltOperatorInstance records from the API.
        Request is executed immediately

        :param availability: Returns Pre-built Operators with the provided availability type. Possible values: internal, beta, public, retired.
        :param language_code: Returns Pre-built 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 PrebuiltOperatorInstance
        r   ZLanguageCodeZ	PageTokenr   ZPageSizeContent-Type!application/x-www-form-urlencodedrQ   rR   rS   rU   rV   paramsrW   )r   rX   r5   rb   rP   rZ   	r.   r#   r]   rm   rn   r_   datarW   responser   r   r   rb   i  s"    
   zPrebuiltOperatorList.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 PrebuiltOperatorInstance records from the API.
        Request is executed immediately

        :param availability: Returns Pre-built Operators with the provided availability type. Possible values: internal, beta, public, retired.
        :param language_code: Returns Pre-built 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 PrebuiltOperatorInstance
        ro   rp   rq   rQ   rR   rS   rr   N)r   rX   r5   re   rP   rZ   rt   r   r   r   re     s"    
   zPrebuiltOperatorList.page_async)
target_urlr3   c                 C   s   | j jjd|}t| j |S )a  
        Retrieve a specific page of PrebuiltOperatorInstance records from the API.
        Request is executed immediately

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

        :returns: Page of PrebuiltOperatorInstance
        rS   )r5   domaintwiliorequestrZ   r.   rw   rv   r   r   r   get_page  s    	zPrebuiltOperatorList.get_pagec                    s$   | j jjd|I dH }t| j |S )a  
        Asynchronously retrieve a specific page of PrebuiltOperatorInstance records from the API.
        Request is executed immediately

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

        :returns: Page of PrebuiltOperatorInstance
        rS   N)r5   rx   ry   Zrequest_asyncrZ   r{   r   r   r   get_page_async  s    	z#PrebuiltOperatorList.get_page_async)r   r3   c                 C   s   t | j|dS z
        Constructs a PrebuiltOperatorContext

        :param sid: A 34 character string that uniquely identifies this Pre-built Operator.
        r4   r1   r5   r.   r   r   r   r   r*     s    zPrebuiltOperatorList.getc                 C   s   t | j|dS r~   r   r   r   r   r   __call__  s    zPrebuiltOperatorList.__call__r2   c                 C   s   dS )r<   z-<Twilio.Intelligence.V2.PrebuiltOperatorList>r   r6   r   r   r   rK     s    zPrebuiltOperatorList.__repr__)r   r   r   r   r)   r   unsetr   rL   rM   r   intr   r   rc   r	   rf   r   rh   rl   rZ   rb   re   r|   r}   r1   r*   r   rK   rO   r   r   r/   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   r1   rZ   r\   r   r   r   r   <module>   s   $`E