o
    /iI                     @   s   d Z ddlmZ ddlmZmZmZmZmZmZm	Z	 ddl
mZmZ ddlmZ ddlmZ ddlmZ ddlmZ dd	lmZ G d
d deZG dd deZG dd deZG dd deZdS )a  
    This code was generated by
   ___ _ _ _ _ _    _ ____    ____ ____ _    ____ ____ _  _ ____ ____ ____ ___ __   __
    |  | | | | |    | |  | __ |  | |__| | __ | __ |___ |\ | |___ |__/ |__|  | |  | |__/
    |  |_|_| | |___ | |__|    |__| |  | |    |__] |___ | \| |___ |  \ |  |  | |__| |  \

    Twilio - 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                       sn   e Zd ZdZ	ddedeeef dee f fddZ	e
dd
dZdddZdddZdefddZ  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:
    Nversionpayloadsidc                    s   t  | |d| _|d| _|d| _|d| _|d| _|d| _|d| _	|d| _
t|d	| _t|d
| _|d| _d|pS| ji| _d | _d S )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__ _/var/www/html/philips/venv/lib/python3.10/site-packages/twilio/rest/preview/wireless/command.pyr    *   s&   

zCommandInstance.__init__returnCommandContextc                 C   s&   | j du rt| j| jd d| _ | j S )z
        Generate an instance context for the instance, the context is capable of
        performing various actions. All instance actions are proxied to the context

        :returns: CommandContext for this CommandInstance
        Nr   r   )r$   r+   _versionr#   r%   r(   r(   r)   _proxyD   s   
zCommandInstance._proxyc                 C   s
   | j  S )[
        Fetch the CommandInstance


        :returns: The fetched CommandInstance
        )r/   fetchr.   r(   r(   r)   r1   S   s   
zCommandInstance.fetchc                    s   | j  I dH S )u
        Asynchronous coroutine to fetch the CommandInstance


        :returns: The fetched CommandInstance
        N)r/   fetch_asyncr.   r(   r(   r)   r3   \   s   zCommandInstance.fetch_asyncc                 C   $   d dd | j D }d|S )f
        Provide a friendly representation

        :returns: Machine friendly representation
         c                 s        | ]\}}d  ||V  qdS z{}={}Nformat.0kvr(   r(   r)   	<genexpr>k       z+CommandInstance.__repr__.<locals>.<genexpr>z,<Twilio.Preview.Wireless.CommandInstance {}>joinr#   itemsr:   r%   contextr(   r(   r)   __repr__e      
zCommandInstance.__repr__N)r*   r+   )r*   r   )__name__
__module____qualname____doc__r   r   strr   r   r    propertyr/   r1   r3   rF   __classcell__r(   r(   r&   r)   r      s    


		r   c                       sP   e Zd Zdedef fddZdefddZdefdd	Zdefd
dZ	  Z
S )r+   r   r   c                    s.   t  | d|i| _djdi | j| _dS )z
        Initialize the CommandContext

        :param version: Version that contains the resource
        :param sid:
        r   z/Commands/{sid}Nr(   )r   r    r#   r:   _uri)r%   r   r   r&   r(   r)   r    p   s   zCommandContext.__init__r*   c                 C   s(   | j jd| jd}t| j || jd dS )r0   GETmethodurir   r,   )r-   r1   rP   r   r#   r%   r   r(   r(   r)   r1      s   zCommandContext.fetchc                    s0   | j jd| jdI dH }t| j || jd dS )r2   rQ   rR   Nr   r,   )r-   r3   rP   r   r#   rU   r(   r(   r)   r3      s   zCommandContext.fetch_asyncc                 C   r4   )r5   r6   c                 s   r7   r8   r9   r;   r(   r(   r)   r?      r@   z*CommandContext.__repr__.<locals>.<genexpr>z+<Twilio.Preview.Wireless.CommandContext {}>rA   rD   r(   r(   r)   rF      rG   zCommandContext.__repr__)rI   rJ   rK   r   rM   r    r   r1   r3   rF   rO   r(   r(   r&   r)   r+   o   s
    r+   c                   @   s4   e Zd Zdeeef defddZdefddZdS )CommandPager   r*   c                 C   s   t | j|S )zm
        Build an instance of CommandInstance

        :param payload: Payload response from the API
        )r   r-   rU   r(   r(   r)   get_instance   s   zCommandPage.get_instancec                 C      dS )r5   z%<Twilio.Preview.Wireless.CommandPage>r(   r.   r(   r(   r)   rF         zCommandPage.__repr__N)	rI   rJ   rK   r   rM   r   r   rW   rF   r(   r(   r(   r)   rV      s    rV   c                       s   e Zd Zdef fd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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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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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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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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!d"Zd#edefd$d%Zd#edefd&d'Zd(edefd)d*Zd(edefd+d,Zdefd-d.Z  ZS )/CommandListr   c                    s   t  | d| _dS )zi
        Initialize the CommandList

        :param version: Version that contains the resource

        z	/CommandsN)r   r    rP   )r%   r   r&   r(   r)   r       s   
zCommandList.__init__r   devicesimcallback_methodcallback_urlr   include_sidr*   c           
   
   C   :   t |||||||d}| jjd| j|d}	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POSTrS   rT   data)r   ofr-   createrP   r   
