o
    erA                     @   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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dd Zdd Zdd Z  ZS )IpCommandListk 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 IpCommandList

        :param Version version: Version that contains the resource

        :returns: twilio.rest.supersim.v1.ip_command.IpCommandList
        :rtype: twilio.rest.supersim.v1.ip_command.IpCommandList
        z/IpCommandsN )superr   __init__	_solutionformat_uri)selfversion	__class__r
   U/var/www/html/venv/lib/python3.10/site-packages/twilio/rest/supersim/v1/ip_command.pyr      s   	zIpCommandList.__init__c              	   C   s8   t ||||||d}| jjd| j|d}t| j|S )a  
        Create the IpCommandInstance

        :param unicode sim: The sid or unique_name of the Super SIM to send the IP Command to
        :param unicode payload: The payload to be delivered to the device
        :param unicode device_port: The device port to which the IP Command will be sent
        :param IpCommandInstance.PayloadType payload_type: Indicates how the payload is encoded
        :param unicode callback_url: The URL we should call after we have sent the IP Command
        :param unicode callback_method: The HTTP method we should use to call callback_url

        :returns: The created IpCommandInstance
        :rtype: twilio.rest.supersim.v1.ip_command.IpCommandInstance
        )SimPayload
DevicePortPayloadTypeCallbackUrlCallbackMethodPOST)methoduridata)r   of_versioncreater   IpCommandInstance)r   simpayloaddevice_portpayload_typecallback_urlcallback_methodr   r
   r
   r   r!   $   s   	zIpCommandList.createNc           	      C   s8   | j ||}| j|||||d d}| j ||d S )a6  
        Streams IpCommandInstance 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 IP Command was sent to or from.
        :param unicode sim_iccid: The ICCID of the Sim resource that IP Command was sent to or from.
        :param IpCommandInstance.Status status: The status of the IP Command
        :param IpCommandInstance.Direction direction: The direction of the IP 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.ip_command.IpCommandInstance]
        	page_size)r#   	sim_iccidstatus	directionr)   limit)r    read_limitspagestream)	r   r#   r*   r+   r,   r-   r)   limitsr/   r
   r
   r   r0   @   s   zIpCommandList.streamc              	   C   s   t | j||||||dS )a  
        Lists IpCommandInstance 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 IP Command was sent to or from.
        :param unicode sim_iccid: The ICCID of the Sim resource that IP Command was sent to or from.
        :param IpCommandInstance.Status status: The status of the IP Command
        :param IpCommandInstance.Direction direction: The direction of the IP 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.ip_command.IpCommandInstance]
        )r#   r*   r+   r,   r-   r)   )listr0   )r   r#   r*   r+   r,   r-   r)   r
   r
   r   r2   b   s   zIpCommandList.listc           
   
   C   s>   t |||||||d}| jjd| j|d}	t| j|	| jS )a8  
        Retrieve a single page of IpCommandInstance records from the API.
        Request is executed immediately

        :param unicode sim: The SID or unique name of the Sim resource that IP Command was sent to or from.
        :param unicode sim_iccid: The ICCID of the Sim resource that IP Command was sent to or from.
        :param IpCommandInstance.Status status: The status of the IP Command
        :param IpCommandInstance.Direction direction: The direction of the IP 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 IpCommandInstance
        :rtype: twilio.rest.supersim.v1.ip_command.IpCommandPage
        )r   SimIccidStatus	Direction	PageTokenr   PageSizeGET)r   r   params)r   r   r    r/   r   IpCommandPager   )
r   r#   r*   r+   r,   
page_tokenpage_numberr)   r   responser
   r
   r   r/      s   
zIpCommandList.pagec                 C   s"   | j jjd|}t| j || jS )a<  
        Retrieve a specific page of IpCommandInstance records from the API.
        Request is executed immediately

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

        :returns: Page of IpCommandInstance
        :rtype: twilio.rest.supersim.v1.ip_command.IpCommandPage
        r8   )r    domaintwiliorequestr:   r   )r   
target_urlr=   r
   r
   r   get_page   s
   

