
    pi                         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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.
    )datetime)AnyDictListOptionalUnionIteratorAsyncIterator)deserialize	serializevalues)InstanceContext)InstanceResource)ListResource)Version)Pagec            #       *    e Zd Zd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$                  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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ef   deeef   dd f"dZej$                  ej$                  ej$                  ej$                  ej$                  ej$                  ej$                  ej$                  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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ef   deeef   dd f"dZdefdZ xZS )#ApplicationInstancea	  
    :ivar account_sid: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Application resource.
    :ivar api_version: The API version used to start a new TwiML session.
    :ivar date_created: The date and time in GMT that the resource was created specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format.
    :ivar date_updated: The date and time in GMT that the resource was last updated specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format.
    :ivar friendly_name: The string that you assigned to describe the resource.
    :ivar message_status_callback: The URL we call using a POST method to send message status information to your application.
    :ivar sid: The unique string that that we created to identify the Application resource.
    :ivar sms_fallback_method: The HTTP method we use to call `sms_fallback_url`. Can be: `GET` or `POST`.
    :ivar sms_fallback_url: The URL that we call when an error occurs while retrieving or executing the TwiML from `sms_url`.
    :ivar sms_method: The HTTP method we use to call `sms_url`. Can be: `GET` or `POST`.
    :ivar sms_status_callback: The URL we call using a POST method to send status information to your application about SMS messages that refer to the application.
    :ivar sms_url: The URL we call when the phone number receives an incoming SMS message.
    :ivar status_callback: The URL we call using the `status_callback_method` to send status information to your application.
    :ivar status_callback_method: The HTTP method we use to call `status_callback`. Can be: `GET` or `POST`.
    :ivar uri: The URI of the resource, relative to `https://api.twilio.com`.
    :ivar voice_caller_id_lookup: Whether we look up the caller's caller-ID name from the CNAM database (additional charges apply). Can be: `true` or `false`.
    :ivar voice_fallback_method: The HTTP method we use to call `voice_fallback_url`. Can be: `GET` or `POST`.
    :ivar voice_fallback_url: The URL that we call when an error occurs retrieving or executing the TwiML requested by `url`.
    :ivar voice_method: The HTTP method we use to call `voice_url`. Can be: `GET` or `POST`.
    :ivar voice_url: The URL we call when the phone number assigned to this application receives a call.
    :ivar public_application_connect_enabled: Whether to allow other Twilio accounts to dial this applicaton using Dial verb. Can be: `true` or `false`.
    versionpayloadaccount_sidsidc                 J   t         |   |       |j                  d      | _        |j                  d      | _        t        j                  |j                  d            | _        t        j                  |j                  d            | _        |j                  d      | _	        |j                  d      | _
        |j                  d      | _        |j                  d      | _        |j                  d	      | _        |j                  d
      | _        |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   api_versiondate_createddate_updatedfriendly_namemessage_status_callbackr   sms_fallback_methodsms_fallback_url
sms_methodsms_status_callbacksms_urlstatus_callbackstatus_callback_methodurivoice_caller_id_lookupvoice_fallback_methodvoice_fallback_urlvoice_method	voice_url"public_application_connect_enabledr   r   )super__init__getr   r   r   rfc2822_datetimer   r   r   r   r   r   r    r!   r"   r#   r$   r%   r&   r'   r(   r)   r*   r+   r,   	_solution_context)selfr   r   r   r   	__class__s        k/opt/services/ai/voice_agent/venv/lib/python3.12/site-packages/twilio/rest/api/v2010/account/application.pyr/   zApplicationInstance.__init__2   s    	!*1++m*D*1++m*D0;0L0LKK'1
 1<0L0LKK'1
 -4KK,H6=kk%7
