o
    f>h6]                     @   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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 )SmsCommandInstancec                   @   s   e Zd ZdZdZdS )SmsCommandInstance.Directionto_simfrom_simN)__name__
__module____qualname__TO_SIMFROM_SIM r   r   V/var/www/html/venv/lib/python3.10/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.Statusqueuedsent	deliveredreceivedfailedN)r   r   r   QUEUEDSENT	DELIVEREDRECEIVED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|pG| 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
   iso8601_datetimer0   r1   r2   	_solution_context)selfr)   r*   r+   	__class__r   r   r4   2   s&   

zSmsCommandInstance.__init__returnSmsCommandContextc                 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: SmsCommandContext for this SmsCommandInstance
        Nr+   r+   )r8   r=   _versionr7   r9   r   r   r   _proxyL   s   
zSmsCommandInstance._proxyc                 C   s
   | j  S )a
        Fetch the SmsCommandInstance


        :returns: The fetched SmsCommandInstance
        )rA   fetchr@   r   r   r   rC   [   s   
zSmsCommandInstance.fetchc                    s   | j  I dH S ){
        Asynchronous coroutine to fetch the SmsCommandInstance


        :returns: The fetched SmsCommandInstance
        N)rA   fetch_asyncr@   r   r   r   rE   d   s   zSmsCommandInstance.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>s       z.SmsCommandInstance.__repr__.<locals>.<genexpr>z*<Twilio.Supersim.V1.SmsCommandInstance {}>joinr7   itemsrL   r9   contextr   r   r   __repr__m      
zSmsCommandInstance.__repr__N)r<   r=   )r<   r   )r   r   r   objectr   r(   r   r   strr   r   r4   propertyrA   rC   rE   rX   __classcell__r   r   r:   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 )r=   r)   r+   c                    s.   t  | d|i| _djdi | 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}Nr   )r3   r4   r7   rL   _uri)r9   r)   r+   r:   r   r   r4   y   s   zSmsCommandContext.__init__r<   c                 C   s<   t i }d|d< | jjd| j|d}t| j|| jd dS )rB   application/jsonAcceptGETmethoduriheadersr+   r>   )r   ofr?   rC   r_   r   r7   r9   rf   r*   r   r   r   rC      s   
zSmsCommandContext.fetchc                    sD   t i }d|d< | jjd| j|dI dH }t| j|| jd dS )rD   r`   ra   rb   rc   Nr+   r>   )r   rg   r?   rE   r_   r   r7   rh   r   r   r   rE      s   
zSmsCommandContext.fetch_asyncc                 C   rF   )rG   rH   c                 s   rI   rJ   rK   rM   r   r   r   rQ      rR   z-SmsCommandContext.__repr__.<locals>.<genexpr>z)<Twilio.Supersim.V1.SmsCommandContext {}>rS   rV   r   r   r   rX      rY   zSmsCommandContext.__repr__)r   r   r   r   r\   r4   r   rC   rE   rX   r^   r   r   r:   r   r=   w   s
    r=   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 )SmsCommandPager*   r<   c                 C   s   t | j|S )zp
        Build an instance of SmsCommandInstance

        :param payload: Payload response from the API
        )r   r?   )r9   r*   r   r   r   get_instance   s   zSmsCommandPage.get_instancec                 C      dS )rG   z#<Twilio.Supersim.V1.SmsCommandPage>r   r@   r   r   r   rX         zSmsCommandPage.__repr__N)	r   r   r   r   r\   r   r   rj   rX   r   r   r   r   ri      s    ri   c                       s(  e Zd Zdef fddZejejfdededeee	f deee	f de
f
d	d
Zejejfdededeee	f deee	f de
f
ddZejejejdd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dd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dd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dd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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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d,d-Z  ZS ).SmsCommandListr)   c                    s   t  | d| _dS )zl
        Initialize the SmsCommandList

        :param version: Version that contains the resource

        z/SmsCommandsN)r3   r4   r_   )r9   r)   r:   r   r   r4      s   
zSmsCommandList.__init__simr*   callback_methodcallback_urlr<   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
        SimPayloadCallbackMethodCallbackUrlContent-Type!application/x-www-form-urlencodedr`   ra   POSTrd   re   datarf   )r   rg   r?   creater_   r   r9   rn   r*   ro   rp   rz   rf   r   r   r   r{      s   
zSmsCommandList.createc                    s\   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
        rq   rv   rw   r`   ra   rx   ry   N)r   rg   r?   create_asyncr_   r   r|   r   r   r   r}     s   
zSmsCommandList.create_asyncNr.   r   r/   r   limit	page_sizec                 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
        r   rn   r.   r/   r   r~   )r?   read_limitspagestreamr9   rn   r.   r/   r~   r   limitsr   r   r   r   r   (  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
        r   r   Nr~   )r?   r   
page_asyncstream_asyncr   r   r   r   r   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
        rn   r.   r/   r~   r   )listr   r9   rn   r.   r/   r~   r   r   r   r   r   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 rZ   r   )rN   recordr   r   r   
<listcomp>  s
    z-SmsCommandList.list_async.<locals>.<listcomp>r   N)r   r   r   r   r   
list_async  s   
zSmsCommandList.list_async
page_tokenpage_numberc           
   	   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
        rr   r(   r   	PageTokenr   PageSizerv   rw   r`   ra   rb   rd   re   paramsrf   )r   rg   r?   r   r_   ri   
r9   rn   r.   r/   r   r   r   rz   rf   responser   r   r   r     s   
zSmsCommandList.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 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   rv   rw   r`   ra   rb   r   N)r   rg   r?   r   r_   ri   r   r   r   r   r     s    
zSmsCommandList.page_async
target_urlc                 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
        rb   )r?   domaintwiliorequestri   r9   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
        rb   N)r?   r   r   request_asyncri   r   r   r   r   get_page_async  s   	zSmsCommandList.get_page_asyncr+   c                 C      t | j|dS zs
        Constructs a SmsCommandContext

        :param sid: The SID of the SMS Command resource to fetch.
        r>   r=   r?   r9   r+   r   r   r   r5        zSmsCommandList.getc                 C   r   r   r   r   r   r   r   __call__%  r   zSmsCommandList.__call__c                 C   rk   )rG   z#<Twilio.Supersim.V1.SmsCommandList>r   r@   r   r   r   rX   -  rl   zSmsCommandList.__repr__) r   r   r   r   r4   r   unsetr\   r   r[   r   r{   r}   r   intr   r   r	   r   r   r   r   ri   r   r   r   r   r=   r5   r   rX   r^   r   r   r:   r   rm      s&   


*


(



#



#



%



&






,






*rm   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   r=   ri   rm   r   r   r   r   <module>   s    $^E