U
    ^g%ij                     @   s   d 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 - Api
    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.
    )AnyDictListOptionalUnionIteratorAsyncIterator)	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	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ejejejejejejejfeeef eeef eeef eeef eeef eeef eeef eed ef d d	ddZejejejejejejejejfeeef eeef eeef eeef eeef eeef eeef eed ef d d	ddZedddZ  ZS )ConnectAppInstancec                   @   s   e Zd ZdZdZdS )ConnectAppInstance.Permissionzget-allzpost-allN)__name__
__module____qualname__ZGET_ALLZPOST_ALL r   r   h/var/www/html/api-medvista/venv/lib/python3.8/site-packages/twilio/rest/api/v2010/account/connect_app.py
Permission   s   r   N)versionpayloadaccount_sidsidc                    s   t  | |d| _|d| _|d| _|d| _|d| _|d| _|d| _	|d| _
|d	| _|d
| _|d| _||p| jd| _d | _d S )Nr   authorize_redirect_urlcompany_namedeauthorize_callback_methoddeauthorize_callback_urldescriptionfriendly_namehomepage_urlpermissionsr   urir   r   )super__init__getr   r   r   r   r   r    r!   r"   r#   r   r$   	_solution_context)selfr   r   r   r   	__class__r   r   r'   ,   s0    zConnectAppInstance.__init__ConnectAppContextreturnc                 C   s.   | j dkr(t| j| jd | 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: ConnectAppContext for this ConnectAppInstance
        Nr   r   r%   )r*   r.   _versionr)   r+   r   r   r   _proxyO   s    
zConnectAppInstance._proxyc                 C   s
   | j  S )m
        Deletes the ConnectAppInstance


        :returns: True if delete succeeds, False otherwise
        )r3   deleter2   r   r   r   r5   _   s    zConnectAppInstance.deletec                    s   | j  I dH S )
        Asynchronous coroutine that deletes the ConnectAppInstance


        :returns: True if delete succeeds, False otherwise
        N)r3   delete_asyncr2   r   r   r   r7   h   s    zConnectAppInstance.delete_asyncc                 C   s
   | j  S )a
        Fetch the ConnectAppInstance


        :returns: The fetched ConnectAppInstance
        )r3   fetchr2   r   r   r   r9   q   s    zConnectAppInstance.fetchc                    s   | j  I dH S ){
        Asynchronous coroutine to fetch the ConnectAppInstance


        :returns: The fetched ConnectAppInstance
        N)r3   fetch_asyncr2   r   r   r   r;   z   s    zConnectAppInstance.fetch_asyncr   	r   r   r   r   r    r!   r"   r#   r0   c	           	   
   C   s   | j j||||||||dS )  
        Update the ConnectAppInstance

        :param authorize_redirect_url: The URL to redirect the user to after we authenticate the user and obtain authorization to access the Connect App.
        :param company_name: The company name to set for the Connect App.
        :param deauthorize_callback_method: The HTTP method to use when calling `deauthorize_callback_url`.
        :param deauthorize_callback_url: The URL to call using the `deauthorize_callback_method` to de-authorize the Connect App.
        :param description: A description of the Connect App.
        :param friendly_name: A descriptive string that you create to describe the resource. It can be up to 64 characters long.
        :param homepage_url: A public URL where users can obtain more information about this Connect App.
        :param permissions: A comma-separated list of the permissions you will request from the users of this ConnectApp.  Can include: `get-all` and `post-all`.

        :returns: The updated ConnectAppInstance
        r   r   r   r   r    r!   r"   r#   )r3   update	r+   r   r   r   r   r    r!   r"   r#   r   r   r   r?      s    zConnectAppInstance.updatec	           	   
      s"   | j j||||||||dI dH S )  
        Asynchronous coroutine to update the ConnectAppInstance

        :param authorize_redirect_url: The URL to redirect the user to after we authenticate the user and obtain authorization to access the Connect App.
        :param company_name: The company name to set for the Connect App.
        :param deauthorize_callback_method: The HTTP method to use when calling `deauthorize_callback_url`.
        :param deauthorize_callback_url: The URL to call using the `deauthorize_callback_method` to de-authorize the Connect App.
        :param description: A description of the Connect App.
        :param friendly_name: A descriptive string that you create to describe the resource. It can be up to 64 characters long.
        :param homepage_url: A public URL where users can obtain more information about this Connect App.
        :param permissions: A comma-separated list of the permissions you will request from the users of this ConnectApp.  Can include: `get-all` and `post-all`.

        :returns: The updated ConnectAppInstance
        r>   N)r3   update_asyncr@   r   r   r   rB      s    zConnectAppInstance.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     z.ConnectAppInstance.__repr__.<locals>.<genexpr>z(<Twilio.Api.V2010.ConnectAppInstance {}>joinr)   itemsrG   r+   contextr   r   r   __repr__   s    zConnectAppInstance.__repr__)N)r   r   r   objectr   r   r   strr   r   r'   propertyr3   boolr5   r7   r9   r;   r
   unsetr   r   r?   rB   rR   __classcell__r   r   r,   r   r      sr    