$ #*++e"429++>S2T /6{{;M/N)0\)B29++>S2T &-kk)&<.5kk:K.L5<[[$6
# #*++e"46=kk$7
# 5<KK@W4X"18=Q1R+2;;~+F(/K(@BI++0C
/
 '?$((
 7;    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: ApplicationContext for this ApplicationInstance
        r   r   r-   )r3   ApplicationContext_versionr2   r4   s    r6   _proxyzApplicationInstance._proxyc   sE     == . NN=9NN5)DM
 }}r7   c                 6    | j                   j                         S )n
        Deletes the ApplicationInstance


        :returns: True if delete succeeds, False otherwise
        )r=   deleter<   s    r6   r@   zApplicationInstance.deletes   s     {{!!##r7   c                 R   K   | j                   j                          d{   S 7 w)
        Asynchronous coroutine that deletes the ApplicationInstance


        :returns: True if delete succeeds, False otherwise
        N)r=   delete_asyncr<   s    r6   rC   z ApplicationInstance.delete_async|   s!      [[--////   '%'c                 6    | j                   j                         S )c
        Fetch the ApplicationInstance


        :returns: The fetched ApplicationInstance
        )r=   fetchr<   s    r6   rG   zApplicationInstance.fetch   s     {{  ""r7   c                 R   K   | j                   j                          d{   S 7 w)}
        Asynchronous coroutine to fetch the ApplicationInstance


        :returns: The fetched ApplicationInstance
        N)r=   fetch_asyncr<   s    r6   rJ   zApplicationInstance.fetch_async   s!      [[,,....rD   r   r   r+   r*   r)   r(   r$   r%   r'   r#   r!   r    r   r"   r   r,   c                 X    | j                   j                  |||||||||	|
||||||      S )	  
        Update the ApplicationInstance

        :param friendly_name: A descriptive string that you create to describe the resource. It can be up to 64 characters long.
        :param api_version: The API version to use to start a new TwiML session. Can be: `2010-04-01` or `2008-08-01`. The default value is your account's default API version.
        :param voice_url: The URL we should call when the phone number assigned to this application receives a call.
        :param voice_method: The HTTP method we should use to call `voice_url`. Can be: `GET` or `POST`.
        :param voice_fallback_url: The URL that we should call when an error occurs retrieving or executing the TwiML requested by `url`.
        :param voice_fallback_method: The HTTP method we should use to call `voice_fallback_url`. Can be: `GET` or `POST`.
        :param status_callback: The URL we should call using the `status_callback_method` to send status information to your application.
        :param status_callback_method: The HTTP method we should use to call `status_callback`. Can be: `GET` or `POST`.
        :param voice_caller_id_lookup: Whether we should look up the caller's caller-ID name from the CNAM database (additional charges apply). Can be: `true` or `false`.
        :param sms_url: The URL we should call when the phone number receives an incoming SMS message.
        :param sms_method: The HTTP method we should use to call `sms_url`. Can be: `GET` or `POST`.
        :param sms_fallback_url: The URL that we should call when an error occurs while retrieving or executing the TwiML from `sms_url`.
        :param sms_fallback_method: The HTTP method we should use to call `sms_fallback_url`. Can be: `GET` or `POST`.
        :param sms_status_callback: Same as message_status_callback: The URL we should call using a POST method to send status information about SMS messages sent by the application. Deprecated, included for backwards compatibility.
        :param message_status_callback: The URL we should call using a POST method to send message status information to your application.
        :param public_application_connect_enabled: Whether to allow other Twilio accounts to dial this applicaton using Dial verb. Can be: `true` or `false`.

        :returns: The updated ApplicationInstance
        r   r   r+   r*   r)   r(   r$   r%   r'   r#   r!   r    r   r"   r   r,   )r=   updater4   r   r   r+   r*   r)   r(   r$   r%   r'   r#   r!   r    r   r"   r   r,   s                    r6   rN   zApplicationInstance.update   sQ    R {{!!'#%1"7+#9#9!- 3 3$;/Q! " 
 	
r7   c                 t   K   | j                   j                  |||||||||	|
||||||       d{   S 7 w)	  
        Asynchronous coroutine to update the ApplicationInstance

        :param friendly_name: A descriptive string that you create to describe the resource. It can be up to 64 characters long.
        :param api_version: The API version to use to start a new TwiML session. Can be: `2010-04-01` or `2008-08-01`. The default value is your account's default API version.
        :param voice_url: The URL we should call when the phone number assigned to this application receives a call.
        :param voice_method: The HTTP method we should use to call `voice_url`. Can be: `GET` or `POST`.
        :param voice_fallback_url: The URL that we should call when an error occurs retrieving or executing the TwiML requested by `url`.
        :param voice_fallback_method: The HTTP method we should use to call `voice_fallback_url`. Can be: `GET` or `POST`.
        :param status_callback: The URL we should call using the `status_callback_method` to send status information to your application.
        :param status_callback_method: The HTTP method we should use to call `status_callback`. Can be: `GET` or `POST`.
        :param voice_caller_id_lookup: Whether we should look up the caller's caller-ID name from the CNAM database (additional charges apply). Can be: `true` or `false`.
        :param sms_url: The URL we should call when the phone number receives an incoming SMS message.
        :param sms_method: The HTTP method we should use to call `sms_url`. Can be: `GET` or `POST`.
        :param sms_fallback_url: The URL that we should call when an error occurs while retrieving or executing the TwiML from `sms_url`.
        :param sms_fallback_method: The HTTP method we should use to call `sms_fallback_url`. Can be: `GET` or `POST`.
        :param sms_status_callback: Same as message_status_callback: The URL we should call using a POST method to send status information about SMS messages sent by the application. Deprecated, included for backwards compatibility.
        :param message_status_callback: The URL we should call using a POST method to send message status information to your application.
        :param public_application_connect_enabled: Whether to allow other Twilio accounts to dial this applicaton using Dial verb. Can be: `true` or `false`.

        :returns: The updated ApplicationInstance
        rM   N)r=   update_asyncrO   s                    r6   rR   z ApplicationInstance.update_async   s_     R [[--'#%1"7+#9#9!- 3 3$;/Q! . 
 
 	
 
s   /868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      r6   	<genexpr>z/ApplicationInstance.__repr__.<locals>.<genexpr>       SDAq7>>!Q/S   !z)<Twilio.Api.V2010.ApplicationInstance {}>joinr2   itemsrY   r4   contexts     r6   __repr__zApplicationInstance.__repr__  s6     ((SDNN<P<P<RSS:AA'JJr7   )N)r8   r:   )r8   r   )__name__
__module____qualname____doc__r   r   strr   r   r/   propertyr=   boolr@   rC   rG   rJ   r   unsetr   objectrN   rR   rf   __classcell__r5   s   @r6   r   r      s   : "/;/; c3h/; 	/;
 c]/;b  $ $0D 0#/ -3LL*0,,(.+1<<174:LL.4ll5;\\6<ll&,ll)//5||28,,28,,6<llBH,,#:
S&[):
 3;':
 f%	:

 CK(:
 "#v+.:
  %S&[1:
 sF{+:
 !&c6k 2:
 !&dFl 3:
 sF{#:
 #v+&:
  V,:
 #3;/:
 #3;/:
  "'sF{!3!:
" -2$,,?#:
$ 
%:
| -3LL*0,,(.+1<<174:LL.4ll5;\\6<ll&,ll)//5||28,,28,,6<llBH,,#:
S&[):
 3;':
 f%	:

 CK(:
 "#v+.:
  %S&[1:
 sF{+:
 !&c6k 2:
 !&dFl 3:
 sF{#:
 #v+&:
  V,:
 #3;/:
 #3;/:
  "'sF{!3!:
" -2$,,?#:
$ 
%:
xK# Kr7   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                  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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ef   deeef   de	f"dZej                  ej                  ej                  ej                  ej                  ej                  ej                  ej                  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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ef   deeef   de	f"dZdefdZ xZS )r:   r   r   r   c                 z    t         |   |       ||d| _         dj                  di | j                  | _        y)ao  
        Initialize the ApplicationContext

        :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 Application resources to update.
        :param sid: The Twilio-provided string that uniquely identifies the Application resource to update.
        r-   z//Accounts/{account_sid}/Applications/{sid}.jsonN r.   r/   r2   rY   _uri)r4   r   r   r   r5   s       r6   r/   zApplicationContext.__init__  sG     	! '
 MELL 
nn
	r7   r8   c                 |    t        j                  i       }| j                  j                  d| j                  |      S )r?   DELETEmethodr&   headers)r   ofr;   r@   rv   r4   r{   s     r6   r@   zApplicationContext.delete.  s1     ))B-}}##8G#TTr7   c                    K   t        j                  i       }| j                  j                  d| j                  |       d{   S 7 w)rB   rx   ry   N)r   r|   r;   rC   rv   r}   s     r6   rC   zApplicationContext.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 )rF   application/jsonAcceptGETry   r   r   r-   )r   r|   r;   rG   rv   r   r2   r4   r{   r   s      r6   rG   zApplicationContext.fetchH  si     ))B-.--%%U		7%S"MM}5u%	
 	
r7   c                   K   t        j                  i       }d|d<   | j                  j                  d| j                  |       d{   }t        | j                  || j                  d   | j                  d         S 7 7w)	rI   r   r   r   ry   Nr   r   r-   )r   r|   r;   rJ   rv   r   r2   r   s      r6   rJ   zApplicationContext.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'   r#   r!   r    r   r"   r   r,   c                    t        j                  i d|d|d|d|d|d|d|d|d	t        j                  |	      d
|
d|d|d|d|d|dt        j                  |            }t        j                  i       }d|d<   d|d<   | j                  j                  d| j                  ||      }t        | j                  || j                  d   | j                  d         S )rL   FriendlyName
ApiVersionVoiceUrlVoiceMethodVoiceFallbackUrlVoiceFallbackMethodStatusCallbackStatusCallbackMethodVoiceCallerIdLookupSmsUrl	SmsMethodSmsFallbackUrlSmsFallbackMethodSmsStatusCallbackMessageStatusCallbackPublicApplicationConnectEnabled!application/x-www-form-urlencodedContent-Typer   r   POSTrz   r&   datar{   r   r   r-   )	r   r|   r   boolean_to_stringr;   rN   rv   r   r2   r4   r   r   r+   r*   r)   r(   r$   r%   r'   r#   r!   r    r   r"   r   r,   r   r{   r   s                       r6   rN   zApplicationContext.updatet  sq   T yyk I |	
 #$6 &'< !/ '(> &y'B'B*( ' Z !"2 $%8  $%8!" ()@#$ 293N3N64%
0 ))B-"E.--&&tyytW ' 
 #MM}5u%	
 	