zIpCommandList.get_pagec                 C      t | j|dS z
        Constructs a IpCommandContext

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

        :returns: twilio.rest.supersim.v1.ip_command.IpCommandContext
        :rtype: twilio.rest.supersim.v1.ip_command.IpCommandContext
        sidIpCommandContextr    r   rF   r
   r
   r   get      	zIpCommandList.getc                 C   rC   rD   rG   rI   r
   r
   r   __call__   rK   zIpCommandList.__call__c                 C      dS )z
        Provide a friendly representation

        :returns: Machine friendly representation
        :rtype: str
        z"<Twilio.Supersim.V1.IpCommandList>r
   r   r
   r
   r   __repr__      zIpCommandList.__repr__)__name__
__module____qualname____doc__r   r   unsetr!   r0   r2   r/   rB   rJ   rL   rP   __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 IpCommandPage

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

        :returns: twilio.rest.supersim.v1.ip_command.IpCommandPage
        :rtype: twilio.rest.supersim.v1.ip_command.IpCommandPage
        N)r   r:   r   r   )r   r   r=   solutionr   r
   r   r      s   

zIpCommandPage.__init__c                 C   s   t | j|S )a  
        Build an instance of IpCommandInstance

        :param dict payload: Payload response from the API

        :returns: twilio.rest.supersim.v1.ip_command.IpCommandInstance
        :rtype: twilio.rest.supersim.v1.ip_command.IpCommandInstance
        )r"   r    r   r$   r
   r
   r   get_instance   s   	zIpCommandPage.get_instancec                 C   rM   )rN   z"<Twilio.Supersim.V1.IpCommandPage>r
   rO   r
   r
   r   rP      rQ   zIpCommandPage.__repr__)rR   rS   rT   rU   r   r[   rP   rW   r
   r
   r   r   r:      s
    r:   c                       rX   )rH   r	   c                    s2   t t| | d|i| _djdi | j| _dS )aB  
        Initialize the IpCommandContext

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

        :returns: twilio.rest.supersim.v1.ip_command.IpCommandContext
        :rtype: twilio.rest.supersim.v1.ip_command.IpCommandContext
        rF   z/IpCommands/{sid}Nr
   )r   rH   r   r   r   r   )r   r   rF   r   r
   r   r      s   

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

        :returns: The fetched IpCommandInstance
        :rtype: twilio.rest.supersim.v1.ip_command.IpCommandInstance
        r8   )r   r   rF   rE   )r    fetchr   r"   r   rZ   r
   r
   r   r]     s   zIpCommandContext.fetchc                 C   $   d dd | j D }d|S )rN    c                 s        | ]\}}d  ||V  qdS z{}={}Nr   .0kvr
   r
   r   	<genexpr>      z,IpCommandContext.__repr__.<locals>.<genexpr>z(<Twilio.Supersim.V1.IpCommandContext {}>joinr   itemsr   r   contextr
   r
   r   rP        
zIpCommandContext.__repr__)rR   rS   rT   rU   r   r]   rP   rW   r
   r
   r   r   rH      s
    rH   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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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S )zIpCommandInstance.StatusqueuedsentreceivedfailedN)rR   rS   rT   QUEUEDSENTRECEIVEDFAILEDr
   r
   r
   r   r4   '  s
    r4   c                   @      e Zd ZdZdZdS )zIpCommandInstance.Directionto_simfrom_simN)rR   rS   rT   TO_SIMFROM_SIMr
   r
   r
   r   r5   -      r5   c                   @   rw   )zIpCommandInstance.PayloadTypetextbinaryN)rR   rS   rT   TEXTBINARYr
   r
   r
   r   r   1  r|   r   Nc                    s   t t| | |d|d|d|d|d|d|dt|d|d	|d
t|dt|d|dd| _d| _d|pS| jd i| _	dS )z
        Initialize the IpCommandInstance

        :returns: twilio.rest.supersim.v1.ip_command.IpCommandInstance
        :rtype: twilio.rest.supersim.v1.ip_command.IpCommandInstance
        rF   account_sidsim_sidr*   r+   r,   	device_ipr%   r&   r$   date_createddate_updatedurl)rF   r   r   r*   r+   r,   r   r%   r&   r$   r   r   r   N)
