o
    ez>                     @   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                       sn   e Zd Z fddZdd ZdddZddd	Zejejejfd
dZ	dd Z
dd Zdd Zdd Z  ZS )MessagingConfigurationListc                    s2   t t| | d|i| _djdi | j| _dS )a  
        Initialize the MessagingConfigurationList

        :param Version version: Version that contains the resource
        :param service_sid: The SID of the Service that the resource is associated with

        :returns: twilio.rest.verify.v2.service.messaging_configuration.MessagingConfigurationList
        :rtype: twilio.rest.verify.v2.service.messaging_configuration.MessagingConfigurationList
        service_sidz//Services/{service_sid}/MessagingConfigurationsN )superr   __init__	_solutionformat_uri)selfversionr	   	__class__r
   h/var/www/html/venv/lib/python3.10/site-packages/twilio/rest/verify/v2/service/messaging_configuration.pyr      s   

z#MessagingConfigurationList.__init__c                 C   s:   t ||d}| jjd| j|d}t| j|| jd dS )a  
        Create the MessagingConfigurationInstance

        :param unicode country: The ISO-3166-1 country code of the country or `all`.
        :param unicode messaging_service_sid: The SID of the Messaging Service used for this configuration.

        :returns: The created MessagingConfigurationInstance
        :rtype: twilio.rest.verify.v2.service.messaging_configuration.MessagingConfigurationInstance
        )CountryMessagingServiceSidPOSTmethoduridatar	   r	   )r   of_versioncreater   MessagingConfigurationInstancer   )r   countrymessaging_service_sidr   payloadr
   r
   r   r   #   s   
z!MessagingConfigurationList.createNc                 C   s0   | j ||}| j|d d}| j ||d S )a  
        Streams MessagingConfigurationInstance 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 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.verify.v2.service.messaging_configuration.MessagingConfigurationInstance]
        	page_size)r$   limit)r   read_limitspagestream)r   r%   r$   limitsr'   r
   r
   r   r(   7   s   z!MessagingConfigurationList.streamc                 C   s   t | j||dS )a  
        Lists MessagingConfigurationInstance records from the API as a list.
        Unlike stream(), this operation is eager and will load `limit` records into
        memory before returning.

        :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.verify.v2.service.messaging_configuration.MessagingConfigurationInstance]
        )r%   r$   )listr(   )r   r%   r$   r
   r
   r   r*   N   s   zMessagingConfigurationList.listc                 C   s6   t |||d}| jjd| j|d}t| j|| jS )a  
        Retrieve a single page of MessagingConfigurationInstance records from the API.
        Request is executed immediately

        :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 MessagingConfigurationInstance
        :rtype: twilio.rest.verify.v2.service.messaging_configuration.MessagingConfigurationPage
        )	PageTokenr   PageSizeGET)r   r   params)r   r   r   r'   r   MessagingConfigurationPager   )r   
page_tokenpage_numberr$   r   responser
   r
   r   r'   `   s   zMessagingConfigurationList.pagec                 C   s"   | j jjd|}t| j || jS )av  
        Retrieve a specific page of MessagingConfigurationInstance records from the API.
        Request is executed immediately

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

        :returns: Page of MessagingConfigurationInstance
        :rtype: twilio.rest.verify.v2.service.messaging_configuration.MessagingConfigurationPage
        r-   )r   domaintwiliorequestr/   r   )r   
target_urlr2   r
   r
   r   get_pages   s
   

z#MessagingConfigurationList.get_pagec                 C      t | j| jd |dS aU  
        Constructs a MessagingConfigurationContext

        :param country: The ISO-3166-1 country code of the country or `all`.

        :returns: twilio.rest.verify.v2.service.messaging_configuration.MessagingConfigurationContext
        :rtype: twilio.rest.verify.v2.service.messaging_configuration.MessagingConfigurationContext
        r	   r	   r!   MessagingConfigurationContextr   r   r   r!   r
   r
   r   get   
   	zMessagingConfigurationList.getc                 C   r8   r9   r;   r=   r
   r
   r   __call__   r?   z#MessagingConfigurationList.__call__c                 C      dS )z
        Provide a friendly representation

        :returns: Machine friendly representation
        :rtype: str
        z-<Twilio.Verify.V2.MessagingConfigurationList>r
   r   r
   r
   r   __repr__      z#MessagingConfigurationList.__repr__)NN)__name__
