
    U}bgk                         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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dS )a  
    This code was generated by
   ___ _ _ _ _ _    _ ____    ____ ____ _    ____ ____ _  _ ____ ____ ____ ___ __   __
    |  | | | | |    | |  | __ |  | |__| | __ | __ |___ |\ | |___ |__/ |__|  | |  | |__/
    |  |_|_| | |___ | |__|    |__| |  | |    |__] |___ | \| |___ |  \ |  |  | |__| |  \

    Twilio - Wireless
    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	serialize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 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efdZdefdZddZddZde
fdZ xZS )CommandInstancec                       e Zd ZdZdZdS )CommandInstance.CommandModetextbinaryN)__name__
__module____qualname__TEXTBINARY     r/home/e360mart.nyusoft.in/public_html/e360mart_env/lib/python3.11/site-packages/twilio/rest/wireless/v1/command.pyCommandModer      s        r   r!   c                       e Zd ZdZdZdS )CommandInstance.Directionfrom_simto_simN)r   r   r   FROM_SIMTO_SIMr   r   r    	Directionr#      s        r   r(   c                   "    e Zd ZdZdZdZdZdZdS )CommandInstance.Statusqueuedsent	deliveredreceivedfailedN)r   r   r   QUEUEDSENT	DELIVEREDRECEIVEDFAILEDr   r   r    Statusr*   #   s'        	r   r5   c                       e Zd ZdZdZdS )CommandInstance.TransportsmsipN)r   r   r   SMSIPr   r   r    	Transportr7   *   s        r   r<   Nversionpayloadsidc                 0   t                                          |           |                    d          | _        |                    d          | _        |                    d          | _        |                    d          | _        |                    d          | _        |                    d          | _        |                    d          | _	        |                    d          | _
        |                    d	          | _        t          j        |                    d
                    | _        t          j        |                    d                    | _        |                    d          | _        d|p| j        i| _        d | _        d S )Nr?   account_sidsim_sidcommandcommand_mode	transportdelivery_receipt_requestedstatus	directiondate_createddate_updatedurl)super__init__getr?   rA   rB   rC   rD   rE   rF   rG   rH   r   iso8601_datetimerI   rJ   rK   	_solution_context)selfr=   r>   r?   	__class__s       r    rM   zCommandInstance.__init__=   s`    	!!!")++e"4"4*1++m*D*D&-kk)&<&<&-kk)&<&<EL[[F
 F
 AHK@X@X:A++(;
 ;
' ;B++h:O:O@GK@X@X0;0LKK''1
 1
 1<0LKK''1
 1
 #*++e"4"4 3?$(
 37r   returnCommandContextc                 j    | 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: CommandContext for this CommandInstance
        Nr?   r?   )rQ   rU   _versionrP   rR   s    r    _proxyzCommandInstance._proxy\   s;     = *N5)  DM }r   c                 4    | j                                         S )j
        Deletes the CommandInstance


        :returns: True if delete succeeds, False otherwise
        )rZ   deleterY   s    r    r]   zCommandInstance.deletek   s     {!!###r   c                 D   K   | j                                          d{V S )
        Asynchronous coroutine that deletes the CommandInstance


        :returns: True if delete succeeds, False otherwise
        N)rZ   delete_asyncrY   s    r    r`   zCommandInstance.delete_asynct   s.       [--/////////r   c                 4    | j                                         S )[
        Fetch the CommandInstance


        :returns: The fetched CommandInstance
        )rZ   fetchrY   s    r    rc   zCommandInstance.fetch}   s     {  """r   c                 D   K   | j                                          d{V S )u
        Asynchronous coroutine to fetch the CommandInstance


        :returns: The fetched CommandInstance
        N)rZ   fetch_asyncrY   s    r    rf   zCommandInstance.fetch_async   s.       [,,.........r   c                     d                     d | j                                        D                       }d                    |          S )f
        Provide a friendly representation

        :returns: Machine friendly representation
         c              3   H   K   | ]\  }}d                      ||          V  dS z{}={}Nformat.0kvs      r    	<genexpr>z+CommandInstance.__repr__.<locals>.<genexpr>   4      SSDAq7>>!Q//SSSSSSr   z'<Twilio.Wireless.V1.CommandInstance {}>joinrP   itemsrm   rR   contexts     r    __repr__zCommandInstance.__repr__   sF     ((SSDN<P<P<R<RSSSSS8??HHHr   N)rT   rU   )rT   r   )r   r   r   objectr!   r(   r5   r<   r   r   strr   r   rM   propertyrZ   boolr]   r`   rc   rf   ry   __classcell__rS   s   @r    r   r      s           f       F              F     OS7 77)-c3h7>Fsm7 7 7 7 7 7>    X$ $ $ $ $0D 0 0 0 0# # # #/ / / /I# I I I I I I I Ir   r   c                   d     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
de	fdZdefd	Z xZS )
rU   r=   r?   c                     t                                          |           d|i| _         dj        di | j        | _        dS )z
        Initialize the CommandContext

        :param version: Version that contains the resource
        :param sid: The SID of the Command resource to fetch.
        r?   z/Commands/{sid}Nr   )rL   rM   rP   rm   _uri)rR   r=   r?   rS   s      r    rM   zCommandContext.__init__   sP     	!!! 3
 -%,>>t~>>			r   rT   c                 D    | j                             d| j                  S )r\   DELETEmethoduri)rX   r]   r   rY   s    r    r]   zCommandContext.delete   s+     }##	 $ 
 
 	
r   c                 T   K   | j                             d| j                   d{V S )r_   r   r   N)rX   r`   r   rY   s    r    r`   zCommandContext.delete_async   sM       ]//	 0 
 
 
 
 
 
 
 
 	
r   c                     | j                             d| j                  }t          | j         || j        d                   S )rb   GETr   r?   rW   )rX   rc   r   r   rP   rR   r>   s     r    rc   zCommandContext.fetch   sS     -%%	 & 
 

 Mu%
 
 
 	
r   c                    K   | j                             d| j                   d{V }t          | j         || j        d                   S )re   r   r   Nr?   rW   )rX   rf   r   r   rP   r   s     r    rf   zCommandContext.fetch_async   su       11	 2 
 
 
 
 
 
 
 

 Mu%
 
 
 	
r   c                     d                     d | j                                        D                       }d                    |          S )rh   ri   c              3   H   K   | ]\  }}d                      ||          V  dS rk   rl   rn   s      r    rr   z*CommandContext.__repr__.<locals>.<genexpr>   rs   r   z&<Twilio.Wireless.V1.CommandContext {}>rt   rw   s     r    ry   zCommandContext.__repr__   sF     ((SSDN<P<P<R<RSSSSS7>>wGGGr   )r   r   r   r   r|   rM   r~   r]   r`   r   rc   rf   ry   r   r   s   @r    rU   rU      s        ? ?c ? ? ? ? ? ?

 

 

 

 



D 

 

 

 


 
 
 
 
&
? 
 
 
 
&H# H H H H H H H Hr   rU   c                   :    e Zd Zdeeef         defdZdefdZdS )CommandPager>   rT   c                 ,    t          | j        |          S )zm
        Build an instance of CommandInstance

        :param payload: Payload response from the API
        )r   rX   r   s     r    get_instancezCommandPage.get_instance   s     t}g666r   c                     dS )rh   z <Twilio.Wireless.V1.CommandPage>r   rY   s    r    ry   zCommandPage.__repr__   
     21r   N)	r   r   r   r   r|   r   r   r   ry   r   r   r    r   r      sY        7DcN 7 7 7 7 72# 2 2 2 2 2 2r   r   c                       e Zd Zdef fdZej        ej        ej        ej        ej        ej        fdedeee	f         deee	f         deee	f         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        ej        ej        fdedeee	f         deee	f         deee	f         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d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d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d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d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d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d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 )&CommandListr=   c                 X    t                                          |           d| _        dS )zi
        Initialize the CommandList

        :param version: Version that contains the resource

        z	/CommandsN)rL   rM   r   )rR   r=   rS   s     r    rM   zCommandList.__init__  s(     	!!!			r   rC   simcallback_methodcallback_urlrD   r   include_sidrF   rT   c                     t          j        ||||||t          j        |          d          }| j                            d| j        |          }	t          | j        |	          S )a  
        Create the CommandInstance

        :param command: The message body of the Command. Can be plain text in text mode or a Base64 encoded byte string in binary mode.
        :param sim: The `sid` or `unique_name` of the [SIM](https://www.twilio.com/docs/iot/wireless/api/sim-resource) to send the Command to.
        :param callback_method: The HTTP method we use to call `callback_url`. Can be: `POST` or `GET`, and the default is `POST`.
        :param callback_url: The URL we call using the `callback_url` when the Command has finished sending, whether the command was delivered or it failed.
        :param command_mode:
        :param include_sid: Whether to include the SID of the command in the message body. Can be: `none`, `start`, or `end`, and the default behavior is `none`. When sending a Command to a SIM in text mode, we can automatically include the SID of the Command in the message body, which could be used to ensure that the device does not process the same Command more than once.  A value of `start` will prepend the message with the Command SID, and `end` will append it to the end, separating the Command SID from the message body with a space. The length of the Command SID is included in the 160 character limit so the SMS body must be 128 characters or less before the Command SID is included.
        :param delivery_receipt_requested: Whether to request delivery receipt from the recipient. For Commands that request delivery receipt, the Command state transitions to 'delivered' once the server has received a delivery receipt from the device. The default value is `true`.

        :returns: The created CommandInstance
        CommandSimCallbackMethodCallbackUrlr!   
IncludeSidDeliveryReceiptRequestedPOSTr   r   data)r   ofr   boolean_to_stringrX   creater   r   
rR   rC   r   r   r   rD   r   rF   r   r>   s
             r    r   zCommandList.create  s    0 y""1++),5,G.- -
 

 
 -&&	 ' 
 
 t}g666r   c                    K   t          j        ||||||t          j        |          d          }| j                            d| j        |           d{V }	t          | j        |	          S )a  
        Asynchronously create the CommandInstance

        :param command: The message body of the Command. Can be plain text in text mode or a Base64 encoded byte string in binary mode.
        :param sim: The `sid` or `unique_name` of the [SIM](https://www.twilio.com/docs/iot/wireless/api/sim-resource) to send the Command to.
        :param callback_method: The HTTP method we use to call `callback_url`. Can be: `POST` or `GET`, and the default is `POST`.
        :param callback_url: The URL we call using the `callback_url` when the Command has finished sending, whether the command was delivered or it failed.
        :param command_mode:
        :param include_sid: Whether to include the SID of the command in the message body. Can be: `none`, `start`, or `end`, and the default behavior is `none`. When sending a Command to a SIM in text mode, we can automatically include the SID of the Command in the message body, which could be used to ensure that the device does not process the same Command more than once.  A value of `start` will prepend the message with the Command SID, and `end` will append it to the end, separating the Command SID from the message body with a space. The length of the Command SID is included in the 160 character limit so the SMS body must be 128 characters or less before the Command SID is included.
        :param delivery_receipt_requested: Whether to request delivery receipt from the recipient. For Commands that request delivery receipt, the Command state transitions to 'delivered' once the server has received a delivery receipt from the device. The default value is `true`.

        :returns: The created CommandInstance
        r   r   r   N)r   r   r   r   rX   create_asyncr   r   r   s
             r    r   zCommandList.create_async@  s      0 y""1++),5,G.- -
 

 
 22	 3 
 
 
 
 
 
 
 
 t}g666r   NrG   r*   rH   r#   rE   r7   limit	page_sizec                     | j                             ||          }|                     |||||d                   }| j                             ||d                   S )a  
        Streams CommandInstance 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 resources](https://www.twilio.com/docs/iot/wireless/api/sim-resource) to read.
        :param &quot;CommandInstance.Status&quot; status: The status of the resources to read. Can be: `queued`, `sent`, `delivered`, `received`, or `failed`.
        :param &quot;CommandInstance.Direction&quot; direction: Only return Commands with this direction value.
        :param &quot;CommandInstance.Transport&quot; transport: Only return Commands with this transport value. Can be: `sms` or `ip`.
        :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   rG   rH   rE   r   r   )rX   read_limitspagestream	rR   r   rG   rH   rE   r   r   limitsr   s	            r    r   zCommandList.streamn  se    8 **5)<<yy[)  
 
 }##D&/:::r   c                    K   | j                             ||          }|                     |||||d                    d{V }| j                             ||d                   S )a  
        Asynchronously streams CommandInstance 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 resources](https://www.twilio.com/docs/iot/wireless/api/sim-resource) to read.
        :param &quot;CommandInstance.Status&quot; status: The status of the resources to read. Can be: `queued`, `sent`, `delivered`, `received`, or `failed`.
        :param &quot;CommandInstance.Direction&quot; direction: Only return Commands with this direction value.
        :param &quot;CommandInstance.Transport&quot; transport: Only return Commands with this transport value. Can be: `sms` or `ip`.
        :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   )rX   r   
page_asyncstream_asyncr   s	            r    r   zCommandList.stream_async  s      8 **5)<<__[) % 
 
 
 
 
 
 
 
 }))$w@@@r   c           
      R    t          |                     ||||||                    S )a  
        Lists CommandInstance 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 resources](https://www.twilio.com/docs/iot/wireless/api/sim-resource) to read.
        :param &quot;CommandInstance.Status&quot; status: The status of the resources to read. Can be: `queued`, `sent`, `delivered`, `received`, or `failed`.
        :param &quot;CommandInstance.Direction&quot; direction: Only return Commands with this direction value.
        :param &quot;CommandInstance.Transport&quot; transport: Only return Commands with this transport value. Can be: `sms` or `ip`.
        :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   rG   rH   rE   r   r   )listr   rR   r   rG   rH   rE   r   r   s          r    r   zCommandList.list  s>    6 KK###   	
 	
 		
r   c           	      h   K   d |                      ||||||           d{V 2              d{V S )a-  
        Asynchronously lists CommandInstance 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 resources](https://www.twilio.com/docs/iot/wireless/api/sim-resource) to read.
        :param &quot;CommandInstance.Status&quot; status: The status of the resources to read. Can be: `queued`, `sent`, `delivered`, `received`, or `failed`.
        :param &quot;CommandInstance.Direction&quot; direction: Only return Commands with this direction value.
        :param &quot;CommandInstance.Transport&quot; transport: Only return Commands with this transport value. Can be: `sms` or `ip`.
        :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                 $   K   g | 3 d {V 	 }|6 S rz   r   )ro   records     r    
<listcomp>z*CommandList.list_async.<locals>.<listcomp>  sO       

 

 

 

 

 

 

 

 

 

 

 

 

s   r   N)r   r   s          r    
list_asynczCommandList.list_async  s      6

 

&*&7&7### '8 ' ' ! ! ! ! ! !

 

 

 

 

 

 

 

 

 
	
r   
page_tokenpage_numberc           
          t          j        |||||||d          }| j                            d| j        |          }	t          | j        |	          S )a$  
        Retrieve a single page of CommandInstance records from the API.
        Request is executed immediately

        :param sim: The `sid` or `unique_name` of the [Sim resources](https://www.twilio.com/docs/iot/wireless/api/sim-resource) to read.
        :param status: The status of the resources to read. Can be: `queued`, `sent`, `delivered`, `received`, or `failed`.
        :param direction: Only return Commands with this direction value.
        :param transport: Only return Commands with this transport value. Can be: `sms` or `ip`.
        :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 CommandInstance
        r   r5   r(   r<   	PageTokenr   PageSizer   r   r   params)r   r   rX   r   r   r   
rR   r   rG   rH   rE   r   r   r   r   responses
             r    r   zCommandList.page	  sf    0 y &&'#% 

 

 =%%U	$%OO4=(333r   c           
         K   t          j        |||||||d          }| j                            d| j        |           d{V }	t          | j        |	          S )a3  
        Asynchronously retrieve a single page of CommandInstance records from the API.
        Request is executed immediately

        :param sim: The `sid` or `unique_name` of the [Sim resources](https://www.twilio.com/docs/iot/wireless/api/sim-resource) to read.
        :param status: The status of the resources to read. Can be: `queued`, `sent`, `delivered`, `received`, or `failed`.
        :param direction: Only return Commands with this direction value.
        :param transport: Only return Commands with this transport value. Can be: `sms` or `ip`.
        :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 CommandInstance
        r   r   r   N)r   r   rX   r   r   r   r   s
             r    r   zCommandList.page_async0  s      0 y &&'#% 

 

 11di 2 
 
 
 
 
 
 
 
 4=(333r   
target_urlc                 v    | j         j        j                            d|          }t	          | j         |          S )z
        Retrieve a specific page of CommandInstance records from the API.
        Request is executed immediately

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

        :returns: Page of CommandInstance
        r   )rX   domaintwiliorequestr   rR   r   r   s      r    get_pagezCommandList.get_pageY  s3     ='.66ujII4=(333r   c                    K   | j         j        j                            d|           d{V }t	          | j         |          S )a  
        Asynchronously retrieve a specific page of CommandInstance records from the API.
        Request is executed immediately

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

        :returns: Page of CommandInstance
        r   N)rX   r   r   request_asyncr   r   s      r    get_page_asynczCommandList.get_page_asynce  sI       -4BB5*UUUUUUUU4=(333r   r?   c                 .    t          | j        |          S zl
        Constructs a CommandContext

        :param sid: The SID of the Command resource to fetch.
        rW   rU   rX   rR   r?   s     r    rN   zCommandList.getq       dm5555r   c                 .    t          | j        |          S r   r   r   s     r    __call__zCommandList.__call__y  r   r   c                     dS )rh   z <Twilio.Wireless.V1.CommandList>r   rY   s    r    ry   zCommandList.__repr__  r   r   )!r   r   r   r   rM   r   unsetr|   r   r{   r~   r   r   r   r   intr	   r   r
   r   r   r   r   r   r   r   r   r   rU   rN   r   ry   r   r   s   @r    r   r     s       	  	  	  	  	  	  	  #),.4l+1<EK\*0,:@,,7 ,7,7 3;,7 sF{+	,7
 CK(,7 96AB,7 3;',7 %*$,$7,7 
,7 ,7 ,7 ,7b #),.4l+1<EK\*0,:@,,7 ,7,7 3;,7 sF{+	,7
 CK(,7 96AB,7 3;',7 %*$,$7,7 
,7 ,7 ,7 ,7` #),:@,@F@F##'%; %;3;%; .67%; 4f<=	%;
 4f<=%; }%; C=%; 
/	"%; %; %; %;R #),:@,@F@F##'%A %A3;%A .67%A 4f<=	%A
 4f<=%A }%A C=%A 
	'%A %A %A %AR #),:@,@F@F##'$
 $
3;$
 .67$
 4f<=	$

 4f<=$
 }$
 C=$
 
o	$
 $
 $
 $
P #),:@,@F@F##'%
 %
3;%
 .67%
 4f<=	%

 4f<=%
 }%
 C=%
 
o	%
 %
 %
 %
R #),:@,@F@F)/*0,(.%4 %43;%4 .67%4 4f<=	%4
 4f<=%4 #v+&%4 3;'%4 f%%4 
%4 %4 %4 %4R #),:@,@F@F)/*0,(.'4 '43;'4 .67'4 4f<=	'4
 4f<='4 #v+&'4 3;''4 f%'4 
'4 '4 '4 '4R
43 
4; 
4 
4 
4 
4
4s 
4{ 
4 
4 
4 
46s 6~ 6 6 6 66C 6N 6 6 6 62# 2 2 2 2 2 2 2 2r   r   N)__doc__r   typingr   r   r   r   r   r	   r
   twilio.baser   r   r   twilio.base.instance_contextr   twilio.base.instance_resourcer   twilio.base.list_resourcer   twilio.base.versionr   twilio.base.pager   r   rU   r   r   r   r   r    <module>r      s          L L L L L L L L L L L L L L L L L L 6 6 6 6 6 6 6 6 6 6 8 8 8 8 8 8 : : : : : : 2 2 2 2 2 2 ' ' ' ' ' ' ! ! ! ! ! !}I }I }I }I }I& }I }I }I@VH VH VH VH VH_ VH VH VHr2 2 2 2 2$ 2 2 2&B2 B2 B2 B2 B2, B2 B2 B2 B2 B2r   