o
    �¨Êhb  ã                   @   s�   d 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	 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 )za
This code was generated by
\ / _    _  _|   _  _
 | (_)\/(_)(_|\/| |(/_  v1.0.0
      /       /
é    )Údeserialize)Úvalues)ÚInstanceContext)ÚInstanceResource)ÚListResource)ÚPagec                       sÀ   e Zd ZdZ‡ f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fdd„Zejddfdd„Zejddfd	d
„Z	ejejejejfdd„Z
dd„ Zdd„ Zdd„ Zdd„ Z‡  ZS )ÚApplicationListú  c                    s2   t t| ƒ |¡ d|i| _djdi | j¤Ž| _dS )aW  
        Initialize the ApplicationList

        :param Version version: Version that contains the resource
        :param account_sid: A string that uniquely identifies this resource

        :returns: twilio.rest.api.v2010.account.application.ApplicationList
        :rtype: twilio.rest.api.v2010.account.application.ApplicationList
        Úaccount_sidz)/Accounts/{account_sid}/Applications.jsonN© )Úsuperr   Ú__init__Ú	_solutionÚformatÚ_uri)ÚselfÚversionr
   ©Ú	__class__r   ú[/var/www/html/env/lib/python3.10/site-packages/twilio/rest/api/v2010/account/application.pyr      s   

zApplicationList.__init__c                 C   sT   t  |||||||||	|
|||||dœ¡}| jjd| j|d�}t| j|| jd d�S )aE  
        Create a new ApplicationInstance

        :param unicode friendly_name: A human readable description of the application
        :param unicode api_version: The API version to use
        :param unicode voice_url: URL Twilio will make requests to when relieving a call
        :param unicode voice_method: HTTP method to use with the URL
        :param unicode voice_fallback_url: Fallback URL
        :param unicode voice_fallback_method: HTTP method to use with the fallback url
        :param unicode status_callback: URL to hit with status updates
        :param unicode status_callback_method: HTTP method to use with the status callback
        :param bool voice_caller_id_lookup: True or False
        :param unicode sms_url: URL Twilio will request when receiving an SMS
        :param unicode sms_method: HTTP method to use with sms_url
        :param unicode sms_fallback_url: Fallback URL if there's an error parsing TwiML
        :param unicode sms_fallback_method: HTTP method to use with sms_fallback_method
        :param unicode sms_status_callback: URL Twilio with request with status updates
        :param unicode message_status_callback: URL to make requests to with status updates

        :returns: Newly created ApplicationInstance
        :rtype: twilio.rest.api.v2010.account.application.ApplicationInstance
        ©ÚFriendlyNameÚ
ApiVersionÚVoiceUrlÚVoiceMethodÚVoiceFallbackUrlÚVoiceFallbackMethodÚStatusCallbackÚStatusCallbackMethodÚVoiceCallerIdLookupÚSmsUrlÚ	SmsMethodÚSmsFallbackUrlÚSmsFallbackMethodÚSmsStatusCallbackÚMessageStatusCallbackÚPOST©Údatar
   ©r
   )r   ÚofÚ_versionÚcreater   ÚApplicationInstancer   ©r   Úfriendly_nameÚapi_versionÚ	voice_urlÚvoice_methodÚvoice_fallback_urlÚvoice_fallback_methodÚstatus_callbackÚstatus_callback_methodÚvoice_caller_id_lookupÚsms_urlÚ
sms_methodÚsms_fallback_urlÚsms_fallback_methodÚsms_status_callbackÚmessage_status_callbackr(   Úpayloadr   r   r   r,   $   s.   ñýzApplicationList.createNc                 C   s8   | j  ||¡}| j||d d�}| j  ||d |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 unicode friendly_name: Filter by friendly name
        :param int limit: Upper limit for the number of records to return. stream()
                          guarantees to never return more than limit.  Default is no limit
        :param int 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
        :rtype: list[twilio.rest.api.v2010.account.application.ApplicationInstance]
        Ú	page_size)r/   r?   ÚlimitÚ