r   r"   r   rJ   r   integeriso8601_datetime_properties_contextr   )r   r   r$   rF   r   r
   r   r   5  s"   zIpCommandInstance.__init__c                 C   s&   | j du rt| j| jd d| _ | j S )a2  
        Generate an instance context for the instance, the context is capable of
        performing various actions.  All instance actions are proxied to the context

        :returns: IpCommandContext for this IpCommandInstance
        :rtype: twilio.rest.supersim.v1.ip_command.IpCommandContext
        NrF   rE   )r   rH   r    r   rO   r
   r
   r   _proxyS  s   
	zIpCommandInstance._proxyc                 C   
   | j d S )zb
        :returns: The unique string that identifies the resource
        :rtype: unicode
        rF   r   rO   r
   r
   r   rF   `     
zIpCommandInstance.sidc                 C   r   )zd
        :returns: The SID of the Account that created the resource
        :rtype: unicode
        r   r   rO   r
   r
   r   r   h  r   zIpCommandInstance.account_sidc                 C   r   )zu
        :returns: The SID of the Super SIM that this IP Command was sent to or from
        :rtype: unicode
        r   r   rO   r
   r
   r   r   p  r   zIpCommandInstance.sim_sidc                 C   r   )zw
        :returns: The ICCID of the Super SIM that this IP Command was sent to or from
        :rtype: unicode
        r*   r   rO   r
   r
   r   r*   x  r   zIpCommandInstance.sim_iccidc                 C   r   )za
        :returns: The status of the IP Command
        :rtype: IpCommandInstance.Status
        r+   r   rO   r
   r
   r   r+     r   zIpCommandInstance.statusc                 C   r   )zg
        :returns: The direction of the IP Command
        :rtype: IpCommandInstance.Direction
        r,   r   rO   r
   r
   r   r,     r   zIpCommandInstance.directionc                 C   r   )z
        :returns: The IP address of the device that the IP Command was sent to or received from
        :rtype: unicode
        r   r   rO   r
   r
   r   r     r   zIpCommandInstance.device_ipc                 C   r   )zv
        :returns: The port that the IP Command either originated from or was sent to
        :rtype: unicode
        r%   r   rO   r
   r
   r   r%     r   zIpCommandInstance.device_portc                 C   r   )zl
        :returns: The payload type of the IP Command
        :rtype: IpCommandInstance.PayloadType
        r&   r   rO   r
   r
   r   r&     r   zIpCommandInstance.payload_typec                 C   r   )zo
        :returns: The payload of the IP Command sent to or from the Super SIM
        :rtype: unicode
        r$   r   rO   r
   r
   r   r$     r   zIpCommandInstance.payloadc                 C   r   )zt
        :returns: The ISO 8601 date and time in GMT when the resource was created
        :rtype: datetime
        r   r   rO   r
   r
   r   r     r   zIpCommandInstance.date_createdc                 C   r   )zy
        :returns: The ISO 8601 date and time in GMT when the resource was last updated
        :rtype: datetime
        r   r   rO   r
   r
   r   r     r   zIpCommandInstance.date_updatedc                 C   r   )z_
        :returns: The absolute URL of the IP Command resource
        :rtype: unicode
        r   r   rO   r
   r
   r   r     r   zIpCommandInstance.urlc                 C   s
   | j  S )r\   )r   r]   rO   r
   r
   r   r]     s   
zIpCommandInstance.fetchc                 C   r^   )rN   r_   c                 s   r`   ra   rb   rc   r
   r
   r   rg     rh   z-IpCommandInstance.__repr__.<locals>.<genexpr>z)<Twilio.Supersim.V1.IpCommandInstance {}>ri   rl   r
   r
   r   rP     rn   zIpCommandInstance.__repr__)N)rR   rS   rT   rU   objectr4   r5   r   r   propertyr   rF   r   r   r*   r+   r,   r   r%   r&   r$   r   r   r   r]   rP   rW   r
   r
   r   r   r"   #  sH    













	r"   N)rU   twilio.baser   r   twilio.base.instance_contextr   twilio.base.instance_resourcer   twilio.base.list_resourcer   twilio.base.pager   r   r:   rH   r"   r
   r
   r
   r   <module>   s    A(*