a
    !fY                     @   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   d/var/www/html/python-backend/venv/lib/python3.9/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
   iso8601_datetimer$   r%   r&   	_solution_context)selfr   r   r   	__class__r   r   r(   2   s&    
zSmsCommandInstance.__init__SmsCommandContext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: SmsCommandContext for this SmsCommandInstance
        Nr   r   )r,   r0   _versionr+   r-   r   r   r   _proxyL   s    
zSmsCommandInstance._proxyc                 C   s
   | j  S )a
        Fetch the SmsCommandInstance


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


        :returns: The fetched SmsCommandInstance
        N)r6   fetch_asyncr5   r   r   r   r:   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       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(   propertyr6   r8   r:   rK   __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 )r0   )r   r   c                    s.   t  | d|i| _djf 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}N)r'   r(   r+   r?   _uri)r-   r   r   r.   r   r   r(   x   s    zSmsCommandContext.__init__r1   c                 C   s(   | j jd| jd}t| j || jd dS )r7   GETmethodurir   r3   )r4   r8   rP   r   r+   r-   r   r   r   r   r8      s    zSmsCommandContext.fetchc                    s.   | j jd| jdI dH }t| j || jd dS )r9   rQ   rR   Nr   r3   )r4   r:   rP   r   r+   rU   r   r   r   r:      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   rD      rE   z-SmsCommandContext.__repr__.<locals>.<genexpr>z)<Twilio.Supersim.V1.SmsCommandContext {}>rF   rI   r   r   r   rK      s    zSmsCommandContext.__repr__)r   r   r   r   rM   r(   r   r8   r:   rK   rO   r   r   r.   r   r0   w   s   r0   c                   @   s2   e Zd Zeeef edddZedddZdS )SmsCommandPage)r   r2   c                 C   s   t | j|S )zp
        Build an instance of SmsCommandInstance

        :param payload: Payload response from the API
        )r   r4   rU   r   r   r   get_instance   s    zSmsCommandPage.get_instancer1   c                 C   s   dS )r;   z#<Twilio.Supersim.V1.SmsCommandPage>r   r5   r   r   r   rK      s    zSmsCommandPage.__repr__N)	r   r   r   r   rM   r   r   rW   rK   r   r   r   r   rV      s   rV   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(   rP   )r-   r   r.   r   r   r(      s    zSmsCommandList.__init__)simr   callback_methodcallback_urlr2   c                 C   s4   t ||||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POSTrS   rT   data)r   ofr4   createrP   r   r-   rY   r   rZ   r[   r`   r   r   r   rb      s    	zSmsCommandList.createc                    s:   t ||||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^   r_   N)r   ra   r4   create_asyncrP   r   rc   r   r   r   rd      s    	zSmsCommandList.create_asyncNr   r   )rY   r"   r#   limit	page_sizer2   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
        rf   rY   r"   r#   rf   re   )r4   read_limitspagestreamr-   rY   r"   r#   re   rf   Zlimitsri   r   r   r   rj     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
        rf   rg   Nre   )r4   rh   
page_asyncstream_asyncrk   r   r   r   rm   :  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
        rY   r"   r#   re   rf   )listrj   r-   rY   r"   r#   re   rf   r   r   r   ro   [  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   )rA   recordr   r   r   
<listcomp>  s   z-SmsCommandList.list_async.<locals>.<listcomp>rn   N)rm   rp   r   r   r   
list_async~  s    
zSmsCommandList.list_async)rY   r"   r#   
page_tokenpage_numberrf   r2   c           	   	   C   s8   t ||||||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PageSizerQ   rS   rT   params)r   ra   r4   ri   rP   rV   	r-   rY   r"   r#   rt   ru   rf   r`   responser   r   r   ri     s    zSmsCommandList.pagec           	   	      s>   t ||||||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
        rv   rQ   rw   N)r   ra   r4   rl   rP   rV   ry   r   r   r   rl     s    zSmsCommandList.page_async)
target_urlr2   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   )r4   domaintwiliorequestrV   r-   r{   rz   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)r4   r|   r}   Zrequest_asyncrV   r   r   r   r   get_page_async  s    	zSmsCommandList.get_page_async)r   r2   c                 C   s   t | j|dS zs
        Constructs a SmsCommandContext

        :param sid: The SID of the SMS Command resource to fetch.
        r3   r0   r4   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__r1   c                 C   s   dS )r;   z#<Twilio.Supersim.V1.SmsCommandList>r   r5   r   r   r   rK     s    zSmsCommandList.__repr__) r   r   r   r   r(   r   unsetrM   r   rL   r   rb   rd   r   intr   rj   r	   rm   r   ro   rs   rV   ri   rl   r   r   r0   r)   r   rK   rO   r   r   r.   r   rX      s   

&

$


#


#


%


&





&





&rX   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   r0   rV   rX   r   r   r   r   <module>   s   $]@