U
    ^g%i:                     @   s   d Z ddlmZmZmZmZmZ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 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 - Pricing
    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.
    )AnyDictListOptionalUnionIteratorAsyncIterator)values)InstanceContext)InstanceResource)ListResource)Version)Pagec                       st   e Zd ZdZdeeeef ee d fddZ	e
dddd	Zd dd
dZd dddZedddZ  ZS )CountryInstanceaI  
    :ivar country: The name of the country.
    :ivar iso_country: The [ISO country code](http://en.wikipedia.org/wiki/ISO_3166-1_alpha-2).
    :ivar outbound_sms_prices: The list of [OutboundSMSPrice](https://www.twilio.com/docs/sms/api/pricing#outbound-sms-price) records that represent the price to send a message for each MCC/MNC applicable in this country.
    :ivar inbound_sms_prices: The list of [InboundPrice](https://www.twilio.com/docs/sms/api/pricing#inbound-price) records that describe the price to receive an inbound SMS to the different Twilio phone number types supported in this country
    :ivar price_unit: The currency in which prices are measured, specified in [ISO 4127](http://www.iso.org/iso/home/standards/currency_codes.htm) format (e.g. `usd`, `eur`, `jpy`).
    :ivar url: The absolute URL of the resource.
    N)versionpayloadiso_countryc                    sn   t  | |d| _|d| _|d| _|d| _|d| _|d| _d|p^| ji| _	d | _
d S )Ncountryr   outbound_sms_pricesinbound_sms_prices
price_uniturl)super__init__getr   r   r   r   r   r   	_solution_context)selfr   r   r   	__class__ g/var/www/html/api-medvista/venv/lib/python3.8/site-packages/twilio/rest/pricing/v1/messaging/country.pyr   "   s     zCountryInstance.__init__CountryContextreturnc                 C   s&   | j dk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: CountryContext for this CountryInstance
        Nr   r   )r   r"   _versionr   r   r    r    r!   _proxy8   s    
zCountryInstance._proxyc                 C   s
   | j  S )[
        Fetch the CountryInstance


        :returns: The fetched CountryInstance
        )r(   fetchr'   r    r    r!   r*   G   s    zCountryInstance.fetchc                    s   | j  I dH S )u
        Asynchronous coroutine to fetch the CountryInstance


        :returns: The fetched CountryInstance
        N)r(   fetch_asyncr'   r    r    r!   r,   P   s    zCountryInstance.fetch_asyncc                 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>_   s     z+CountryInstance.__repr__.<locals>.<genexpr>z&<Twilio.Pricing.V1.CountryInstance {}>joinr   itemsr1   r   contextr    r    r!   __repr__Y   s    zCountryInstance.__repr__)N)__name__
__module____qualname____doc__r   r   strr   r   r   propertyr(   r*   r,   r<   __classcell__r    r    r   r!   r      s    
		r   c                       sN   e Zd Zeed fddZedddZedddZedd	d
Z	  Z
S )r"   )r   r   c                    s*   t  | d|i| _djf | j| _dS )z
        Initialize the CountryContext

        :param version: Version that contains the resource
        :param iso_country: The [ISO country code](http://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) of the pricing information to fetch.
        r   z"/Messaging/Countries/{iso_country}N)r   r   r   r1   _uri)r   r   r   r   r    r!   r   e   s
     zCountryContext.__init__r#   c                 C   s<   t i }d|d< | jjd| j|d}t| j|| jd dS )r)   application/jsonAcceptGETmethoduriheadersr   r%   )r	   ofr&   r*   rD   r   r   r   rK   r   r    r    r!   r*   t   s    
zCountryContext.fetchc                    sB   t i }d|d< | jjd| j|dI dH }t| j|| jd dS )r+   rE   rF   rG   rH   Nr   r%   )r	   rL   r&   r,   rD   r   r   rM   r    r    r!   r,      s    
  zCountryContext.fetch_asyncc                 C   s$   d dd | j D }d|S )r-   r.   c                 s   s   | ]\}}d  ||V  qdS r/   r0   r2   r    r    r!   r6      s     z*CountryContext.__repr__.<locals>.<genexpr>z%<Twilio.Pricing.V1.CountryContext {}>r7   r:   r    r    r!   r<      s    zCountryContext.__repr__)r=   r>   r?   r   rA   r   r   r*   r,   r<   rC   r    r    r   r!   r"   c   s   r"   c                   @   s2   e Zd Zeeef edddZedddZdS )CountryPage)r   r$   c                 C   s   t | j|S )zm
        Build an instance of CountryInstance

        :param payload: Payload response from the API
        )r   r&   )r   r   r    r    r!   get_instance   s    zCountryPage.get_instancer#   c                 C   s   dS )r-   z<Twilio.Pricing.V1.CountryPage>r    r'   r    r    r!   r<      s    zCountryPage.__repr__N)	r=   r>   r?   r   rA   r   r   rO   r<   r    r    r    r!   rN      s   rN   c                       sd  e Zd Z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edddZeedddZedddZ  ZS )$CountryList)r   c                    s   t  | d| _dS )zi
        Initialize the CountryList

        :param version: Version that contains the resource

        z/Messaging/CountriesN)r   r   rD   )r   r   r   r    r!   r      s    zCountryList.__init__N)limit	page_sizer$   c                 C   s0   | j ||}| j|d d}| j ||d S )a]  
        Streams CountryInstance 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
        rR   rR   rQ   )r&   read_limitspagestreamr   rQ   rR   ZlimitsrU   r    r    r!   rV      s    zCountryList.streamc                    s6   | j ||}| j|d dI dH }| j ||d S )al  
        Asynchronously streams CountryInstance 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
        rR   rS   NrQ   )r&   rT   
