
    pi:M                         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 - Preview
    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                   r     e Zd Zd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 )CommandInstancez
    :ivar sid:
    :ivar account_sid:
    :ivar device_sid:
    :ivar sim_sid:
    :ivar command:
    :ivar command_mode:
    :ivar status:
    :ivar direction:
    :ivar date_created:
    :ivar date_updated:
    :ivar url:
    versionpayloadsidc                    t         |   |       |j                  d      | _        |j                  d      | _        |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 )Nr   account_sid
device_sidsim_sidcommandcommand_modestatus	directiondate_createddate_updatedurl)super__init__getr   r   r   r   r   r   r   r   r   iso8601_datetimer   r    r!   	_solution_context)selfr   r   r   	__class__s       f/opt/services/ai/voice_agent/venv/lib/python3.12/site-packages/twilio/rest/preview/wireless/command.pyr#   zCommandInstance.__init__(   s    	!")++e"4*1++m*D)0\)B&-kk)&<&-kk)&<+2;;~+F%,[[%:(/K(@0;0L0LKK'1
 1<0L0LKK'1
 #*++e"4 3?$((
 37    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: CommandContext for this CommandInstance
        r   r   )r'   CommandContext_versionr&   r(   s    r*   _proxyzCommandInstance._proxyB   s9     == *NN5)DM }}r+   c                 6    | j                   j                         S )[
        Fetch the CommandInstance


        :returns: The fetched CommandInstance
        )r2   fetchr1   s    r*   r5   zCommandInstance.fetchQ   s     {{  ""r+   c                 R   K   | j                   j                          d{   S 7 w)u
        Asynchronous coroutine to fetch the CommandInstance


        :returns: The fetched CommandInstance
        N)r2   fetch_asyncr1   s    r*   r8   zCommandInstance.fetch_asyncZ   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+CommandInstance.__repr__.<locals>.<genexpr>i        SDAq7>>!Q/S   !z,<Twilio.Preview.Wireless.CommandInstance {}>joinr&   itemsr?   r(   contexts     r*   __repr__zCommandInstance.__repr__c   s6     ((SDNN<P<P<RSS=DDWMMr+   )N)r,   r/   )r,   r   )__name__
