
    pik                         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 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 )IpCommandInstancec                       e Zd ZdZdZy)IpCommandInstance.Directionto_simfrom_simN)__name__
__module____qualname__TO_SIMFROM_SIM     d/opt/services/ai/voice_agent/venv/lib/python3.12/site-packages/twilio/rest/supersim/v1/ip_command.py	Directionr      s    r   r    c                       e Zd ZdZdZy)IpCommandInstance.PayloadTypetextbinaryN)r   r   r   TEXTBINARYr   r   r   PayloadTyper"      s    r   r'   c                       e Zd ZdZdZdZdZy)IpCommandInstance.StatusqueuedsentreceivedfailedN)r   r   r   QUEUEDSENTRECEIVEDFAILEDr   r   r   Statusr)   #   s    r   r2   versionpayloadsidc                    t         |   |       |j                  d      | _        |j                  d      | _        |j                  d      | _        |j                  d      | _        |j                  d      | _        |j                  d      | _        |j                  d      | _	        t        j                  |j                  d            | _        |j                  d	      | _        |j                  d
      | _        t        j                  |j                  d            | _        t        j                  |j                  d            | _        |j                  d      | _        d|xs | j                  i| _        d | _        y )Nr5   account_sidsim_sid	sim_iccidstatus	direction	device_ipdevice_portpayload_typer4   date_createddate_updatedurl)super__init__getr5   r7   r8   r9   r:   r;   r<   r   integerr=   r>   r4   iso8601_datetimer?   r@   rA   	_solution_context)selfr3   r4   r5   	__class__s       r   rC   zIpCommandInstance.__init__9   sF    	!")++e"4*1++m*D&-kk)&<(/K(@<CKK<QBI++C
 )0K(@*5*=*=KK&+
 HO{{H
 '.kk)&<0;0L0LKK'1
 1<0L0LKK'1
 #*++e"4 3?$((
 59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: IpCommandContext for this IpCommandInstance
        r5   r5   )rH   IpCommandContext_versionrG   rI   s    r   _proxyzIpCommandInstance._proxy[   s9     == ,NN5)DM }}r   c                 6    | j                   j                         S )_
        Fetch the IpCommandInstance


        :returns: The fetched IpCommandInstance
        )rQ   fetchrP   s    r   rT   zIpCommandInstance.fetchj   s     {{  ""r   c                 R   K   | j                   j                          d{   S 7 w)y
        Asynchronous coroutine to fetch the IpCommandInstance


        :returns: The fetched IpCommandInstance
        N)rQ   fetch_asyncrP   s    r   rW   zIpCommandInstance.fetch_asyncs   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-IpCommandInstance.__repr__.<locals>.<genexpr>        SDAq7>>!Q/S   !z)<Twilio.Supersim.V1.IpCommandInstance {}>joinrG   itemsr^   rI   contexts     r   __repr__zIpCommandInstance.__repr__|   s6     ((SDNN<P<P<RSS:AA'JJr   )N)rK   rN   )rK   r   )r   r   r   objectr    r'   r2   r   r   strr   r   rC   propertyrQ   rT   rW   rk   __classcell__rJ   s   @r   r   r      s    F f  " OS 9 9)-c3h 9>Fsm 9D  #/K# K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 )rN   r3   r5   c                 x    t         |   |       d|i| _         dj                  di | j                  | _        y)z
        Initialize the IpCommandContext

        :param version: Version that contains the resource
        :param sid: The SID of the IP Command resource to fetch.
        r5   z/IpCommands/{sid}Nr   )rB   rC   rG   r^   _uri)rI   r3   r5   rJ   s      r   rC   zIpCommandContext.__init__   s@     	! 3
 /'..@@	r   rK   c                     t        j                  i       }d|d<   | j                  j                  d| j                  |      }t        | j                  || j                  d         S )rS   application/jsonAcceptGETmethoduriheadersr5   rM   )r   ofrO   rT   rs   r   rG   rI   r{   r4   s      r   rT   zIpCommandContext.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)rV   ru   rv   rw   rx   Nr5   rM   )r   r|   rO   rW   rs   r   rG   r}   s      r   rW   zIpCommandContext.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 )rY   rZ   c              3   F   K   | ]  \  }}d j                  ||        ywr\   r]   r_   s      r   rc   z,IpCommandContext.__repr__.<locals>.<genexpr>   rd   re   z(<Twilio.Supersim.V1.IpCommandContext {}>rf   ri   s     r   rk   zIpCommandContext.__repr__   s6     ((SDNN<P<P<RSS9@@IIr   )r   r   r   r   rm   rC   r   rT   rW   rk   ro   rp   s   @r   rN   rN      sA    A Ac A
