o
    �¨ÊhX+  ã                   @   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                       sj   e Zd 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 )ÚCountryListú  c                    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	   úV/var/www/html/env/lib/python3.10/site-packages/twilio/rest/pricing/v2/voice/country.pyr      s   	zCountryList.__init__Nc                 C   s6   | j  ||¡}| j|d d�}| j  ||d |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Ú
page_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   9   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©Úparams)r   Úofr   r   r   ÚCountryPager   )r   Ú
page_tokenÚpage_numberr   r!   Úresponser	   r	   r   r   K   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_pageb   s
   

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

        :param iso_country: Fetches voice prices for country

        :returns: twilio.rest.pricing.v2.voice.country.CountryContext
        :rtype: twilio.rest.pricing.v2.voice.country.CountryContext
        ©Úiso_country©ÚCountryContextr   ©r   r/   r	   r	   r   Úgets   ó   	zCountryList.getc                 C   r,   r-   r0   r2   r	   r	   r   Ú__call__~   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__Ú__doc__r   r   r   r   Úunsetr   r+   r3   r5   r9   Ú__classcell__r	   r	   r   r   r      s    


ÿr   c                       ó0   e Zd ZdZ‡ fdd„Zdd„ Zdd„ Z‡  ZS )r#   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>   r   rE   r9   r@   r	   r	   r   r   r#   “   s
    r#   c                       rA   )r1   r   c                    s2   t t| ƒ |¡ d|i| _djdi | j¤Ž| _dS )a;  
        Initialize the CountryContext

        :param Version version: Version that contains the resource
        :param iso_country: Fetches voice prices for country

        :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   s4   t  i ¡}| jjd| j|d�}t| j|| jd d�S )ú™
        Fetch a CountryInstance

        :returns: Fetched CountryInstance
        :rtype: twilio.rest.pricing.v2.voice.country.CountryInstance
        r   r    r/   r.   )r   r"   r   Úfetchr   rC   r   )r   r!   rD   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>   r   rG   r9   r@   r	   r	   r   r   r1   º   s
    r1   c                       s†   e Zd 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 )rC   r   Nc                    s`   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/   ÚurlÚoutbound_prefix_pricesÚinbound_call_pricesÚ
price_unit)rY   r/   rZ   r[   r\   r]   N)r
   rC   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 )zG
        :returns: 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   )za
        :returns: List of OutboundPrefixPriceWithOrigin records
        :rtype: unicode
        r[   rb   r8   r	   r	   r   r[      rc   z&CountryInstance.outbound_prefix_pricesc                 C   ra   )zT
        :returns: List of InboundCallPrice records
        :rtype: 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]   0  rc   zCountryInstance.price_unitc                 C   ra   )zM
        :returns: The URL of this resource.
        :rtype: unicode
        rZ   rb   r8   r	   r	   r   rZ   8  rc   zCountryInstance.urlc                 C   s
   | j  ¡ S )rF   )r`   rG   r8   r	   r	   r   rG   @  s   
zCountryInstance.fetchc                 C   rH   )r7   rI   c                 s   rJ   rK   rL   rM   r	   r	   r   rQ   P  rR   z+CountryInstance.__repr__.<locals>.<genexpr>z&<Twilio.Pricing.V2.CountryInstance {}>rS   rV   r	   r	   r   r9   I  rX   zCountryInstance.__repr__)N)r;   r<   r=   r>   r   Úpropertyr`   rY   r/   r[   r\   r]   rZ   rG   r9   r@   r	   r	   r   r   rC   é   s&    






	rC   N)r>   Útwilio.baser   Útwilio.base.instance_contextr   Útwilio.base.instance_resourcer   Útwilio.base.list_resourcer   Útwilio.base.pager   r   r#   r1   rC   r	   r	   r	   r   Ú<module>   s    '/