U
    ^g%i6]                     @   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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 )SmsCommandInstancec                   @   s   e Zd ZdZdZdS )SmsCommandInstance.DirectionZto_simZfrom_simN)__name__
__module____qualname__ZTO_SIMZFROM_SIM r   r   b/var/www/html/api-medvista/venv/lib/python3.8/site-packages/twilio/rest/supersim/v1/sms_command.py	Direction   s   r   c                   @   s    e Zd ZdZdZdZdZdZdS )SmsCommandInstance.StatusZqueuedsentZ	deliveredZreceivedfailedN)r   r   r   ZQUEUEDZSENTZ	DELIVEREDZRECEIVEDZFAILEDr   r   r   r   Status   s
   r   N)versionpayloadsidc                    s   t  | |d| _|d| _|d| _|d| _|d| _|d| _t	
|d| _t	
|d| _|d	| _d|p| ji| _d | _d S )
Nr   account_sidsim_sidr   status	directiondate_createddate_updatedurl)super__init__getr   r    r!   r   r"   r#   r
   Ziso8601_datetimer$   r%   r&   	_solution_context)selfr   r   r   	__class__r   r   r(   2   s(     zSmsCommandInstance.__init__SmsCommandContext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: SmsCommandContext for this SmsCommandInstance
        Nr   r   )r+   r/   _versionr*   r,   r   r   r   _proxyL   s    
zSmsCommandInstance._proxyc                 C   s
   | j  S )a
        Fetch the SmsCommandInstance


        :returns: The fetched SmsCommandInstance
        )r5   fetchr4   r   r   r   r7   [   s    zSmsCommandInstance.fetchc                    s   | j  I dH S ){
        Asynchronous coroutine to fetch the SmsCommandInstance


        :returns: The fetched SmsCommandInstance
        N)r5   fetch_asyncr4   r   r   r   r9   d   s    zSmsCommandInstance.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   s     z.SmsCommandInstance.__repr__.<locals>.<genexpr>z*<Twilio.Supersim.V1.SmsCommandInstance {}>joinr*   itemsr>   r,   contextr   r   r   __repr__m   s    zSmsCommandInstance.__repr__)N)r   r   r   objectr   r   r   r   strr   r   r(   propertyr5   r7   r9   rI   __classcell__r   r   r-   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 | j| _dS )z
        Initialize the SmsCommandContext

        :param version: Version that contains the resource
        :param sid: The SID of the SMS Command resource to fetch.
        r   z/SmsCommands/{sid}N)r'   r(   r*   r>   _uri)r,   r   r   r-   r   r   r(   y   s
     zSmsCommandContext.__init__r0   c                 C   s<   t i }d|d< | jjd| j|d}t| j|| jd dS )r6   application/jsonAcceptGETmethoduriheadersr   r2   )r   ofr3   r7   rN   r   r*   r,   rU   r   r   r   r   r7      s    
zSmsCommandContext.fetchc                    sB   t i }d|d< | jjd| j|dI dH }t| j|| jd dS )r8   rO   rP   rQ   rR   Nr   r2   )r   rV   r3   r9   rN   r   r*   rW   r   r   r   r9      s    
  zSmsCommandContext.fetch_asyncc                 C   s$   d dd | j D }d|S )r:   r;   c                 s   s   | ]\}}d  ||V  qdS r<   r=   r?   r   r   r   rC      s     z-SmsCommandContext.__repr__.<locals>.<genexpr>z)<Twilio.Supersim.V1.SmsCommandContext {}>rD   rG   r   r   r   rI      s    zSmsCommandContext.__repr__)r   r   r   r   rK   r(   r   r7   r9   rI   rM   r   r   r-   r   r/   w   s   r/   c                   @   s2   e Zd Zeeef edddZedddZdS )SmsCommandPage)r   r1   c                 C   s   t | j|S )zp
        Build an instance of SmsCommandInstance

        :param payload: Payload response from the API
        )r   r3   )r,   r   r   r   r   get_instance   s    zSmsCommandPage.get_instancer0   c                 C   s   dS )r:   z#<Twilio.Supersim.V1.SmsCommandPage>r   r4   r   r   r   rI      s    zSmsCommandPage.__repr__N)	r   r   r   r   rK   r   r   rY   rI   r   r   r   r   rX      s   rX   c                	       s  e Zd Zed fddZejejfeeeee	f eee	f e
