o
    /i(h                     @   s   d Z ddlmZ ddlmZmZmZmZmZmZm	Z	 ddl
mZ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 )a  
    This code was generated by
   ___ _ _ _ _ _    _ ____    ____ ____ _    ____ ____ _  _ ____ ____ ____ ___ __   __
    |  | | | | |    | |  | __ |  | |__| | __ | __ |___ |\ | |___ |__/ |__|  | |  | |__/
    |  |_|_| | |___ | |__|    |__| |  | |    |__] |___ | \| |___ |  \ |  |  | |__| |  \

    Twilio - Supersim
    This is the public Twilio REST API.

    NOTE: This class is auto generated by OpenAPI Generator.
    https://openapi-generator.tech
    Do not edit the class manually.
    )datetime)AnyDictListOptionalUnionIteratorAsyncIterator)deserializevalues)InstanceContext)InstanceResource)ListResource)Version)Pagec                       s   e Zd ZG dd deZG dd deZG dd deZ	 	dded	ee	e
f d
ee	 f fddZedddZdddZdddZde	fddZ  ZS )IpCommandInstancec                   @      e Zd ZdZdZdS )IpCommandInstance.Directionto_simfrom_simN)__name__
__module____qualname__TO_SIMFROM_SIM r   r   ]/var/www/html/philips/venv/lib/python3.10/site-packages/twilio/rest/supersim/v1/ip_command.py	Direction       r   c                   @   r   )IpCommandInstance.PayloadTypetextbinaryN)r   r   r   TEXTBINARYr   r   r   r   PayloadType   r   r$   c                   @   s   e Zd ZdZdZdZdZdS )IpCommandInstance.StatusqueuedsentreceivedfailedN)r   r   r   QUEUEDSENTRECEIVEDFAILEDr   r   r   r   Status#   s
    r.   Nversionpayloadsidc                    s   t  | |d| _|d| _|d| _|d| _|d| _|d| _|d| _	t
|d| _|d	| _|d
| _t
|d| _t
|d| _|d| _d|pb| ji| _d | _d S )Nr1   account_sidsim_sid	sim_iccidstatus	direction	device_ipdevice_portpayload_typer0   date_createddate_updatedurl)super__init__getr1   r2   r3   r4   r5   r6   r7   r
   integerr8   r9   r0   iso8601_datetimer:   r;   r<   	_solution_context)selfr/   r0   r1   	__class__r   r   r>   9   s6   

zIpCommandInstance.__init__returnIpCommandContextc                 C   s&   | j du rt| j| jd d| _ | j S )z
        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
        Nr1   r1   )rC   rH   _versionrB   rD   r   r   r   _proxy[   s   
zIpCommandInstance._proxyc                 C   s
   | j  S )_
        Fetch the IpCommandInstance


        :returns: The fetched IpCommandInstance
        )rL   fetchrK   r   r   r   rN   j   s   
zIpCommandInstance.fetchc                    s   | j  I dH S )y
        Asynchronous coroutine to fetch the IpCommandInstance


        :returns: The fetched IpCommandInstance
        N)rL   fetch_asyncrK   r   r   r   rP   s   s   zIpCommandInstance.fetch_asyncc                 C   $   d dd | j D }d|S )f
        Provide a friendly representation

        :returns: Machine friendly representation
         c                 s        | ]\}}d  ||V  qdS z{}={}Nformat.0kvr   r   r   	<genexpr>       z-IpCommandInstance.__repr__.<locals>.<genexpr>z)<Twilio.Supersim.V1.IpCommandInstance {}>joinrB   itemsrW   rD   contextr   r   r   __repr__|      
zIpCommandInstance.__repr__N)rG   rH   )rG   r   )r   r   r   objectr   r$   r.   r   r   strr   r   r>   propertyrL   rN   rP   rc   __classcell__r   r   rE   r   r      s$    
"

		r   c                       sP   e Zd Zdedef fddZdefddZdefdd	Zdefd
