o
    f>h39                     @   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 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 - 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values)InstanceResource)ListResource)Version)Pagec                       sD   e Zd ZdZdedeeef def fddZdefdd	Z	  Z
S )
DataSessionInstanceaR
  
    :ivar sid: The unique string that we created to identify the DataSession resource.
    :ivar sim_sid: The SID of the [Sim resource](https://www.twilio.com/docs/iot/wireless/api/sim-resource) that the Data Session is for.
    :ivar account_sid: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the DataSession resource.
    :ivar radio_link: The generation of wireless technology that the device was using.
    :ivar operator_mcc: The 'mobile country code' is the unique ID of the home country where the Data Session took place. See: [MCC/MNC lookup](http://mcc-mnc.com/).
    :ivar operator_mnc: The 'mobile network code' is the unique ID specific to the mobile operator network where the Data Session took place.
    :ivar operator_country: The three letter country code representing where the device's Data Session took place. This is determined by looking up the `operator_mcc`.
    :ivar operator_name: The friendly name of the mobile operator network that the [SIM](https://www.twilio.com/docs/iot/wireless/api/sim-resource)-connected device is attached to. This is determined by looking up the `operator_mnc`.
    :ivar cell_id: The unique ID of the cellular tower that the device was attached to at the moment when the Data Session was last updated.
    :ivar cell_location_estimate: An object that describes the estimated location in latitude and longitude where the device's Data Session took place. The location is derived from the `cell_id` when the Data Session was last updated. See [Cell Location Estimate Object](https://www.twilio.com/docs/iot/wireless/api/datasession-resource#cell-location-estimate-object).
    :ivar packets_uploaded: The number of packets uploaded by the device between the `start` time and when the Data Session was last updated.
    :ivar packets_downloaded: The number of packets downloaded by the device between the `start` time and when the Data Session was last updated.
    :ivar last_updated: The date that the resource was last updated, given as GMT in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format.
    :ivar start: The date that the Data Session started, given as GMT in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format.
    :ivar end: The date that the record ended, given as GMT in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format.
    :ivar imei: The 'international mobile equipment identity' is the unique ID of the device using the SIM to connect. An IMEI is a 15-digit string: 14 digits for the device identifier plus a check digit calculated using the Luhn formula.
    versionpayloadsim_sidc                    s   t  | |d| _|d| _|d| _|d| _|d| _|d| _|d| _	|d| _
|d	| _|d
| _t|d| _t|d| _t|d| _t|d| _t|d| _|d| _d|i| _d S )Nsidr   account_sid
radio_linkoperator_mccoperator_mncoperator_countryoperator_namecell_idcell_location_estimatepackets_uploadedpackets_downloadedlast_updatedstartendimei)super__init__getr   r   r   r   r   r   r   r   r   r   r
   integerr   r   iso8601_datetimer   r    r!   r"   	_solution)selfr   r   r   	__class__ [/var/www/html/venv/lib/python3.10/site-packages/twilio/rest/wireless/v1/sim/data_session.pyr$   -   s:   
zDataSessionInstance.__init__returnc                 C   s$   d dd | j D }d|S )f
        Provide a friendly representation

        :returns: Machine friendly representation
         c                 s   s     | ]\}}d  ||V  qdS )z{}={}N)format).0kvr,   r,   r-   	<genexpr>U   s    z/DataSessionInstance.__repr__.<locals>.<genexpr>z+<Twilio.Wireless.V1.DataSessionInstance {}>)joinr(   itemsr1   )r)   contextr,   r,   r-   __repr__O   s   
zDataSessionInstance.__repr__)__name__
__module____qualname____doc__r   r   strr   r$   r9   __classcell__r,   r,   r*   r-   r      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 )DataSessionPager   r.   c                 C   s   t | j|| jd dS )zq
        Build an instance of DataSessionInstance

        :param payload: Payload response from the API
        r   )r   )r   _versionr(   )r)   r   r,   r,   r-   get_instance[   s   zDataSessionPage.get_instancec                 C      dS )r/   z$<Twilio.Wireless.V1.DataSessionPage>r,   r)   r,   r,   r-   r9   e      zDataSessionPage.__repr__N)	r:   r;   r<   r   r>   r   r   rB   r9   r,   r,   r,   r-   r@   Y   s    
