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dZ fddZejejejejddfddZejejejejddfddZejejej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fddZdd Zdd Zdd Z  ZS )CommandListz PLEASE NOTE that this class contains preview products that are subject
    to change. Use them with caution. If you currently do not have developer
    preview access, please contact help@twilio.com. c                s*   t t| | i | _djf | j| _dS )z
        Initialize the CommandList

        :param Version version: Version that contains the resource

        :returns: twilio.rest.preview.wireless.command.CommandList
        :rtype: twilio.rest.preview.wireless.command.CommandList
        z	/CommandsN)superr   __init__	_solutionformat_uri)selfversion)	__class__ S/home/dcms/DCMS/lib/python3.7/site-packages/twilio/rest/preview/wireless/command.pyr
      s    	zCommandList.__init__Nc       	      C   s8   | j ||}| j|||||d d}| j ||d S )ah  
        Streams CommandInstance 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 device: The device
        :param unicode sim: The sim
        :param unicode status: The status
        :param unicode direction: The direction
        :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.preview.wireless.command.CommandInstance]
        	page_size)devicesimstatus	directionr   limit)_versionZread_limitspagestream)	r   r   r   r   r   r   r   Zlimitsr   r   r   r   r   %   s    zCommandList.streamc          	   C   s   t | j||||||dS )a  
        Lists CommandInstance records from the API as a list.
        Unlike stream(), this operation is eager and will load `limit` records into
        memory before returning.

        :param unicode device: The device
        :param unicode sim: The sim
        :param unicode status: The status
        :param unicode direction: The direction
        :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.preview.wireless.command.CommandInstance]
        )r   r   r   r   r   r   )listr   )r   r   r   r   r   r   r   r   r   r   r   G   s    zCommandList.listc       
   
   C   s>   t |||||||d}| jjd| j|d}	t| j|	| jS )ah  
        Retrieve a single page of CommandInstance records from the API.
        Request is executed immediately

        :param unicode device: The device
        :param unicode sim: The sim
        :param unicode status: The status
        :param unicode direction: The direction
        :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 CommandInstance
        :rtype: twilio.rest.preview.wireless.command.CommandPage
        )DeviceSimZStatusZ	DirectionZ	PageTokenr   ZPageSizeGET)methoduriparams)r   ofr   r   r   CommandPager   )
r   r   r   r   r   Z
page_tokenZpage_numberr   dataresponser   r   r   r   e   s    
zCommandList.pagec             C   s"   | j jjd|}t| j || jS )a8  
        Retrieve a specific page of CommandInstance records from the API.
        Request is executed immediately

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

        :returns: Page of CommandInstance
        :rtype: twilio.rest.preview.wireless.command.CommandPage
        r   )r   domainZtwiliorequestr$   r   )r   
target_urlr&   r   r   r   get_page   s    

zCommandList.get_pagec       
   
   C   s:   t |||||||d}| jjd| j|d}	t| j|	S )a  
        Create the CommandInstance

        :param unicode command: The command
        :param unicode device: The device
        :param unicode sim: The sim
        :param unicode callback_method: The callback_method
        :param unicode callback_url: The callback_url
        :param unicode command_mode: The command_mode
        :param unicode include_sid: The include_sid

        :returns: The created CommandInstance
        :rtype: twilio.rest.preview.wireless.command.CommandInstance
        )Commandr   r   ZCallbackMethodZCallbackUrlZCommandModeZ
IncludeSidPOST)r    r!   r%   )r   r#   r   creater   CommandInstance)
r   commandr   r   Zcallback_methodZcallback_urlcommand_modeZinclude_sidr%   payloadr   r   r   r-      s    
zCommandList.createc             C   s   t | j|dS )z
        Constructs a CommandContext

        :param sid: The sid

        :returns: twilio.rest.preview.wireless.command.CommandContext
        :rtype: twilio.rest.preview.wireless.command.CommandContext
        )sid)CommandContextr   )r   r2   r   r   r   get   s    	zCommandList.getc             C   s   t | j|dS )z
        Constructs a CommandContext

        :param sid: The sid

        :returns: twilio.rest.preview.wireless.command.CommandContext
        :rtype: twilio.rest.preview.wireless.command.CommandContext
        )r2   )r3   r   )r   r2   r   r   r   __call__   s    	zCommandList.__call__c             C   s   dS )zz
        Provide a friendly representation

        :returns: Machine friendly representation
        :rtype: str
        z%<Twilio.Preview.Wireless.CommandList>r   )r   r   r   r   __repr__   s    zCommandList.__repr__)__name__
__module____qualname____doc__r
   r   Zunsetr   r   r   r*   r-   r4   r5   r6   __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$   z PLEASE NOTE that this class contains preview products that are subject
    to change. Use them with caution. If you currently do not have developer
    preview access, please contact help@twilio.com. c                s   t t| || || _dS )a-  
        Initialize the CommandPage

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

        :returns: twilio.rest.preview.wireless.command.CommandPage
        :rtype: twilio.rest.preview.wireless.command.CommandPage
        N)r	   r$   r
   r   )r   r   r&   Zsolution)r   r   r   r
      s    
