o
    eT                     @   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
 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)	serialize)values)InstanceContext)InstanceResource)ListResource)Pagec                	       s   e Zd Z 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	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dd Zdd Z  ZS )AddressConfigurationListc                    s.   t t| | i | _djdi | j| _dS )a8  
        Initialize the AddressConfigurationList

        :param Version version: Version that contains the resource

        :returns: twilio.rest.conversations.v1.address_configuration.AddressConfigurationList
        :rtype: twilio.rest.conversations.v1.address_configuration.AddressConfigurationList
        z/Configuration/AddressesN )superr	   __init__	_solutionformat_uri)selfversion	__class__r
   e/var/www/html/venv/lib/python3.10/site-packages/twilio/rest/conversations/v1/address_configuration.pyr      s   	z!AddressConfigurationList.__init__Nc                 C   s2   | j ||}| j||d d}| j ||d S )a(  
        Streams AddressConfigurationInstance 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 type: The type of address configuration.
        :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.conversations.v1.address_configuration.AddressConfigurationInstance]
        	page_size)typer   limit)_versionread_limitspagestream)r   r   r   r   limitsr   r
   r
   r   r   #   s   zAddressConfigurationList.streamc                 C   s   t | j|||dS )a  
        Lists AddressConfigurationInstance records from the API as a list.
        Unlike stream(), this operation is eager and will load `limit` records into
        memory before returning.

        :param unicode type: The type of address configuration.
        :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.conversations.v1.address_configuration.AddressConfigurationInstance]
        )r   r   r   )listr   )r   r   r   r   r
   r
   r   r   ;   s   zAddressConfigurationList.listc                 C   s8   t ||||d}| jjd| j|d}t| j|| jS )a5  
        Retrieve a single page of AddressConfigurationInstance records from the API.
        Request is executed immediately

        :param unicode type: The type of address configuration.
        :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 AddressConfigurationInstance
        :rtype: twilio.rest.conversations.v1.address_configuration.AddressConfigurationPage
        )Type	PageTokenr   PageSizeGET)methoduriparams)r   ofr   r   r   AddressConfigurationPager   )r   r   
page_tokenpage_numberr   dataresponser
   r
   r   r   N   s   zAddressConfigurationList.pagec                 C   s"   | j jjd|}t| j || jS )am  
        Retrieve a specific page of AddressConfigurationInstance records from the API.
        Request is executed immediately

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

        :returns: Page of AddressConfigurationInstance
        :rtype: twilio.rest.conversations.v1.address_configuration.AddressConfigurationPage
        r!   )r   domaintwiliorequestr&   r   )r   
target_urlr*   r
   r
   r   get_pageg   s
   