dZ	  Z
S )rH   r/   r1   c                    s.   t  | d|i| _djdi | j| _dS )z
        Initialize the IpCommandContext

        :param version: Version that contains the resource
        :param sid: The SID of the IP Command resource to fetch.
        r1   z/IpCommands/{sid}Nr   )r=   r>   rB   rW   _uri)rD   r/   r1   rE   r   r   r>      s   zIpCommandContext.__init__rG   c                 C   s(   | j jd| jd}t| j || jd dS )rM   GETmethodurir1   rI   )rJ   rN   rj   r   rB   rD   r0   r   r   r   rN      s   zIpCommandContext.fetchc                    s0   | j jd| jdI dH }t| j || jd dS )rO   rk   rl   Nr1   rI   )rJ   rP   rj   r   rB   ro   r   r   r   rP      s   zIpCommandContext.fetch_asyncc                 C   rQ   )rR   rS   c                 s   rT   rU   rV   rX   r   r   r   r\      r]   z,IpCommandContext.__repr__.<locals>.<genexpr>z(<Twilio.Supersim.V1.IpCommandContext {}>r^   ra   r   r   r   rc      rd   zIpCommandContext.__repr__)r   r   r   r   rg   r>   r   rN   rP   rc   ri   r   r   rE   r   rH      s
    rH   c                   @   s4   e Zd Zdeeef defddZdefddZdS )IpCommandPager0   rG   c                 C   s   t | j|S )zo
        Build an instance of IpCommandInstance

        :param payload: Payload response from the API
        )r   rJ   ro   r   r   r   get_instance   s   zIpCommandPage.get_instancec                 C      dS )rR   z"<Twilio.Supersim.V1.IpCommandPage>r   rK   r   r   r   rc         zIpCommandPage.__repr__N)	r   r   r   r   rg   r   r   rq   rc   r   r   r   r   rp      s    rp   c                       s  e Zd Zdef fddZejejejfdededede	de
f d	e	ee
f d
e	ee
f defddZejejejfdededede	de
f d	e	ee
f d
e	ee
f defddZejejejejddfde	ee
f de	ee
f de	de
f de	de
f dee dee dee fddZejejejejddfde	ee
f de	ee
f de	de
f de	de
f dee dee dee fddZejejejejddfde	ee
f de	ee
f de	de
f de	de
f dee dee dee fddZejejejejddfde	ee
f de	ee
f de	de
f de	de
f dee dee dee fddZejejejejejejejfde	ee
f de	ee
f de	de
f de	de
f d e	ee
f d!e	ee
f de	ee
f defd"d#Zejejejejejejejfde	ee
f de	ee
f de	de
f de	de
f d e	ee
f d!e	ee
f de	ee
f defd$d%Zd&edefd'd(Zd&edefd)d*Zd+edefd,d-Zd+edefd.d/Zdefd0d1Z  ZS )2IpCommandListr/   c                    s   t  | d| _dS )zk
        Initialize the IpCommandList

        :param version: Version that contains the resource

        z/IpCommandsN)r=   r>   rj   )rD   r/   rE   r   r   r>      s   
