
    pij                         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
e      Z G d de      Z G d de      Z G d de      Zy)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                   
    e Zd Z G d de      Z	 	 ddedeeef   dede	e   f fdZ
edd	       Zdefd
ZdefdZddZ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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ZdefdZ xZS )ConnectAppInstancec                       e Zd ZdZdZy)ConnectAppInstance.Permissionzget-allzpost-allN)__name__
__module____qualname__GET_ALLPOST_ALL     k/opt/services/ai/voice_agent/venv/lib/python3.12/site-packages/twilio/rest/api/v2010/account/connect_app.py
Permissionr      s    r   r   versionpayloadaccount_sidsidc                 F   t         |   |       |j                  d      | _        |j                  d      | _        |j                  d      | _        |j                  d      | _        |j                  d      | _        |j                  d      | _        |j                  d      | _	        |j                  d      | _
        |j                  d	      | _        |j                  d
      | _        |j                  d      | _        ||xs | j                  d| _        d | _        y )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__s        r   r.   zConnectAppInstance.__init__,   s    	!*1++m*D5<[[$6
# ,3;;~+F:A++);
( 8?{{&8
% +2++m*D,3KK,H+2;;~+FLSKKM
 #*++e"4")++e"4 '?$((
 6:r   returnc                     | j                   7t        | j                  | j                  d   | j                  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
        r    r!   r,   )r1   ConnectAppContext_versionr0   r2   s    r   _proxyzConnectAppInstance._proxyO   sE     == - NN=9NN5)DM
 }}r   c                 6    | j                   j                         S )m
        Deletes the ConnectAppInstance


        :returns: True if delete succeeds, False otherwise
        )r9   deleter8   s    r   r<   zConnectAppInstance.delete_   s     {{!!##r   c                 R   K   | j                   j                          d{   S 7 w)
        Asynchronous coroutine that deletes the ConnectAppInstance


        :returns: True if delete succeeds, False otherwise
        N)r9   delete_asyncr8   s    r   r?   zConnectAppInstance.delete_asynch   s!      [[--////   '%'c                 6    | j                   j                         S )a
        Fetch the ConnectAppInstance


        :returns: The fetched ConnectAppInstance
        )r9   fetchr8   s    r   rC   zConnectAppInstance.fetchq   s     {{  ""r   c                 R   K   | j                   j                          d{   S 7 w){
        Asynchronous coroutine to fetch the ConnectAppInstance


        :returns: The fetched ConnectAppInstance
        N)r9   fetch_asyncr8   s    r   rF   zConnectAppInstance.fetch_asyncz   s!      [[,,....r@   r#   r$   r%   r&   r'   r(   r)   r*   r   c	           
      H    | j                   j                  ||||||||      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*   )r9   update	r2   r#   r$   r%   r&   r'   r(   r)   r*   s	            r   rJ   zConnectAppInstance.update   s8    6 {{!!#9%(C%=#'%# " 	
 		
r   c	           
      d   K   | j                   j                  ||||||||       d{   S 7 w)  
        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
        rI   N)r9   update_asyncrK   s	            r   rN   zConnectAppInstance.update_async   sF     6 [[--#9%(C%=#'%# . 	
 	
 		
 	
s   '0.0c                     dj                  d | j                  j                         D              }dj                  |      S )f
        Provide a friendly representation

        :returns: Machine friendly representation
         c              3   F   K   | ]  \  }}d j                  ||        ywz{}={}Nformat.0kvs      r   	<genexpr>z.ConnectAppInstance.__repr__.<locals>.<genexpr>        SDAq7>>!Q/S   !z(<Twilio.Api.V2010.ConnectAppInstance {}>joinr0   itemsrU   r2   contexts     r   __repr__zConnectAppInstance.__repr__   s6     ((SDNN<P<P<RSS9@@IIr   N)r4   r6   )r4   r   )r   r   r   objectr   r   r   strr   r   r.   propertyr9   boolr<   r?   rC   rF   r   unsetr   r   rJ   rN   rb   __classcell__r3   s   @r   r   r      sm   V & "!:!: c3h!: 	!:
 c]!:F  $ $0D 0#/ 6<\\+1<<:@,,7=||*0,,,2LL+1<< LL$
 %c6k 2$
 CK($
 &+3;%7	$

 #(V"4$
 3;'$
 S&[)$
 CK($
 0169
$
 
$
P 6<\\+1<<:@,,7=||*0,,,2LL+1<< LL$
 %c6k 2$
 CK($
 &+3;%7	$

 #(V"4$
 3;'$
 S&[)$
 CK($
 0169
$
 
$
LJ# Jr   r   c                       e Zd Zdededef fdZdefdZdefdZde	fdZ
de	f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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ZdefdZ xZS )r6   r   r    r!   c                 z    t         |   |       ||d| _         dj                  di | j                  | _        y)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.   r0   rU   _uri)r2   r   r    r!   r3   s       r   r.   zConnectAppContext.__init__   sG     	! '
 LDKK 
nn
	r   r4   c                 |    t        j                  i       }| j                  j                  d| j                  |      S )r;   DELETEmethodr+   headers)r   ofr7   r<   rn   r2   rs   s     r   r<   zConnectAppContext.delete   s1     ))B-}}##8G#TTr   c                    K   t        j                  i       }| j                  j                  d| j                  |       d{   S 7 w)r>   rp   rq   N)r   rt   r7   r?   rn   ru   s     r   r?   zConnectAppContext.delete_async   sF      ))B-]]//G 0 
 
 	
 