z!AddressConfigurationList.get_pagec                 C   sN   t ||||||||t|	dd |
|d}| jjd| j|d}t| j|S )a  
        Create the AddressConfigurationInstance

        :param AddressConfigurationInstance.Type type: Type of Address.
        :param unicode address: The unique address to be configured.
        :param unicode friendly_name: The human-readable name of this configuration.
        :param bool auto_creation_enabled: Enable/Disable auto-creating conversations for messages to this address
        :param AddressConfigurationInstance.AutoCreationType auto_creation_type: Type of Auto Creation.
        :param unicode auto_creation_conversation_service_sid: Conversation Service for the auto-created conversation.
        :param unicode auto_creation_webhook_url: For type `webhook`, the url for the webhook request.
        :param AddressConfigurationInstance.Method auto_creation_webhook_method: For type `webhook`, the HTTP method to be used when sending a webhook request.
        :param list[unicode] auto_creation_webhook_filters: The list of events, firing webhook event for this Conversation.
        :param unicode auto_creation_studio_flow_sid: For type `studio`, the studio flow SID where the webhook should be sent to.
        :param unicode auto_creation_studio_retry_count: For type `studio`, number of times to retry the webhook request

        :returns: The created AddressConfigurationInstance
        :rtype: twilio.rest.conversations.v1.address_configuration.AddressConfigurationInstance
        c                 S      | S Nr
   er
   r
   r   <lambda>       z1AddressConfigurationList.create.<locals>.<lambda>)r   AddressFriendlyNameAutoCreation.EnabledAutoCreation.Type#AutoCreation.ConversationServiceSidAutoCreation.WebhookUrlAutoCreation.WebhookMethodAutoCreation.WebhookFiltersAutoCreation.StudioFlowSidAutoCreation.StudioRetryCountPOSTr"   r#   r)   )r   r%   r   mapr   creater   AddressConfigurationInstance)r   r   addressfriendly_nameauto_creation_enabledauto_creation_type&auto_creation_conversation_service_sidauto_creation_webhook_urlauto_creation_webhook_methodauto_creation_webhook_filtersauto_creation_studio_flow_sid auto_creation_studio_retry_countr)   payloadr
   r
   r   rC   x   s   zAddressConfigurationList.createc                 C      t | j|dS a9  
        Constructs a AddressConfigurationContext

        :param sid: The SID or Address of the Configuration.

        :returns: twilio.rest.conversations.v1.address_configuration.AddressConfigurationContext
        :rtype: twilio.rest.conversations.v1.address_configuration.AddressConfigurationContext
        sidAddressConfigurationContextr   r   rS   r
   r
   r   get      	zAddressConfigurationList.getc                 C   rP   rQ   rT   rV   r
   r
   r   __call__   rX   z!AddressConfigurationList.__call__c                 C      dS )z
        Provide a friendly representation

        :returns: Machine friendly representation
        :rtype: str
        z2<Twilio.Conversations.V1.AddressConfigurationList>r
   r   r
   r
   r   __repr__      z!AddressConfigurationList.__repr__)__name__
__module____qualname__r   r   unsetr   r   r   r/   rC   rW   rY   r]   __classcell__r
   r
   r   r   r	      s(    

,r	   c                       s,   e Zd Z fddZdd Zdd Z  ZS )r&   c                    s   t t| || || _dS )ap  
        Initialize the AddressConfigurationPage

        :param Version version: Version that contains the resource
        :param Response response: Response from the API

        :returns: twilio.rest.conversations.v1.address_configuration.AddressConfigurationPage
        :rtype: twilio.rest.conversations.v1.address_configuration.AddressConfigurationPage
        N)r   r&   r   r   )r   r   r*   solutionr   r
   r   r      s   