page_limit)r+   Úread_limitsÚpageÚstream)r   r/   r@   r?   ÚlimitsrC   r   r   r   rD   \   s   zApplicationList.streamc                 C   s   t | j|||d�ƒ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 unicode friendly_name: Filter by friendly name
        :param int limit: Upper limit for the number of records to return. list() guarantees
                          never to return more than limit.  Default is no limit
        :param int 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: Generator that will yield up to limit results
        :rtype: list[twilio.rest.api.v2010.account.application.ApplicationInstance]
        )r/   r@   r?   )ÚlistrD   )r   r/   r@   r?   r   r   r   rF   t   s   zApplicationList.listc                 C   s8   t  ||||dœ¡}| jjd| j|d�}t| j|| jƒS )a  
        Retrieve a single page of ApplicationInstance records from the API.
        Request is executed immediately

        :param unicode friendly_name: Filter by friendly name
        :param str page_token: PageToken provided by the API
        :param int page_number: Page Number, this value is simply for client state
        :param int page_size: Number of records to return, defaults to 50

        :returns: Page of ApplicationInstance
        :rtype: twilio.rest.api.v2010.account.application.ApplicationPage
        )r   Ú	PageTokenr   ÚPageSizeÚGET©Úparams)r   r*   r+   rC   r   ÚApplicationPager   )r   r/   Ú
page_tokenÚpage_numberr?   rK   Úresponser   r   r   rC   ‡   s   üýzApplicationList.pagec                 C   s"   | j jj d|¡}t| j || jƒS )aI  
        Retrieve a specific page of ApplicationInstance records from the API.
        Request is executed immediately

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

        :returns: Page of ApplicationInstance
        :rtype: twilio.rest.api.v2010.account.application.ApplicationPage
        rI   )r+   ÚdomainÚtwilioÚrequestrL   r   )r   Ú
target_urlrO   r   r   r   Úget_page¤   s
   

þzApplicationList.get_pagec                 C   ó   t | j| jd |d�S ©a  
        Constructs a ApplicationContext

        :param sid: Fetch by unique Application Sid

        :returns: twilio.rest.api.v2010.account.application.ApplicationContext
        :rtype: twilio.rest.api.v2010.account.application.ApplicationContext
        r
   ©r
   Úsid©ÚApplicationContextr+   r   ©r   rX   r   r   r   Úgetµ   ó   	zApplicationList.getc                 C   rU   rV   rY   r[   r   r   r   Ú__call__À   r]   zApplicationList.__call__c                 C   ó   dS )úz
        Provide a friendly representation

        :returns: Machine friendly representation
        :rtype: str
        z"<Twilio.Api.V2010.ApplicationList>r   ©r   r   r   r   Ú__repr__Ë   ó   zApplicationList.__repr__)Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   r   Úunsetr,   rD   rF   rC   rT   r\   r^   rb   Ú__classcell__r   r   r   r   r      s*    
ù8
ÿr   c                       s0   e Zd ZdZ‡ fdd„Zdd„ Zdd„ Z‡  ZS )rL   r	   c                    s   t t| ƒ ||¡ || _dS )a�  
        Initialize the ApplicationPage

        :param Version version: Version that contains the resource
        :param Response response: Response from the API
        :param account_sid: A string that uniquely identifies this resource

        :returns: twilio.rest.api.v2010.account.application.ApplicationPage
        :rtype: twilio.rest.api.v2010.account.application.ApplicationPage
        N)r   rL   r   r   )r   r   rO   Úsolutionr   r   r   r   Ø   s   
