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 fddZejejddfddZejejddfddZej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 )OutgoingCallerIdListc                s.   t t| | d|i| _djf | j| _dS )au  
        Initialize the OutgoingCallerIdList

        :param Version version: Version that contains the resource
        :param account_sid: The SID of the Account that created the resource

        :returns: twilio.rest.api.v2010.account.outgoing_caller_id.OutgoingCallerIdList
        :rtype: twilio.rest.api.v2010.account.outgoing_caller_id.OutgoingCallerIdList
        account_sidz./Accounts/{account_sid}/OutgoingCallerIds.jsonN)superr   __init__	_solutionformat_uri)selfversionr	   )	__class__ _/home/dcms/DCMS/lib/python3.7/site-packages/twilio/rest/api/v2010/account/outgoing_caller_id.pyr      s    

zOutgoingCallerIdList.__init__Nc             C   s4   | j ||}| j|||d d}| j ||d S )a  
        Streams OutgoingCallerIdInstance 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 phone_number: The phone number of the OutgoingCallerId resources to read
        :param unicode friendly_name: The string that identifies the OutgoingCallerId resources to read
        :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.outgoing_caller_id.OutgoingCallerIdInstance]
        	page_size)phone_numberfriendly_namer   limit)_versionZread_limitspagestream)r   r   r   r   r   Zlimitsr   r   r   r   r   #   s    zOutgoingCallerIdList.streamc             C   s   t | j||||dS )aF  
        Lists OutgoingCallerIdInstance records from the API as a list.
        Unlike stream(), this operation is eager and will load `limit` records into
        memory before returning.

        :param unicode phone_number: The phone number of the OutgoingCallerId resources to read
        :param unicode friendly_name: The string that identifies the OutgoingCallerId resources to read
        :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.outgoing_caller_id.OutgoingCallerIdInstance]
        )r   r   r   r   )listr   )r   r   r   r   r   r   r   r   r   A   s
    zOutgoingCallerIdList.listc             C   s:   t |||||d}| jjd| j|d}t| j|| jS )a  
        Retrieve a single page of OutgoingCallerIdInstance records from the API.
        Request is executed immediately

        :param unicode phone_number: The phone number of the OutgoingCallerId resources to read
        :param unicode friendly_name: The string that identifies the OutgoingCallerId resources to read
        :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 OutgoingCallerIdInstance
        :rtype: twilio.rest.api.v2010.account.outgoing_caller_id.OutgoingCallerIdPage
        )ZPhoneNumberFriendlyNameZ	PageTokenr   ZPageSizeGET)methoduriparams)r   ofr   r   r   OutgoingCallerIdPager   )r   r   r   Z
page_tokenZpage_numberr   dataresponser   r   r   r   [   s    
zOutgoingCallerIdList.pagec             C   s"   | j jjd|}t| j || jS )a_  
        Retrieve a specific page of OutgoingCallerIdInstance records from the API.
        Request is executed immediately

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

        :returns: Page of OutgoingCallerIdInstance
        :rtype: twilio.rest.api.v2010.account.outgoing_caller_id.OutgoingCallerIdPage
        r   )r   domainZtwiliorequestr"   r   )r   
target_urlr$   r   r   r   get_pagew   s    

zOutgoingCallerIdList.get_pagec             C   s   t | j| jd |dS )a/  
        Constructs a OutgoingCallerIdContext

        :param sid: The unique string that identifies the resource

        :returns: twilio.rest.api.v2010.account.outgoing_caller_id.OutgoingCallerIdContext
        :rtype: twilio.rest.api.v2010.account.outgoing_caller_id.OutgoingCallerIdContext
        r	   )r	   sid)OutgoingCallerIdContextr   r   )r   r)   r   r   r   get   s    	zOutgoingCallerIdList.getc             C   s   t | j| jd |dS )a/  
        Constructs a OutgoingCallerIdContext

        :param sid: The unique string that identifies the resource

        :returns: twilio.rest.api.v2010.account.outgoing_caller_id.OutgoingCallerIdContext
        :rtype: twilio.rest.api.v2010.account.outgoing_caller_id.OutgoingCallerIdContext
        r	   )r	   r)   )r*   r   r   )r   r)   r   r   r   __call__   s    	zOutgoingCallerIdList.__call__c             C   s   dS )zz
        Provide a friendly representation

        :returns: Machine friendly representation
        :rtype: str
        z'<Twilio.Api.V2010.OutgoingCallerIdList>r   )r   r   r   r   __repr__   s    zOutgoingCallerIdList.__repr__)__name__
