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 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 )CommandListc                    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	   R/var/www/html/venv/lib/python3.10/site-packages/twilio/rest/wireless/v1/command.pyr      s   	zCommandList.__init__Nc           	      C   s8   | j ||}| j|||||d d}| j ||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: The sid or unique_name of the Sim resources to read
        :param CommandInstance.Status status: The status of the resources to read
        :param CommandInstance.Direction direction: Only return Commands with this direction value
        :param CommandInstance.Transport transport: Only return Commands with this transport value
        :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)_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: The sid or unique_name of the Sim resources to read
        :param CommandInstance.Status status: The status of the resources to read
        :param CommandInstance.Direction direction: Only return Commands with this direction value
        :param CommandInstance.Transport transport: Only return Commands with this transport value
        :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   D   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: The sid or unique_name of the Sim resources to read
        :param CommandInstance.Status status: The status of the resources to read
        :param CommandInstance.Direction direction: Only return Commands with this direction value
        :param CommandInstance.Transport transport: Only return Commands with this transport value
        :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)methoduriparams)r   ofr   r   r   CommandPager   )
r   r   r   r   r   
page_tokenpage_numberr   dataresponser	   r	   r   r   b   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 the 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 unique_name of the SIM to send the Command to
        :param unicode callback_method: The HTTP method we use to call callback_url
        :param unicode callback_url: he URL we call when the Command has finished sending
        :param CommandInstance.CommandMode command_mode: The mode to use when sending the SMS message
        :param unicode include_sid: Whether to include the SID of the command in the message body
        :param bool delivery_receipt_requested: Whether to request delivery receipt from the recipient

        :returns: The created CommandInstance
        :rtype: twilio.rest.wireless.v1.command.CommandInstance
        )Commandr    CallbackMethodCallbackUrlCommandMode
IncludeSidDeliveryReceiptRequestedPOST)r'   r(   r.   )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 that identifies the resource to fetch

        :returns: twilio.rest.wireless.v1.command.CommandContext
        :rtype: twilio.rest.wireless.v1.command.CommandContext
        sidCommandContextr   r   rH   r	   r	   r   get      	zCommandList.getc                 C   rE   rF   rI   rK   r	   r	   r   __call__   rM   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__r   r   unsetr   r   r   r4   r<   rL   rN   rR   __classcell__r	   r	   r   r   r      s(    
"

 
r   c                       s,   e Zd Z fddZdd Zdd Z  ZS )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   rD   r	   r	   r   get_instance   s   	zCommandPage.get_instancec                 C   rO   )rP   z <Twilio.Wireless.V1.CommandPage>r	   rQ   r	   r	   r   rR      rS   zCommandPage.__repr__)rT   rU   rV   r   r[   rR   rX   r	   r	   r   r   r+      s    r+   c                       s4   e Zd Z fddZdd Zdd Zdd Z  ZS )	rJ   c                    s2   t t| | d|i| _djdi | j| _dS )a6  
        Initialize the CommandContext

        :param Version version: Version that contains the resource
        :param sid: The SID that identifies the resource to fetch

        :returns: twilio.rest.wireless.v1.command.CommandContext
        :rtype: twilio.rest.wireless.v1.command.CommandContext
        rH   z/Commands/{sid}Nr	   )r
   rJ   r   r   r   r   )r   r   rH   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.wireless.v1.command.CommandInstance
        r&   r'   r(   rH   rG   )r   fetchr   r=   r   rZ   r	   r	   r   r^   
  s   zCommandContext.fetchc                 C   s   | j jd| jdS )~
        Deletes the CommandInstance

        :returns: True if delete succeeds, False otherwise
        :rtype: bool
        DELETEr]   )r   deleter   rQ   r	   r	   r   ra     s   zCommandContext.deletec                 C   $   d dd | j D }d|S )rP    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   rR        
zCommandContext.__repr__)rT   rU   rV   r   r^   ra   rR   rX   r	   r	   r   r   rJ      s
    	rJ   c                       s  e 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d*d+ Z  ZS )-r=   c                   @      e Zd ZdZdZdS )zCommandInstance.Directionfrom_simto_simN)rT   rU   rV   FROM_SIMTO_SIMr	   r	   r	   r   r"   +      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)rT   rU   rV   QUEUEDSENT	DELIVEREDRECEIVEDFAILEDr	   r	   r	   r   r!   /  s    r!   c                   @   rs   )zCommandInstance.CommandModetextbinaryN)rT   rU   rV   TEXTBINARYr	   r	   r	   r   r8   6  rx   r8   c                   @   rs   )zCommandInstance.TransportsmsipN)rT   rU   rV   SMSIPr	   r	   r	   r   r#   :  rx   r#   Nc                    s   t t| | |d|d|d|d|d|d|d|d|d	t|d
