a
    !f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eee	e
f ee	 d fd	d
ZeddddZd dddZd dddZe	dddZ  ZS )IpCommandInstancec                   @   s   e Zd ZdZdZdS )IpCommandInstance.DirectionZto_simZfrom_simN)__name__
__module____qualname__ZTO_SIMZFROM_SIM r   r   c/var/www/html/python-backend/venv/lib/python3.9/site-packages/twilio/rest/supersim/v1/ip_command.py	Direction   s   r   c                   @   s   e Zd ZdZdZdS )IpCommandInstance.PayloadTypetextbinaryN)r   r   r   ZTEXTBINARYr   r   r   r   PayloadType   s   r   c                   @   s   e Zd ZdZdZdZdZdS )IpCommandInstance.StatusZqueuedsentZreceivedfailedN)r   r   r   ZQUEUEDZSENTZRECEIVEDZ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|p| ji| _d | _d S )Nr$   account_sidsim_sid	sim_iccidstatus	direction	device_ipdevice_portpayload_typer#   date_createddate_updatedurl)super__init__getr$   r%   r&   r'   r(   r)   r*   r
   integerr+   r,   r#   iso8601_datetimer-   r.   r/   	_solution_context)selfr"   r#   r$   	__class__r   r   r1   9   s6    
zIpCommandInstance.__init__IpCommandContextreturnc                 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
        Nr$   r$   )r6   r:   _versionr5   r7   r   r   r   _proxy[   s    
zIpCommandInstance._proxyc                 C   s
   | j  S )_
        Fetch the IpCommandInstance


        :returns: The fetched IpCommandInstance
        )r@   fetchr?   r   r   r   rB   j   s    zIpCommandInstance.fetchc                    s   | j  I dH S )y
        Asynchronous coroutine to fetch the IpCommandInstance


        :returns: The fetched IpCommandInstance
        N)r@   fetch_asyncr?   r   r   r   rD   s   s    zIpCommandInstance.fetch_asyncc                 C   s$   d dd | j D }d|S )f
        Provide a friendly representation

        :returns: Machine friendly representation
         c                 s   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 {}>joinr5   itemsrI   r7   contextr   r   r   __repr__|   s    zIpCommandInstance.__repr__)N)r   r   r   objectr   r   r!   r   r   strr   r   r1   propertyr@   rB   rD   rU   __classcell__r   r   r8   r   r      s    "		r   c                       sN   e Zd Zeed fddZedddZedddZedd	d
Z	  Z
S )r:   )r"   r$   c                    s.   t  | d|i| _djf 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.
        r$   z/IpCommands/{sid}N)r0   r1   r5   rI   _uri)r7   r"   r$   r8   r   r   r1      s    zIpCommandContext.__init__r;   c                 C   s(   | j jd| jd}t| j || jd dS )rA   GETmethodurir$   r=   )r>   rB   rZ   r   r5   r7   r#   r   r   r   rB      s    zIpCommandContext.fetchc                    s.   | j jd| jdI dH }t| j || jd dS )rC   r[   r\   Nr$   r=   )r>   rD   rZ   r   r5   r_   r   r   r   rD      s    zIpCommandContext.fetch_asyncc                 C   s$   d dd | j D }d|S )rE   rF   c                 s   s   | ]\}}d  ||V  qdS rG   rH   rJ   r   r   r   rN      rO   z,IpCommandContext.__repr__.<locals>.<genexpr>z(<Twilio.Supersim.V1.IpCommandContext {}>rP   rS   r   r   r   rU      s    zIpCommandContext.__repr__)r   r   r   r   rW   r1   r   rB   rD   rU   rY   r   r   r8   r   r:      s   r:   c                   @   s2   e Zd Zeeef edddZedddZdS )IpCommandPage)r#   r<   c                 C   s   t | j|S )zo
        Build an instance of IpCommandInstance

        :param payload: Payload response from the API
        )r   r>   r_   r   r   r   get_instance   s    zIpCommandPage.get_instancer;   c                 C   s   dS )rE   z"<Twilio.Supersim.V1.IpCommandPage>r   r?   r   r   r   rU      s    zIpCommandPage.__repr__N)	r   r   r   r   rW   r   r   ra   rU   r   r   r   r   r`      s   r`   c                
       sD  e Zd Zed fddZejejejfeeee	de
