o
    e9                     @   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 )SmsCommandListk 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 SmsCommandList

        :param Version version: Version that contains the resource

        :returns: twilio.rest.supersim.v1.sms_command.SmsCommandList
        :rtype: twilio.rest.supersim.v1.sms_command.SmsCommandList
        z/SmsCommandsN )superr   __init__	_solutionformat_uri)selfversion	__class__r
   V/var/www/html/venv/lib/python3.10/site-packages/twilio/rest/supersim/v1/sms_command.pyr      s   	zSmsCommandList.__init__c                 C   s4   t ||||d}| jjd| j|d}t| j|S )a  
        Create the SmsCommandInstance

        :param unicode sim: The sid or unique_name of the SIM to send the SMS Command to
        :param unicode payload: The message body of the SMS 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 SmsCommandInstance
        :rtype: twilio.rest.supersim.v1.sms_command.SmsCommandInstance
        )SimPayloadCallbackMethodCallbackUrlPOST)methoduridata)r   of_versioncreater   SmsCommandInstance)r   simpayloadcallback_methodcallback_urlr   r
   r
   r   r   $   s   zSmsCommandList.createNc                 C   s6   | j ||}| j||||d d}| j ||d S )a  
        Streams SmsCommandInstance 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 resource that SMS Command was sent to or from.
        :param SmsCommandInstance.Status status: The status of the SMS Command
        :param SmsCommandInstance.Direction direction: The direction of the SMS 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.sms_command.SmsCommandInstance]
        	page_size)r!   status	directionr%   limit)r   read_limitspagestream)r   r!   r&   r'   r(   r%   limitsr*   r
   r
   r   r+   <   s   zSmsCommandList.streamc                 C   s   t | j|||||dS )ay  
        Lists SmsCommandInstance 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 resource that SMS Command was sent to or from.
        :param SmsCommandInstance.Status status: The status of the SMS Command
        :param SmsCommandInstance.Direction direction: The direction of the SMS 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.sms_command.SmsCommandInstance]
        )r!   r&   r'   r(   r%   )listr+   )r   r!   r&   r'   r(   r%   r
   r
   r   r-   W   s   zSmsCommandList.listc           	   	   C   s<   t ||||||d}| jjd| j|d}t| j|| jS )a  
        Retrieve a single page of SmsCommandInstance records from the API.
        Request is executed immediately

        :param unicode sim: The SID or unique name of the Sim resource that SMS Command was sent to or from.
        :param SmsCommandInstance.Status status: The status of the SMS Command
        :param SmsCommandInstance.Direction direction: The direction of the SMS 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 SmsCommandInstance
        :rtype: twilio.rest.supersim.v1.sms_command.SmsCommandPage
        )r   Status	Direction	PageTokenr   PageSizeGET)r   r   params)r   r   r   r*   r   SmsCommandPager   )	r   r!   r&   r'   
page_tokenpage_numberr%   r   responser
   r
   r   r*   s   s   	zSmsCommandList.pagec                 C   s"   | j jjd|}t| j || jS )a@  
        Retrieve a specific page of SmsCommandInstance records from the API.
        Request is executed immediately

        :param str target_url: API-generated URL for the requested results page

        :returns: Page of SmsCommandInstance
        :rtype: twilio.rest.supersim.v1.sms_command.SmsCommandPage
        r2   )r   domaintwiliorequestr4   r   )r   
target_urlr7   r
   r
   r   get_page   s
   

zSmsCommandList.get_pagec                 C      t | j|dS a  
        Constructs a SmsCommandContext

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

        :returns: twilio.rest.supersim.v1.sms_command.SmsCommandContext
        :rtype: twilio.rest.supersim.v1.sms_command.SmsCommandContext
        sidSmsCommandContextr   r   r@   r
   r
   r   get      	zSmsCommandList.getc                 C   r=   r>   rA   rC   r
   r
   r   __call__   rE   zSmsCommandList.__call__c                 C      dS )z
        Provide a friendly representation

        :returns: Machine friendly representation
        :rtype: str
        z#<Twilio.Supersim.V1.SmsCommandList>r
   r   r
   r
   r   __repr__      zSmsCommandList.__repr__)__name__
__module____qualname____doc__r   r   unsetr   r+   r-   r*   r<   rD   rF   rJ   __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 )r4   r	   c                    s   t t| || || _dS )a4  
        Initialize the SmsCommandPage

        :param Version version: Version that contains the resource
        :param Response response: Response from the API

        :returns: twilio.rest.supersim.v1.sms_command.SmsCommandPage
        :rtype: twilio.rest.supersim.v1.sms_command.SmsCommandPage
        N)r   r4   r   r   )r   r   r7   solutionr   r
   r   r      s   

zSmsCommandPage.__init__c                 C   s   t | j|S )a  
        Build an instance of SmsCommandInstance

        :param dict payload: Payload response from the API

        :returns: twilio.rest.supersim.v1.sms_command.SmsCommandInstance
        :rtype: twilio.rest.supersim.v1.sms_command.SmsCommandInstance
        )r    r   r   r"   r
   r
   r   get_instance   s   	zSmsCommandPage.get_instancec                 C   rG   )rH   z#<Twilio.Supersim.V1.SmsCommandPage>r
   rI   r
   r
   r   rJ      rK   zSmsCommandPage.__repr__)rL   rM   rN   rO   r   rU   rJ   rQ   r
   r
   r   r   r4      s
    r4   c                       rR   )rB   r	   c                    s2   t t| | d|i| _djdi | j| _dS )aG  
        Initialize the SmsCommandContext

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

        :returns: twilio.rest.supersim.v1.sms_command.SmsCommandContext
        :rtype: twilio.rest.supersim.v1.sms_command.SmsCommandContext
        r@   z/SmsCommands/{sid}Nr
   )r   rB   r   r   r   r   )r   r   r@   r   r
   r   r      s   