__module____qualname__r   r   unsetr   r   r   r(   r+   r,   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 )a  
        Initialize the OutgoingCallerIdPage

        :param Version version: Version that contains the resource
        :param Response response: Response from the API
        :param account_sid: The SID of the Account that created the resource

        :returns: twilio.rest.api.v2010.account.outgoing_caller_id.OutgoingCallerIdPage
        :rtype: twilio.rest.api.v2010.account.outgoing_caller_id.OutgoingCallerIdPage
        N)r
   r"   r   r   )r   r   r$   Zsolution)r   r   r   r      s    zOutgoingCallerIdPage.__init__c             C   s   t | j|| jd dS )a2  
        Build an instance of OutgoingCallerIdInstance

        :param dict payload: Payload response from the API

        :returns: twilio.rest.api.v2010.account.outgoing_caller_id.OutgoingCallerIdInstance
        :rtype: twilio.rest.api.v2010.account.outgoing_caller_id.OutgoingCallerIdInstance
        r	   )r	   )OutgoingCallerIdInstancer   r   )r   payloadr   r   r   get_instance   s    	z!OutgoingCallerIdPage.get_instancec             C   s   dS )zz
        Provide a friendly representation

        :returns: Machine friendly representation
        :rtype: str
        z'<Twilio.Api.V2010.OutgoingCallerIdPage>r   )r   r   r   r   r-      s    zOutgoingCallerIdPage.__repr__)r.   r/   r0   r   r5   r-   r2   r   r   )r   r   r"      s   r"   c                   sB   e Zd Z fddZdd Zejf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 OutgoingCallerIdContext

        :param Version version: Version that contains the resource
        :param account_sid: The SID of the Account that created the resource to fetch
        :param sid: The unique string that identifies the resource

        :returns: twilio.rest.api.v2010.account.outgoing_caller_id.OutgoingCallerIdContext
        :rtype: twilio.rest.api.v2010.account.outgoing_caller_id.OutgoingCallerIdContext
        )r	   r)   z4/Accounts/{account_sid}/OutgoingCallerIds/{sid}.jsonN)r
   r*   r   r   r   r   )r   r   r	   r)   )r   r   r   r      s    z OutgoingCallerIdContext.__init__c             C   s0   | j jd| jd}t| j || jd | jd dS )z
        Fetch the OutgoingCallerIdInstance

        :returns: The fetched OutgoingCallerIdInstance
        :rtype: twilio.rest.api.v2010.account.outgoing_caller_id.OutgoingCallerIdInstance
        r   )r   r   r	   r)   )r	   r)   )r   fetchr   r3   r   )r   r4   r   r   r   r6      s    zOutgoingCallerIdContext.fetchc             C   s@   t d|i}| jjd| j|d}t| j|| jd | jd dS )a  
        Update the OutgoingCallerIdInstance

        :param unicode friendly_name: A string to describe the resource

        :returns: The updated OutgoingCallerIdInstance
        :rtype: twilio.rest.api.v2010.account.outgoing_caller_id.OutgoingCallerIdInstance
        r   POST)r   r   r#   r	   r)   )r	   r)   )r   r!   r   updater   r3   r   )r   r   r#   r4   r   r   r   r8      s    	zOutgoingCallerIdContext.updatec             C   s   | j jd| jdS )z
        Deletes the OutgoingCallerIdInstance

        :returns: True if delete succeeds, False otherwise
        :rtype: bool
        DELETE)r   r   )r   deleter   )r   r   r   r   r:     s    zOutgoingCallerIdContext.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    z3OutgoingCallerIdContext.__repr__.<locals>.<genexpr>z-<Twilio.Api.V2010.OutgoingCallerIdContext {}>)joinr   itemsr   )r   contextr   r   r   r-     s    z OutgoingCallerIdContext.__repr__)r.   r/   r0   r   r6   r   r1   r8   r:   r-   r2   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ejfddZdd Zdd Z  ZS )r3   Nc          	      s|   t t| | |dt|dt|d|d|d|d|dd| _d	| _||pp| jd d