t|d|dd| _d| _d|pL| jd i| _dS )z
        Initialize the CommandInstance

        :returns: twilio.rest.wireless.v1.command.CommandInstance
        :rtype: twilio.rest.wireless.v1.command.CommandInstance
        rH   account_sidsim_sidr>   rA   r   rC   r   r   date_createddate_updatedurl)rH   r   r   r>   rA   r   rC   r   r   r   r   r   N)	r
   r=   r   rL   r   iso8601_datetime_properties_contextr   )r   r   rD   rH   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.wireless.v1.command.CommandContext
        NrH   rG   )r   rJ   r   r   rQ   r	   r	   r   _proxy[  s   
	zCommandInstance._proxyc                 C   
   | j d S )zb
        :returns: The unique string that identifies the resource
        :rtype: unicode
        rH   r   rQ   r	   r	   r   rH   h     
zCommandInstance.sidc                 C   r   )zd
        :returns: The SID of the Account that created the resource
        :rtype: unicode
        r   r   rQ   r	   r	   r   r   p  r   zCommandInstance.account_sidc                 C   r   )zt
        :returns: The SID of the Sim resource that the Command was sent to or from
        :rtype: unicode
        r   r   rQ   r	   r	   r   r   x  r   zCommandInstance.sim_sidc                 C   r   )z]
        :returns: The message being sent to or from the SIM
        :rtype: unicode
        r>   r   rQ   r	   r	   r   r>     r   zCommandInstance.commandc                 C   r   )zm
        :returns: The mode used to send the SMS message
        :rtype: CommandInstance.CommandMode
        rA   r   rQ   r	   r	   r   rA     r   zCommandInstance.command_modec                 C   r   )z`
        :returns: The type of transport used
        :rtype: CommandInstance.Transport
        r   r   rQ   r	   r	   r   r     r   zCommandInstance.transportc                 C   r   )zV
        :returns: Whether to request a delivery receipt
        :rtype: bool
        rC   r   rQ   r	   r	   r   rC     r   z*CommandInstance.delivery_receipt_requestedc                 C   r   )z\
        :returns: The status of the Command
        :rtype: CommandInstance.Status
        r   r   rQ   r	   r	   r   r     r   zCommandInstance.statusc                 C   r   )zb
        :returns: The direction of the Command
        :rtype: CommandInstance.Direction
        r   r   rQ   r	   r	   r   r     r   zCommandInstance.directionc                 C   r   )zt
        :returns: The ISO 8601 date and time in GMT when the resource was created
        :rtype: datetime
        r   r   rQ   r	   r	   r   r     r   zCommandInstance.date_createdc                 C   r   )z
        :returns: The ISO 8601 date and time in GMT when the resource was last updated format
        :rtype: datetime
        r   r   rQ   r	   r	   r   r     r   zCommandInstance.date_updatedc                 C   r   )zT
        :returns: The absolute URL of the resource
        :rtype: unicode
        r   r   rQ   r	   r	   r   r     r   zCommandInstance.urlc                 C   
   | j  S )r\   )r   r^   rQ   r	   r	   r   r^        
zCommandInstance.fetchc                 C   r   )r_   )r   ra   rQ   r	   r	   r   ra     r   zCommandInstance.deletec                 C   rb   )rP   rc   c                 s   rd   re   rf   rg   r	   r	   r   rk     rl   z+CommandInstance.__repr__.<locals>.<genexpr>z'<Twilio.Wireless.V1.CommandInstance {}>rm   rp   r	   r	   r   rR     rr   zCommandInstance.__repr__)N)rT   rU   rV   objectr"   r!   r8   r#   r   propertyr   rH   r   r   r>   rA   r   rC   r   r   r   r   r   r^   ra   rR   rX   r	   r	   r   r   r=   )  sF    












		r=   N)__doc__twilio.baser   r   twilio.base.instance_contextr   twilio.base.instance_resourcer   twilio.base.list_resourcer   twilio.base.pager   r   r+   rJ   r=   r	   r	   r	   r   <module>   s    B&1