#			







(







&r   c                       st  e Zd Ze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ejejejejejejejfeeef eeef eeef eeef eeef eeef eeef eed ef e	d	ddZejejejejejejejejfeeef eeef eeef eeef eeef eeef eeef eed ef e	d	ddZedddZ  ZS )r.   )r   r   r   c                    s,   t  | ||d| _djf | j| _dS )al  
        Initialize the ConnectAppContext

        :param version: Version that contains the resource
        :param account_sid: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the ConnectApp resources to update.
        :param sid: The Twilio-provided string that uniquely identifies the ConnectApp resource to update.
        r%   z./Accounts/{account_sid}/ConnectApps/{sid}.jsonNr&   r'   r)   rG   _uri)r+   r   r   r   r,   r   r   r'      s    zConnectAppContext.__init__r/   c                 C   s   t i }| jjd| j|dS )r4   DELETEmethodr$   headers)r
   ofr1   r5   rZ   r+   r^   r   r   r   r5      s    
zConnectAppContext.deletec                    s$   t i }| jjd| j|dI dH S )r6   r[   r\   N)r
   r_   r1   r7   rZ   r`   r   r   r   r7      s    
  zConnectAppContext.delete_asyncc                 C   sD   t i }d|d< | jjd| j|d}t| j|| jd | jd dS )r8   application/jsonAcceptGETr\   r   r   r%   )r
   r_   r1   r9   rZ   r   r)   r+   r^   r   r   r   r   r9     s    
zConnectAppContext.fetchc                    sJ   t i }d|d< | jjd| j|dI dH }t| j|| jd | jd dS )	r:   ra   rb   rc   r\   Nr   r   r%   )r
   r_   r1   r;   rZ   r   r)   rd   r   r   r   r;     s    
  zConnectAppContext.fetch_asyncr   r<   c	                 C   sv   t |||||||t|dd d}	t i }
d|
d< d|
d< | jjd| j|	|
d	}t| j|| jd
 | jd dS )r=   c                 S   s   | S Nr   er   r   r   <lambda>Y      z*ConnectAppContext.update.<locals>.<lambda>ZAuthorizeRedirectUrlZCompanyNameZDeauthorizeCallbackMethodZDeauthorizeCallbackUrlDescriptionZFriendlyNameZHomepageUrlZPermissions!application/x-www-form-urlencodedContent-Typera   rb   POSTr]   r$   datar^   r   r   r%   )	r
   r_   r	   mapr1   r?   rZ   r   r)   r+   r   r   r   r   r    r!   r"   r#   rp   r^   r   r   r   r   r?   4  s4    
   zConnectAppContext.updatec	                    s|   t |||||||t|dd d}	t i }
d|
d< d|
d< | jjd| j|	|
d	I d
H }t| j|| jd | jd dS )rA   c                 S   s   | S re   r   rf   r   r   r   rh     ri   z0ConnectAppContext.update_async.<locals>.<lambda>rj   rl   rm   ra   rb   rn   ro   Nr   r   r%   )	r
   r_   r	   rq   r1   rB   rZ   r   r)   rr   r   r   r   rB   m  s4    
   zConnectAppContext.update_asyncc                 C   s$   d dd | j D }d|S )rC   rD   c                 s   s   | ]\}}d  ||V  qdS rE   rF   rH   r   r   r   rL     s     z-ConnectAppContext.__repr__.<locals>.<genexpr>z'<Twilio.Api.V2010.ConnectAppContext {}>rM   rP   r   r   r   rR     s    zConnectAppContext.__repr__)r   r   r   r   rT   r'   rV   r5   r7   r   r9   r;   r
   rW   r   rS   r   r?   rB   rR   rX   r   r   r,   r   r.      s`   







;







9r.   c                   @   s2   e Zd Zeeef edddZedddZdS )ConnectAppPage)r   r0   c                 C   s   t | j|| jd dS )zp
        Build an instance of ConnectAppInstance

        :param payload: Payload response from the API
        r   )r   )r   r1   r)   )r+   r   r   r   r   get_instance  s
      zConnectAppPage.get_instancer/   c                 C   s   dS )rC   z!<Twilio.Api.V2010.ConnectAppPage>r   r2   r   r   r   rR     s    zConnectAppPage.__repr__N)	r   r   r   r   rT   r   r   rt   rR   r   r   r   r   rs     s   