| _d	S )z
        Initialize the OutgoingCallerIdInstance

        :returns: twilio.rest.api.v2010.account.outgoing_caller_id.OutgoingCallerIdInstance
        :rtype: twilio.rest.api.v2010.account.outgoing_caller_id.OutgoingCallerIdInstance
        r)   date_createddate_updatedr   r	   r   r   )r)   rC   rD   r   r	   r   r   N)r	   r)   )	r
   r3   r   r+   r   Zrfc2822_datetime_properties_contextr   )r   r   r4   r	   r)   )r   r   r   r     s    z!OutgoingCallerIdInstance.__init__c             C   s.   | j dkr(t| j| jd | jd d| _ | j S )aU  
        Generate an instance context for the instance, the context is capable of
        performing various actions.  All instance actions are proxied to the context

        :returns: OutgoingCallerIdContext for this OutgoingCallerIdInstance
        :rtype: twilio.rest.api.v2010.account.outgoing_caller_id.OutgoingCallerIdContext
        Nr	   r)   )r	   r)   )rF   r*   r   r   )r   r   r   r   _proxy4  s    	
zOutgoingCallerIdInstance._proxyc             C   s
   | j d S )zb
        :returns: The unique string that identifies the resource
        :rtype: unicode
        r)   )rE   )r   r   r   r   r)   E  s    zOutgoingCallerIdInstance.sidc             C   s
   | j d S )zt
        :returns: The RFC 2822 date and time in GMT that the resource was created
        :rtype: datetime
        rC   )rE   )r   r   r   r   rC   M  s    z%OutgoingCallerIdInstance.date_createdc             C   s
   | j d S )zy
        :returns: The RFC 2822 date and time in GMT that the resource was last updated
        :rtype: datetime
        rD   )rE   )r   r   r   r   rD   U  s    z%OutgoingCallerIdInstance.date_updatedc             C   s
   | j d S )zi
        :returns: The string that you assigned to describe the resource
        :rtype: unicode
        r   )rE   )r   r   r   r   r   ]  s    z&OutgoingCallerIdInstance.friendly_namec             C   s
   | j d S )zd
        :returns: The SID of the Account that created the resource
        :rtype: unicode
        r	   )rE   )r   r   r   r   r	   e  s    z$OutgoingCallerIdInstance.account_sidc             C   s
   | j d S )zT
        :returns: The phone number in E.164 format
        :rtype: unicode
        r   )rE   )r   r   r   r   r   m  s    z%OutgoingCallerIdInstance.phone_numberc             C   s
   | j d S )zq
        :returns: The URI of the resource, relative to `https://api.twilio.com`
        :rtype: unicode
        r   )rE   )r   r   r   r   r   u  s    zOutgoingCallerIdInstance.uric             C   s
   | j  S )z
        Fetch the OutgoingCallerIdInstance

        :returns: The fetched OutgoingCallerIdInstance
        :rtype: twilio.rest.api.v2010.account.outgoing_caller_id.OutgoingCallerIdInstance
        )rG   r6   )r   r   r   r   r6   }  s    zOutgoingCallerIdInstance.fetchc             C   s   | j j|dS )a  
        Update the OutgoingCallerIdInstance

        :param unicode friendly_name: A string to describe the resource

        :returns: The updated OutgoingCallerIdInstance
        :rtype: twilio.rest.api.v2010.account.outgoing_caller_id.OutgoingCallerIdInstance
        )r   )rG   r8   )r   r   r   r   r   r8     s    	zOutgoingCallerIdInstance.updatec             C   s
   | j  S )z
        Deletes the OutgoingCallerIdInstance

        :returns: True if delete succeeds, False otherwise
        :rtype: bool
        )rG   r:   )r   r   r   r   r:     s    zOutgoingCallerIdInstance.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    z4OutgoingCallerIdInstance.__repr__.<locals>.<genexpr>z.<Twilio.Api.V2010.OutgoingCallerIdInstance {}>)r@   r   rA   r   )r   rB   r   r   r   r-     s    z!OutgoingCallerIdInstance.__repr__)N)r.   r/   r0   r   propertyrG   r)   rC   rD   r   r	   r   r   r6   r   r1   r8   r:   r-   r2   r   r   )r   r   r3     s   		r3   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*   r3   r   r   r   r   <module>   s    'K