r7   c                   K   t        j                  i d|d|d|d|d|d|d|d|d	t        j                  |	      d
|
d|d|d|d|d|dt        j                  |            }t        j                  i       }d|d<   d|d<   | j                  j                  d| j                  ||       d{   }t        | j                  || j                  d   | j                  d         S 7 7w)rQ   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   Nr   r   r-   )	r   r|   r   r   r;   rR   rv   r   r2   r   s                       r6   rR   zApplicationContext.update_async  s    T yyk I |	
 #$6 &'< !/ '(> &y'B'B*( ' Z !"2 $%8  $%8!" ()@#$ 293N3N64%
0 ))B-"E.22tyytW 3 
 
 #MM}5u%	
 	
	
s   B7C39C1:8C3c                     dj                  d | j                  j                         D              }dj                  |      S )rT   rU   c              3   F   K   | ]  \  }}d j                  ||        ywrW   rX   rZ   s      r6   r^   z.ApplicationContext.__repr__.<locals>.<genexpr>   r_   r`   z(<Twilio.Api.V2010.ApplicationContext {}>ra   rd   s     r6   rf   zApplicationContext.__repr__  s6     ((SDNN<P<P<RSS9@@IIr7   )rg   rh   ri   r   rk   r/   rm   r@   rC   r   rG   rJ   r   rn   r   ro   rN   rR   rf   rp   rq   s   @r6   r:   r:     s   
 
c 
 
&
U 
U
D 

* 
*
#6 
2 -3LL*0,,(.+1<<174:LL.4ll5;\\6<ll&,ll)//5||28,,28,,6<llBH,,#Q
S&[)Q
 3;'Q
 f%	Q

 CK(Q
 "#v+.Q
  %S&[1Q
 sF{+Q
 !&c6k 2Q
 !&dFl 3Q
 sF{#Q
 #v+&Q
  V,Q
 #3;/Q
 #3;/Q
  "'sF{!3!Q
" -2$,,?#Q
$ 
%Q
j -3LL*0,,(.+1<<174:LL.4ll5;\\6<ll&,ll)//5||28,,28,,6<llBH,,#Q
S&[)Q
 3;'Q
 f%	Q

 CK(Q
 "#v+.Q
  %S&[1Q
 sF{+Q
 !&c6k 2Q
 !&dFl 3Q
 sF{#Q
 #v+&Q
  V,Q
 #3;/Q
 #3;/Q
  "'sF{!3!Q
" -2$,,?#Q
$ 
%Q
fJ# Jr7   r:   c                   2    e Zd Zdeeef   defdZdefdZy)ApplicationPager   r8   c                 L    t        | j                  || j                  d         S )zq
        Build an instance of ApplicationInstance

        :param payload: Payload response from the API
        r   r   )r   r;   r2   )r4   r   s     r6   get_instancezApplicationPage.get_instance&  s%     #MM7}0M
 	
r7   c                      y)rT   z"<Twilio.Api.V2010.ApplicationPage>rt   r<   s    r6   rf   zApplicationPage.__repr__0       4r7   N)	rg   rh   ri   r   rk   r   r   r   rf   rt   r7   r6   r   r   $  s*    
DcN 
7J 
4# 4r7   r   c            #           e Zd Zdedef fdZej                  ej                  ej                  ej                  ej                  ej                  ej                  ej                  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
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e	f   dee
e	f   def"dZej                  ej                  ej                  ej                  ej                  ej                  ej                  ej                  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
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e	f   dee
e	f   def"dZej                  ddfdeee	f   dee   dee   dee   fdZej                  ddfdeee	f   dee   dee   dee   fdZej                  ddfdeee	f   dee   dee   dee   fdZej                  ddfdeee	f   dee   dee   dee   fdZ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f
d Z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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 ))ApplicationListr   r   c                 x    t         |   |       d|i| _         dj                  di | j                  | _        y)z
        Initialize the ApplicationList

        :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 Application resources to read.

        r   z)/Accounts/{account_sid}/Applications.jsonNrt   ru   )r4   r   r   r5   s      r6   r/   zApplicationList.__init__;  sA     	! ;
 G?FFXX	r7   r   r+   r*   r)   r(   r$   r%   r'   r#   r!   r    r   r"   r   r   r,   r8   c                    t        j                  i d|d|d|d|d|d|d|dt        j                  |      d	|	d
|
d|d|d|d|d|dt        j                  |            }t        j                  ddi      }d|d<   d|d<   | j                  j                  d| j                  ||      }t        | j                  || j                  d         S )a  
        Create the ApplicationInstance

        :param api_version: The API version to use to start a new TwiML session. Can be: `2010-04-01` or `2008-08-01`. The default value is the account's default API version.
        :param voice_url: The URL we should call when the phone number assigned to this application receives a call.
        :param voice_method: The HTTP method we should use to call `voice_url`. Can be: `GET` or `POST`.
        :param voice_fallback_url: The URL that we should call when an error occurs retrieving or executing the TwiML requested by `url`.
        :param voice_fallback_method: The HTTP method we should use to call `voice_fallback_url`. Can be: `GET` or `POST`.
        :param status_callback: The URL we should call using the `status_callback_method` to send status information to your application.
        :param status_callback_method: The HTTP method we should use to call `status_callback`. Can be: `GET` or `POST`.
        :param voice_caller_id_lookup: Whether we should look up the caller's caller-ID name from the CNAM database (additional charges apply). Can be: `true` or `false`.
        :param sms_url: The URL we should call when the phone number receives an incoming SMS message.
        :param sms_method: The HTTP method we should use to call `sms_url`. Can be: `GET` or `POST`.
        :param sms_fallback_url: The URL that we should call when an error occurs while retrieving or executing the TwiML from `sms_url`.
        :param sms_fallback_method: The HTTP method we should use to call `sms_fallback_url`. Can be: `GET` or `POST`.
        :param sms_status_callback: The URL we should call using a POST method to send status information about SMS messages sent by the application.
        :param message_status_callback: The URL we should call using a POST method to send message status information to your application.
        :param friendly_name: A descriptive string that you create to describe the new application. It can be up to 64 characters long.
        :param public_application_connect_enabled: Whether to allow other Twilio accounts to dial this applicaton using Dial verb. Can be: `true` or `false`.

        :returns: The created ApplicationInstance
        r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   )	r   r|   r   r   r;   createrv   r   r2   r4   r   r+   r*   r)   r(   r$   r%   r'   r#   r!   r    r   r"   r   r   r,   r   r{   r   s                       r6   r   zApplicationList.createK  sj   T yykI | #$6	
 &'< !/ '(> &y'B'B*( ' Z !"2 $%8 $%8  ()@!" #$ 293N3N64%
0 ))^-PQR"E.--&&tyytW ' 
 #MM7}0M
 	
r7   c                   K   t        j                  i d|d|d|d|d|d|d|dt        j                  |      d	|	d
|
d|d|d|d|d|dt        j                  |            }t        j                  ddi      }d|d<   d|d<   | j                  j                  d| j                  ||       d{   }t        | j                  || j                  d         S 7 )w)a  
        Asynchronously create the ApplicationInstance

        :param api_version: The API version to use to start a new TwiML session. Can be: `2010-04-01` or `2008-08-01`. The default value is the account's default API version.
        :param voice_url: The URL we should call when the phone number assigned to this application receives a call.
        :param voice_method: The HTTP method we should use to call `voice_url`. Can be: `GET` or `POST`.
        :param voice_fallback_url: The URL that we should call when an error occurs retrieving or executing the TwiML requested by `url`.
        :param voice_fallback_method: The HTTP method we should use to call `voice_fallback_url`. Can be: `GET` or `POST`.
        :param status_callback: The URL we should call using the `status_callback_method` to send status information to your application.
        :param status_callback_method: The HTTP method we should use to call `status_callback`. Can be: `GET` or `POST`.
        :param voice_caller_id_lookup: Whether we should look up the caller's caller-ID name from the CNAM database (additional charges apply). Can be: `true` or `false`.
        :param sms_url: The URL we should call when the phone number receives an incoming SMS message.
        :param sms_method: The HTTP method we should use to call `sms_url`. Can be: `GET` or `POST`.
        :param sms_fallback_url: The URL that we should call when an error occurs while retrieving or executing the TwiML from `sms_url`.
        :param sms_fallback_method: The HTTP method we should use to call `sms_fallback_url`. Can be: `GET` or `POST`.
        :param sms_status_callback: The URL we should call using a POST method to send status information about SMS messages sent by the application.
        :param message_status_callback: The URL we should call using a POST method to send message status information to your application.
        :param friendly_name: A descriptive string that you create to describe the new application. It can be up to 64 characters long.
        :param public_application_connect_enabled: Whether to allow other Twilio accounts to dial this applicaton using Dial verb. Can be: `true` or `false`.

        :returns: The created ApplicationInstance
        r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   Nr   r   )	r   r|   r   r   r;   create_asyncrv   r   r2   r   s                       r6   r   zApplicationList.create_async  sx    T yykI | #$6	
 &'< !/ '(> &y'B'B*( ' Z !"2 $%8 $%8  ()@!" #$ 293N3N64%
0 ))^-PQR"E.22tyytW 3 
 
 #MM7}0M
 	
	
s   B9C';C%<*C'Nlimit	page_sizec                     | j                   j                  ||      }| j                  ||d         }| j                   j                  ||d         S )a  
        Streams ApplicationInstance 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 str friendly_name: The string that identifies the Application resources to read.
        :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;   read_limitspagestreamr4   r   r   r   limitsr   s         r6   r   zApplicationList.stream  sL    , **5)<yy}{@SyT}}##D&/::r7   c                    K   | j                   j                  ||      }| j                  ||d          d{   }| j                   j                  ||d         S 7 #w)a  
        Asynchronously streams ApplicationInstance 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 str friendly_name: The string that identifies the Application resources to read.
        :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   )r;   r   
page_asyncstream_asyncr   s         r6   r   zApplicationList.stream_async  sb     , **5)<__'6+3F % 
 
 }}))$w@@	
s   6AA$Ac                 <    t        | j                  |||            S )a^  
        Lists ApplicationInstance records from the API as a list.
        Unlike stream(), this operation is eager and will load `limit` records into
        memory before returning.

        :param str friendly_name: The string that identifies the Application resources to read.
        :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   )listr   )r4   r   r   r   s       r6   r   zApplicationList.list#  s+    * KK+#  
 	
r7   c                 |   K   | j                  |||       d{   2 cg c3 d{   }|7 7 	6 c}S c c}w w)am  
        Asynchronously lists ApplicationInstance records from the API as a list.
        Unlike stream(), this operation is eager and will load `limit` records into
        memory before returning.

        :param str friendly_name: The string that identifies the Application resources to read.
        :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   )r4   r   r   r   records        r6   
list_asynczApplicationList.list_async@  sW     . '+&7&7+# '8 ' !
 
 !
 
 	
 
s0   </<731
37<37<
page_tokenpage_numberc                    t        j                  ||||d      }t        j                  ddi      }d|d<   | j                  j                  d| j                  ||      }t        | j                  || j                        S )a  
        Retrieve a single page of ApplicationInstance records from the API.
        Request is executed immediately

        :param friendly_name: The string that identifies the Application resources to read.
        :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 ApplicationInstance
        r   	PageTokenr   PageSizer   r   r   r   r   rz   r&   paramsr{   )r   r|   r;   r   rv   r   r2   r4   r   r   r   r   r   r{   responses           r6   r   zApplicationList.page^  s    $ yy -'#%	
 ))^-PQR.==%%diig & 
 t}}hGGr7   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 ApplicationInstance records from the API.
        Request is executed immediately

        :param friendly_name: The string that identifies the Application resources to read.
        :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 ApplicationInstance
        r   r   r   r   r   r   r   N)r   r|   r;   r   rv   r   r2   r   s           r6   r   zApplicationList.page_async  s     $ yy -'#%	
 ))^-PQR.11diig 2 
 
 t}}hGG
s   A#B%B&&B
target_urlc                     | j                   j                  j                  j                  d|      }t	        | j                   || j
                        S )z
        Retrieve a specific page of ApplicationInstance records from the API.
        Request is executed immediately

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

        :returns: Page of ApplicationInstance
        r   )r;   domaintwiliorequestr   r2   r4   r   r   s      r6   get_pagezApplicationList.get_page  s=     ==''..66ujIt}}hGGr7   c                    K   | j                   j                  j                  j                  d|       d{   }t	        | j                   || j
                        S 7 %w)a
  
        Asynchronously retrieve a specific page of ApplicationInstance records from the API.
        Request is executed immediately

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

        :returns: Page of ApplicationInstance
        r   N)r;   r   r   request_asyncr   r2   r   s      r6   get_page_asynczApplicationList.get_page_async  sJ      --44BB5*UUt}}hGG Vs   4AA&Ar   c                 L    t        | j                  | j                  d   |      S z
        Constructs a ApplicationContext

        :param sid: The Twilio-provided string that uniquely identifies the Application resource to update.
        r   r-   r:   r;   r2   r4   r   s     r6   r0   zApplicationList.get  %     "MMt~~m'D#
 	
r7   c                 L    t        | j                  | j                  d   |      S r   r   r   s     r6   __call__zApplicationList.__call__  r   r7   c                      y)rT   z"<Twilio.Api.V2010.ApplicationList>rt   r<   s    r6   rf   zApplicationList.__repr__  r   r7   )!rg   rh   ri   r   rk   r/   r   rn   r   ro   rm   r   r   r   r   intr	   r   r
   r   r   r   r   r   r   r   r   r   r:   r0   r   rf   rp   rq   s   @r6   r   r   9  sC   Y Yc Y$ +1,,(.+1<<174:LL.4ll5;\\6<ll&,ll)//5||28,,28,,6<ll,2LLBH,,#N
3;'N
 f%N
 CK(	N

 "#v+.N
  %S&[1N
 sF{+N
 !&c6k 2N
 !&dFl 3N
 sF{#N
 #v+&N
  V,N
 #3;/N
 #3;/N
 "'sF{!3N
  S&[)!N
" -2$,,?#N
$ 
%N
d +1,,(.+1<<174:LL.4ll5;\\6<ll&,ll)//5||28,,28,,6<ll,2LLBH,,#N
3;'N
 f%N
 CK(	N

 "#v+.N
  %S&[1N
 sF{+N
 !&c6k 2N
 !&dFl 3N
 sF{#N
 #v+&N
  V,N
 #3;/N
 #3;/N
 "'sF{!3N
  S&[)!N
" -2$,,?#N
$ 
%N
d -3LL##'	;S&[); }; C=	;
 
%	&;: -3LL##'	AS&[)A }A C=	A
 
*	+A> -3LL##'	
S&[)
 }
 C=	

 
!	"
> -3LL##'	
S&[)
 }
 C=	

 
!	"
@ -3LL)/*0,,(."HS&[)"H #v+&"H 3;'	"H
 f%"H 
"HL -3LL)/*0,,(."HS&[)"H #v+&"H 3;'	"H
 f%"H 
"HH
H3 
H? 
H
Hs 
H 
H
s 
1 

C 
$6 
4# 4r7   r   N)rj   r   typingr   r   r   r   r   r	   r
   twilio.baser   r   r   twilio.base.instance_contextr   twilio.base.instance_resourcer   twilio.base.list_resourcer   twilio.base.versionr   twilio.base.pager   r   r:   r   r   rt   r7   r6   <module>r      sj     L L L 6 6 8 : 2 ' !}K* }K@HJ HJV4d 4*_4l _4r7   