B
    `z>                 @   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                s.   t t| | d|i| _djf | 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__ d/home/dcms/DCMS/lib/python3.7/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
        )Z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   Zread_limitspagestream)r   r!   r    Z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
        )Z	PageTokenr   ZPageSizeGET)r   r   params)r   r   r   r"   r   MessagingConfigurationPager   )r   Z
page_tokenZ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   domainZtwiliorequestr'   r   )r   
target_urlr(   r   r   r   get_pages   s    

z#MessagingConfigurationList.get_pagec             C   s   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   s    	zMessagingConfigurationList.getc             C   s   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   )r-   r   r   )r   r   r   r   r   __call__   s    	z#MessagingConfigurationList.__call__c             C   s   dS )zz
        Provide a friendly representation

        :returns: Machine friendly representation
        :rtype: str
        z-<Twilio.Verify.V2.MessagingConfigurationList>r   )r   r   r   r   __repr__   s    z#MessagingConfigurationList.__repr__)NN)NN)__name__
__module____qualname__r   r   r#   r$   r   Zunsetr"   r,   r.   r/   r0   __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   r(   Zsolution)r   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   s   dS )zz
        Provide a friendly representation

        :returns: Machine friendly representation
        :rtype: str
        z-<Twilio.Verify.V2.MessagingConfigurationPage>r   )r   r   r   r   r0      s    z#MessagingConfigurationPage.__repr__)r1   r2   r3   r   r5   r0   r4   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                s0   t t| | ||d| _djf | 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	   r   z9/Services/{service_sid}/MessagingConfigurations/{country}N)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 )aK  
        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   )r   r   r   updater   r   r   )r   r   r   r   r   r   r   r6      s    	z$MessagingConfigurationContext.updatec             C   s0   | j jd| jd}t| j || jd | jd dS )z
        Fetch the MessagingConfigurationInstance

        :returns: The fetched MessagingConfigurationInstance
        :rtype: twilio.rest.verify.v2.service.messaging_configuration.MessagingConfigurationInstance
        r%   )r   r   r	   r   )r	   r   )r   fetchr   r   r   )r   r   r   r   r   r7      s    z#MessagingConfigurationContext.fetchc             C   s   | j jd| jdS )z
        Deletes the MessagingConfigurationInstance

        :returns: True if delete succeeds, False otherwise
        :rtype: bool
        DELETE)r   r   )r   deleter   )r   r   r   r   r9     s    z$MessagingConfigurationContext.deletec             C   s$   d dd | j D }d|S )zz
        Provide a friendly representation

        :returns: Machine friendly representation
        :rtype: str
         c             s   s   | ]\}}d  ||V  qdS )z{}={}N)r   ).0kvr   r   r   	<genexpr>  s    z9MessagingConfigurationContext.__repr__.<locals>.<genexpr>z3<Twilio.Verify.V2.MessagingConfigurationContext {}>)joinr   itemsr   )r   contextr   r   r   r0     s    z&MessagingConfigurationContext.__repr__)	r1   r2   r3   r   r6   r7   r9   r0   r4   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	| _||pp| 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)rB   r	   r   r   rC   rD   rE   N)r	   r   )	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k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	   r   )rH   r-   r   r   )r   r   r   r   _proxy<  s    	
z%MessagingConfigurationInstance._proxyc             C   s
   | j d S )zd
        :returns: The SID of the Account that created the resource
        :rtype: unicode
        rB   )rG   )r   r   r   r   rB   M  s    z*MessagingConfigurationInstance.account_sidc             C   s
   | j d S )zo
        :returns: The SID of the Service that the resource is associated with
        :rtype: unicode
        r	   )rG   )r   r   r   r   r	   U  s    z*MessagingConfigurationInstance.service_sidc             C   s
   | j d S )zh
        :returns: The ISO-3166-1 country code of the country or `all`.
        :rtype: unicode
        r   )rG   )r   r   r   r   r   ]  s    z&MessagingConfigurationInstance.countryc             C   s
   | j d S )zq
        :returns: The SID of the Messaging Service used for this configuration.
        :rtype: unicode
        r   )rG   )r   r   r   r   r   e  s    z4MessagingConfigurationInstance.messaging_service_sidc             C   s
   | j d S )zt
        :returns: The RFC 2822 date and time in GMT when the resource was created
        :rtype: datetime
        rC   )rG   )r   r   r   r   rC   m  s    z+MessagingConfigurationInstance.date_createdc             C   s
   | j d S )zy
        :returns: The RFC 2822 date and time in GMT when the resource was last updated
        :rtype: datetime
        rD   )rG   )r   r   r   r   rD   u  s    z+MessagingConfigurationInstance.date_updatedc             C   s
   | j d S )zM
        :returns: The URL of this resource.
        :rtype: unicode
        rE   )rG   )r   r   r   r   rE   }  s    z"MessagingConfigurationInstance.urlc             C   s   | j |S )aK  
        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
        )rI   r6   )r   r   r   r   r   r6     s    	z%MessagingConfigurationInstance.updatec             C   s
   | j  S )z
        Fetch the MessagingConfigurationInstance

        :returns: The fetched MessagingConfigurationInstance
        :rtype: twilio.rest.verify.v2.service.messaging_configuration.MessagingConfigurationInstance
        )rI   r7   )r   r   r   r   r7     s    z$MessagingConfigurationInstance.fetchc             C   s
   | j  S )z
        Deletes the MessagingConfigurationInstance

        :returns: True if delete succeeds, False otherwise
        :rtype: bool
        )rI   r9   )r   r   r   r   r9     s    z%MessagingConfigurationInstance.deletec             C   s$   d dd | j D }d|S )zz
        Provide a friendly representation

        :returns: Machine friendly representation
        :rtype: str
        r:   c             s   s   | ]\}}d  ||V  qdS )z{}={}N)r   )r;   r<   r=   r   r   r   r>     s    z:MessagingConfigurationInstance.__repr__.<locals>.<genexpr>z4<Twilio.Verify.V2.MessagingConfigurationInstance {}>)r?   r   r@   r   )r   rA   r   r   r   r0     s    z'MessagingConfigurationInstance.__repr__)N)r1   r2   r3   r   propertyrI   rB   r	   r   r   rC   rD   rE   r6   r7   r9   r0   r4   r   r   )r   r   r   "  s   		r   N)__doc__Ztwilio.baser   r   Ztwilio.base.instance_contextr   Ztwilio.base.instance_resourcer   Ztwilio.base.list_resourcer   Ztwilio.base.pager   r   r'   r-   r   r   r   r   r   <module>   s    +K