U
    ^g%ik                     @   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   a/var/www/html/api-medvista/venv/lib/python3.8/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TEXTZ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"   Ziso8601_datetimer,   r-   r.   	_solution_context)selfr!   r"   r#   	__class__r   r   r0   9   s8     zIpCommandInstance.__init__IpCommandContextreturnc                 C   s&   | j dk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#   )r4   r8   _versionr3   r5   r   r   r   _proxy[   s    
zIpCommandInstance._proxyc                 C   s
   | j  S )_
        Fetch the IpCommandInstance


        :returns: The fetched IpCommandInstance
        )r>   fetchr=   r   r   r   r@   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   rB   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>   s     z-IpCommandInstance.__repr__.<locals>.<genexpr>z)<Twilio.Supersim.V1.IpCommandInstance {}>joinr3   itemsrG   r5   contextr   r   r   __repr__|   s    zIpCommandInstance.__repr__)N)r   r   r   objectr   r   r    r   r   strr   r   r0   propertyr>   r@   rB   rR   __classcell__r   r   r6   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 )r8   )r!   r#   c                    s*   t  | d|i| _djf | 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)r/   r0   r3   rG   _uri)r5   r!   r#   r6   r   r   r0      s
     zIpCommandContext.__init__r9   c                 C   s<   t i }d|d< | jjd| j|d}t| j|| jd dS )r?   application/jsonAcceptGETmethoduriheadersr#   r;   )r   ofr<   r@   rW   r   r3   r5   r^   r"   r   r   r   r@      s    
zIpCommandContext.fetchc                    sB   t i }d|d< | jjd| j|dI dH }t| j|| jd dS )rA   rX   rY   rZ   r[   Nr#   r;   )r   r_   r<   rB   rW   r   r3   r`   r   r   r   rB      s    
  zIpCommandContext.fetch_asyncc                 C   s$   d dd | j D }d|S )rC   rD   c                 s   s   | ]\}}d  ||V  qdS rE   rF   rH   r   r   r   rL      s     z,IpCommandContext.__repr__.<locals>.<genexpr>z(<Twilio.Supersim.V1.IpCommandContext {}>rM   rP   r   r   r   rR      s    zIpCommandContext.__repr__)r   r   r   r   rT   r0   r   r@   rB   rR   rV   r   r   r6   r   r8      s   r8   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<   )r5   r"   r   r   r   get_instance   s    zIpCommandPage.get_instancer9   c                 C   s   dS )rC   z"<Twilio.Supersim.V1.IpCommandPage>r   r=   r   r   r   rR      s    zIpCommandPage.__repr__N)	r   r   r   r   rT   r   r   rb   rR   r   r   r   r   ra      s   ra   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)r/   r0   rW   )r5   r!   r6   r   r   r0      s    zIpCommandList.__init__r   )simr"   r*   r+   callback_urlcallback_methodr:   c           	   	   C   sX   t ||||||d}t ddi}d|d< d|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Content-Type!application/x-www-form-urlencodedrX   rY   POSTr\   r]   datar^   )r   r_   r<   createrW   r   	r5   rd   r"   r*   r+   re   rf   rm   r^   r   r   r   rn      s&    
   zIpCommandList.createc           	   	      s^   t ||||||d}t ddi}d|d< d|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
        rg   ri   rj   rX   rY   rk   rl   N)r   r_   r<   create_asyncrW   r   ro   r   r   r   rp     s&    
   zIpCommandList.create_asyncNr   r   )rd   r&   r'   r(   limit	page_sizer:   c           	      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
        rr   rd   r&   r'   r(   rr   rq   )r<   read_limitspagestream	r5   rd   r&   r'   r(   rq   rr   Zlimitsru   r   r   r   rv   C  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
        rr   rs   Nrq   )r<   rt   
page_asyncstream_asyncrw   r   r   r   ry   j  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
        rd   r&   r'   r(   rq   rr   )listrv   r5   rd   r&   r'   r(   rq   rr   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 )Nr   )rI   recordr   r   r   
<listcomp>  s   z,IpCommandList.list_async.<locals>.<listcomp>rz   N)ry   r|   r   r   r   
list_async  s    
zIpCommandList.list_async)rd   r&   r'   r(   
page_tokenpage_numberrr   r:   c              
   C   sR   t |||||||d}t ddi}	d|	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
        rh   ZSimIccidr    r   Z	PageTokenr   ZPageSizeri   rj   rX   rY   rZ   r\   r]   paramsr^   )r   r_   r<   ru   rW   ra   r5   rd   r&   r'   r(   r   r   rr   rm   r^   responser   r   r   ru     s&       zIpCommandList.pagec              
      sX   t |||||||d}t ddi}	d|	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   ri   rj   rX   rY   rZ   r   N)r   r_   r<   rx   rW   ra   r   r   r   r   rx     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
        rZ   )r<   domaintwiliorequestra   r5   r   r   r   r   r   get_page8  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
        rZ   N)r<   r   r   Zrequest_asyncra   r   r   r   r   get_page_asyncD  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;   r8   r<   r5   r#   r   r   r   r1   P  s    zIpCommandList.getc                 C   s   t | j|dS r   r   r   r   r   r   __call__X  s    zIpCommandList.__call__r9   c                 C   s   dS )rC   z"<Twilio.Supersim.V1.IpCommandList>r   r=   r   r   r   rR   `  s    zIpCommandList.__repr__) r   r   r   r   r0   r   unsetrT   intr   rS   r   rn   rp   r   r   rv   r	   ry   r   r{   r   ra   ru   rx   r   r   r8   r1   r   rR   rV   r   r   r6   r   rc      s   


1


.



)



)



(



)






/






-rc   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   r8   ra   rc   r   r   r   r   <module>   s   $mE