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ú  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.wireless.v1.command.CommandList
        :rtype: twilio.rest.wireless.v1.command.CommandList
        z	/CommandsN© )Úsuperr   Ú__init__Ú	_solutionÚformatÚ_uri)ÚselfÚversion©Ú	__class__r
   úQ/var/www/html/env/lib/python3.10/site-packages/twilio/rest/wireless/v1/command.pyr      s   	zCommandList.__init__Nc           	      C   s>   | j  ||¡}| j|||||d d�}| j  ||d |d ¡S )a  
        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 sim: Only return Commands to or from this SIM.
        :param CommandInstance.Status status: Only return Commands with this status value.
        :param CommandInstance.Direction direction: Only return Commands with this direction value.
        :param CommandInstance.Transport transport: The transport
        :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.wireless.v1.command.CommandInstance]
        Ú	page_size)ÚsimÚstatusÚ	directionÚ	transportr   Ú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 sim: Only return Commands to or from this SIM.
        :param CommandInstance.Status status: Only return Commands with this status value.
        :param CommandInstance.Direction direction: Only return Commands with this direction value.
        :param CommandInstance.Transport transport: The transport
        :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.wireless.v1.command.CommandInstance]
        )r   r   r   r   r   r   )Úlistr   )r   r   r   r   r   r   r   r
   r
   r   r!   E   s   úzCommandList.listc           
   
   C   s>   t  |||||||dœ¡}| jjd| j|d�}	t| j|	| jƒS )a  
        Retrieve a single page of CommandInstance records from the API.
        Request is executed immediately

        :param unicode sim: Only return Commands to or from this SIM.
        :param CommandInstance.Status status: Only return Commands with this status value.
        :param CommandInstance.Direction direction: Only return Commands with this direction value.
        :param CommandInstance.Transport transport: The transport
        :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.wireless.v1.command.CommandPage
        )ÚSimÚStatusÚ	DirectionÚ	TransportÚ	PageTokenr   ÚPageSizeÚGET©Úparams)r   Úofr   r   r   ÚCommandPager   )
r   r   r   r   r   Ú
page_tokenÚpage_numberr   r*   Úresponser
   r
   r   r   c   s   ù
ýzCommandList.pagec                 C   s"   | j jj d|¡}t| j || jƒS )a3  
        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.wireless.v1.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 message body of the Command or a Base64 encoded byte string in binary mode.
        :param unicode sim: The Sid or UniqueName of the SIM to send the Command to.
        :param unicode callback_method: The HTTP method Twilio will use when making a request to the callback URL.
        :param unicode callback_url: Twilio will make a request to this URL when the Command has finished sending.
        :param CommandInstance.CommandMode command_mode: A string representing which mode to send the SMS message using.
        :param unicode include_sid: When sending a Command to a SIM in text mode, Twilio can automatically include the Sid of the Command in the message body, which could be used to ensure that the device does not process the same Command more than once.
        :param bool delivery_receipt_requested: The delivery_receipt_requested

        :returns: Newly created CommandInstance
        :rtype: twilio.rest.wireless.v1.command.CommandInstance
        )ÚCommandr"   ÚCallbackMethodÚCallbackUrlÚCommandModeÚ
IncludeSidÚDeliveryReceiptRequestedÚPOST)Údata)r   r+   r   Úcreater   ÚCommandInstance)
r   Úcommandr   Úcallback_methodÚcallback_urlÚcommand_modeÚinclude_sidÚdelivery_receipt_requestedr<   Úpayloadr
   r
   r   r=   ˜   s   ù