dddZejejfeeeee	f eee	f e
dddZejejejd	d	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d	d	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d	d	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d	d	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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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 )'SmsCommandList)r   c                    s   t  | d| _dS )zl
        Initialize the SmsCommandList

        :param version: Version that contains the resource

        z/SmsCommandsN)r'   r(   rN   )r,   r   r-   r   r   r(      s    zSmsCommandList.__init__)simr   callback_methodcallback_urlr1   c                 C   sT   t ||||d}t ddi}d|d< d|d< | jjd| j||d}t| j|S )a)  
        Create the SmsCommandInstance

        :param sim: The `sid` or `unique_name` of the [SIM](https://www.twilio.com/docs/iot/supersim/api/sim-resource) to send the SMS Command to.
        :param payload: The message body of the SMS Command.
        :param callback_method: The HTTP method we should use to call `callback_url`. Can be: `GET` or `POST` and the default is POST.
        :param callback_url: The URL we should call using the `callback_method` after we have sent the command.

        :returns: The created SmsCommandInstance
        SimZPayloadZCallbackMethodZCallbackUrlContent-Type!application/x-www-form-urlencodedrO   rP   POSTrS   rT   datarU   )r   rV   r3   createrN   r   r,   r[   r   r\   r]   rd   rU   r   r   r   re      s"       zSmsCommandList.createc                    sZ   t ||||d}t ddi}d|d< d|d< | jjd| j||dI dH }t| j|S )	a8  
        Asynchronously create the SmsCommandInstance

        :param sim: The `sid` or `unique_name` of the [SIM](https://www.twilio.com/docs/iot/supersim/api/sim-resource) to send the SMS Command to.
        :param payload: The message body of the SMS Command.
        :param callback_method: The HTTP method we should use to call `callback_url`. Can be: `GET` or `POST` and the default is POST.
        :param callback_url: The URL we should call using the `callback_method` after we have sent the command.

        :returns: The created SmsCommandInstance
        r^   r`   ra   rO   rP   rb   rc   N)r   rV   r3   create_asyncrN   r   rf   r   r   r   rg     s"       zSmsCommandList.create_asyncNr   r   )r[   r"   r#   limit	page_sizer1   c                 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 str sim: The SID or unique name of the Sim resource that SMS Command was sent to or from.
        :param &quot;SmsCommandInstance.Status&quot; status: The status of the SMS Command. Can be: `queued`, `sent`, `delivered`, `received` or `failed`. See the [SMS Command Status Values](https://www.twilio.com/docs/iot/supersim/api/smscommand-resource#status-values) for a description of each.
        :param &quot;SmsCommandInstance.Direction&quot; direction: The direction of the SMS 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
        ri   r[   r"   r#   ri   rh   )r3   read_limitspagestreamr,   r[   r"   r#   rh   ri   Zlimitsrl   r   r   r   rm   (  s       zSmsCommandList.streamc                    s<   | j ||}| j||||d dI dH }| j ||d S )a  
        Asynchronously 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 str sim: The SID or unique name of the Sim resource that SMS Command was sent to or from.
        :param &quot;SmsCommandInstance.Status&quot; status: The status of the SMS Command. Can be: `queued`, `sent`, `delivered`, `received` or `failed`. See the [SMS Command Status Values](https://www.twilio.com/docs/iot/supersim/api/smscommand-resource#status-values) for a description of each.
        :param &quot;SmsCommandInstance.Direction&quot; direction: The direction of the SMS 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
        ri   rj   Nrh   )r3   rk   
page_asyncstream_asyncrn   r   r   r   rp   I  s       zSmsCommandList.stream_asyncc                 C   s   t | j|||||dS )a  
        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 str sim: The SID or unique name of the Sim resource that SMS Command was sent to or from.
        :param &quot;SmsCommandInstance.Status&quot; status: The status of the SMS Command. Can be: `queued`, `sent`, `delivered`, `received` or `failed`. See the [SMS Command Status Values](https://www.twilio.com/docs/iot/supersim/api/smscommand-resource#status-values) for a description of each.
        :param &quot;SmsCommandInstance.Direction&quot; direction: The direction of the SMS 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
        r[   r"   r#   rh   ri   )listrm   r,   r[   r"   r#   rh   ri   r   r   r   rr   j  s    zSmsCommandList.listc                    s*   dd | j |||||dI dH 2 I dH S )a  
        Asynchronously 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 str sim: The SID or unique name of the Sim resource that SMS Command was sent to or from.
        :param &quot;SmsCommandInstance.Status&quot; status: The status of the SMS Command. Can be: `queued`, `sent`, `delivered`, `received` or `failed`. See the [SMS Command Status Values](https://www.twilio.com/docs/iot/supersim/api/smscommand-resource#status-values) for a description of each.
        :param &quot;SmsCommandInstance.Direction&quot; direction: The direction of the SMS 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   )r@   recordr   r   r   
<listcomp>  s   z-SmsCommandList.list_async.<locals>.<listcomp>rq   N)rp   rs   r   r   r   
list_async  s    
zSmsCommandList.list_async)r[   r"   r#   
page_tokenpage_numberri   r1   c           
   	   C   sP   t ||||||d}t ddi}d|d< | jjd| j||d}	t| j|	S )a  
        Retrieve a single page of SmsCommandInstance records from the API.
        Request is executed immediately

        :param sim: The SID or unique name of the Sim resource that SMS Command was sent to or from.
        :param status: The status of the SMS Command. Can be: `queued`, `sent`, `delivered`, `received` or `failed`. See the [SMS Command Status Values](https://www.twilio.com/docs/iot/supersim/api/smscommand-resource#status-values) for a description of each.
        :param direction: The direction of the SMS 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 SmsCommandInstance
        r_   r   r   Z	PageTokenr   ZPageSizer`   ra   rO   rP   rQ   rS   rT   paramsrU   )r   rV   r3   rl   rN   rX   
