o
    e+                     @   s   d 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 )za
This code was generated by
\ / _    _  _|   _  _
 | (_)\/(_)(_|\/| |(/_  v1.0.0
      /       /
    )values)InstanceContext)InstanceResource)ListResource)Pagec                       sf   e Zd Z fddZdddZdddZejejejfdd	Zd
d Z	dd Z
dd Zdd Z  ZS )CountryListc                    s.   t t| | i | _djdi | j| _dS )z
        Initialize the CountryList

        :param Version version: Version that contains the resource

        :returns: twilio.rest.pricing.v2.voice.country.CountryList
        :rtype: twilio.rest.pricing.v2.voice.country.CountryList
        z/Voice/CountriesN )superr   __init__	_solutionformat_uri)selfversion	__class__r   W/var/www/html/venv/lib/python3.10/site-packages/twilio/rest/pricing/v2/voice/country.pyr
      s   	zCountryList.__init__Nc                 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 int limit: Upper limit for the number of records to return. stream()
                          guarantees to never return more than limit.  Default is no limit
        :param int 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
        :rtype: list[twilio.rest.pricing.v2.voice.country.CountryInstance]
        	page_size)r   limit)_versionread_limitspagestream)r   r   r   limitsr   r   r   r   r   !   s   zCountryList.streamc                 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 int limit: Upper limit for the number of records to return. list() guarantees
                          never to return more than limit.  Default is no limit
        :param int 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: Generator that will yield up to limit results
        :rtype: list[twilio.rest.pricing.v2.voice.country.CountryInstance]
        )r   r   )listr   )r   r   r   r   r   r   r   8   s   zCountryList.listc                 C   s6   t |||d}| jjd| j|d}t| j|| jS )a  
        Retrieve a single page of CountryInstance records from the API.
        Request is executed immediately

        :param str page_token: PageToken provided by the API
        :param int page_number: Page Number, this value is simply for client state
        :param int page_size: Number of records to return, defaults to 50

        :returns: Page of CountryInstance
        :rtype: twilio.rest.pricing.v2.voice.country.CountryPage
        )	PageTokenr   PageSizeGET)methoduriparams)r   ofr   r   r   CountryPager   )r   
page_tokenpage_numberr   dataresponser   r   r   r   J   s   zCountryList.pagec                 C   s"   | j jjd|}t| j || jS )a8  
        Retrieve a specific page of CountryInstance records from the API.
        Request is executed immediately

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

        :returns: Page of CountryInstance
        :rtype: twilio.rest.pricing.v2.voice.country.CountryPage
        r   )r   domaintwiliorequestr"   r   )r   
target_urlr&   r   r   r   get_page]   s
   

zCountryList.get_pagec                 C      t | j|dS a  
        Constructs a CountryContext

        :param iso_country: The ISO country code of the pricing information to fetch

        :returns: twilio.rest.pricing.v2.voice.country.CountryContext
        :rtype: twilio.rest.pricing.v2.voice.country.CountryContext
        iso_countryCountryContextr   r   r/   r   r   r   getn      	zCountryList.getc                 C   r,   r-   r0   r2   r   r   r   __call__y   r4   zCountryList.__call__c                 C      dS )z
        Provide a friendly representation

        :returns: Machine friendly representation
        :rtype: str
        z<Twilio.Pricing.V2.CountryList>r   r   r   r   r   __repr__      zCountryList.__repr__)NN)__name__
__module____qualname__r
   r   r   r   unsetr   r+   r3   r5   r9   __classcell__r   r   r   r   r      s    


r   c                       ,   e Zd Z fddZdd Zdd Z  ZS )r"   c                    s   t t| || || _dS )a-  
        Initialize the CountryPage

        :param Version version: Version that contains the resource
        :param Response response: Response from the API

        :returns: twilio.rest.pricing.v2.voice.country.CountryPage
        :rtype: twilio.rest.pricing.v2.voice.country.CountryPage
        N)r	   r"   r
   r   )r   r   r&   solutionr   r   r   r
      s   