__module____qualname____doc__r   r   strr   r   r#   propertyr2   r5   r8   rL   __classcell__r)   s   @r*   r   r      sd     OS77)-c3h7>Fsm74  #/N# N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 )r/   r   r   c                 x    t         |   |       d|i| _         dj                  di | j                  | _        y)z
        Initialize the CommandContext

        :param version: Version that contains the resource
        :param sid:
        r   z/Commands/{sid}N )r"   r#   r&   r?   _uri)r(   r   r   r)   s      r*   r#   zCommandContext.__init__o   s@     	! 3
 -%,,>t~~>	r+   r,   c                     t        j                  i       }d|d<   | j                  j                  d| j                  |      }t        | j                  || j                  d         S )r4   application/jsonAcceptGETmethoduriheadersr   r.   )r   ofr0   r5   rX   r   r&   r(   r`   r   s      r*   r5   zCommandContext.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)r7   rZ   r[   r\   r]   Nr   r.   )r   ra   r0   r8   rX   r   r&   rb   s      r*   r8   zCommandContext.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 )r:   r;   c              3   F   K   | ]  \  }}d j                  ||        ywr=   r>   r@   s      r*   rD   z*CommandContext.__repr__.<locals>.<genexpr>   rE   rF   z+<Twilio.Preview.Wireless.CommandContext {}>rG   rJ   s     r*   rL   zCommandContext.__repr__   s6     ((SDNN<P<P<RSS<CCGLLr+   )rM   rN   rO   r   rQ   r#   r   r5   r8   rL   rS   rT   s   @r*   r/   r/   m   s<    ? ?c ?
 
(
? 
,M# Mr+   r/   c                   2    e Zd Zdeeef   defdZdefdZy)CommandPager   r,   c                 .    t        | j                  |      S )zm
        Build an instance of CommandInstance

        :param payload: Payload response from the API
        )r   r0   )r(   r   s     r*   get_instancezCommandPage.get_instance   s     t}}g66r+   c                      y)r:   z%<Twilio.Preview.Wireless.CommandPage>rW   r1   s    r*   rL   zCommandPage.__repr__        7r+   N)	rM   rN   rO   r   rQ   r   r   ri   rL   rW   r+   r*   rg   rg      s)    7DcN 7 77# 7r+   rg   c                   H    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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deee	f   deee	f   dee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                  ddfdeee	f   deee	f   deee	f   dee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ee	f   dee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ee	f   dee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ee	f   dee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ee	f   dee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ee	f   dee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                 2    t         |   |       d| _        y)zi
        Initialize the CommandList

        :param version: Version that contains the resource

        z	/CommandsN)r"   r#   rX   )r(   r   r)   s     r*   r#   zCommandList.__init__   s     	!	r+   r   devicesimcallback_methodcallback_urlr   include_sidr,   c           
          t        j                  |||||||d      }t        j                  ddi      }	d|	d<   d|	d<   | j                  j                  d| j                  ||	      }
t        | j                  |
      S )a  
        Create the CommandInstance

        :param command:
        :param device:
        :param sim:
        :param callback_method:
        :param callback_url:
        :param command_mode:
        :param include_sid:

        :returns: The created CommandInstance
        CommandDeviceSimCallbackMethodCallbackUrlCommandMode
IncludeSidContent-Type!application/x-www-form-urlencodedrZ   r[   POSTr^   r_   datar`   )r   ra   r0   createrX   r   r(   r   ro   rp   rq   rr   r   rs   r   r`   r   s              r*   r   zCommandList.create   s    0 yy" "1++)

 ))^-PQR"E.--&&tyytW ' 
 t}}g66r+   c           
        K   t        j                  |||||||d      }t        j                  ddi      }	d|	d<   d|	d<   | j                  j                  d| j                  ||	       d{   }
t        | j                  |
      S 7 w)	a$  
        Asynchronously create the CommandInstance

        :param command:
        :param device:
        :param sim:
        :param callback_method:
        :param callback_url:
        :param command_mode:
        :param include_sid:

        :returns: The created CommandInstance
        ru   r}   r~   rZ   r[   r   r   N)r   ra   r0   create_asyncrX   r   r   s              r*   r   zCommandList.create_async  s     0 yy" "1++)

 ))^-PQR"E.22tyytW 3 
 
 t}}g66	
s   A+B
-B.B
Nr   r   limit	page_sizec                     | j                   j                  ||      }| j                  |||||d         }| j                   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 device:
        :param str sim:
        :param str status:
        :param str direction:
        :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   ro   rp   r   r   r   r   )r0   read_limitspagestream	r(   ro   rp   r   r   r   r   limitsr   s	            r*   r   zCommandList.stream0  s^    8 **5)<yy[)  
 }}##D&/::r+   c                    K   | j                   j                  ||      }| j                  |||||d          d{   }| j                   j                  ||d         S 7 #w)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 device:
        :param str sim:
        :param str status:
        :param str direction:
        :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   )r0   r   
page_asyncstream_asyncr   s	            r*   r   zCommandList.stream_asyncW  sl     8 **5)<__[) % 
 
 }}))$w@@
s   9A!A$A!c           
      B    t        | j                  ||||||            S )af  
        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 device:
        :param str sim:
        :param str status:
        :param str direction:
        :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
        ro   rp   r   r   r   r   )listr   )r(   ro   rp   r   r   r   r   s          r*   r   zCommandList.list~  s4    6 KK##  	
 		
r+   c                    K   | j                  ||||||       d{   2 cg c3 d{   }|7 7 	6 c}S c c}w w)au  
        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 device:
        :param str sim:
        :param str status:
        :param str direction:
        :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(   ro   rp   r   r   r   r   records           r*   
list_asynczCommandList.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 CommandInstance records from the API.
        Request is executed immediately

        :param device:
        :param sim:
        :param status:
        :param direction:
        :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
        rw   rx   Status	Direction	PageTokenr   PageSizer}   r~   rZ   r[   r\   r^   r_   paramsr`   )r   ra   r0   r   rX   rg   r(   ro   rp   r   r   r   r   r   r   r`   responses              r*   r   zCommandList.page  s    0 yy  &'#%

 ))^-PQR.==%%diig & 
 4==(33r+   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 CommandInstance records from the API.
        Request is executed immediately

        :param device:
        :param sim:
        :param status:
        :param direction:
        :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~   rZ   r[   r\   r   N)r   ra   r0   r   rX   rg   r   s              r*   r   zCommandList.page_async  s     0 yy  &'#%

 ))^-PQR.11diig 2 
 
 4==(33
s   A&B(B)B
target_urlc                     | j                   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\   )r0   domaintwiliorequestrg   r(   r   r   s      r*   get_pagezCommandList.get_page%  s7     ==''..66ujI4==(33r+   c                    K   | j                   j                  j                  j                  d|       d{   }t	        | j                   |      S 7 w)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)r0   r   r   request_asyncrg   r   s      r*   get_page_asynczCommandList.get_page_async1  sD      --44BB5*UU4==(33 Vs   4AAAr   c                 0    t        | j                  |      S zB
        Constructs a CommandContext

        :param sid:
        r.   r/   r0   r(   r   s     r*   r$   zCommandList.get=       dmm55r+   c                 0    t        | j                  |      S r   r   r   s     r*   __call__zCommandList.__call__E  r   r+   c                      y)r:   z%<Twilio.Preview.Wireless.CommandList>rW   r1   s    r*   rL   zCommandList.__repr__M  rk   r+   ) rM   rN   rO   r   r#   r   unsetrQ   r   objectr   r   r   r   intr	   r   r
   r   r   r   r   rg   r   r   r   r   r/   r$   r   rL   rS   rT   s   @r*   rm   rm      s   	  	  &,\\"(,,.4ll+1<<+1<<*0,,-7-7 c6k"-7 3;	-7
 sF{+-7 CK(-7 CK(-7 3;'-7 
-7d &,\\"(,,.4ll+1<<+1<<*0,,-7-7 c6k"-7 3;	-7
 sF{+-7 CK(-7 CK(-7 3;'-7 
-7b &,\\"(,,%+\\(.##'%;c6k"%; 3;%; c6k"	%;
 f%%; }%; C=%; 
/	"%;R &,\\"(,,%+\\(.##'%Ac6k"%A 3;%A c6k"	%A
 f%%A }%A C=%A 
	'%AR &,\\"(,,%+\\(.##'$
c6k"$
 3;$
 c6k"	$

 f%$
 }$
 C=$
 
o	$
P &,\\"(,,%+\\(.##'%
c6k"%
 3;%
 c6k"	%

 f%%
 }%
 C=%
 
o	%
R &,\\"(,,%+\\(.)/*0,,(.+4c6k"+4 3;+4 c6k"	+4
 f%+4 #v+&+4 3;'+4 f%+4 
+4^ &,\\"(,,%+\\(.)/*0,,(.+4c6k"+4 3;+4 c6k"	+4
 f%+4 #v+&+4 3;'+4 f%+4 
+4Z
43 
4; 
4
4s 
4{ 
46s 6~ 66C 6N 67# 7r+   rm   N)rP   r   typingr   r   r   r   r   r	   r
   twilio.baser   r   twilio.base.instance_contextr   twilio.base.instance_resourcer   twilio.base.list_resourcer   twilio.base.versionr   twilio.base.pager   r   r/   rg   rm   rW   r+   r*   <module>r      sg     L L L + 8 : 2 ' !QN& QNhBM_ BMJ7$ 7&N7, N7r+   