__module____qualname__r   r   r(   r*   r   unsetr'   r7   r>   r@   rD   __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 )a  
        Initialize the MessagingConfigurationPage

        :param Version version: Version that contains the resource
        :param Response response: Response from the API
        :param service_sid: The SID of the Service that the resource is associated with

        :returns: twilio.rest.verify.v2.service.messaging_configuration.MessagingConfigurationPage
        :rtype: twilio.rest.verify.v2.service.messaging_configuration.MessagingConfigurationPage
        N)r   r/   r   r   )r   r   r2   solutionr   r
   r   r      s   
z#MessagingConfigurationPage.__init__c                 C   s   t | j|| jd dS )aN  
        Build an instance of MessagingConfigurationInstance

        :param dict payload: Payload response from the API

        :returns: twilio.rest.verify.v2.service.messaging_configuration.MessagingConfigurationInstance
        :rtype: twilio.rest.verify.v2.service.messaging_configuration.MessagingConfigurationInstance
        r	   r   )r    r   r   r   r#   r
   r
   r   get_instance   s
   	z'MessagingConfigurationPage.get_instancec                 C   rA   )rB   z-<Twilio.Verify.V2.MessagingConfigurationPage>r
   rC   r
   r
   r   rD      rE   z#MessagingConfigurationPage.__repr__)rF   rG   rH   r   rM   rD   rJ   r
   r
   r   r   r/      s    r/   c                       s<   e Zd Z fddZdd Zdd Zdd Zd	d
 Z  ZS )r<   c                    s4   t t| | ||d| _djdi | j| _dS )a  
        Initialize the MessagingConfigurationContext

        :param Version version: Version that contains the resource
        :param service_sid: The SID of the Service that the resource is associated with
        :param country: The ISO-3166-1 country code of the country or `all`.

        :returns: twilio.rest.verify.v2.service.messaging_configuration.MessagingConfigurationContext
        :rtype: twilio.rest.verify.v2.service.messaging_configuration.MessagingConfigurationContext
        r:   z9/Services/{service_sid}/MessagingConfigurations/{country}Nr
   )r   r<   r   r   r   r   )r   r   r	   r!   r   r
   r   r      s   z&MessagingConfigurationContext.__init__c                 C   s@   t d|i}| jjd| j|d}t| j|| jd | jd dS )K  
        Update the MessagingConfigurationInstance

        :param unicode messaging_service_sid: The SID of the Messaging Service used for this configuration.

        :returns: The updated MessagingConfigurationInstance
        :rtype: twilio.rest.verify.v2.service.messaging_configuration.MessagingConfigurationInstance
        r   r   r   r	   r!   r:   )r   r   r   updater   r    r   )r   r"   r   r#   r
   r
   r   rO      s   	z$MessagingConfigurationContext.updatec                 C   s0   | j jd| jd}t| j || jd | jd dS )
        Fetch the MessagingConfigurationInstance

        :returns: The fetched MessagingConfigurationInstance
        :rtype: twilio.rest.verify.v2.service.messaging_configuration.MessagingConfigurationInstance
        r-   r   r   r	   r!   r:   )r   fetchr   r    r   rL   r
   r
   r   rR      s   z#MessagingConfigurationContext.fetchc                 C   s   | j jd| jdS )
        Deletes the MessagingConfigurationInstance

        :returns: True if delete succeeds, False otherwise
        :rtype: bool
        DELETErQ   )r   deleter   rC   r
   r
   r   rU     s   z$MessagingConfigurationContext.deletec                 C   $   d dd | j D }d|S )rB    c                 s        | ]\}}d  ||V  qdS z{}={}Nr   .0kvr
   r
   r   	<genexpr>      z9MessagingConfigurationContext.__repr__.<locals>.<genexpr>z3<Twilio.Verify.V2.MessagingConfigurationContext {}>joinr   itemsr   r   contextr
   r
   r   rD        