z!AddressConfigurationPage.__init__c                 C   s   t | j|S )aB  
        Build an instance of AddressConfigurationInstance

        :param dict payload: Payload response from the API

        :returns: twilio.rest.conversations.v1.address_configuration.AddressConfigurationInstance
        :rtype: twilio.rest.conversations.v1.address_configuration.AddressConfigurationInstance
        )rD   r   r   rO   r
   r
   r   get_instance   s   	z%AddressConfigurationPage.get_instancec                 C   rZ   )r[   z2<Twilio.Conversations.V1.AddressConfigurationPage>r
   r\   r
   r
   r   r]      r^   z!AddressConfigurationPage.__repr__)r_   r`   ra   r   rf   r]   rc   r
   r
   r   r   r&      s    r&   c                	       sb   e Zd Z fddZdd Z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d	d
 Z	  Z
S )rU   c                    s2   t t| | d|i| _djdi | j| _dS )a~  
        Initialize the AddressConfigurationContext

        :param Version version: Version that contains the resource
        :param sid: The SID or Address of the Configuration.

        :returns: twilio.rest.conversations.v1.address_configuration.AddressConfigurationContext
        :rtype: twilio.rest.conversations.v1.address_configuration.AddressConfigurationContext
        rS   z/Configuration/Addresses/{sid}Nr
   )r   rU   r   r   r   r   )r   r   rS   r   r
   r   r      s   

z$AddressConfigurationContext.__init__c                 C   s(   | j jd| jd}t| j || jd dS )
        Fetch the AddressConfigurationInstance

        :returns: The fetched AddressConfigurationInstance
        :rtype: twilio.rest.conversations.v1.address_configuration.AddressConfigurationInstance
        r!   r"   r#   rS   rR   )r   fetchr   rD   r   re   r
   r
   r   ri      s   z!AddressConfigurationContext.fetchc
                 C   sT   t ||||||t|dd ||	d	}
| jjd| j|
d}t| j|| jd dS )  
        Update the AddressConfigurationInstance

        :param unicode friendly_name: The human-readable name of this configuration.
        :param bool auto_creation_enabled: Enable/Disable auto-creating conversations for messages to this address
        :param AddressConfigurationInstance.AutoCreationType auto_creation_type: Type of Auto Creation.
        :param unicode auto_creation_conversation_service_sid: Conversation Service for the auto-created conversation.
        :param unicode auto_creation_webhook_url: For type `webhook`, the url for the webhook request.
        :param AddressConfigurationInstance.Method auto_creation_webhook_method: For type `webhook`, the HTTP method to be used when sending a webhook request.
        :param list[unicode] auto_creation_webhook_filters: The list of events, firing webhook event for this Conversation.
        :param unicode auto_creation_studio_flow_sid: For type `studio`, the studio flow SID where the webhook should be sent to.
        :param unicode auto_creation_studio_retry_count: For type `studio`, number of times to retry the webhook request

        :returns: The updated AddressConfigurationInstance
        :rtype: twilio.rest.conversations.v1.address_configuration.AddressConfigurationInstance
        c                 S   r0   r1   r
   r2   r
   r
   r   r4   &  r5   z4AddressConfigurationContext.update.<locals>.<lambda>)	r7   r8   r9   r:   r;   r<   r=   r>   r?   r@   rA   rS   rR   )	r   r%   r   rB   r   updater   rD   r   )r   rF   rG   rH   rI   rJ   rK   rL   rM   rN   r)   rO   r
   r
   r   rk     s   z"AddressConfigurationContext.updatec                 C   s   | j jd| jdS )
        Deletes the AddressConfigurationInstance

        :returns: True if delete succeeds, False otherwise
        :rtype: bool
        DELETErh   )r   deleter   r\   r
   r
   r   rn   /  s   z"AddressConfigurationContext.deletec                 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>?      z7AddressConfigurationContext.__repr__.<locals>.<genexpr>z8<Twilio.Conversations.V1.AddressConfigurationContext {}>joinr   itemsr   r   contextr
   r
   r   r]   8     
z$AddressConfigurationContext.__repr__)r_   r`   ra   r   ri   r   rb   rk   rn   r]   rc   r
   r
   r   r   rU      s    