zSmsCommandContext.__init__c                 C   s(   | j jd| jd}t| j || jd dS )
        Fetch the SmsCommandInstance

        :returns: The fetched SmsCommandInstance
        :rtype: twilio.rest.supersim.v1.sms_command.SmsCommandInstance
        r2   )r   r   r@   r?   )r   fetchr   r    r   rT   r
   r
   r   rW      s   zSmsCommandContext.fetchc                 C   $   d dd | j D }d|S )rH    c                 s        | ]\}}d  ||V  qdS z{}={}Nr   .0kvr
   r
   r   	<genexpr>      z-SmsCommandContext.__repr__.<locals>.<genexpr>z)<Twilio.Supersim.V1.SmsCommandContext {}>joinr   itemsr   r   contextr
   r
   r   rJ   	     
zSmsCommandContext.__repr__)rL   rM   rN   rO   r   rW   rJ   rQ   r
   r
   r   r   rB      s
    rB   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SmsCommandInstance.Statusqueuedsent	deliveredreceivedfailedN)rL   rM   rN   QUEUEDSENT	DELIVEREDRECEIVEDFAILEDr
   r
   r
   r   r.     s    r.   c                   @   s   e Zd ZdZdZdS )zSmsCommandInstance.Directionto_simfrom_simN)rL   rM   rN   TO_SIMFROM_SIMr
   r
   r
   r   r/     s    r/   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 SmsCommandInstance

        :returns: twilio.rest.supersim.v1.sms_command.SmsCommandInstance
        :rtype: twilio.rest.supersim.v1.sms_command.SmsCommandInstance
        r@   account_sidsim_sidr"   r&   r'   date_createddate_updatedurl)	r@   rw   rx   r"   r&   r'   ry   rz   r{   N)	r   r    r   rD   r   iso8601_datetime_properties_contextr   )r   r   r"   r@   r   r
   r   r   #  s   zSmsCommandInstance.__init__c                 C   s&   | j du rt| j| jd d| _ | j S )a6  
        Generate an instance context for the instance, the context is capable of
        performing various actions.  All instance actions are proxied to the context

        :returns: SmsCommandContext for this SmsCommandInstance
        :rtype: twilio.rest.supersim.v1.sms_command.SmsCommandContext
        Nr@   r?   )r~   rB   r   r   rI   r
   r
   r   _proxy=  s   
	zSmsCommandInstance._proxyc                 C   
   | j d S )zb
        :returns: The unique string that identifies the resource
        :rtype: unicode
        r@   r}   rI   r
   r
   r   r@   J     
zSmsCommandInstance.sidc                 C   r   )zd
        :returns: The SID of the Account that created the resource
        :rtype: unicode
        rw   r   rI   r
   r
   r   rw   R  r   zSmsCommandInstance.account_sidc                 C   r   )zp
        :returns: The SID of the SIM that this SMS Command was sent to or from
        :rtype: unicode
        rx   r   rI   r
   r
   r   rx   Z  r   zSmsCommandInstance.sim_sidc                 C   r   )zo
        :returns: The message body of the SMS Command sent to or from the SIM
        :rtype: unicode
        r"   r   rI   r
   r
   r   r"   b  r   zSmsCommandInstance.payloadc                 C   r   )zc
        :returns: The status of the SMS Command
        :rtype: SmsCommandInstance.Status
        r&   r   rI   r
   r
   r   r&   j  r   zSmsCommandInstance.statusc                 C   r   )zi
        :returns: The direction of the SMS Command
        :rtype: SmsCommandInstance.Direction
        r'   r   rI   r
   r
   r   r'   r  r   zSmsCommandInstance.directionc                 C   r   )zt
        :returns: The ISO 8601 date and time in GMT when the resource was created
        :rtype: datetime
        ry   r   rI   r
   r
   r   ry   z  r   zSmsCommandInstance.date_createdc                 C   r   )zy
        :returns: The ISO 8601 date and time in GMT when the resource was last updated
        :rtype: datetime
        rz   r   rI   r
   r
   r   rz     r   zSmsCommandInstance.date_updatedc                 C   r   )z`
        :returns: The absolute URL of the SMS Command resource
        :rtype: unicode
        r{   r   rI   r
   r
   r   r{     r   zSmsCommandInstance.urlc                 C   s
   | j  S )rV   )r   rW   rI   r
   r
   r   rW     s   
zSmsCommandInstance.fetchc                 C   rX   )rH   rY   c                 s   rZ   r[   r\   r]   r
   r
   r   ra     rb   z.SmsCommandInstance.__repr__.<locals>.<genexpr>z*<Twilio.Supersim.V1.SmsCommandInstance {}>rc   rf   r
   r
   r   rJ     rh   zSmsCommandInstance.__repr__)N)rL   rM   rN   rO   objectr.   r/   r   propertyr   r@   rw   rx   r"   r&   r'   ry   rz   r{   rW   rJ   rQ   r
   r
   r   r   r      s6    









	r    N)rO   twilio.baser   r   twilio.base.instance_contextr   twilio.base.instance_resourcer   twilio.base.list_resourcer   twilio.base.pager   r   r4   rB   r    r
   r
   r
   r   <module>   s    2(*