zApplicationPage.__init__c                 C   s   t | j|| jd d�S )a  
        Build an instance of ApplicationInstance

        :param dict payload: Payload response from the API

        :returns: twilio.rest.api.v2010.account.application.ApplicationInstance
        :rtype: twilio.rest.api.v2010.account.application.ApplicationInstance
        r
   r)   )r-   r+   r   )r   r>   r   r   r   Úget_instanceè   r]   zApplicationPage.get_instancec                 C   r_   )r`   z"<Twilio.Api.V2010.ApplicationPage>r   ra   r   r   r   rb   ó   rc   zApplicationPage.__repr__)rd   re   rf   rg   r   rk   rb   ri   r   r   r   r   rL   Õ   s
    rL   c                       s~   e Zd ZdZ‡ fd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fdd	„Z	d
d„ Z
‡  ZS )rZ   r	   c                    s4   t t| ƒ |¡ ||dœ| _djdi | j¤Ž| _dS )at  
        Initialize the ApplicationContext

        :param Version version: Version that contains the resource
        :param account_sid: The account_sid
        :param sid: Fetch by unique Application Sid

        :returns: twilio.rest.api.v2010.account.application.ApplicationContext
        :rtype: twilio.rest.api.v2010.account.application.ApplicationContext
        rW   z//Accounts/{account_sid}/Applications/{sid}.jsonNr   )r   rZ   r   r   r   r   )r   r   r
   rX   r   r   r   r      s   zApplicationContext.__init__c                 C   s   | j  d| j¡S )ú‚
        Deletes the ApplicationInstance

        :returns: True if delete succeeds, False otherwise
        :rtype: bool
        Údelete)r+   rm   r   ra   r   r   r   rm     s   zApplicationContext.deletec                 C   s<   t  i ¡}| jjd| j|d�}t| j|| jd | jd d�S )úª
        Fetch a ApplicationInstance

        :returns: Fetched ApplicationInstance
        :rtype: twilio.rest.api.v2010.account.application.ApplicationInstance
        rI   rJ   r
   rX   rW   )r   r*   r+   Úfetchr   r-   r   )r   rK   r>   r   r   r   ro     s   
ýüzApplicationContext.fetchc                 C   s\   t  |||||||||	|
|||||dœ¡}| jjd| j|d�}t| j|| jd | jd d�S )á9  
        Update the ApplicationInstance

        :param unicode friendly_name: Human readable description of this resource
        :param unicode api_version: The API version to use
        :param unicode voice_url: URL Twilio will make requests to when relieving a call
        :param unicode voice_method: HTTP method to use with the URL
        :param unicode voice_fallback_url: Fallback URL
        :param unicode voice_fallback_method: HTTP method to use with the fallback url
        :param unicode status_callback: URL to hit with status updates
        :param unicode status_callback_method: HTTP method to use with the status callback
        :param bool voice_caller_id_lookup: True or False
        :param unicode sms_url: URL Twilio will request when receiving an SMS
        :param unicode sms_method: HTTP method to use with sms_url
        :param unicode sms_fallback_url: Fallback URL if there's an error parsing TwiML
        :param unicode sms_fallback_method: HTTP method to use with sms_fallback_method
        :param unicode sms_status_callback: URL Twilio with request with status updates
        :param unicode message_status_callback: URL to make requests to with status updates

        :returns: Updated ApplicationInstance
        :rtype: twilio.rest.api.v2010.account.application.ApplicationInstance
        r   r&   r'   r
   rX   rW   )r   r*   r+   Úupdater   r-   r   r.   r   r   r   rq   0  s8   ñýüzApplicationContext.updatec                 C   ó$   d  dd„ | j ¡ D ƒ¡}d |¡S )r`   ú c                 s   ó    � | ]\}}d   ||¡V  qdS ©z{}={}N©r   ©Ú.0ÚkÚvr   r   r   Ú	<genexpr>t  ó   € z.ApplicationContext.__repr__.<locals>.<genexpr>z(<Twilio.Api.V2010.ApplicationContext {}>©Újoinr   Úitemsr   ©r   Úcontextr   r   r   rb   m  ó   
zApplicationContext.__repr__)rd   re   rf   rg   r   rm   ro   r   rh   rq   rb   ri   r   r   r   r   rZ   ý   s    	
ù=rZ   c                       s|  e Zd ZdZd7‡ fdd„	Zedd„ ƒZedd„ ƒZed	d
„ ƒZedd„ ƒZ	edd„ ƒZ
edd„ ƒZedd„ ƒZedd„ ƒZedd„ ƒZedd„ ƒZedd„ ƒZedd„ ƒZedd„ ƒZedd „ ƒZed!d"„ ƒZed#d$„ ƒZed%d&„ ƒZed'd(„ ƒZed)d*„ ƒZed+d,„ ƒZed-d.„ ƒZd/d0„ Zd1d2„ 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fd3d4„Zd5d6„ Z ‡  Z!S )8r-   r	   Nc                    s  t t| ƒ |¡ i d|d “d|d “dt |d ¡“dt |d ¡“d|d “d|d “d|d “d|d “d	|d	 “d
|d
 “d|d “d|d “d|d “d|d “d|d “d|d “d|d “|d |d |d dœ¥| _d| _||p|| jd dœ| _dS )zÓ
        Initialize the ApplicationInstance

        :returns: twilio.rest.api.v2010.account.application.ApplicationInstance
        :rtype: twilio.rest.api.v2010.account.application.ApplicationInstance
        r
   r0   Údate_createdÚdate_updatedr/   r=   rX   r;   r:   r9   r<   r8   r5   r6   Úurir7   r4   r3   r2   r1   )r3   r2   r1   NrW   )r   r-   r   r   Úrfc2822_datetimeÚ_propertiesÚ_contextr   )r   r   r>   r
   rX   r   r   r   r   {  sT   ÿþýüûúùø	÷
öõôóòñðï
ìzApplicationInstance.__init__c                 C   s.   | j du rt| j| jd | jd d�| _ | j S )a?  
        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
        :rtype: twilio.rest.api.v2010.account.application.ApplicationContext
        Nr
   rX   rW   )rˆ   rZ   r+   r   ra   r   r   r   Ú_proxy   s   
	ýzApplicationInstance._proxyc                 C   ó
   | j d S )úc
        :returns: A string that uniquely identifies this resource
        :rtype: unicode
        r
   ©r‡   ra   r   r   r   r
   ±  ó   
