U
    ^g%i39                     @   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                       s@   e Zd ZdZeeeef ed fddZed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   Ziso8601_datetimer   r    r!   r"   	_solution)selfr   r   r   	__class__ g/var/www/html/api-medvista/venv/lib/python3.8/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                   @   s2   e Zd Zeeef edddZedddZdS )DataSessionPage)r   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_instancer-   c                 C   s   dS )r/   z$<Twilio.Wireless.V1.DataSessionPage>r+   r(   r+   r+   r,   r9   e   s    zDataSessionPage.__repr__N)	r:   r;   r<   r   r>   r   r   rB   r9   r+   r+   r+   r,   r@   Y   s   
r@   c                       sF  e Zd Zeed fddZdee ee ee	 dddZ
dee ee ee	 ddd	Zdee ee ee	 dd
dZdee ee ee	 dddZejejejfeeef eeef eeef edddZejejejfeeef eeef eeef edddZeedddZeedddZedddZ  ZS )DataSessionList)r   r   c                    s*   t  | d|i| _djf | 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}/DataSessionsN)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
        rG   rG   rF   )rA   read_limitspagestreamr(   rF   rG   ZlimitsrJ   r+   r+   r,   rK      s    zDataSessionList.streamc                    s6   | 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
        rG   rH   NrF   )rA   rI   
page_asyncstream_asyncrL   r+   r+   r,   rN      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
        rF   rG   )listrK   r(   rF   rG   r+   r+   r,   rP      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>rO   N)rN   rQ   r+   r+   r,   
list_async   s    
zDataSessionList.list_async)
page_tokenpage_numberrG   r.   c                 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
        Z	PageTokenr   ZPageSizeContent-Type!application/x-www-form-urlencodedapplication/jsonAcceptGETmethoduriparamsheaders)r   ofrA   rJ   rE   r@   r'   r(   rU   rV   rG   datara   responser+   r+   r,   rJ      s       zDataSessionList.pagec                    sT   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
        rW   rX   rY   rZ   r[   r\   r]   N)r   rb   rA   rM   rE   r@   r'   rc   r+   r+   r,   rM     s       zDataSessionList.page_async)
target_urlr.   c                 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
        r\   )rA   domaintwiliorequestr@   r'   r(   rf   re   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
        r\   N)rA   rg   rh   Zrequest_asyncr@   r'   rj   r+   r+   r,   get_page_async5  s    	zDataSessionList.get_page_asyncr-   c                 C   s   dS )r/   z$<Twilio.Wireless.V1.DataSessionList>r+   rC   r+   r+   r,   r9   A  s    zDataSessionList.__repr__)NN)NN)NN)NN)r:   r;   r<   r   r>   r$   r   intr   r   rK   r	   rN   r   rP   rT   r   unsetr   objectr@   rJ   rM   rk   rl   r9   r?   r+   r+   r)   r,   rD   n   sd           


#


!rD   N)r=   r   typingr   r   r   r   r   r   r	   Ztwilio.baser
   r   Ztwilio.base.instance_resourcer   Ztwilio.base.list_resourcer   Ztwilio.base.versionr   Ztwilio.base.pager   r   r@   rD   r+   r+   r+   r,   <module>   s   $@