r,   r[   r"   r#   rw   rx   ri   rd   rU   responser   r   r   rl     s$       zSmsCommandList.pagec           
   	      sV   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 SmsCommandInstance records from the API.
        Request is executed immediately

        :param sim: The SID or unique name of the Sim resource that SMS Command was sent to or from.
        :param status: The status of the SMS Command. Can be: `queued`, `sent`, `delivered`, `received` or `failed`. See the [SMS Command Status Values](https://www.twilio.com/docs/iot/supersim/api/smscommand-resource#status-values) for a description of each.
        :param direction: The direction of the SMS 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 SmsCommandInstance
        ry   r`   ra   rO   rP   rQ   rz   N)r   rV   r3   ro   rN   rX   r|   r   r   r   ro     s$       zSmsCommandList.page_async)
target_urlr1   c                 C   s   | j jjd|}t| j |S )z
        Retrieve a specific page of SmsCommandInstance records from the API.
        Request is executed immediately

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

        :returns: Page of SmsCommandInstance
        rQ   )r3   domaintwiliorequestrX   r,   r~   r}   r   r   r   get_page  s    	zSmsCommandList.get_pagec                    s$   | j jjd|I dH }t| j |S )a  
        Asynchronously retrieve a specific page of SmsCommandInstance records from the API.
        Request is executed immediately

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

        :returns: Page of SmsCommandInstance
        rQ   N)r3   r   r   Zrequest_asyncrX   r   r   r   r   get_page_async  s    	zSmsCommandList.get_page_async)r   r1   c                 C   s   t | j|dS zs
        Constructs a SmsCommandContext

        :param sid: The SID of the SMS Command resource to fetch.
        r2   r/   r3   r,   r   r   r   r   r)     s    zSmsCommandList.getc                 C   s   t | j|dS r   r   r   r   r   r   __call__%  s    zSmsCommandList.__call__r0   c                 C   s   dS )r:   z#<Twilio.Supersim.V1.SmsCommandList>r   r4   r   r   r   rI   -  s    zSmsCommandList.__repr__) r   r   r   r   r(   r   unsetrK   r   rJ   r   re   rg   r   intr   rm   r	   rp   r   rr   rv   rX   rl   ro   r   r   r/   r)   r   rI   rM   r   r   r-   r   rZ      s   

*

(


#


#


%


&





,





*rZ   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/   rX   rZ   r   r   r   r   <module>   s   $^E