zApplicationInstance.account_sidc                 C   rŠ   )zJ
        :returns: The API version to use
        :rtype: unicode
        r0   rŒ   ra   r   r   r   r0   ¹  r�   zApplicationInstance.api_versionc                 C   rŠ   )zS
        :returns: Date this resource was created
        :rtype: datetime
        rƒ   rŒ   ra   r   r   r   rƒ   Á  r�   z ApplicationInstance.date_createdc                 C   rŠ   )zX
        :returns: Date this resource was last updated
        :rtype: datetime
        r„   rŒ   ra   r   r   r   r„   É  r�   z ApplicationInstance.date_updatedc                 C   rŠ   )z_
        :returns: Human readable description of this resource
        :rtype: unicode
        r/   rŒ   ra   r   r   r   r/   Ñ  r�   z!ApplicationInstance.friendly_namec                 C   rŠ   )z_
        :returns: URL to make requests to with status updates
        :rtype: unicode
        r=   rŒ   ra   r   r   r   r=   Ù  r�   z+ApplicationInstance.message_status_callbackc                 C   rŠ   )r‹   rX   rŒ   ra   r   r   r   rX   á  r�   zApplicationInstance.sidc                 C   rŠ   )z_
        :returns: HTTP method to use with sms_fallback_method
        :rtype: unicode
        r;   rŒ   ra   r   r   r   r;   é  r�   z'ApplicationInstance.sms_fallback_methodc                 C   rŠ   )zb
        :returns: Fallback URL if there's an error parsing TwiML
        :rtype: unicode
        r:   rŒ   ra   r   r   r   r:   ñ  r�   z$ApplicationInstance.sms_fallback_urlc                 C   rŠ   )zS
        :returns: HTTP method to use with sms_url
        :rtype: unicode
        r9   rŒ   ra   r   r   r   r9   ù  r�   zApplicationInstance.sms_methodc                 C   rŠ   )z_
        :returns: URL Twilio with request with status updates
        :rtype: unicode
        r<   rŒ   ra   r   r   r   r<     r�   z'ApplicationInstance.sms_status_callbackc                 C   rŠ   )za
        :returns: URL Twilio will request when receiving an SMS
        :rtype: unicode
        r8   rŒ   ra   r   r   r   r8   	  r�   zApplicationInstance.sms_urlc                 C   rŠ   )zR
        :returns: URL to hit with status updates
        :rtype: unicode
        r5   rŒ   ra   r   r   r   r5     r�   z#ApplicationInstance.status_callbackc                 C   rŠ   )z_
        :returns: HTTP method to use with the status callback
        :rtype: unicode
        r6   rŒ   ra   r   r   r   r6     r�   z*ApplicationInstance.status_callback_methodc                 C   rŠ   )zI
        :returns: URI for this resource
        :rtype: unicode
        r…   rŒ   ra   r   r   r   r…   !  r�   zApplicationInstance.uric                 C   rŠ   )z>
        :returns: True or False
        :rtype: bool
        r7   rŒ   ra   r   r   r   r7   )  r�   z*ApplicationInstance.voice_caller_id_lookupc                 C   rŠ   )z\
        :returns: HTTP method to use with the fallback url
        :rtype: unicode
        r4   rŒ   ra   r   r   r   r4   1  r�   z)ApplicationInstance.voice_fallback_methodc                 C   rŠ   )z@
        :returns: Fallback URL
        :rtype: unicode
        r3   rŒ   ra   r   r   r   r3   9  r�   z&ApplicationInstance.voice_fallback_urlc                 C   rŠ   )zS
        :returns: HTTP method to use with the URL
        :rtype: unicode
        r2   rŒ   ra   r   r   r   r2   A  r�   z ApplicationInstance.voice_methodc                 C   rŠ   )zj
        :returns: URL Twilio will make requests to when relieving a call
        :rtype: unicode
        r1   rŒ   ra   r   r   r   r1   I  r�   zApplicationInstance.voice_urlc                 C   ó
   | j  ¡ S )rl   )r‰   rm   ra   r   r   r   rm   Q  ó   