f e	ee
f e	ee
f edddZejejejfeeee	de
f e	ee
f e	ee
f eddd	Zejejejejd
d
fe	ee
f e	ee
f e	de
f e	de
f ee ee ee dddZejejejejd
d
fe	ee
f e	ee
f e	de
f e	de
f ee ee ee dddZejejejejd
d
fe	ee
f e	ee
f e	de
f e	de
f ee ee ee dddZejejejejd
d
fe	ee
f e	ee
f e	de
f e	de
f ee ee ee dddZejejejejejejejfe	ee
f e	ee
f e	de
f e	de
f e	ee
f e	ee
f e	ee
f edddZejejejejejejejfe	ee
f e	ee
f e	de
f e	de
f e	ee
f e	ee
f e	ee
f edddZeedddZeedddZeed d!d"Zeed d#d$Zed%d&d'Z  ZS )(IpCommandList)r"   c                    s   t  | d| _dS )zk
        Initialize the IpCommandList

        :param version: Version that contains the resource

        z/IpCommandsN)r0   r1   rZ   )r7   r"   r8   r   r   r1      s    zIpCommandList.__init__r   )simr#   r+   r,   callback_urlcallback_methodr<   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
        SimZPayloadZ
DevicePortr   ZCallbackUrlZCallbackMethodPOSTr]   r^   data)r   ofr>   createrZ   r   r7   rc   r#   r+   r,   rd   re   rj   r   r   r   rl      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
        rf   rh   ri   N)r   rk   r>   create_asyncrZ   r   rm   r   r   r   rn     s    zIpCommandList.create_asyncNr   r   )rc   r'   r(   r)   limit	page_sizer<   c           	      C   s8   | j ||}| j|||||d d}| j ||d S )aF  
        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/wireless/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
        rp   rc   r'   r(   r)   rp   ro   )r>   read_limitspagestream	r7   rc   r'   r(   r)   ro   rp   Zlimitsrs   r   r   r   rt   4  s    zIpCommandList.streamc           	         s>   | j ||}| j|||||d dI dH }| j ||d S )aU  
        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/wireless/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
        rp   rq   Nro   )r>   rr   
page_asyncstream_asyncru   r   r   r   rw   [  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/wireless/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
        rc   r'   r(   r)   ro   rp   )listrt   r7   rc   r'   r(   r)   ro   rp   r   r   r   ry     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/wireless/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 )Nr   )rK   recordr   r   r   
<listcomp>  s   z,IpCommandList.list_async.<locals>.<listcomp>rx   N)rw   rz   r   r   r   
list_async  s    
zIpCommandList.list_async)rc   r'   r(   r)   
page_tokenpage_numberrp   r<   c           
   
   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/wireless/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
        rg   ZSimIccidr!   r   Z	PageTokenr   ZPageSizer[   r]   r^   params)r   rk   r>   rs   rZ   r`   
r7   rc   r'   r(   r)   r~   r   rp   rj   responser   r   r   rs     s    zIpCommandList.pagec           
   
      s@   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/wireless/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   r[   r   N)r   rk   r>   rv   rZ   r`   r   r   r   r   rv     s    zIpCommandList.page_async)
target_urlr<   c                 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
        r[   )r>   domaintwiliorequestr`   r7   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
        r[   N)r>   r   r   Zrequest_asyncr`   r   r   r   r   get_page_async+  s    	zIpCommandList.get_page_async)r$   r<   c                 C   s   t | j|dS zq
        Constructs a IpCommandContext

        :param sid: The SID of the IP Command resource to fetch.
        r=   r:   r>   r7   r$   r   r   r   r2   7  s    zIpCommandList.getc                 C   s   t | j|dS r   r   r   r   r   r   __call__?  s    zIpCommandList.__call__r;   c                 C   s   dS )rE   z"<Twilio.Supersim.V1.IpCommandList>r   r?   r   r   r   rU   G  s    zIpCommandList.__repr__) r   r   r   r   r1   r   unsetrW   intr   rV   r   rl   rn   r   r   rt   r	   rw   r   ry   r}   r`   rs   rv   r   r   r:   r2   r   rU   rY   r   r   r8   r   rb      s   


-


*



)



)



(



)






)






)rb   N)__doc__r   typingr   r   r   r   r   r   r	   Ztwilio.baser
   r   Ztwilio.base.instance_contextr   Ztwilio.base.instance_resourcer   Ztwilio.base.list_resourcer   Ztwilio.base.versionr   Ztwilio.base.pager   r   r:   r`   rb   r   r   r   r   <module>   s   $l@