B
    `+7                 @   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                   sr   e Zd 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 )AlphaSenderListzk PLEASE NOTE that this class contains beta products that are subject to
    change. Use them with caution. c                s.   t t| | d|i| _djf | j| _dS )ak  
        Initialize the AlphaSenderList

        :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.messaging.v1.service.alpha_sender.AlphaSenderList
        :rtype: twilio.rest.messaging.v1.service.alpha_sender.AlphaSenderList
        service_sidz$/Services/{service_sid}/AlphaSendersN)superr   __init__	_solutionformat_uri)selfversionr	   )	__class__ \/home/dcms/DCMS/lib/python3.7/site-packages/twilio/rest/messaging/v1/service/alpha_sender.pyr      s    

zAlphaSenderList.__init__c             C   s8   t d|i}| jjd| j|d}t| j|| jd dS )z
        Create the AlphaSenderInstance

        :param unicode alpha_sender: The Alphanumeric Sender ID string

        :returns: The created AlphaSenderInstance
        :rtype: twilio.rest.messaging.v1.service.alpha_sender.AlphaSenderInstance
        ZAlphaSenderPOST)methoduridatar	   )r	   )r   of_versioncreater   AlphaSenderInstancer   )r   alpha_senderr   payloadr   r   r   r   %   s    	zAlphaSenderList.createNc             C   s0   | j ||}| j|d d}| j ||d S )a  
        Streams AlphaSenderInstance 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.messaging.v1.service.alpha_sender.AlphaSenderInstance]
        	page_size)r   limit)r   Zread_limitspagestream)r   r   r   Zlimitsr    r   r   r   r!   4   s    zAlphaSenderList.streamc             C   s   t | j||dS )aq  
        Lists AlphaSenderInstance 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.messaging.v1.service.alpha_sender.AlphaSenderInstance]
        )r   r   )listr!   )r   r   r   r   r   r   r"   K   s    zAlphaSenderList.listc             C   s6   t |||d}| jjd| j|d}t| j|| jS )a  
        Retrieve a single page of AlphaSenderInstance 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 AlphaSenderInstance
        :rtype: twilio.rest.messaging.v1.service.alpha_sender.AlphaSenderPage
        )Z	PageTokenr   ZPageSizeGET)r   r   params)r   r   r   r    r   AlphaSenderPager   )r   Z
page_tokenZpage_numberr   r   responser   r   r   r    ]   s    zAlphaSenderList.pagec             C   s"   | j jjd|}t| j || jS )aM  
        Retrieve a specific page of AlphaSenderInstance records from the API.
        Request is executed immediately

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

        :returns: Page of AlphaSenderInstance
        :rtype: twilio.rest.messaging.v1.service.alpha_sender.AlphaSenderPage
        r#   )r   domainZtwiliorequestr%   r   )r   
target_urlr&   r   r   r   get_pagep   s    

zAlphaSenderList.get_pagec             C   s   t | j| jd |dS )a  
        Constructs a AlphaSenderContext

        :param sid: The SID that identifies the resource to fetch

        :returns: twilio.rest.messaging.v1.service.alpha_sender.AlphaSenderContext
        :rtype: twilio.rest.messaging.v1.service.alpha_sender.AlphaSenderContext
        r	   )r	   sid)AlphaSenderContextr   r   )r   r+   r   r   r   get   s    	zAlphaSenderList.getc             C   s   t | j| jd |dS )a  
        Constructs a AlphaSenderContext

        :param sid: The SID that identifies the resource to fetch

        :returns: twilio.rest.messaging.v1.service.alpha_sender.AlphaSenderContext
        :rtype: twilio.rest.messaging.v1.service.alpha_sender.AlphaSenderContext
        r	   )r	   r+   )r,   r   r   )r   r+   r   r   r   __call__   s    	zAlphaSenderList.__call__c             C   s   dS )zz
        Provide a friendly representation

        :returns: Machine friendly representation
        :rtype: str
        z%<Twilio.Messaging.V1.AlphaSenderList>r   )r   r   r   r   __repr__   s    zAlphaSenderList.__repr__)NN)NN)__name__
__module____qualname____doc__r   r   r!   r"   r   Zunsetr    r*   r-   r.   r/   __classcell__r   r   )r   r   r      s   

r   c                   s0   e Zd ZdZ fddZdd Zdd Z  ZS )r%   zk PLEASE NOTE that this class contains beta products that are subject to
    change. Use them with caution. c                s   t t| || || _dS )a  
        Initialize the AlphaSenderPage

        :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.messaging.v1.service.alpha_sender.AlphaSenderPage
        :rtype: twilio.rest.messaging.v1.service.alpha_sender.AlphaSenderPage
        N)r
   r%   r   r   )r   r   r&   Zsolution)r   r   r   r      s    zAlphaSenderPage.__init__c             C   s   t | j|| jd dS )a  
        Build an instance of AlphaSenderInstance

        :param dict payload: Payload response from the API

        :returns: twilio.rest.messaging.v1.service.alpha_sender.AlphaSenderInstance
        :rtype: twilio.rest.messaging.v1.service.alpha_sender.AlphaSenderInstance
        r	   )r	   )r   r   r   )r   r   r   r   r   get_instance   s    	zAlphaSenderPage.get_instancec             C   s   dS )zz
        Provide a friendly representation

        :returns: Machine friendly representation
        :rtype: str
        z%<Twilio.Messaging.V1.AlphaSenderPage>r   )r   r   r   r   r/      s    zAlphaSenderPage.__repr__)r0   r1   r2   r3   r   r5   r/   r4   r   r   )r   r   r%      s   r%   c                   s8   e Zd ZdZ fddZdd Zdd Zdd	 Z  ZS )
r,   zk PLEASE NOTE that this class contains beta products that are subject to
    change. Use them with caution. c                s0   t t| | ||d| _djf | j| _dS )a  
        Initialize the AlphaSenderContext

        :param Version version: Version that contains the resource
        :param service_sid: The SID of the Messaging Service to fetch the resource from
        :param sid: The SID that identifies the resource to fetch

        :returns: twilio.rest.messaging.v1.service.alpha_sender.AlphaSenderContext
        :rtype: twilio.rest.messaging.v1.service.alpha_sender.AlphaSenderContext
        )r	   r+   z*/Services/{service_sid}/AlphaSenders/{sid}N)r
   r,   r   r   r   r   )r   r   r	   r+   )r   r   r   r      s    zAlphaSenderContext.__init__c             C   s0   | j jd| jd}t| j || jd | jd dS )z
        Fetch the AlphaSenderInstance

        :returns: The fetched AlphaSenderInstance
        :rtype: twilio.rest.messaging.v1.service.alpha_sender.AlphaSenderInstance
        r#   )r   r   r	   r+   )r	   r+   )r   fetchr   r   r   )r   r   r   r   r   r6      s    zAlphaSenderContext.fetchc             C   s   | j jd| jdS )z
        Deletes the AlphaSenderInstance

        :returns: True if delete succeeds, False otherwise
        :rtype: bool
        DELETE)r   r   )r   deleter   )r   r   r   r   r8      s    zAlphaSenderContext.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    z.AlphaSenderContext.__repr__.<locals>.<genexpr>z+<Twilio.Messaging.V1.AlphaSenderContext {}>)joinr   itemsr   )r   contextr   r   r   r/      s    zAlphaSenderContext.__repr__)	r0   r1   r2   r3   r   r6   r8   r/   r4   r   r   )r   r   r,      s
   	r,   c                   s   e Zd 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edd Zdd Zdd Zdd Z  ZS )r   zk PLEASE NOTE that this class contains beta products that are subject to
    change. Use them with caution. Nc          
      s   t t| | |d|d|dt|dt|d|d|d|dd	| _d
| _||px| jd d| _d
S )z
        Initialize the AlphaSenderInstance

        :returns: twilio.rest.messaging.v1.service.alpha_sender.AlphaSenderInstance
        :rtype: twilio.rest.messaging.v1.service.alpha_sender.AlphaSenderInstance
        r+   account_sidr	   date_createddate_updatedr   capabilitiesurl)r+   rA   r	   rB   rC   r   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AlphaSenderInstance.__init__c             C   s.   | j dkr(t| j| jd | 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: AlphaSenderContext for this AlphaSenderInstance
        :rtype: twilio.rest.messaging.v1.service.alpha_sender.AlphaSenderContext
        Nr	   r+   )r	   r+   )rH   r,   r   r   )r   r   r   r   _proxy   s    	
zAlphaSenderInstance._proxyc             C   s
   | j d S )zb
        :returns: The unique string that identifies the resource
        :rtype: unicode
        r+   )rG   )r   r   r   r   r+   1  s    zAlphaSenderInstance.sidc             C   s
   | j d S )zd
        :returns: The SID of the Account that created the resource
        :rtype: unicode
        rA   )rG   )r   r   r   r   rA   9  s    zAlphaSenderInstance.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	   A  s    zAlphaSenderInstance.service_sidc             C   s
   | j d S )zt
        :returns: The ISO 8601 date and time in GMT when the resource was created
        :rtype: datetime
        rB   )rG   )r   r   r   r   rB   I  s    z AlphaSenderInstance.date_createdc             C   s
   | j d S )zy
        :returns: The ISO 8601 date and time in GMT when the resource was last updated
        :rtype: datetime
        rC   )rG   )r   r   r   r   rC   Q  s    z AlphaSenderInstance.date_updatedc             C   s
   | j d S )zU
        :returns: The Alphanumeric Sender ID string
        :rtype: unicode
        r   )rG   )r   r   r   r   r   Y  s    z AlphaSenderInstance.alpha_senderc             C   s
   | j d S )z
        :returns: An array of values that describe whether the number can receive calls or messages
        :rtype: unicode
        rD   )rG   )r   r   r   r   rD   a  s    z AlphaSenderInstance.capabilitiesc             C   s
   | j d S )z`
        :returns: The absolute URL of the AlphaSender resource
        :rtype: unicode
        rE   )rG   )r   r   r   r   rE   i  s    zAlphaSenderInstance.urlc             C   s
   | j  S )z
        Fetch the AlphaSenderInstance

        :returns: The fetched AlphaSenderInstance
        :rtype: twilio.rest.messaging.v1.service.alpha_sender.AlphaSenderInstance
        )rI   r6   )r   r   r   r   r6   q  s    zAlphaSenderInstance.fetchc             C   s
   | j  S )z
        Deletes the AlphaSenderInstance

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

        :returns: Machine friendly representation
        :rtype: str
        r9   c             s   s   | ]\}}d  ||V  qdS )z{}={}N)r   )r:   r;   r<   r   r   r   r=     s    z/AlphaSenderInstance.__repr__.<locals>.<genexpr>z,<Twilio.Messaging.V1.AlphaSenderInstance {}>)r>   r   r?   r   )r   r@   r   r   r   r/     s    zAlphaSenderInstance.__repr__)N)r0   r1   r2   r3   r   propertyrI   r+   rA   r	   rB   rC   r   rD   rE   r6   r8   r/   r4   r   r   )r   r   r     s   		r   N)r3   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    )9