zCommandPage.__init__c             C   s   t | j|S )z
        Build an instance of CommandInstance

        :param dict payload: Payload response from the API

        :returns: twilio.rest.preview.wireless.command.CommandInstance
        :rtype: twilio.rest.preview.wireless.command.CommandInstance
        )r.   r   )r   r1   r   r   r   get_instance   s    	zCommandPage.get_instancec             C   s   dS )zz
        Provide a friendly representation

        :returns: Machine friendly representation
        :rtype: str
        z%<Twilio.Preview.Wireless.CommandPage>r   )r   r   r   r   r6      s    zCommandPage.__repr__)r7   r8   r9   r:   r
   r<   r6   r;   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 )r3   z PLEASE NOTE that this class contains preview products that are subject
    to change. Use them with caution. If you currently do not have developer
    preview access, please contact help@twilio.com. c                s.   t t| | d|i| _djf | j| _dS )a  
        Initialize the CommandContext

        :param Version version: Version that contains the resource
        :param sid: The sid

        :returns: twilio.rest.preview.wireless.command.CommandContext
        :rtype: twilio.rest.preview.wireless.command.CommandContext
        r2   z/Commands/{sid}N)r	   r3   r
   r   r   r   )r   r   r2   )r   r   r   r
     s    

zCommandContext.__init__c             C   s(   | j jd| jd}t| j || jd dS )z
        Fetch the CommandInstance

        :returns: The fetched CommandInstance
        :rtype: twilio.rest.preview.wireless.command.CommandInstance
        r   )r    r!   r2   )r2   )r   fetchr   r.   r   )r   r1   r   r   r   r=     s    zCommandContext.fetchc             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*CommandContext.__repr__.<locals>.<genexpr>z+<Twilio.Preview.Wireless.CommandContext {}>)joinr   itemsr   )r   contextr   r   r   r6     s    zCommandContext.__repr__)r7   r8   r9   r:   r
   r=   r6   r;   r   r   )r   r   r3      s   r3   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edd Zedd Zedd Zdd Zdd  Z  ZS )"r.   z PLEASE NOTE that this class contains preview products that are subject
    to change. Use them with caution. If you currently do not have developer
    preview access, please contact help@twilio.com. Nc                s   t t| | |d|d|d|d|d|d|d|dt|d	t|d
|dd| _d| _d|p| jd i| _dS )z
        Initialize the CommandInstance

        :returns: twilio.rest.preview.wireless.command.CommandInstance
        :rtype: twilio.rest.preview.wireless.command.CommandInstance
        r2   account_sid
device_sidsim_sidr/   r0   r   r   date_createddate_updatedurl)r2   rF   rG   rH   r/   r0   r   r   rI   rJ   rK   N)	r	   r.   r
   r4   r   iso8601_datetime_properties_contextr   )r   r   r1   r2   )r   r   r   r
   .  s    zCommandInstance.__init__c             C   s&   | j dkr t| j| jd d| _ | j S )a.  
        Generate an instance context for the instance, the context is capable of
        performing various actions.  All instance actions are proxied to the context

        :returns: CommandContext for this CommandInstance
        :rtype: twilio.rest.preview.wireless.command.CommandContext
        Nr2   )r2   )rN   r3   r   r   )r   r   r   r   _proxyJ  s    	
zCommandInstance._proxyc             C   s
   | j d S )z;
        :returns: The sid
        :rtype: unicode
        r2   )rM   )r   r   r   r   r2   W  s    zCommandInstance.sidc             C   s
   | j d S )zC
        :returns: The account_sid
        :rtype: unicode
        rF   )rM   )r   r   r   r   rF   _  s    zCommandInstance.account_sidc             C   s
   | j d S )zB
        :returns: The device_sid
        :rtype: unicode
        rG   )rM   )r   r   r   r   rG   g  s    zCommandInstance.device_sidc             C   s
   | j d S )z?
        :returns: The sim_sid
        :rtype: unicode
        rH   )rM   )r   r   r   r   rH   o  s    zCommandInstance.sim_sidc             C   s
   | j d S )z?
        :returns: The command
        :rtype: unicode
        r/   )rM   )r   r   r   r   r/   w  s    zCommandInstance.commandc             C   s
   | j d S )zD
        :returns: The command_mode
        :rtype: unicode
        r0   )rM   )r   r   r   r   r0     s    zCommandInstance.command_modec             C   s
   | j d S )z>
        :returns: The status
        :rtype: unicode
        r   )rM   )r   r   r   r   r     s    zCommandInstance.statusc             C   s
   | j d S )zA
        :returns: The direction
        :rtype: unicode
        r   )rM   )r   r   r   r   r     s    zCommandInstance.directionc             C   s
   | j d S )zE
        :returns: The date_created
        :rtype: datetime
        rI   )rM   )r   r   r   r   rI     s    zCommandInstance.date_createdc             C   s
   | j d S )zE
        :returns: The date_updated
        :rtype: datetime
        rJ   )rM   )r   r   r   r   rJ     s    zCommandInstance.date_updatedc             C   s
   | j d S )z;
        :returns: The url
        :rtype: unicode
        rK   )rM   )r   r   r   r   rK     s    zCommandInstance.urlc             C   s
   | j  S )z
        Fetch the CommandInstance

        :returns: The fetched CommandInstance
        :rtype: twilio.rest.preview.wireless.command.CommandInstance
        )rO   r=   )r   r   r   r   r=     s    zCommandInstance.fetchc             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@   rA   r   r   r   rB     s    z+CommandInstance.__repr__.<locals>.<genexpr>z,<Twilio.Preview.Wireless.CommandInstance {}>)rC   r   rD   r   )r   rE   r   r   r   r6     s    zCommandInstance.__repr__)N)r7   r8   r9   r:   r
   propertyrO   r2   rF   rG   rH   r/   r0   r   r   rI   rJ   rK   r=   r6   r;   r   r   )r   r   r.   )  s    	r.   N)r:   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$   r3   r.   r   r   r   r   <module>   s    E)+