rs   c                       sf  e Zd Zeed fddZd ee ee ee	 dddZ
d!ee ee ee	 ddd	Zd"ee ee ee	 dd
dZd#ee ee ee	 dddZejejejfeeef eeef eeef edddZejejej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 )$ConnectAppList)r   r   c                    s*   t  | d|i| _djf | j| _dS )z
        Initialize the ConnectAppList

        :param version: Version that contains the resource
        :param account_sid: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the ConnectApp resources to read.

        r   z(/Accounts/{account_sid}/ConnectApps.jsonNrY   )r+   r   r   r,   r   r   r'     s
     zConnectAppList.__init__N)limit	page_sizer0   c                 C   s0   | j ||}| j|d d}| j ||d S )a`  
        Streams ConnectAppInstance 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 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
        rw   rw   rv   )r1   read_limitspagestreamr+   rv   rw   Zlimitsrz   r   r   r   r{     s    zConnectAppList.streamc                    s6   | j ||}| j|d dI dH }| j ||d S )ao  
        Asynchronously streams ConnectAppInstance 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 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
        rw   rx   Nrv   )r1   ry   
page_asyncstream_asyncr|   r   r   r   r~     s    zConnectAppList.stream_asyncc                 C   s   t | j||dS )a  
        Lists ConnectAppInstance records from the API as a list.
        Unlike stream(), this operation is eager and will load `limit` records into
        memory before returning.

        :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
        rv   rw   )listr{   r+   rv   rw   r   r   r   r   	  s    zConnectAppList.listc                    s$   dd | j ||dI dH 2 I dH S )a  
        Asynchronously lists ConnectAppInstance records from the API as a list.
        Unlike stream(), this operation is eager and will load `limit` records into
        memory before returning.

        :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 re   r   )rI   recordr   r   r   
<listcomp>6  s   z-ConnectAppList.list_async.<locals>.<listcomp>r   N)r~   r   r   r   r   
list_async#  s    
zConnectAppList.list_async)
page_tokenpage_numberrw   r0   c                 C   sN   t |||d}t ddi}d|d< | jjd| j||d}t| j|| jS )ay  
        Retrieve a single page of ConnectAppInstance records from the API.
        Request is executed immediately

        :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 ConnectAppInstance
        Z	PageTokenr   ZPageSizerm   rl   ra   rb   rc   r]   r$   paramsr^   )r
   r_   r1   rz   rZ   rs   r)   r+   r   r   rw   rp   r^   responser   r   r   rz   >  s       zConnectAppList.pagec                    sT   t |||d}t ddi}d|d< | jjd| j||dI dH }t| j|| jS )	a  
        Asynchronously retrieve a single page of ConnectAppInstance records from the API.
        Request is executed immediately

        :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 ConnectAppInstance
        r   rm   rl   ra   rb   rc   r   N)r
   r_   r1   r}   rZ   rs   r)   r   r   r   r   r}   _  s       zConnectAppList.page_async)
target_urlr0   c                 C   s"   | j jjd|}t| j || jS )z
        Retrieve a specific page of ConnectAppInstance records from the API.
        Request is executed immediately

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

        :returns: Page of ConnectAppInstance
        rc   )r1   domaintwiliorequestrs   r)   r+   r   r   r   r   r   get_page  s    	zConnectAppList.get_pagec                    s(   | j jjd|I dH }t| j || jS )a  
        Asynchronously retrieve a specific page of ConnectAppInstance records from the API.
        Request is executed immediately

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

        :returns: Page of ConnectAppInstance
        rc   N)r1   r   r   Zrequest_asyncrs   r)   r   r   r   r   get_page_async  s    	zConnectAppList.get_page_async)r   r0   c                 C   s   t | j| jd |dS z
        Constructs a ConnectAppContext

        :param sid: The Twilio-provided string that uniquely identifies the ConnectApp resource to update.
        r   r%   r.   r1   r)   r+   r   r   r   r   r(     s
      zConnectAppList.getc                 C   s   t | j| jd |dS r   r   r   r   r   r   __call__  s
      zConnectAppList.__call__r/   c                 C   s   dS )rC   z!<Twilio.Api.V2010.ConnectAppList>r   r2   r   r   r   rR     s    zConnectAppList.__repr__)NN)NN)NN)NN)r   r   r   r   rT   r'   r   intr   r   r{   r   r~   r   r   r   r
   rW   r   rS   rs   rz   r}   r   r   r.   r(   r   rR   rX   r   r   r,   r   ru     sh           


#


!

ru   N)__doc__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   r.   rs   ru   r   r   r   r   <module>   s   $ B X