z&MessagingConfigurationContext.__repr__)	rF   rG   rH   r   rO   rR   rU   rD   rJ   r
   r
   r   r   r<      s    	r<   c                       s   e Zd 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dd Zdd Zdd Zdd Z  ZS )r    Nc              
      s|   t t| | |d|d|d|dt|dt|d|dd| _d	| _||p8| jd d
| _d	S )a  
        Initialize the MessagingConfigurationInstance

        :returns: twilio.rest.verify.v2.service.messaging_configuration.MessagingConfigurationInstance
        :rtype: twilio.rest.verify.v2.service.messaging_configuration.MessagingConfigurationInstance
        account_sidr	   r!   r"   date_createddate_updatedurl)rg   r	   r!   r"   rh   ri   rj   Nr:   )	r   r    r   r>   r   iso8601_datetime_properties_contextr   )r   r   r#   r	   r!   r   r
   r   r   $  s   z'MessagingConfigurationInstance.__init__c                 C   s.   | j du rt| j| jd | jd d| _ | j S )al  
        Generate an instance context for the instance, the context is capable of
        performing various actions.  All instance actions are proxied to the context

        :returns: MessagingConfigurationContext for this MessagingConfigurationInstance
        :rtype: twilio.rest.verify.v2.service.messaging_configuration.MessagingConfigurationContext
        Nr	   r!   r:   )rm   r<   r   r   rC   r
   r
   r   _proxy<  s   
	z%MessagingConfigurationInstance._proxyc                 C   
   | j d S )zd
        :returns: The SID of the Account that created the resource
        :rtype: unicode
        rg   rl   rC   r
   r
   r   rg   M     
z*MessagingConfigurationInstance.account_sidc                 C   ro   )zo
        :returns: The SID of the Service that the resource is associated with
        :rtype: unicode
        r	   rp   rC   r
   r
   r   r	   U  rq   z*MessagingConfigurationInstance.service_sidc                 C   ro   )zh
        :returns: The ISO-3166-1 country code of the country or `all`.
        :rtype: unicode
        r!   rp   rC   r
   r
   r   r!   ]  rq   z&MessagingConfigurationInstance.countryc                 C   ro   )zq
        :returns: The SID of the Messaging Service used for this configuration.
        :rtype: unicode
        r"   rp   rC   r
   r
   r   r"   e  rq   z4MessagingConfigurationInstance.messaging_service_sidc                 C   ro   )zt
        :returns: The RFC 2822 date and time in GMT when the resource was created
        :rtype: datetime
        rh   rp   rC   r
   r
   r   rh   m  rq   z+MessagingConfigurationInstance.date_createdc                 C   ro   )zy
        :returns: The RFC 2822 date and time in GMT when the resource was last updated
        :rtype: datetime
        ri   rp   rC   r
   r
   r   ri   u  rq   z+MessagingConfigurationInstance.date_updatedc                 C   ro   )zM
        :returns: The URL of this resource.
        :rtype: unicode
        rj   rp   rC   r
   r
   r   rj   }  rq   z"MessagingConfigurationInstance.urlc                 C   s   | j |S )rN   )rn   rO   )r   r"   r
   r
   r   rO     s   	z%MessagingConfigurationInstance.updatec                 C   
   | j  S )rP   )rn   rR   rC   r
   r
   r   rR        
z$MessagingConfigurationInstance.fetchc                 C   rr   )rS   )rn   rU   rC   r
   r
   r   rU     rs   z%MessagingConfigurationInstance.deletec                 C   rV   )rB   rW   c                 s   rX   rY   rZ   r[   r
   r
   r   r_     r`   z:MessagingConfigurationInstance.__repr__.<locals>.<genexpr>z4<Twilio.Verify.V2.MessagingConfigurationInstance {}>ra   rd   r
   r
   r   rD     rf   z'MessagingConfigurationInstance.__repr__)N)rF   rG   rH   r   propertyrn   rg   r	   r!   r"   rh   ri   rj   rO   rR   rU   rD   rJ   r
   r
   r   r   r    "  s,    







		r    N)__doc__twilio.baser   r   twilio.base.instance_contextr   twilio.base.instance_resourcer   twilio.base.list_resourcer   twilio.base.pager   r   r/   r<   r    r
   r
   r
   r   <module>   s    +K