zIpCommandList.__init__simr0   r8   r9   r   callback_urlcallback_methodrG   c              	   C   s8   t ||||||d}| jjd| j|d}t| j|S )aR  
        Create the IpCommandInstance

        :param sim: The `sid` or `unique_name` of the [Super SIM](https://www.twilio.com/docs/iot/supersim/api/sim-resource) to send the IP Command to.
        :param payload: The data that will be sent to the device. The payload cannot exceed 1300 bytes. If the PayloadType is set to text, the payload is encoded in UTF-8. If PayloadType is set to binary, the payload is encoded in Base64.
        :param device_port: The device port to which the IP Command will be sent.
        :param payload_type:
        :param callback_url: The URL we should call using the `callback_method` after we have sent the IP Command.
        :param callback_method: The HTTP method we should use to call `callback_url`. Can be `GET` or `POST`, and the default is `POST`.

        :returns: The created IpCommandInstance
        SimPayload
DevicePortr$   CallbackUrlCallbackMethodPOSTrm   rn   data)r   ofrJ   createrj   r   rD   ru   r0   r8   r9   rv   rw   r   r   r   r   r      s   zIpCommandList.createc              	      s@   t ||||||d}| jjd| j|dI dH }t| j|S )aa  
        Asynchronously create the IpCommandInstance

        :param sim: The `sid` or `unique_name` of the [Super SIM](https://www.twilio.com/docs/iot/supersim/api/sim-resource) to send the IP Command to.
        :param payload: The data that will be sent to the device. The payload cannot exceed 1300 bytes. If the PayloadType is set to text, the payload is encoded in UTF-8. If PayloadType is set to binary, the payload is encoded in Base64.
        :param device_port: The device port to which the IP Command will be sent.
        :param payload_type:
        :param callback_url: The URL we should call using the `callback_method` after we have sent the IP Command.
        :param callback_method: The HTTP method we should use to call `callback_url`. Can be `GET` or `POST`, and the default is `POST`.

        :returns: The created IpCommandInstance
        rx   r~   r   N)r   r   rJ   create_asyncrj   r   r   r   r   r   r     s    zIpCommandList.create_asyncNr4   r5   r%   r6   r   limit	page_sizec           	      C   s8   | j ||}| j|||||d d}| j ||d S )aJ  
        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 str sim: The SID or unique name of the Sim resource that IP Command was sent to or from.
        :param str sim_iccid: The ICCID of the Sim resource that IP Command was sent to or from.
        :param &quot;IpCommandInstance.Status&quot; status: The status of the IP Command. Can be: `queued`, `sent`, `received` or `failed`. See the [IP Command Status Values](https://www.twilio.com/docs/iot/supersim/api/ipcommand-resource#status-values) for a description of each.
        :param &quot;IpCommandInstance.Direction&quot; direction: The direction of the IP Command. Can be `to_sim` or `from_sim`. The value of `to_sim` is synonymous with the term `mobile terminated`, and `from_sim` is synonymous with the term `mobile originated`.
        :param limit: Upper limit for the number of records to return. stream()
                      guarantees to never return more than limit.  Default is no limit
        :param 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
        r   ru   r4   r5   r6   r   r   )rJ   read_limitspagestream	rD   ru   r4   r5   r6   r   r   limitsr   r   r   r   r   4  s   zIpCommandList.streamc           	         s@   | j ||}| j|||||d dI dH }| j ||d S )aY  
        Asynchronously 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 str sim: The SID or unique name of the Sim resource that IP Command was sent to or from.
        :param str sim_iccid: The ICCID of the Sim resource that IP Command was sent to or from.
        :param &quot;IpCommandInstance.Status&quot; status: The status of the IP Command. Can be: `queued`, `sent`, `received` or `failed`. See the [IP Command Status Values](https://www.twilio.com/docs/iot/supersim/api/ipcommand-resource#status-values) for a description of each.
        :param &quot;IpCommandInstance.Direction&quot; direction: The direction of the IP Command. Can be `to_sim` or `from_sim`. The value of `to_sim` is synonymous with the term `mobile terminated`, and `from_sim` is synonymous with the term `mobile originated`.
        :param limit: Upper limit for the number of records to return. stream()
                      guarantees to never return more than limit.  Default is no limit
        :param 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
        r   r   Nr   )rJ   r   
page_asyncstream_asyncr   r   r   r   r   [  s   zIpCommandList.stream_asyncc              	   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 str sim: The SID or unique name of the Sim resource that IP Command was sent to or from.
        :param str sim_iccid: The ICCID of the Sim resource that IP Command was sent to or from.
        :param &quot;IpCommandInstance.Status&quot; status: The status of the IP Command. Can be: `queued`, `sent`, `received` or `failed`. See the [IP Command Status Values](https://www.twilio.com/docs/iot/supersim/api/ipcommand-resource#status-values) for a description of each.
        :param &quot;IpCommandInstance.Direction&quot; direction: The direction of the IP Command. Can be `to_sim` or `from_sim`. The value of `to_sim` is synonymous with the term `mobile terminated`, and `from_sim` is synonymous with the term `mobile originated`.
        :param limit: Upper limit for the number of records to return. list() guarantees
                      never to return more than limit.  Default is no limit
        :param 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: list that will contain up to limit results
        ru   r4   r5   r6   r   r   )listr   rD   ru   r4   r5   r6   r   r   r   r   r   r     s   zIpCommandList.listc              	      s.   dd | j ||||||dI dH 2 I dH S )a  
        Asynchronously 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 str sim: The SID or unique name of the Sim resource that IP Command was sent to or from.
        :param str sim_iccid: The ICCID of the Sim resource that IP Command was sent to or from.
        :param &quot;IpCommandInstance.Status&quot; status: The status of the IP Command. Can be: `queued`, `sent`, `received` or `failed`. See the [IP Command Status Values](https://www.twilio.com/docs/iot/supersim/api/ipcommand-resource#status-values) for a description of each.
        :param &quot;IpCommandInstance.Direction&quot; direction: The direction of the IP Command. Can be `to_sim` or `from_sim`. The value of `to_sim` is synonymous with the term `mobile terminated`, and `from_sim` is synonymous with the term `mobile originated`.
        :param limit: Upper limit for the number of records to return. list() guarantees
                      never to return more than limit.  Default is no limit
        :param 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: list that will contain up to limit results
        c                    s   g | z3 d H W }|q6 S re   r   )rY   recordr   r   r   