(	rU   c                	       s  e Zd ZG dd deZG dd deZG dd deZd& 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dd Z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d$d% Z  ZS )'rD   c                   @   s   e Zd ZdZdZdZdZdS )z!AddressConfigurationInstance.Typesmswhatsapp	messengergbmN)r_   r`   ra   SMSWHATSAPP	MESSENGERGBMr
   r
   r
   r   r   E  s
    r   c                   @   s   e Zd ZdZdZdZdS )z-AddressConfigurationInstance.AutoCreationTypewebhookstudiodefaultN)r_   r`   ra   WEBHOOKSTUDIODEFAULTr
   r
   r
   r   AutoCreationTypeK  s    r   c                   @   s   e Zd ZdZdZdS )z#AddressConfigurationInstance.Methodr!   r@   N)r_   r`   ra   r!   r@   r
   r
   r
   r   MethodP  s    r   Nc                    s   t t| | |d|d|d|d|d|dt|dt|d|d	d
	| _d| _d|p@| jd i| _dS )a   
        Initialize the AddressConfigurationInstance

        :returns: twilio.rest.conversations.v1.address_configuration.AddressConfigurationInstance
        :rtype: twilio.rest.conversations.v1.address_configuration.AddressConfigurationInstance
        rS   account_sidr   rE   rF   auto_creationdate_createddate_updatedurl)	rS   r   r   rE   rF   r   r   r   r   N)	r   rD   r   rW   r   iso8601_datetime_properties_contextr   )r   r   rO   rS   r   r
   r   r   T  s   z%AddressConfigurationInstance.__init__c                 C   s&   | j du rt| j| jd d| _ | j S )ac  
        Generate an instance context for the instance, the context is capable of
        performing various actions.  All instance actions are proxied to the context

        :returns: AddressConfigurationContext for this AddressConfigurationInstance
        :rtype: twilio.rest.conversations.v1.address_configuration.AddressConfigurationContext
        NrS   rR   )r   rU   r   r   r\   r
   r
   r   _proxyn  s   
	z#AddressConfigurationInstance._proxyc                 C   
   | j d S )zq
        :returns: A 34 character string that uniquely identifies this resource.
        :rtype: unicode
        rS   r   r\   r
   r
   r   rS   {     
z AddressConfigurationInstance.sidc                 C   r   )zh
        :returns: The unique ID of the Account the address belongs to.
        :rtype: unicode
        r   r   r\   r
   r
   r   r     r   z(AddressConfigurationInstance.account_sidc                 C   r   )zD
        :returns: Type of Address.
        :rtype: unicode
        r   r   r\   r
   r
   r   r     r   z!AddressConfigurationInstance.typec                 C   r   )zX
        :returns: The unique address to be configured.
        :rtype: unicode
        rE   r   r\   r
   r
   r   rE     r   z$AddressConfigurationInstance.addressc                 C   r   )zb
        :returns: The human-readable name of this configuration.
        :rtype: unicode
        rF   r   r\   r
   r
   r   rF     r   z*AddressConfigurationInstance.friendly_namec                 C   r   )z]
        :returns: Auto Creation configuration for the address.
        :rtype: dict
        r   r   r\   r
   r
   r   r     r   z*AddressConfigurationInstance.auto_creationc                 C   r   )z]
        :returns: The date that this resource was created.
        :rtype: datetime
        r   r   r\   r
   r
   r   r     r   z)AddressConfigurationInstance.date_createdc                 C   r   )zb
        :returns: The date that this resource was last updated.
        :rtype: datetime
        r   r   r\   r
   r
   r   r     r   z)AddressConfigurationInstance.date_updatedc                 C   r   )zc
        :returns: An absolute URL for this address configuration.
        :rtype: unicode
        r   r   r\   r
   r
   r   r     r   z AddressConfigurationInstance.urlc                 C   
   | j  S )rg   )r   ri   r\   r
   r
   r   ri        
z"AddressConfigurationInstance.fetchc
           
      C   s   | j j|||||||||	d	S )rj   )	rF   rG   rH   rI   rJ   rK   rL   rM   rN   )r   rk   )
r   rF   rG   rH   rI   rJ   rK   rL   rM   rN   r
   r
   r   rk     s   z#AddressConfigurationInstance.updatec                 C   r   )rl   )r   rn   r\   r
   r
   r   rn     r   z#AddressConfigurationInstance.deletec                 C   ro   )r[   rp   c                 s   rq   rr   rs   rt   r
   r
   r   rx      ry   z8AddressConfigurationInstance.__repr__.<locals>.<genexpr>z9<Twilio.Conversations.V1.AddressConfigurationInstance {}>rz   r}   r
   r
   r   r]     r   z%AddressConfigurationInstance.__repr__r1   )r_   r`   ra   objectr   r   r   r   propertyr   rS   r   r   rE   rF   r   r   r   r   ri   r   rb   rk   rn   r]   rc   r
   r
   r   r   rD   C  sJ    









	
$	rD   N)__doc__twilio.baser   r   r   twilio.base.instance_contextr   twilio.base.instance_resourcer   twilio.base.list_resourcer   twilio.base.pager   r	   r&   rU   rD   r
   r
   r
   r   <module>   s    3&Y