r@   c                	       sx  e Zd Zdedef fddZ		ddee dee dee	 fd	d
Z
		ddee dee dee	 fddZ		ddee dee dee	 fddZ		ddee dee dee	 fddZejejej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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fddZ  ZS )DataSessionListr   r   c                    s.   t  | d|i| _djdi | j| _dS )z
        Initialize the DataSessionList

        :param version: Version that contains the resource
        :param sim_sid: The SID of the [Sim resource](https://www.twilio.com/docs/iot/wireless/api/sim-resource) with the Data Sessions to read.

        r   z/Sims/{sim_sid}/DataSessionsNr,   )r#   r$   r(   r1   _uri)r)   r   r   r*   r,   r-   r$   p   s   zDataSessionList.__init__Nlimit	page_sizer.   c                 C   s0   | j ||}| j|d d}| j ||d S )aa  
        Streams DataSessionInstance 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 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
        rI   rI   rH   )rA   read_limitspagestreamr)   rH   rI   limitsrL   r,   r,   r-   rM      s   zDataSessionList.streamc                    s8   | j ||}| j|d dI dH }| j ||d S )ap  
        Asynchronously streams DataSessionInstance 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 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
        rI   rJ   NrH   )rA   rK   
page_asyncstream_asyncrN   r,   r,   r-   rQ      s   zDataSessionList.stream_asyncc                 C   s   t | j||dS )a  
        Lists DataSessionInstance records from the API as a list.
        Unlike stream(), this operation is eager and will load `limit` records into
        memory before returning.

        :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
        rH   rI   )listrM   r)   rH   rI   r,   r,   r-   rS      s   zDataSessionList.listc                    s&   dd | j ||dI dH 2 I dH S )a  
        Asynchronously lists DataSessionInstance records from the API as a list.
        Unlike stream(), this operation is eager and will load `limit` records into
        memory before returning.

        :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 )Nr,   )r2   recordr,   r,   r-   
<listcomp>   s
    z.DataSessionList.list_async.<locals>.<listcomp>rR   N)rQ   rT   r,   r,   r-   
list_async   s   
zDataSessionList.list_async
page_tokenpage_numberc                 C   sN   t |||d}t ddi}d|d< | jjd| j||d}t| j|| jS )a{  
        Retrieve a single page of DataSessionInstance records from the API.
        Request is executed immediately

        :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 DataSessionInstance
        	PageTokenr   PageSizeContent-Type!application/x-www-form-urlencodedapplication/jsonAcceptGETmethoduriparamsheaders)r   ofrA   rL   rG   r@   r(   r)   rX   rY   rI   datarf   responser,   r,   r-   rL      s   
zDataSessionList.pagec                    sV   t |||d}t ddi}d|d< | jjd| j||dI dH }t| j|| jS )	a  
        Asynchronously retrieve a single page of DataSessionInstance records from the API.
        Request is executed immediately

        :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 DataSessionInstance
        rZ   r]   r^   r_   r`   ra   rb   N)r   rg   rA   rP   rG   r@   r(   rh   r,   r,   r-   rP     s   
zDataSessionList.page_async
target_urlc                 C   s"   | j jjd|}t| j || jS )z
        Retrieve a specific page of DataSessionInstance records from the API.
        Request is executed immediately

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

        :returns: Page of DataSessionInstance
        ra   )rA   domaintwiliorequestr@   r(   r)   rk   rj   r,   r,   r-   get_page)  s   	zDataSessionList.get_pagec                    s*   | j jjd|I dH }t| j || jS )a
  
        Asynchronously retrieve a specific page of DataSessionInstance records from the API.
        Request is executed immediately

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

        :returns: Page of DataSessionInstance
        ra   N)rA   rl   rm   request_asyncr@   r(   ro   r,   r,   r-   get_page_async5  s   	zDataSessionList.get_page_asyncc                 C   rC   )r/   z$<Twilio.Wireless.V1.DataSessionList>r,   rD   r,   r,   r-   r9   A  rE   zDataSessionList.__repr__)NN)r:   r;   r<   r   r>   r$   r   intr   r   rM   r	   rQ   r   rS   rW   r   unsetr   objectr@   rL   rP   rp   rr   r9   r?   r,   r,   r*   r-   rF   n   s    







#



!rF   N)r=   r   typingr   r   r   r   r   r   r	   twilio.baser
   r   twilio.base.instance_resourcer   twilio.base.list_resourcer   twilio.base.versionr   twilio.base.pager   r   r@   rF   r,   r,   r,   r-   <module>   s    $@