zApplicationInstance.deletec                 C   rŽ   )rn   )r‰   ro   ra   r   r   r   ro   Z  r�   zApplicationInstance.fetchc                 C   s*   | j j|||||||||	|
|||||d�S )rp   )r/   r0   r1   r2   r3   r4   r5   r6   r7   r8   r9   r:   r;   r<   r=   )r‰   rq   )r   r/   r0   r1   r2   r3   r4   r5   r6   r7   r8   r9   r:   r;   r<   r=   r   r   r   rq   c  s"   ñzApplicationInstance.updatec                 C   rr   )r`   rs   c                 s   rt   ru   rv   rw   r   r   r   r{   š  r|   z/ApplicationInstance.__repr__.<locals>.<genexpr>z)<Twilio.Api.V2010.ApplicationInstance {}>r}   r€   r   r   r   rb   “  r‚   zApplicationInstance.__repr__)N)"rd   re   rf   rg   r   Úpropertyr‰   r
   r0   rƒ   r„   r/   r=   rX   r;   r:   r9   r<   r8   r5   r6   r…   r7   r4   r3   r2   r1   rm   ro   r   rh   rq   rb   ri   r   r   r   r   r-   x  sr    %




















		
ù0r-   N)rg   Útwilio.baser   r   Útwilio.base.instance_contextr   Útwilio.base.instance_resourcer   Útwilio.base.list_resourcer   Útwilio.base.pager   r   rL   rZ   r-   r   r   r   r   Ú<module>   s    E({