s   AA
AA
c                     t        j                  i       }d|d<   | j                  j                  d| j                  |      }t        | j                  || j                  d   | j                  d         S )rB   application/jsonAcceptGETrq   r    r!   r,   )r   rt   r7   rC   rn   r   r0   r2   rs   r   s      r   rC   zConnectAppContext.fetch  si     ))B-.--%%U		7%S!MM}5u%	
 	
r   c                   K   t        j                  i       }d|d<   | j                  j                  d| j                  |       d{   }t        | j                  || j                  d   | j                  d         S 7 7w)	rE   rx   ry   rz   rq   Nr    r!   r,   )r   rt   r7   rF   rn   r   r0   r{   s      r   rF   zConnectAppContext.fetch_async  s~      ))B-.11dii 2 
 
 "MM}5u%	
 	
	
s   ABB 	8Br#   r$   r%   r&   r'   r(   r)   r*   r   c	                 ^   t        j                  |||||||t        j                  |d       d      }	t        j                  i       }
d|
d<   d|
d<   | j                  j                  d| j                  |	|
      }t        | j                  || j                  d	   | j                  d
         S )rH   c                     | S rc   r   es    r   <lambda>z*ConnectAppContext.update.<locals>.<lambda>Y      A r   AuthorizeRedirectUrlCompanyNameDeauthorizeCallbackMethodDeauthorizeCallbackUrlDescriptionFriendlyNameHomepageUrlPermissions!application/x-www-form-urlencodedContent-Typerx   ry   POSTrr   r+   datars   r    r!   r,   )	r   rt   r
   mapr7   rJ   rn   r   r0   r2   r#   r$   r%   r&   r'   r(   r)   r*   r   rs   r   s               r   rJ   zConnectAppContext.update4  s    8 yy(>+-H*B* -+(}}[+F	
 ))B-"E.--&&tyytW ' 
 "MM}5u%	
 	
r   c	                 z  K   t        j                  |||||||t        j                  |d       d      }	t        j                  i       }
d|
d<   d|
d<   | j                  j                  d| j                  |	|
       d	{   }t        | j                  || j                  d
   | j                  d         S 7 7w)rM   c                     | S rc   r   r   s    r   r   z0ConnectAppContext.update_async.<locals>.<lambda>  r   r   r   r   r   rx   ry   r   r   Nr    r!   r,   )	r   rt   r
   r   r7   rN   rn   r   r0   r   s               r   rN   zConnectAppContext.update_asyncm  s     8 yy(>+-H*B* -+(}}[+F	
 ))B-"E.22tyytW 3 
 
 "MM}5u%	
 	
	
s   A?B;B98B;c                     dj                  d | j                  j                         D              }dj                  |      S )rP   rQ   c              3   F   K   | ]  \  }}d j                  ||        ywrS   rT   rV   s      r   rZ   z-ConnectAppContext.__repr__.<locals>.<genexpr>  r[   r\   z'<Twilio.Api.V2010.ConnectAppContext {}>r]   r`   s     r   rb   zConnectAppContext.__repr__  s6     ((SDNN<P<P<RSS8??HHr   )r   r   r   r   re   r.   rg   r<   r?   r   rC   rF   r   rh   r   rd   r   rJ   rN   rb   ri   rj   s   @r   r6   r6      s7   
 
c 
 
&
U 
U
D 

) 
*
#5 
2 6<\\+1<<:@,,7=||*0,,,2LL+1<< LL7
 %c6k 27
 CK(7
 &+3;%7	7

 #(V"47
 3;'7
 S&[)7
 CK(7
 0169
7
 
7
v 6<\\+1<<:@,,7=||*0,,,2LL+1<< LL7
 %c6k 27
 CK(7
 &+3;%7	7

 #(V"47
 3;'7
 S&[)7
 CK(7
 0169
7
 
7
rI# Ir   r6   c                   2    e Zd Zdeeef   defdZdefdZy)ConnectAppPager   r4   c                 L    t        | j                  || j                  d         S )zp
        Build an instance of ConnectAppInstance

        :param payload: Payload response from the API
        r    )r    )r   r7   r0   )r2   r   s     r   get_instancezConnectAppPage.get_instance  s%     "MM7}0M
 	
r   c                      y)rP   z!<Twilio.Api.V2010.ConnectAppPage>r   r8   s    r   rb   zConnectAppPage.__repr__       3r   N)	r   r   r   r   re   r   r   r   rb   r   r   r   r   r     s*    
DcN 
7I 
3# 3r   r   c            	           e Zd Zdedef fdZ	 	 ddee   dee   dee	   fdZ
	 	 ddee   dee   dee	   fdZ	 	 ddee   dee   dee	   fd	Z	 	 ddee   dee   dee	   f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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ZdedefdZdedefdZdedefdZdedefdZdefdZ xZS )ConnectAppListr   r    c                 x    t         |   |       d|i| _         dj                  di | j                  | _        y)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   rm   )r2   r   r    r3   s      r   r.   zConnectAppList.__init__  sA     	! ;
 F>EEWW	r   limit	page_sizer4   c                     | j                   j                  ||      }| j                  |d         }| j                   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   )r7   read_limitspagestreamr2   r   r   limitsr   s        r   r   zConnectAppList.stream  sJ    ( **5)<yy6+#6y7}}##D&/::r   c                    K   | j                   j                  ||      }| j                  |d          d{   }| j                   j                  ||d         S 7 #w)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   )r7   r   
