
    pi6]                         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e      Z G d de      Z G d de      Z G d de      Zy)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                        e Zd Z G d de      Z G d de      Z	 	 ddedeee	f   de
e   f fdZedd
       ZddZddZd	efdZ xZS )SmsCommandInstancec                       e Zd ZdZdZy)SmsCommandInstance.Directionto_simfrom_simN)__name__
__module____qualname__TO_SIMFROM_SIM     e/opt/services/ai/voice_agent/venv/lib/python3.12/site-packages/twilio/rest/supersim/v1/sms_command.py	Directionr      s    r   r    c                        e Zd ZdZdZdZdZdZy)SmsCommandInstance.Statusqueuedsent	deliveredreceivedfailedN)r   r   r   QUEUEDSENT	DELIVEREDRECEIVEDFAILEDr   r   r   Statusr"      s    	r   r-   versionpayloadsidc                 8   t         |   |       |j                  d      | _        |j                  d      | _        |j                  d      | _        |j                  d      | _        |j                  d      | _        |j                  d      | _        t        j                  |j                  d            | _        t        j                  |j                  d            | _        |j                  d	      | _        d|xs | j                  i| _        d | _        y )
Nr0   account_sidsim_sidr/   status	directiondate_createddate_updatedurl)super__init__getr0   r2   r3   r/   r4   r5   r   iso8601_datetimer6   r7   r8   	_solution_context)selfr.   r/   r0   	__class__s       r   r:   zSmsCommandInstance.__init__2   s     	!")++e"4*1++m*D&-kk)&<&-kk)&<=D[[=RCJ;;D
 1<0L0LKK'1
 1<0L0LKK'1
 #*++e"4 3?$((
 6:r   returnc                     | j                   )t        | j                  | j                  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
        r0   r0   )r>   SmsCommandContext_versionr=   r?   s    r   _proxyzSmsCommandInstance._proxyL   s9     == -NN5)DM }}r   c                 6    | j                   j                         S )a
        Fetch the SmsCommandInstance


        :returns: The fetched SmsCommandInstance
        )rG   fetchrF   s    r   rJ   zSmsCommandInstance.fetch[   s     {{  ""r   c                 R   K   | j                   j                          d{   S 7 w){
        Asynchronous coroutine to fetch the SmsCommandInstance


        :returns: The fetched SmsCommandInstance
        N)rG   fetch_asyncrF   s    r   rM   zSmsCommandInstance.fetch_asyncd   s!      [[,,....s   '%'c                     dj                  d | j                  j                         D              }dj                  |      S )f
        Provide a friendly representation

        :returns: Machine friendly representation
         c              3   F   K   | ]  \  }}d j                  ||        ywz{}={}Nformat.0kvs      r   	<genexpr>z.SmsCommandInstance.__repr__.<locals>.<genexpr>s        SDAq7>>!Q/S   !z*<Twilio.Supersim.V1.SmsCommandInstance {}>joinr=   itemsrT   r?   contexts     r   __repr__zSmsCommandInstance.__repr__m   s6     ((SDNN<P<P<RSS;BB7KKr   )N)rA   rD   )rA   r   )r   r   r   objectr    r-   r   r   strr   r   r:   propertyrG   rJ   rM   ra   __classcell__r@   s   @r   r   r      s|    F  
 OS::)-c3h:>Fsm:4  #/L# Lr   r   c                   L     e Zd Zdedef fdZdefdZdefdZdefdZ	 xZ
