o
    O`g8                     @   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fddZejejejddfddZejejejddf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dd Z  ZS )CommandListk PLEASE NOTE that this class contains beta products that are subject to
    change. Use them with caution. 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.supersim.v1.command.CommandList
        :rtype: twilio.rest.supersim.v1.command.CommandList
        z	/CommandsN )superr   __init__	_solutionformat_uri)selfversion	__class__r
   c/var/www/html/asistente-voz-ia/venv/lib/python3.10/site-packages/twilio/rest/supersim/v1/command.pyr      s   	zCommandList.__init__c                 C   s4   t ||||d}| jjd| j|d}t| j|S )a  
        Create the CommandInstance

        :param unicode sim: The sid or unique_name of the SIM to send the Command to
        :param unicode command: The message body of the command
        :param unicode callback_method: The HTTP method we should use to call callback_url
        :param unicode callback_url: The URL we should call after we have sent the command

        :returns: The created CommandInstance
        :rtype: twilio.rest.supersim.v1.command.CommandInstance
        )SimCommandCallbackMethodCallbackUrlPOST)methoduridata)r   of_versioncreater   CommandInstance)r   simcommandcallback_methodcallback_urlr   payloadr
   r
   r   r   $   s   zCommandList.createNc                 C   s6   | 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 that Command was sent to or from.
        :param CommandInstance.Status status: The status of the Command
        :param CommandInstance.Direction direction: The direction of the Command
        :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.supersim.v1.command.CommandInstance]
        	page_size)r!   status	directionr&   limit)r   read_limitspagestream)r   r!   r'   r(   r)   r&   limitsr+   r
   r
   r   r,   <   s   zCommandList.streamc                 C   s   t | j|||||dS )aT  
        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 that Command was sent to or from.
        :param CommandInstance.Status status: The status of the Command
        :param CommandInstance.Direction direction: The direction of the Command
        :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.supersim.v1.command.CommandInstance]
        )r!   r'   r(   r)   r&   )listr,   )r   r!   r'   r(   r)   r&   r
   r
   r   r.   W   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 that Command was sent to or from.
        :param CommandInstance.Status status: The status of the Command
        :param CommandInstance.Direction direction: The direction of the Command
        :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.supersim.v1.command.CommandPage
        )r   Status	Direction	PageTokenr   PageSizeGET)r   r   params)r   r   r   r+   r   CommandPager   )	r   r!   r'   r(   
page_tokenpage_numberr&   r   responser
   r
   r   r+   s   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.supersim.v1.command.CommandPage
        r3   )r   domaintwiliorequestr5   r   )r   
target_urlr8   r
   r
   r   get_page   s
   

zCommandList.get_pagec                 C      t | j|dS z
        Constructs a CommandContext

        :param sid: The SID that identifies the resource to fetch

        :returns: twilio.rest.supersim.v1.command.CommandContext
        :rtype: twilio.rest.supersim.v1.command.CommandContext
        sidCommandContextr   r   rA   r
   r
   r   get      	zCommandList.getc                 C   r>   r?   rB   rD   r
   r
   r   __call__   rF   zCommandList.__call__c                 C      dS )z
        Provide a friendly representation

        :returns: Machine friendly representation
        :rtype: str
        z <Twilio.Supersim.V1.CommandList>r
   r   r
   r
   r   __repr__      zCommandList.__repr__)__name__
__module____qualname____doc__r   r   unsetr   r,   r.   r+   r=   rE   rG   rK   __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 )r5   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.supersim.v1.command.CommandPage
        :rtype: twilio.rest.supersim.v1.command.CommandPage
        N)r   r5   r   r   )r   r   r8   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.supersim.v1.command.CommandInstance
        :rtype: twilio.rest.supersim.v1.command.CommandInstance
        )r    r   r   r%   r
   r
   r   get_instance   s   	zCommandPage.get_instancec                 C   rH   )rI   z <Twilio.Supersim.V1.CommandPage>r
   rJ   r
   r
   r   rK      rL   zCommandPage.__repr__)rM   rN   rO   rP   r   rV   rK   rR   r
   r
   r   r   r5      s
    r5   c                       rS   )rC   r	   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.supersim.v1.command.CommandContext
        :rtype: twilio.rest.supersim.v1.command.CommandContext
        rA   z/Commands/{sid}Nr
   )r   rC   r   r   r   r   )r   r   rA   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.supersim.v1.command.CommandInstance
        r3   )r   r   rA   r@   )r   fetchr   r    r   rU   r
   r
   r   rX      s   zCommandContext.fetchc                 C   $   d dd | j D }d|S )rI    c                 s        | ]\}}d  ||V  qdS z{}={}Nr   .0kvr
   r
   r   	<genexpr>      z*CommandContext.__repr__.<locals>.<genexpr>z&<Twilio.Supersim.V1.CommandContext {}>joinr   itemsr   r   contextr
   r
   r   rK   	     
zCommandContext.__repr__)rM   rN   rO   rP   r   rX   rK   rR   r
   r
   r   r   rC      s
    rC   c                       s   e Zd Zd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dd Zdd  Z  ZS )"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)rM   rN   rO   QUEUEDSENT	DELIVEREDRECEIVEDFAILEDr
   r
   r
   r   r/     s    r/   c                   @   s   e Zd ZdZdZdS )zCommandInstance.Directionto_simfrom_simN)rM   rN   rO   TO_SIMFROM_SIMr
   r
   r
   r   r0     s    r0   Nc                    s   t t| | |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.supersim.v1.command.CommandInstance
        :rtype: twilio.rest.supersim.v1.command.CommandInstance
        rA   account_sidsim_sidr"   r'   r(   date_createddate_updatedurl)	rA   rx   ry   r"   r'   r(   rz   r{   r|   N)	r   r    r   rE   r   iso8601_datetime_properties_contextr   )r   r   r%   rA   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.supersim.v1.command.CommandContext
        NrA   r@   )r   rC   r   r   rJ   r
   r
   r   _proxy=  s   
	zCommandInstance._proxyc                 C   
   | j d S )zb
        :returns: The unique string that identifies the resource
        :rtype: unicode
        rA   r~   rJ   r
   r
   r   rA   J     
zCommandInstance.sidc                 C   r   )zd
        :returns: The SID of the Account that created the resource
        :rtype: unicode
        rx   r   rJ   r
   r
   r   rx   R  r   zCommandInstance.account_sidc                 C   r   )zl
        :returns: The SID of the SIM that this Command was sent to or from
        :rtype: unicode
        ry   r   rJ   r
   r
   r   ry   Z  r   zCommandInstance.sim_sidc                 C   r   )zk
        :returns: The message body of the command sent to or from the SIM
        :rtype: unicode
        r"   r   rJ   r
   r
   r   r"   b  r   zCommandInstance.commandc                 C   r   )z\
        :returns: The status of the Command
        :rtype: CommandInstance.Status
        r'   r   rJ   r
   r
   r   r'   j  r   zCommandInstance.statusc                 C   r   )zb
        :returns: The direction of the Command
        :rtype: CommandInstance.Direction
        r(   r   rJ   r
   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
        rz   r   rJ   r
   r
   r   rz   z  r   zCommandInstance.date_createdc                 C   r   )zy
        :returns: The ISO 8601 date and time in GMT when the resource was last updated
        :rtype: datetime
        r{   r   rJ   r
   r
   r   r{     r   zCommandInstance.date_updatedc                 C   r   )z\
        :returns: The absolute URL of the Command resource
        :rtype: unicode
        r|   r   rJ   r
   r
   r   r|     r   zCommandInstance.urlc                 C   s
   | j  S )rW   )r   rX   rJ   r
   r
   r   rX     s   
zCommandInstance.fetchc                 C   rY   )rI   rZ   c                 s   r[   r\   r]   r^   r
   r
   r   rb     rc   z+CommandInstance.__repr__.<locals>.<genexpr>z'<Twilio.Supersim.V1.CommandInstance {}>rd   rg   r
   r
   r   rK     ri   zCommandInstance.__repr__)N)rM   rN   rO   rP   objectr/   r0   r   propertyr   rA   rx   ry   r"   r'   r(   rz   r{   r|   rX   rK   rR   r
   r
   r   r   r      s6    









	r    N)rP   twilio.baser   r   twilio.base.instance_contextr   twilio.base.instance_resourcer   twilio.base.list_resourcer   twilio.base.pager   r   r5   rC   r    r
   r
   r
   r   <module>   s    2(*