o
    �¨Êhˆ:  ã                   @   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
   úV/var/www/html/env/lib/python3.10/site-packages/twilio/rest/preview/wireless/command.pyr      s   	zCommandList.__init__Nc           	      C   s>   | j  ||¡}| j|||||d d�}| j  ||d |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Ú
page_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©Úparams)r   Úofr   r   r   ÚCommandPager   )
r   r   r   r   r   Ú
page_tokenÚpage_numberr   r*   Ú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_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 a new 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: Newly created CommandInstance
        :rtype: twilio.rest.preview.wireless.command.CommandInstance
        )ÚCommandr"   r#   ÚCallbackMethodÚCallbackUrlÚCommandModeÚ
IncludeSidÚPOST)Údata)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   r4   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   r/   Ú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   s4   t  i ¡}| jjd| j|d�}t| j|| jd d�S )ú™
        Fetch a CommandInstance

        :returns: Fetched CommandInstance
        :rtype: twilio.rest.preview.wireless.command.CommandInstance
        r(   r)   rG   rF   )r   r+   r   Úfetchr   r=   r   )r   r*   rC   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>3  ó   € 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|p=| 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   ro   rp   rq   r>   rA   r   r   rr   rs   rt   N)r   r=   r   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   )rw   rI   r   r   rP   r
   r
   r   Ú_proxyX  s   
	zCommandInstance._proxyc                 C   ó
   | j d S )z;
        :returns: The sid
        :rtype: unicode
        rG   ©rv   rP   r
   r
   r   rG   e  ó   
zCommandInstance.sidc                 C   ry   )zC
        :returns: The account_sid
        :rtype: unicode
        ro   rz   rP   r
   r
   r   ro   m  r{   zCommandInstance.account_sidc                 C   ry   )zB
        :returns: The device_sid
        :rtype: unicode
        rp   rz   rP   r
   r
   r   rp   u  r{   zCommandInstance.device_sidc                 C   ry   )z?
        :returns: The sim_sid
        :rtype: unicode
        rq   rz   rP   r
   r
   r   rq   }  r{   zCommandInstance.sim_sidc                 C   ry   )z?
        :returns: The command
        :rtype: unicode
        r>   rz   rP   r
   r
   r   r>   …  r{   zCommandInstance.commandc                 C   ry   )zD
        :returns: The command_mode
        :rtype: unicode
        rA   rz   rP   r
   r
   r   rA   �  r{   zCommandInstance.command_modec                 C   ry   )z>
        :returns: The status
        :rtype: unicode
        r   rz   rP   r
   r
   r   r   •  r{   zCommandInstance.statusc                 C   ry   )zA
        :returns: The direction
        :rtype: unicode
        r   rz   rP   r
   r
   r   r   �  r{   zCommandInstance.directionc                 C   ry   )zE
        :returns: The date_created
        :rtype: datetime
        rr   rz   rP   r
   r
   r   rr   ¥  r{   zCommandInstance.date_createdc                 C   ry   )zE
        :returns: The date_updated
        :rtype: datetime
        rs   rz   rP   r
   r
   r   rs   ­  r{   zCommandInstance.date_updatedc                 C   ry   )z;
        :returns: The url
        :rtype: unicode
        rt   rz   rP   r
   r
   r   rt   µ  r{   zCommandInstance.urlc                 C   s
   | j  ¡ S )r\   )rx   r]   rP   r
   r
   r   r]   ½  s   
zCommandInstance.fetchc                 C   r^   )rO   r_   c                 s   r`   ra   rb   rc   r
   r
   r   rg   Í  rh   z+CommandInstance.__repr__.<locals>.<genexpr>z,<Twilio.Preview.Wireless.CommandInstance {}>ri   rl   r
   r
   r   rQ   Æ  rn   zCommandInstance.__repr__)N)rS   rT   rU   rV   r   Úpropertyrx   rG   ro   rp   rq   r>   rA   r   r   rr   rs   rt   r]   rQ   rX   r
   r
   r   r   r=   7  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    M)1