r%   r   r[   r\   r]   r^   r   r_   rk   r   r(   r(   r)   rm      s    zCommandList.createc           
   
      B   t |||||||d}| jjd| j|dI dH }	t| j|	S )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
        ra   ri   rj   N)r   rl   r-   create_asyncrP   r   rn   r(   r(   r)   rp      s"   zCommandList.create_asyncNr   r   limit	page_sizec           	      C   s8   | j ||}| j|||||d 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 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
        rr   r[   r\   r   r   rr   rq   )r-   read_limitspagestream	r%   r[   r\   r   r   rq   rr   limitsru   r(   r(   r)   rv   #  s   zCommandList.streamc           	         s@   | j ||}| j|||||d dI dH }| 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 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
        rr   rs   Nrq   )r-   rt   
page_asyncstream_asyncrw   r(   r(   r)   rz   J  s   zCommandList.stream_asyncc              	   C   s   t | j||||||d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
        r[   r\   r   r   rq   rr   )listrv   r%   r[   r\   r   r   rq   rr   r(   r(   r)   r|   q  s   zCommandList.listc              	      s.   dd | j ||||||dI dH 2 I dH S )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
        c                    s   g | z3 d H W }|q6 S rH   r(   )r<   recordr(   r(   r)   
<listcomp>  s
    z*CommandList.list_async.<locals>.<listcomp>r{   N)rz   r}   r(   r(   r)   
list_async  s   
zCommandList.list_async
page_tokenpage_numberc           
   
   C   r`   )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
        rc   rd   Status	Direction	PageTokenr   PageSizerQ   rS   rT   params)r   rl   r-   ru   rP   rV   
r%   r[   r\   r   r   r   r   rr   rk   responser(   r(   r)   ru     s   zCommandList.pagec           
   
      ro   )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   rQ   r   N)r   rl   r-   ry   rP   rV   r   r(   r(   r)   ry     s   zCommandList.page_async
target_urlc                 C   s   | 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
        rQ   )r-   domaintwiliorequestrV   r%   r   r   r(   r(   r)   get_page  s   	zCommandList.get_pagec                    s&   | j jjd|I dH }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
        rQ   N)r-   r   r   request_asyncrV   r   r(   r(   r)   get_page_async  s   	zCommandList.get_page_asyncr   c                 C      t | j|dS zB
        Constructs a CommandContext

        :param sid:
        r,   r+   r-   r%   r   r(   r(   r)   r!   &     zCommandList.getc                 C   r   r   r   r   r(   r(   r)   __call__.  r   zCommandList.__call__c                 C   rX   )r5   z%<Twilio.Preview.Wireless.CommandList>r(   r.   r(   r(   r)   rF   6  rY   zCommandList.__repr__) rI   rJ   rK   r   r    r   unsetrM   r   objectr   rm   rp   r   intr   rv   r	   rz   r   r|   r   rV   ru   ry   r   r   r+   r!   r   rF   rO   r(   r(   r&   r)   rZ      sr   





	
.





	
-




)




)




(




)






	
)






	
)rZ   N)rL   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+   rV   rZ   r(   r(   r(   r)   <module>   s    $U@