page_asyncstream_asyncr   s        r   r   zConnectAppList.stream_async  sW     ( **5)<__vk/B_CC}}))$w@@ Ds   5AA$Ac                 :    t        | j                  ||            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   )r2   r   r   s      r   r   zConnectAppList.list	  s(    & KK#  
 	
r   c                 z   K   | j                  ||       d{   2 cg c3 d{   }|7 7 	6 c}S c c}w w)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
        r   N)r   )r2   r   r   records       r   
list_asynczConnectAppList.list_async#  sT     * '+&7&7# '8 ' !
 
 !
 
 	
 
s0   ;.;620
26;26;
page_tokenpage_numberc                     t        j                  |||d      }t        j                  ddi      }d|d<   | j                  j                  d| j                  ||      }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   rx   ry   rz   rr   r+   paramsrs   )r   rt   r7   r   rn   r   r0   r2   r   r   r   r   rs   responses          r   r   zConnectAppList.page>  s      yy'#%
 ))^-PQR.==%%diig & 
 dmmXt~~FFr   c                   K   t        j                  |||d      }t        j                  ddi      }d|d<   | j                  j                  d| j                  ||       d{   }t        | j                  || j                        S 7 %w)	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   rx   ry   rz   r   N)r   rt   r7   r   rn   r   r0   r   s          r   r   zConnectAppList.page_async_  s       yy'#%
 ))^-PQR.11diig 2 
 
 dmmXt~~FF
s   A"B$B
%&B
target_urlc                     | j                   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
        rz   )r7   domaintwiliorequestr   r0   r2   r   r   s      r   get_pagezConnectAppList.get_page  s=     ==''..66ujIdmmXt~~FFr   c                    K   | j                   j                  j                  j                  d|       d{   }t	        | j                   || j
                        S 7 %w)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
        rz   N)r7   r   r   request_asyncr   r0   r   s      r   get_page_asynczConnectAppList.get_page_async  sJ      --44BB5*UUdmmXt~~FF Vs   4AA&Ar!   c                 L    t        | j                  | j                  d   |      S z
        Constructs a ConnectAppContext

        :param sid: The Twilio-provided string that uniquely identifies the ConnectApp resource to update.
        r    r,   r6   r7   r0   r2   r!   s     r   r/   zConnectAppList.get  %     !MMt~~m'D#
 	
r   c                 L    t        | j                  | j                  d   |      S r   r   r   s     r   __call__zConnectAppList.__call__  r   r   c                      y)rP   z!<Twilio.Api.V2010.ConnectAppList>r   r8   s    r   rb   zConnectAppList.__repr__  r   r   )NN)r   r   r   r   re   r.   r   intr   r   r   r	   r   r   r   r   r   rh   r   rd   r   r   r   r   r   r6   r/   r   rb   ri   rj   s   @r   r   r     s   X Xc X$  $#';}; C=; 
$	%	;6  $#'A}A C=A 
)	*	A6  $#'
}
 C=
 
 	!	
8  $#'
}
 C=
 
 	!	
: *0*0,,(.	G#v+&G 3;'G f%	G
 
GF *0*0,,(.	G#v+&G 3;'G f%	G
 
GB
G3 
G> 
G
Gs 
G~ 
G
s 
0 

C 
$5 
3# 3r   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   r6   r   r   r   r   r   <module>r      se    M L L ) 8 : 2 ' !~J) ~JBTI TIn3T 3*m3\ m3r   