( 
(
#4 
,J# Jr   rN   c                   2    e Zd Zdeeef   defdZdefdZy)IpCommandPager4   rK   c                 .    t        | j                  |      S )zo
        Build an instance of IpCommandInstance

        :param payload: Payload response from the API
        )r   rO   )rI   r4   s     r   get_instancezIpCommandPage.get_instance   s     !88r   c                      y)rY   z"<Twilio.Supersim.V1.IpCommandPage>r   rP   s    r   rk   zIpCommandPage.__repr__        4r   N)	r   r   r   r   rm   r   r   r   rk   r   r   r   r   r      s*    9DcN 97H 94# 4r   r   c                       e Zd Zdef fdZej                  ej                  ej                  fdededede	de
f   de	ee
f   d	e	ee
f   d
efdZej                  ej                  ej                  fdededede	d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                  ddfde	ee
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                  ddfde	ee
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                  ddfde	ee
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                  ddfde	ee
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                  ej                  fde	ee
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                  ej                  fde	ee
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 )$IpCommandListr3   c                 2    t         |   |       d| _        y)zk
        Initialize the IpCommandList

        :param version: Version that contains the resource

        z/IpCommandsN)rB   rC   rs   )rI   r3   rJ   s     r   rC   zIpCommandList.__init__   s     	!!	r   simr4   r=   r>   r"   callback_urlcallback_methodrK   c           	          t        j                  ||||||d      }t        j                  ddi      }d|d<   d|d<   | j                  j                  d| j                  ||      }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
        SimPayload
DevicePortr'   CallbackUrlCallbackMethodContent-Type!application/x-www-form-urlencodedru   rv   POSTry   rz   datar{   )r   r|   rO   creaters   r   	rI   r   r4   r=   r>   r   r   r   r{   s	            r   r   zIpCommandList.create   s    , yy")++"1	
 ))^-PQR"E.--&&tyytW ' 
 !88r   c           	        K   t        j                  ||||||d      }t        j                  ddi      }d|d<   d|d<   | j                  j                  d| j                  ||       d{   }t        | j                  |      S 7 w)	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
        r   r   r   ru   rv   r   r   N)r   r|   rO   create_asyncrs   r   r   s	            r   r   zIpCommandList.create_async  s     , yy")++"1	
 ))^-PQR"E.22tyytW 3 
 
 !88	
s   A*B	,B-B	Nr9   r:   r)   r;   r   limit	page_sizec                     | j                   j                  ||      }| j                  |||||d         }| j                   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
        r   r   r9   r:   r;   r   r   )rO   read_limitspagestream	rI   r   r9   r:   r;   r   r   limitsr   s	            r   r   zIpCommandList.streamC  s^    8 **5)<yy[)  
 }}##D&/::r   c                    K   | j                   j                  ||      }| j                  |||||d          d{   }| j                   j                  ||d         S 7 #w)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
        r   r   Nr   )rO   r   
page_asyncstream_asyncr   s	            r   r   zIpCommandList.stream_asyncj  sl     8 **5)<__[) % 
 
 }}))$w@@