<listcomp>  s
    z,IpCommandList.list_async.<locals>.<listcomp>r   N)r   r   r   r   r   
list_async  s   
zIpCommandList.list_async
page_tokenpage_numberc           
   
   C   s:   t |||||||d}| jjd| j|d}	t| j|	S )a  
        Retrieve a single page of IpCommandInstance records from the API.
        Request is executed immediately

        :param sim: The SID or unique name of the Sim resource that IP Command was sent to or from.
        :param sim_iccid: The ICCID of the Sim resource that IP Command was sent to or from.
        :param status: The status of the IP Command. Can be: `queued`, `sent`, `received` or `failed`. See the [IP Command Status Values](https://www.twilio.com/docs/iot/supersim/api/ipcommand-resource#status-values) for a description of each.
        :param direction: The direction of the IP Command. Can be `to_sim` or `from_sim`. The value of `to_sim` is synonymous with the term `mobile terminated`, and `from_sim` is synonymous with the term `mobile originated`.
        :param page_token: PageToken provided by the API
        :param page_number: Page Number, this value is simply for client state
        :param page_size: Number of records to return, defaults to 50

        :returns: Page of IpCommandInstance
        ry   SimIccidr.   r   	PageTokenr   PageSizerk   rm   rn   params)r   r   rJ   r   rj   rp   
rD   ru   r4   r5   r6   r   r   r   r   responser   r   r   r     s   zIpCommandList.pagec           
   
      sB   t |||||||d}| jjd| j|dI dH }	t| j|	S )a  
        Asynchronously retrieve a single page of IpCommandInstance records from the API.
        Request is executed immediately

        :param sim: The SID or unique name of the Sim resource that IP Command was sent to or from.
        :param sim_iccid: The ICCID of the Sim resource that IP Command was sent to or from.
        :param status: The status of the IP Command. Can be: `queued`, `sent`, `received` or `failed`. See the [IP Command Status Values](https://www.twilio.com/docs/iot/supersim/api/ipcommand-resource#status-values) for a description of each.
        :param direction: The direction of the IP Command. Can be `to_sim` or `from_sim`. The value of `to_sim` is synonymous with the term `mobile terminated`, and `from_sim` is synonymous with the term `mobile originated`.
        :param page_token: PageToken provided by the API
        :param page_number: Page Number, this value is simply for client state
        :param page_size: Number of records to return, defaults to 50

        :returns: Page of IpCommandInstance
        r   rk   r   N)r   r   rJ   r   rj   rp   r   r   r   r   r     s   zIpCommandList.page_async
target_urlc                 C   s   | j jjd|}t| j |S )z
        Retrieve a specific page of IpCommandInstance records from the API.
        Request is executed immediately

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

        :returns: Page of IpCommandInstance
        rk   )rJ   domaintwiliorequestrp   rD   r   r   r   r   r   get_page  s   	zIpCommandList.get_pagec                    s&   | j jjd|I dH }t| j |S )a  
        Asynchronously retrieve a specific page of IpCommandInstance records from the API.
        Request is executed immediately

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

        :returns: Page of IpCommandInstance
        rk   N)rJ   r   r   request_asyncrp   r   r   r   r   get_page_async+  s   	zIpCommandList.get_page_asyncr1   c                 C      t | j|dS zq
        Constructs a IpCommandContext

        :param sid: The SID of the IP Command resource to fetch.
        rI   rH   rJ   rD   r1   r   r   r   r?   7     zIpCommandList.getc                 C   r   r   r   r   r   r   r   __call__?  r   zIpCommandList.__call__c                 C   rr   )rR   z"<Twilio.Supersim.V1.IpCommandList>r   rK   r   r   r   rc   G  rs   zIpCommandList.__repr__) r   r   r   r   r>   r   unsetrg   intr   rf   r   r   r   r   r   r   r	   r   r   r   r   rp   r   r   r   r   rH   r?   r   rc   ri   r   r   rE   r   rt      s^   



-



*




)




)




(




)






	
)






	
)rt   N)__doc__r   typingr   r   r   r   r   r   r	   twilio.baser
   r   twilio.base.instance_contextr   twilio.base.instance_resourcer   twilio.base.list_resourcer   twilio.base.versionr   twilio.base.pager   r   rH   rp   rt   r   r   r   r   <module>   s    $l@