page_asyncstream_asyncrW   r    r    r!   rY      s    zCountryList.stream_asyncc                 C   s   t | j||dS )a  
        Lists CountryInstance 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
        rQ   rR   )listrV   r   rQ   rR   r    r    r!   r[      s    zCountryList.listc                    s$   dd | j ||dI dH 2 I dH S )a	  
        Asynchronously lists CountryInstance 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    )r3   recordr    r    r!   
<listcomp>'  s   z*CountryList.list_async.<locals>.<listcomp>rZ   N)rY   r\   r    r    r!   
list_async  s    
zCountryList.list_async)
page_tokenpage_numberrR   r$   c                 C   sJ   t |||d}t ddi}d|d< | jjd| j||d}t| j|S )as  
        Retrieve a single page of CountryInstance 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 CountryInstance
        Z	PageTokenr   ZPageSizeContent-Type!application/x-www-form-urlencodedrE   rF   rG   rI   rJ   paramsrK   )r	   rL   r&   rU   rD   rN   r   r`   ra   rR   datarK   responser    r    r!   rU   /  s       zCountryList.pagec                    sP   t |||d}t ddi}d|d< | jjd| j||dI dH }t| j|S )	a  
        Asynchronously retrieve a single page of CountryInstance 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 CountryInstance
        rb   rc   rd   rE   rF   rG   re   N)r	   rL   r&   rX   rD   rN   rg   r    r    r!   rX   P  s       zCountryList.page_async)
target_urlr$   c                 C   s   | j jjd|}t| j |S )z
        Retrieve a specific page of CountryInstance records from the API.
        Request is executed immediately

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

        :returns: Page of CountryInstance
        rG   )r&   domaintwiliorequestrN   r   rj   ri   r    r    r!   get_pageq  s    	zCountryList.get_pagec                    s$   | j jjd|I dH }t| j |S )a  
        Asynchronously retrieve a specific page of CountryInstance records from the API.
        Request is executed immediately

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

        :returns: Page of CountryInstance
        rG   N)r&   rk   rl   Zrequest_asyncrN   rn   r    r    r!   get_page_async}  s    	zCountryList.get_page_async)r   r$   c                 C   s   t | j|dS z
        Constructs a CountryContext

        :param iso_country: The [ISO country code](http://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) of the pricing information to fetch.
        r%   r"   r&   r   r   r    r    r!   r     s    zCountryList.getc                 C   s   t | j|dS rq   rr   rs   r    r    r!   __call__  s    zCountryList.__call__r#   c                 C   s   dS )r-   z<Twilio.Pricing.V1.CountryList>r    r'   r    r    r!   r<     s    zCountryList.__repr__)NN)NN)NN)NN)r=   r>   r?   r   r   r   intr   r   rV   r   rY   r   r[   r_   r	   unsetr   rA   objectrN   rU   rX   ro   rp   r"   r   rt   r<   rC   r    r    r   r!   rP      sh           


#


!rP   N)r@   typingr   r   r   r   r   r   r   Ztwilio.baser	   Ztwilio.base.instance_contextr
   Ztwilio.base.instance_resourcer   Ztwilio.base.list_resourcer   Ztwilio.base.versionr   Ztwilio.base.pager   r   r"   rN   rP   r    r    r    r!   <module>   s   $KE