ýzCommandList.createc                 C   ó   t | j|d�S ©zË
        Constructs a CommandContext

        :param sid: The sid

        :returns: twilio.rest.wireless.v1.command.CommandContext
        :rtype: twilio.rest.wireless.v1.command.CommandContext
        ©Úsid©ÚCommandContextr   ©r   rI   r
   r
   r   Úget»   ó   	zCommandList.getc                 C   rF   rG   rJ   rL   r
   r
   r   Ú__call__Æ   rN   zCommandList.__call__c                 C   ó   dS )úz
        Provide a friendly representation

        :returns: Machine friendly representation
        :rtype: str
        z <Twilio.Wireless.V1.CommandList>r
   ©r   r
   r
   r   Ú__repr__Ñ   ó   zCommandList.__repr__)Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   r   Úunsetr   r!   r   r4   r=   rM   rO   rS   Ú__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.wireless.v1.command.CommandPage
        :rtype: twilio.rest.wireless.v1.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.wireless.v1.command.CommandInstance
        :rtype: twilio.rest.wireless.v1.command.CommandInstance
        )r>   r   )r   rE   r
   r
   r   Úget_instanceí   s   	zCommandPage.get_instancec                 C   rP   )rQ   z <Twilio.Wireless.V1.CommandPage>r
   rR   r
   r
   r   rS   ø   rT   zCommandPage.__repr__)rU   rV   rW   rX   r   r]   rS   rZ   r
   r
   r   r   r,   Û   s
    r,   c                       r[   )rK   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.wireless.v1.command.CommandContext
        :rtype: twilio.rest.wireless.v1.command.CommandContext
        rI   z/Commands/{sid}Nr
   )r   rK   r   r   r   r   )r   r   rI   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.wireless.v1.command.CommandInstance
        r(   r)   rI   rH   )r   r+   r   Úfetchr   r>   r   )r   r*   rE   r
   r
   r   r_     s   
ýzCommandContext.fetchc                 C   ó$   d  dd„ | j ¡ D ƒ¡}d |¡S )rQ   ú c                 s   ó    � | ]\}}d   ||¡V  qdS ©z{}={}N©r   ©Ú.0ÚkÚvr
   r
   r   Ú	<genexpr>-  ó   € z*CommandContext.__repr__.<locals>.<genexpr>z&<Twilio.Wireless.V1.CommandContext {}>©Újoinr   Úitemsr   ©r   Úcontextr
   r
   r   rS   &  ó   
zCommandContext.__repr__)rU   rV   rW   rX   r   r_   rS   rZ   r
   r
   r   r   rK     s
    rK   c                       s  e Zd Zd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+‡ 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e
d%d&„ ƒZd'd(„ Zd)d*„ Z‡  ZS ),r>   r	   c                   @   ó   e Zd ZdZdZdS )zCommandInstance.DirectionÚfrom_simÚto_simN)rU   rV   rW   ÚFROM_SIMÚTO_SIMr
   r
   r
   r   r$   4  ó    r$   c                   @   s    e Zd ZdZdZdZdZdZdS )zCommandInstance.StatusÚqueuedÚsentÚ	deliveredÚreceivedÚfailedN)rU   rV   rW   ÚQUEUEDÚSENTÚ	DELIVEREDÚRECEIVEDÚFAILEDr
   r
   r
   r   r#   8  s    r#   c                   @   rq   )zCommandInstance.CommandModeÚtextÚbinaryN)rU   rV   rW   ÚTEXTÚBINARYr
   r
   r
   r   r8   ?  rv   r8   c                   @   rq   )zCommandInstance.TransportÚsmsÚipN)rU   rV   rW   ÚSMSÚIPr
   r
   r
   r   r%   C  rv   r%   Nc                    sŠ   t t| ƒ |¡ |d |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.wireless.v1.command.CommandInstance
        :rtype: twilio.rest.wireless.v1.command.CommandInstance
        rI   Úaccount_sidÚsim_sidr?   rB   r   rD   r   r   Údate_createdÚdate_updatedÚurl)rI   r‰   rŠ   r?   rB   r   rD   r   r   r‹   rŒ   r�   N)r   r>   r   r   Úiso8601_datetimeÚ_propertiesÚ_contextr   )r   r   rE   rI   r   r
   r   r   G  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.wireless.v1.command.CommandContext
        NrI   rH   )r�   rK   r   r   rR   r
   r
   r   Ú_proxyd  s   
	zCommandInstance._proxyc                 C   ó
   | j d S )zq
        :returns: A 34 character string that uniquely identifies this resource.
        :rtype: unicode
        rI   ©r�   rR   r
   r
   r   rI   q  ó   
