U
    ^g%i@0                     @   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 - Supersim
    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                       sL   e Zd ZG dd deZeeeef ed fddZ	edddZ
  ZS )	BillingPeriodInstancec                   @   s   e Zd ZdZdZdS )zBillingPeriodInstance.BpTypereadyZactiveN)__name__
__module____qualname__ZREADYZACTIVE r   r   i/var/www/html/api-medvista/venv/lib/python3.8/site-packages/twilio/rest/supersim/v1/sim/billing_period.pyBpType   s   r   )versionpayloadsim_sidc                    s   t  | |d| _|d| _|d| _t|d| _t|d| _	|d| _
t|d| _t|d| _d|i| _d S )	Nsidaccount_sidr   
start_timeend_timeperiod_typedate_createddate_updated)super__init__getr   r   r   r
   Ziso8601_datetimer   r   r   r    r!   	_solution)selfr   r   r   	__class__r   r   r#   *   s,     zBillingPeriodInstance.__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>J   s     z1BillingPeriodInstance.__repr__.<locals>.<genexpr>z-<Twilio.Supersim.V1.BillingPeriodInstance {}>)joinr%   itemsr-   )r&   contextr   r   r   __repr__D   s    zBillingPeriodInstance.__repr__)r   r   r   objectr   r   r   strr   r#   r5   __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 )BillingPeriodPage)r   r*   c                 C   s   t | j|| jd dS )zs
        Build an instance of BillingPeriodInstance

        :param payload: Payload response from the API
        r   )r   )r   _versionr%   )r&   r   r   r   r   get_instanceP   s
      zBillingPeriodPage.get_instancer)   c                 C   s   dS )r+   z&<Twilio.Supersim.V1.BillingPeriodPage>r   r&   r   r   r   r5   Z   s    zBillingPeriodPage.__repr__N)	r   r   r   r   r7   r   r   r;   r5   r   r   r   r   r9   N   s   
r9   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 )BillingPeriodList)r   r   c                    s*   t  | d|i| _djf | j| _dS )z
        Initialize the BillingPeriodList

        :param version: Version that contains the resource
        :param sim_sid: The SID of the Super SIM to list Billing Periods for.

        r   z/Sims/{sim_sid}/BillingPeriodsN)r"   r#   r%   r-   _uri)r&   r   r   r'   r   r   r#   e   s
     zBillingPeriodList.__init__N)limit	page_sizer*   c                 C   s0   | j ||}| j|d d}| j ||d S )ac  
        Streams BillingPeriodInstance 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
        r@   r@   r?   )r:   read_limitspagestreamr&   r?   r@   ZlimitsrC   r   r   r   rD   u   s    zBillingPeriodList.streamc                    s6   | j ||}| j|d dI dH }| j ||d S )ar  
        Asynchronously streams BillingPeriodInstance 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
        r@   rA   Nr?   )r:   rB   
page_asyncstream_asyncrE   r   r   r   rG      s    zBillingPeriodList.stream_asyncc                 C   s   t | j||dS )a   
        Lists BillingPeriodInstance 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
        r?   r@   )listrD   r&   r?   r@   r   r   r   rI      s    zBillingPeriodList.listc                    s$   dd | j ||dI dH 2 I dH S )a  
        Asynchronously lists BillingPeriodInstance 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   )r.   recordr   r   r   
<listcomp>   s   z0BillingPeriodList.list_async.<locals>.<listcomp>rH   N)rG   rJ   r   r   r   
list_async   s    
zBillingPeriodList.list_async)
page_tokenpage_numberr@   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 BillingPeriodInstance 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 BillingPeriodInstance
        Z	PageTokenr   ZPageSizeContent-Type!application/x-www-form-urlencodedapplication/jsonAcceptGETmethoduriparamsheaders)r   ofr:   rC   r>   r9   r%   r&   rN   rO   r@   datarZ   responser   r   r   rC      s       zBillingPeriodList.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 BillingPeriodInstance 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 BillingPeriodInstance
        rP   rQ   rR   rS   rT   rU   rV   N)r   r[   r:   rF   r>   r9   r%   r\   r   r   r   rF      s       zBillingPeriodList.page_async)
target_urlr*   c                 C   s"   | j jjd|}t| j || jS )z
        Retrieve a specific page of BillingPeriodInstance records from the API.
        Request is executed immediately

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

        :returns: Page of BillingPeriodInstance
        rU   )r:   domaintwiliorequestr9   r%   r&   r_   r^   r   r   r   get_page  s    	zBillingPeriodList.get_pagec                    s(   | j jjd|I dH }t| j || jS )a  
        Asynchronously retrieve a specific page of BillingPeriodInstance records from the API.
        Request is executed immediately

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

        :returns: Page of BillingPeriodInstance
        rU   N)r:   r`   ra   Zrequest_asyncr9   r%   rc   r   r   r   get_page_async*  s    	z BillingPeriodList.get_page_asyncr)   c                 C   s   dS )r+   z&<Twilio.Supersim.V1.BillingPeriodList>r   r<   r   r   r   r5   6  s    zBillingPeriodList.__repr__)NN)NN)NN)NN)r   r   r   r   r7   r#   r   intr   r   rD   r	   rG   r   rI   rM   r   unsetr   r6   r9   rC   rF   rd   re   r5   r8   r   r   r'   r   r=   c   sd           


#


!r=   N)__doc__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   r9   r=   r   r   r   r   <module>   s   $5