zCountryPage.__init__c                 C   s   t | j|S )z
        Build an instance of CountryInstance

        :param dict payload: Payload response from the API

        :returns: twilio.rest.pricing.v2.voice.country.CountryInstance
        :rtype: twilio.rest.pricing.v2.voice.country.CountryInstance
        )CountryInstancer   r   payloadr   r   r   get_instance   s   	zCountryPage.get_instancec                 C   r6   )r7   z<Twilio.Pricing.V2.CountryPage>r   r8   r   r   r   r9      r:   zCountryPage.__repr__)r;   r<   r=   r
   rE   r9   r?   r   r   r   r   r"      s    r"   c                       r@   )r1   c                    s2   t t| | d|i| _djdi | j| _dS )aS  
        Initialize the CountryContext

        :param Version version: Version that contains the resource
        :param iso_country: The ISO country code of the pricing information to fetch

        :returns: twilio.rest.pricing.v2.voice.country.CountryContext
        :rtype: twilio.rest.pricing.v2.voice.country.CountryContext
        r/   z/Voice/Countries/{iso_country}Nr   )r	   r1   r
   r   r   r   )r   r   r/   r   r   r   r
      s   

zCountryContext.__init__c                 C   s(   | j jd| jd}t| j || jd dS )
        Fetch the CountryInstance

        :returns: The fetched CountryInstance
        :rtype: twilio.rest.pricing.v2.voice.country.CountryInstance
        r   )r   r   r/   r.   )r   fetchr   rB   r   rC   r   r   r   rG      s   zCountryContext.fetchc                 C   $   d dd | j D }d|S )r7    c                 s        | ]\}}d  ||V  qdS z{}={}Nr   .0kvr   r   r   	<genexpr>       z*CountryContext.__repr__.<locals>.<genexpr>z%<Twilio.Pricing.V2.CountryContext {}>joinr   itemsr   r   contextr   r   r   r9         
zCountryContext.__repr__)r;   r<   r=   r
   rG   r9   r?   r   r   r   r   r1      s    r1   c                       s   e Zd Zd fdd	Zedd Zedd Zedd	 Zed
d Zedd Z	edd Z
edd Zdd Zdd Z  ZS )rB   Nc                    sf   t t| | |d|d|d|d|d|dd| _d| _d|p.| jd i| _dS )	z
        Initialize the CountryInstance

        :returns: twilio.rest.pricing.v2.voice.country.CountryInstance
        :rtype: twilio.rest.pricing.v2.voice.country.CountryInstance
        countryr/   outbound_prefix_pricesinbound_call_prices
price_uniturl)rY   r/   rZ   r[   r\   r]   N)r	   rB   r
   r3   _properties_contextr   )r   r   rD   r/   r   r   r   r
      s   
zCountryInstance.__init__c                 C   s&   | j du rt| j| jd d| _ | j S )a.  
        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
        :rtype: twilio.rest.pricing.v2.voice.country.CountryContext
        Nr/   r.   )r_   r1   r   r   r8   r   r   r   _proxy   s   
	zCountryInstance._proxyc                 C   
   | j d S )zK
        :returns: The name of the country
        :rtype: unicode
        rY   r^   r8   r   r   r   rY        
zCountryInstance.countryc                 C   ra   )zH
        :returns: The ISO country code
        :rtype: unicode
        r/   rb   r8   r   r   r   r/   
  rc   zCountryInstance.iso_countryc                 C   ra   )zk
        :returns: The list of OutboundPrefixPriceWithOrigin records
        :rtype: list[unicode]
        rZ   rb   r8   r   r   r   rZ     rc   z&CountryInstance.outbound_prefix_pricesc                 C   ra   )z^
        :returns: The list of InboundCallPrice records
        :rtype: list[unicode]
        r[   rb   r8   r   r   r   r[     rc   z#CountryInstance.inbound_call_pricesc                 C   ra   )z
        :returns: The currency in which prices are measured, in ISO 4127 format (e.g. usd, eur, jpy)
        :rtype: unicode
        r\   rb   r8   r   r   r   r\   "  rc   zCountryInstance.price_unitc                 C   ra   )zT
        :returns: The absolute URL of the resource
        :rtype: unicode
        r]   rb   r8   r   r   r   r]   *  rc   zCountryInstance.urlc                 C   s
   | j  S )rF   )r`   rG   r8   r   r   r   rG   2  s   
zCountryInstance.fetchc                 C   rH   )r7   rI   c                 s   rJ   rK   rL   rM   r   r   r   rQ   B  rR   z+CountryInstance.__repr__.<locals>.<genexpr>z&<Twilio.Pricing.V2.CountryInstance {}>rS   rV   r   r   r   r9   ;  rX   zCountryInstance.__repr__)N)r;   r<   r=   r
   propertyr`   rY   r/   rZ   r[   r\   r]   rG   r9   r?   r   r   r   r   rB      s$    






	rB   N)__doc__twilio.baser   twilio.base.instance_contextr   twilio.base.instance_resourcer   twilio.base.list_resourcer   twilio.base.pager   r   r"   r1   rB   r   r   r   r   <module>   s   ~&(