S )rD   r.   r0   c                 x    t         |   |       d|i| _         dj                  di | j                  | _        y)z
        Initialize the SmsCommandContext

        :param version: Version that contains the resource
        :param sid: The SID of the SMS Command resource to fetch.
        r0   z/SmsCommands/{sid}Nr   )r9   r:   r=   rT   _uri)r?   r.   r0   r@   s      r   r:   zSmsCommandContext.__init__y   s@     	! 3
 0(//A$..A	r   rA   c                     t        j                  i       }d|d<   | j                  j                  d| j                  |      }t        | j                  || j                  d         S )rI   application/jsonAcceptGETmethoduriheadersr0   rC   )r   ofrE   rJ   ri   r   r=   r?   rq   r/   s      r   rJ   zSmsCommandContext.fetch   s]     ))B-.--%%U		7%S!MMu%
 	
r   c                    K   t        j                  i       }d|d<   | j                  j                  d| j                  |       d{   }t        | j                  || j                  d         S 7 )w)rL   rk   rl   rm   rn   Nr0   rC   )r   rr   rE   rM   ri   r   r=   rs   s      r   rM   zSmsCommandContext.fetch_async   sr      ))B-.11dii 2 
 
 "MMu%
 	
	
s   AA4A2	*A4c                     dj                  d | j                  j                         D              }dj                  |      S )rO   rP   c              3   F   K   | ]  \  }}d j                  ||        ywrR   rS   rU   s      r   rY   z-SmsCommandContext.__repr__.<locals>.<genexpr>   rZ   r[   z)<Twilio.Supersim.V1.SmsCommandContext {}>r\   r_   s     r   ra   zSmsCommandContext.__repr__   s6     ((SDNN<P<P<RSS:AA'JJr   )r   r   r   r   rc   r:   r   rJ   rM   ra   re   rf   s   @r   rD   rD   w   sA    B Bc B
) 
(
#5 
,K# Kr   rD   c                   2    e Zd Zdeeef   defdZdefdZy)SmsCommandPager/   rA   c                 .    t        | j                  |      S )zp
        Build an instance of SmsCommandInstance

        :param payload: Payload response from the API
        )r   rE   )r?   r/   s     r   get_instancezSmsCommandPage.get_instance   s     "$--99r   c                      y)rO   z#<Twilio.Supersim.V1.SmsCommandPage>r   rF   s    r   ra   zSmsCommandPage.__repr__        5r   N)	r   r   r   r   rc   r   r   rz   ra   r   r   r   rx   rx      s*    :DcN :7I :5# 5r   rx   c                   X    e Zd Zdef f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Zej                  ej                  fdededeee	f   deee	f   de
f
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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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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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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ZdedefdZdedefdZdedefdZdedefdZdefdZ xZS ) SmsCommandListr.   c                 2    t         |   |       d| _        y)zl
        Initialize the SmsCommandList

        :param version: Version that contains the resource

        z/SmsCommandsN)r9   r:   ri   )r?   r.   r@   s     r   r:   zSmsCommandList.__init__   s     	!"	r   simr/   callback_methodcallback_urlrA   c                     t        j                  ||||d      }t        j                  ddi      }d|d<   d|d<   | j                  j                  d| j                  ||      }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-urlencodedrk   rl   POSTro   rp   datarq   )r   rr   rE   createri   r   r?   r   r/   r   r   r   rq   s          r   r   zSmsCommandList.create   s    $ yy""1+	
 ))^-PQR"E.--&&tyytW ' 
 "$--99r   c                   K   t        j                  ||||d      }t        j                  ddi      }d|d<   d|d<   | j                  j                  d| j                  ||       d{   }t        | j                  |      S 7 w)	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   rk   rl   r   r   N)r   rr   rE   create_asyncri   r   r   s          r   r   zSmsCommandList.create_async  s     $ yy""1+	
 ))^-PQR"E.22tyytW 3 
 
 "$--99	
s   A(B*B+BNr4   r"   r5   r   limit	page_sizec                     | j                   j                  ||      }| j                  ||||d         }| j                   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   r   r4   r5   r   r   )rE   read_limitspagestreamr?   r   r4   r5   r   r   limitsr   s           r   r   zSmsCommandList.stream(  sX    4 **5)<yyFi6+CV  
 }}##D&/::r   c                    K   | j                   j                  ||      }| j                  ||||d          d{   }| j                   j                  ||d         S 7 #w)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   )rE   r   
page_asyncstream_asyncr   s           r   r   zSmsCommandList.stream_asyncI  sf     4 **5)<__Fi6+CV % 
 
 }}))$w@@	
