o
    f>hj                     @   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%dedeeef dede	e f fdd	Z
ed&ddZd
efddZd
efddZd'ddZd'ddZejejejejejejejejfdeeef deeef deeef deeef deeef deeef deeef deed ef d
d fdd Zejejejejejejejejfdeeef deeef deeef deeef deeef deeef deeef deed ef d
d fd!d"Zd
ef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__GET_ALLPOST_ALL r   r   \/var/www/html/venv/lib/python3.10/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| _||pM| 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__returnConnectAppContextc                 C   s.   | j du 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,   r1   _versionr+   r-   r   r   r   _proxyO   s   
zConnectAppInstance._proxyc                 C   
   | j  S )m
        Deletes the ConnectAppInstance


        :returns: True if delete succeeds, False otherwise
        )r4   deleter3   r   r   r   r7   _      
zConnectAppInstance.deletec                       | j  I dH S )
        Asynchronous coroutine that deletes the ConnectAppInstance


        :returns: True if delete succeeds, False otherwise
        N)r4   delete_asyncr3   r   r   r   r;   h      zConnectAppInstance.delete_asyncc                 C   r5   )a
        Fetch the ConnectAppInstance


        :returns: The fetched ConnectAppInstance
        )r4   fetchr3   r   r   r   r>   q   r8   zConnectAppInstance.fetchc                    r9   ){
        Asynchronous coroutine to fetch the ConnectAppInstance


        :returns: The fetched ConnectAppInstance
        N)r4   fetch_asyncr3   r   r   r   r@   z   r<   zConnectAppInstance.fetch_asyncr   r   r    r!   r"   r#   r$   r%   r   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%   )r4   update	r-   r   r   r    r!   r"   r#   r$   r%   r   r   r   rC      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
        rB   N)r4   update_asyncrD   r   r   r   rF      s   zConnectAppInstance.update_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>       z.ConnectAppInstance.__repr__.<locals>.<genexpr>z(<Twilio.Api.V2010.ConnectAppInstance {}>joinr+   itemsrM   r-   contextr   r   r   __repr__      
zConnectAppInstance.__repr__N)r0   r1   )r0   r   )r   r   r   objectr   r   r   strr   r   r)   propertyr4   boolr7   r;   r>   r@   r
   unsetr   r   rC   rF   rY   __classcell__r   r   r.   r   r      s    
#	
	
	






	

(






	

&r   c                       s  e Zd Zde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
de	fddZejejejejejejejejfdeeef deeef deeef deeef deeef deeef deeef deed ef de	fddZejejejejejejejejfdeeef deeef deeef deeef deeef deeef deeef deed ef de	fddZdefddZ  ZS )r1   r   r   r   c                    s0   t  | ||d| _djdi | 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}.jsonNr   r(   r)   r+   rM   _uri)r-   r   r   r   r.   r   r   r)      s   zConnectAppContext.__init__r0   c                 C   s   t i }| jjd| j|dS )r6   DELETEmethodr&   headers)r
   ofr2   r7   rc   r-   rg   r   r   r   r7      s   
zConnectAppContext.deletec                    s&   t i }| jjd| j|dI dH S )r:   rd   re   N)r
   rh   r2   r;   rc   ri   r   r   r   r;      s
   
zConnectAppContext.delete_asyncc                 C   sD   t i }d|d< | jjd| j|d}t| j|| jd | jd dS )r=   application/jsonAcceptGETre   r   r   r'   )r
   rh   r2   r>   rc   r   r+   r-   rg   r   r   r   r   r>     s   
zConnectAppContext.fetchc                    sL   t i }d|d< | jjd| j|dI dH }t| j|| jd | jd dS )	r?   rj   rk   rl   re   Nr   r   r'   )r
   rh   r2   r@   rc   r   r+   rm   r   r   r   r@     s   
