o
    e:                     @   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 )CommandList 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di | 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__r
   W/var/www/html/venv/lib/python3.10/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)_versionread_limitspagestream)	r   r   r   r   r   r   r   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SimStatus	Direction	PageTokenr   PageSizeGET)methoduriparams)r   ofr   r   r   CommandPager   )
r   r   r   r   r   
page_token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   domaintwiliorequestr,   r   )r   
target_urlr0   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"   CallbackMethodCallbackUrlCommandMode
IncludeSidPOST)r(   r)   r/   )r   r+   r   creater   CommandInstance)
r   commandr   r   callback_methodcallback_urlcommand_modeinclude_sidr/   payloadr
   r
   r   r<      s   
zCommandList.createc                 C      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   rG   r
   r
   r   get      	zCommandList.getc                 C   rD   rE   rH   rJ   r
   r
   r   __call__   rL   zCommandList.__call__c                 C      dS )z
        Provide a friendly representation

        :returns: Machine friendly representation
        :rtype: str
        z%<Twilio.Preview.Wireless.CommandList>r
   r   r
   r
   r   __repr__      zCommandList.__repr__)__name__
__module____qualname____doc__r   r   unsetr   r    r   r5   r<   rK   rM   rQ   __classcell__r
   r
   r   r   r      s*    
"

 
r   c                       0   e Zd ZdZ fddZdd Zdd Z  ZS )r,   r	   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   r0   solutionr   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   rC   r
   r
   r   get_instance   s   	zCommandPage.get_instancec                 C   rN   )rO   z%<Twilio.Preview.Wireless.CommandPage>r
   rP   r
   r
   r   rQ      rR   zCommandPage.__repr__)rS   rT   rU   rV   r   r\   rQ   rX   r
   r
   r   r   r,      s
    r,   c                       rY   )rI   r	   c                    s2   t t| | d|i| _djdi | 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
        rG   z/Commands/{sid}Nr
   )r   rI   r   r   r   r   )r   r   rG   r   r
   r   r     s   

zCommandContext.__init__c                 C   s(   | j jd| jd}t| j || jd dS )
        Fetch the CommandInstance

        :returns: The fetched CommandInstance
        :rtype: twilio.rest.preview.wireless.command.CommandInstance
        r'   )r(   r)   rG   rF   )r   fetchr   r=   r   r[   r
   r
   r   r^     s   zCommandContext.fetchc                 C   $   d dd | j D }d|S )rO    c                 s        | ]\}}d  ||V  qdS z{}={}Nr   .0kvr
   r
   r   	<genexpr>%      z*CommandContext.__repr__.<locals>.<genexpr>z+<Twilio.Preview.Wireless.CommandContext {}>joinr   itemsr   r   contextr
   r
   r   rQ        
zCommandContext.__repr__)rS   rT   rU   rV   r   r^   rQ   rX   r
   r
   r   r   rI      s
    rI   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=   r	   Nc                    s   t t| | |d|d|d|d|d|d|d|dt|d	t|d
|dd| _d| _d|pH| jd i| _dS )z
        Initialize the CommandInstance

        :returns: twilio.rest.preview.wireless.command.CommandInstance
        :rtype: twilio.rest.preview.wireless.command.CommandInstance
        rG   account_sid
device_sidsim_sidr>   rA   r   r   date_createddate_updatedurl)rG   rp   rq   rr   r>   rA   r   r   rs   rt   ru   N)	r   r=   r   rK   r   iso8601_datetime_properties_contextr   )r   r   rC   rG   r   r
   r   r   .  s   zCommandInstance.__init__c                 C   s&   | j du 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
        NrG   rF   )rx   rI   r   r   rP   r
   r
   r   _proxyJ  s   
	zCommandInstance._proxyc                 C   
   | j d S )z;
        :returns: The sid
        :rtype: unicode
        rG   rw   rP   r
   r
   r   rG   W     
zCommandInstance.sidc                 C   rz   )zC
        :returns: The account_sid
        :rtype: unicode
        rp   r{   rP   r
   r
   r   rp   _  r|   zCommandInstance.account_sidc                 C   rz   )zB
        :returns: The device_sid
        :rtype: unicode
        rq   r{   rP   r
   r
   r   rq   g  r|   zCommandInstance.device_sidc                 C   rz   )z?
        :returns: The sim_sid
        :rtype: unicode
        rr   r{   rP   r
   r
   r   rr   o  r|   zCommandInstance.sim_sidc                 C   rz   )z?
        :returns: The command
        :rtype: unicode
        r>   r{   rP   r
   r
   r   r>   w  r|   zCommandInstance.commandc                 C   rz   )zD
        :returns: The command_mode
        :rtype: unicode
        rA   r{   rP   r
   r
   r   rA     r|   zCommandInstance.command_modec                 C   rz   )z>
        :returns: The status
        :rtype: unicode
        r   r{   rP   r
   r
   r   r     r|   zCommandInstance.statusc                 C   rz   )zA
        :returns: The direction
        :rtype: unicode
        r   r{   rP   r
   r
   r   r     r|   zCommandInstance.directionc                 C   rz   )zE
        :returns: The date_created
        :rtype: datetime
        rs   r{   rP   r
   r
   r   rs     r|   zCommandInstance.date_createdc                 C   rz   )zE
        :returns: The date_updated
        :rtype: datetime
        rt   r{   rP   r
   r
   r   rt     r|   zCommandInstance.date_updatedc                 C   rz   )z;
        :returns: The url
        :rtype: unicode
        ru   r{   rP   r
   r
   r   ru     r|   zCommandInstance.urlc                 C   s
   | j  S )r]   )ry   r^   rP   r
   r
   r   r^     s   
zCommandInstance.fetchc                 C   r_   )rO   r`   c                 s   ra   rb   rc   rd   r
   r
   r   rh     ri   z+CommandInstance.__repr__.<locals>.<genexpr>z,<Twilio.Preview.Wireless.CommandInstance {}>rj   rm   r
   r
   r   rQ     ro   zCommandInstance.__repr__)N)rS   rT   rU   rV   r   propertyry   rG   rp   rq   rr   r>   rA   r   r   rs   rt   ru   r^   rQ   rX   r
   r
   r   r   r=   )  s:    











	r=   N)rV   twilio.baser   r   twilio.base.instance_contextr   twilio.base.instance_resourcer   twilio.base.list_resourcer   twilio.base.pager   r   r,   rI   r=   r
   r
   r
   r   <module>   s    E)+