s   8A A$A c           	      @    t        | j                  |||||            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   r4   r5   r   r   )listr   )r?   r   r4   r5   r   r   s         r   r   zSmsCommandList.listj  s1    2 KK##  
 	
r   c                    K   | j                  |||||       d{   2 cg c3 d{   }|7 7 	6 c}S c c}w w)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
        r   N)r   )r?   r   r4   r5   r   r   records          r   
list_asynczSmsCommandList.list_async  s]     6 '+&7&7## '8 ' !	
 	
 !	
 	
 		
 	
s0   >1>953
59>59>
page_tokenpage_numberc           	          t        j                  ||||||d      }t        j                  ddi      }d|d<   | j                  j                  d| j                  ||      }	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    	PageTokenr   PageSizer   r   rk   rl   rm   ro   rp   paramsrq   )r   rr   rE   r   ri   rx   
r?   r   r4   r5   r   r   r   r   rq   responses
             r   r   zSmsCommandList.page  s    , yy &'#%	
 ))^-PQR.==%%diig & 
 dmmX66r   c           	        K   t        j                  ||||||d      }t        j                  ddi      }d|d<   | j                  j                  d| j                  ||       d{   }	t        | j                  |	      S 7 w)	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   r   r   rk   rl   rm   r   N)r   rr   rE   r   ri   rx   r   s
             r   r   zSmsCommandList.page_async  s     , yy &'#%	
 ))^-PQR.11diig 2 
 
 dmmX66
s   A%B'B(B
target_urlc                     | j                   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
        rm   )rE   domaintwiliorequestrx   r?   r   r   s      r   get_pagezSmsCommandList.get_page  s7     ==''..66ujIdmmX66r   c                    K   | j                   j                  j                  j                  d|       d{   }t	        | j                   |      S 7 w)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
        rm   N)rE   r   r   request_asyncrx   r   s      r   get_page_asynczSmsCommandList.get_page_async  sD      --44BB5*UUdmmX66 Vs   4AAAr0   c                 0    t        | j                  |      S zs
        Constructs a SmsCommandContext

        :param sid: The SID of the SMS Command resource to fetch.
        rC   rD   rE   r?   r0   s     r   r;   zSmsCommandList.get       !C88r   c                 0    t        | j                  |      S r   r   r   s     r   __call__zSmsCommandList.__call__%  r   r   c                      y)rO   z#<Twilio.Supersim.V1.SmsCommandList>r   rF   s    r   ra   zSmsCommandList.__repr__-  r|   r   ) r   r   r   r   r:   r   unsetrc   r   rb   r   r   r   r   intr	   r   r
   r   r   r   r   rx   r   r   r   r   rD   r;   r   ra   re   rf   s   @r   r~   r~      s   	# 	# /5ll+1<<$:$: $: sF{+	$:
 CK($: 
$:T /5ll+1<<$:$: $: sF{+	$:
 CK($: 
$:P #),,=C\\CI<<##';3;; 169:; 7?@	;
 }; C=; 
$	%;F #),,=C\\CI<<##'A3;A 169:A 7?@	A
 }A C=A 
)	*AF #),,=C\\CI<<##'!
3;!
 169:!
 7?@	!

 }!
 C=!
 
 	!!
J #),,=C\\CI<<##'"
3;"
 169:"
 7?@	"

 }"
 C="
 
 	!"
L #),,=C\\CI<<)/*0,,(.(73;(7 169:(7 7?@	(7
 #v+&(7 3;'(7 f%(7 
(7X #),,=C\\CI<<)/*0,,(.(73;(7 169:(7 7?@	(7
 #v+&(7 3;'(7 f%(7 
(7T
73 
7> 
7
7s 
7~ 
79s 90 99C 9$5 95# 5r   r~   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   rD   rx   r~   r   r   r   <module>r      sg     L L L + 8 : 2 ' ![L) [L|BK BKJ5T 5&d5\ d5r   