zConnectAppContext.fetch_asyncr   r   r    r!   r"   r#   r$   r%   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 )rA   c                 S      | S r[   r   er   r   r   <lambda>Y      z*ConnectAppContext.update.<locals>.<lambda>AuthorizeRedirectUrlCompanyNameDeauthorizeCallbackMethodDeauthorizeCallbackUrlDescriptionFriendlyNameHomepageUrlPermissions!application/x-www-form-urlencodedContent-Typerj   rk   POSTrf   r&   datarg   r   r   r'   )	r
   rh   r	   mapr2   rC   rc   r   r+   r-   r   r   r    r!   r"   r#   r$   r%   r   rg   r   r   r   r   rC   4  s.   

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 )rE   c                 S   rn   r[   r   ro   r   r   r   rq     rr   z0ConnectAppContext.update_async.<locals>.<lambda>rs   r|   r}   rj   rk   r~   r   Nr   r   r'   )	r
   rh   r	   r   r2   rF   rc   r   r+   r   r   r   r   rF   m  s0   

zConnectAppContext.update_asyncc                 C   rG   )rH   rI   c                 s   rJ   rK   rL   rN   r   r   r   rR     rS   z-ConnectAppContext.__repr__.<locals>.<genexpr>z'<Twilio.Api.V2010.ConnectAppContext {}>rT   rW   r   r   r   rY     rZ   zConnectAppContext.__repr__)r   r   r   r   r]   r)   r_   r7   r;   r   r>   r@   r
   r`   r   r\   r   rC   rF   rY   ra   r   r   r.   r   r1      s    






	

;






	

9r1   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 )ConnectAppPager   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   r2   r+   )r-   r   r   r   r   get_instance     zConnectAppPage.get_instancec                 C      dS )rH   z!<Twilio.Api.V2010.ConnectAppPage>r   r3   r   r   r   rY        zConnectAppPage.__repr__N)	r   r   r   r   r]   r   r   r   rY   r   r   r   r   r     s    
r   c                	       s  e Zd Zdedef fddZ		d#dee dee dee	 fd	d
Z
		d#dee dee dee	 fddZ		d#dee dee dee	 fddZ		d#dee dee dee	 fddZejejej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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 )$ConnectAppListr   r   c                    s.   t  | d|i| _djdi | 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.jsonNr   rb   )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
        r   r   r   )r2   read_limitspagestreamr-   r   r   limitsr   r   r   r   r     s   zConnectAppList.streamc                    s8   | 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
        r   r   Nr   )r2   r   
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
        r   r   )listr   r-   r   r   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 r[   r   )rO   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_numberc                 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
        	PageTokenr   PageSizer}   r|   rj   rk   rl   rf   r&   paramsrg   )r
   rh   r2   r   rc   r   r+   r-   r   r   r   r   rg   responser   r   r   r   >  s   
zConnectAppList.pagec                    sV   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   r}   r|   rj   rk   rl   r   N)r
   rh   r2   r   rc   r   r+   r   r   r   r   r   _  s   
zConnectAppList.page_async
target_urlc                 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
        rl   )r2   domaintwiliorequestr   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
        rl   N)r2   r   r   request_asyncr   r+   r   r   r   r   get_page_async  s   	zConnectAppList.get_page_asyncr   c                 C      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'   r1   r2   r+   r-   r   r   r   r   r*     r   zConnectAppList.getc                 C   r   r   r   r   r   r   r   __call__  r   zConnectAppList.__call__c                 C   r   )rH   z!<Twilio.Api.V2010.ConnectAppList>r   r3   r   r   r   rY     r   zConnectAppList.__repr__)NN)r   r   r   r   r]   r)   r   intr   r   r   r   r   r   r   r   r
   r`   r   r\   r   r   r   r   r   r1   r*   r   rY   ra   r   r   r.   r   r     s    







#



!

r   N)__doc__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   r1   r   r   r   r   r   r   <module>   s    $ B X