zCommandInstance.sidc                 C   r’   )zn
        :returns: The unique id of the Account that this Command belongs to.
        :rtype: unicode
        r‰   r“   rR   r
   r
   r   r‰   y  r”   zCommandInstance.account_sidc                 C   r’   )zs
        :returns: The unique ID of the SIM that this Command was sent to or from.
        :rtype: unicode
        rŠ   r“   rR   r
   r
   r   rŠ   �  r”   zCommandInstance.sim_sidc                 C   r’   )z^
        :returns: The message being sent to or from the SIM.
        :rtype: unicode
        r?   r“   rR   r
   r
   r   r?   ‰  r”   zCommandInstance.commandc                 C   r’   )zŒ
        :returns: A string representing which mode the SMS was sent or received using.
        :rtype: CommandInstance.CommandMode
        rB   r“   rR   r
   r
   r   rB   ‘  r”   zCommandInstance.command_modec                 C   r’   )zS
        :returns: The transport
        :rtype: CommandInstance.Transport
        r   r“   rR   r
   r
   r   r   ™  r”   zCommandInstance.transportc                 C   r’   )zO
        :returns: The delivery_receipt_requested
        :rtype: bool
        rD   r“   rR   r
   r
   r   rD   ¡  r”   z*CommandInstance.delivery_receipt_requestedc                 C   r’   )zs
        :returns: A string representing the status of the Command.
        :rtype: CommandInstance.Status
        r   r“   rR   r
   r
   r   r   ©  r”   zCommandInstance.statusc                 C   r’   )zc
        :returns: The direction of the Command.
        :rtype: CommandInstance.Direction
        r   r“   rR   r
   r
   r   r   ±  r”   zCommandInstance.directionc                 C   r’   )z~
        :returns: The date that this resource was created, given as GMT in ISO 8601 format.
        :rtype: datetime
        r‹   r“   rR   r
   r
   r   r‹   ¹  r”   zCommandInstance.date_createdc                 C   r’   )zƒ
        :returns: The date that this resource was last updated, given as GMT in ISO 8601 format.
        :rtype: datetime
        rŒ   r“   rR   r
   r
   r   rŒ   Á  r”   zCommandInstance.date_updatedc                 C   r’   )zN
        :returns: The URL for this resource.
        :rtype: unicode
        r�   r“   rR   r
   r
   r   r�   É  r”   zCommandInstance.urlc                 C   s
   | j  ¡ S )r^   )r‘   r_   rR   r
   r
   r   r_   Ñ  s   
zCommandInstance.fetchc                 C   r`   )rQ   ra   c                 s   rb   rc   rd   re   r
   r
   r   ri   á  rj   z+CommandInstance.__repr__.<locals>.<genexpr>z'<Twilio.Wireless.V1.CommandInstance {}>rk   rn   r
   r
   r   rS   Ú  rp   zCommandInstance.__repr__)N)rU   rV   rW   rX   Úobjectr$   r#   r8   r%   r   Úpropertyr‘   rI   r‰   rŠ   r?   rB   r   rD   r   r   r‹   rŒ   r�   r_   rS   rZ   r
   r
   r   r   r>   1  sF    












	r>   N)rX   Útwilio.baser   r   Útwilio.base.instance_contextr   Útwilio.base.instance_resourcer   Útwilio.base.list_resourcer   Útwilio.base.pager   r   r,   rK   r>   r
   r
   r
   r   Ú<module>   s    K'/