s   9A!A$A!c           
      B    t        | j                  ||||||            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
        r   r9   r:   r;   r   r   )listr   )rI   r   r9   r:   r;   r   r   s          r   r   zIpCommandList.list  s4    6 KK###  	
 		
r   c                    K   | j                  ||||||       d{   2 cg c3 d{   }|7 7 	6 c}S c c}w w)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
        r   N)r   )rI   r   r9   r:   r;   r   r   records           r   
list_asynczIpCommandList.list_async  s`     : '+&7&7### '8 ' !

 

 !

 

 
	
 

s0   ?2?:64
6:?6:?
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 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   SimIccidr2   r    	PageTokenr   PageSizer   r   ru   rv   rw   ry   rz   paramsr{   )r   r|   rO   r   rs   r   rI   r   r9   r:   r;   r   r   r   r   r{   responses              r   r   zIpCommandList.page  s    0 yy% &'#%

 ))^-PQR.==%%diig & 
 T]]H55r   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 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   r   r   ru   rv   rw   r   N)r   r|   rO   r   rs   r   r   s              r   r   zIpCommandList.page_async  s     0 yy% &'#%

 ))^-PQR.11diig 2 
 
 T]]H55
s   A&B(B)B
target_urlc                     | j                   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
        rw   )rO   domaintwiliorequestr   rI   r   r   s      r   get_pagezIpCommandList.get_page8  s7     ==''..66ujIT]]H55r   c                    K   | j                   j                  j                  j                  d|       d{   }t	        | j                   |      S 7 w)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
        rw   N)rO   r   r   request_asyncr   r   s      r   get_page_asynczIpCommandList.get_page_asyncD  sD      --44BB5*UUT]]H55 Vs   4AAAr5   c                 0    t        | j                  |      S zq
        Constructs a IpCommandContext

        :param sid: The SID of the IP Command resource to fetch.
        rM   rN   rO   rI   r5   s     r   rD   zIpCommandList.getP        377r   c                 0    t        | j                  |      S r   r   r   s     r   __call__zIpCommandList.__call__X  r   r   c                      y)rY   z"<Twilio.Supersim.V1.IpCommandList>r   rP   s    r   rk   zIpCommandList.__repr__`  r   r   ) r   r   r   r   rC   r   unsetrm   intr   rl   r   r   r   r   r	   r   r
   r   r   r   r   r   r   r   r   r   rN   rD   r   rk   ro   rp   s   @r   r   r      s   	" 	"  HN||+1<<.4ll*9*9 *9 	*9
 ;VCD*9 CK(*9 sF{+*9 
*9b HN||+1<<.4ll*9*9 *9 	*9
 ;VCD*9 CK(*9 sF{+*9 
*9\ #),,(.<BLLBH,,##'%;3;%; f%%; 0&89	%;
 6>?%; }%; C=%; 
#	$%;R #),,(.<BLLBH,,##'%A3;%A f%%A 0&89	%A
 6>?%A }%A C=%A 
(	)%AR #),,(.<BLLBH,,##'$
3;$
 f%$
 0&89	$

 6>?$
 }$
 C=$
 
	 $
P #),,(.<BLLBH,,##'%
3;%
 f%%
 0&89	%

 6>?%
 }%
 C=%
 
	 %
R #),,(.<BLLBH,,)/*0,,(.+63;+6 f%+6 0&89	+6
 6>?+6 #v+&+6 3;'+6 f%+6 
+6^ #),,(.<BLLBH,,)/*0,,(.+63;+6 f%+6 0&89	+6
 6>?+6 #v+&+6 3;'+6 f%+6 
+6Z
63 
6= 
6
6s 
6} 
68s 8/ 88C 8$4 84# 4r   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   rN   r   r   r   r   r   <module>r      sg     L L L + 8 : 2 ' !jK( jKZBJ BJJ4D 4&H4L H4r   