o
    �¨Êh˜*  ã                   @   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 )a  
        Initialize the CountryList

        :param Version version: Version that contains the resource

        :returns: twilio.rest.pricing.v1.phone_number.country.CountryList
        :rtype: twilio.rest.pricing.v1.phone_number.country.CountryList
        z/PhoneNumbers/CountriesN© )Úsuperr   Ú__init__Ú	_solutionÚformatÚ_uri)ÚselfÚversion©Ú	__class__r	   ú]/var/www/html/env/lib/python3.10/site-packages/twilio/rest/pricing/v1/phone_number/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.v1.phone_number.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 )ag  
        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.v1.phone_number.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.v1.phone_number.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 )a?  
        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.v1.phone_number.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: The iso_country

        :returns: twilio.rest.pricing.v1.phone_number.country.CountryContext
        :rtype: twilio.rest.pricing.v1.phone_number.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.V1.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.v1.phone_number.country.CountryPage
        :rtype: twilio.rest.pricing.v1.phone_number.country.CountryPage
        N)r
   r#   r   r   )r   r   r&   Úsolutionr   r	   r   r   –   s   

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

        :param dict payload: Payload response from the API

        :returns: twilio.rest.pricing.v1.phone_number.country.CountryInstance
        :rtype: twilio.rest.pricing.v1.phone_number.country.CountryInstance
        )ÚCountryInstancer   )r   Úpayloadr	   r	   r   Úget_instance¥   s   	zCountryPage.get_instancec                 C   r6   )r7   z<Twilio.Pricing.V1.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 )a8  
        Initialize the CountryContext

        :param Version version: Version that contains the resource
        :param iso_country: The iso_country

        :returns: twilio.rest.pricing.v1.phone_number.country.CountryContext
        :rtype: twilio.rest.pricing.v1.phone_number.country.CountryContext
        r/   z%/PhoneNumbers/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.v1.phone_number.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.V1.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                       sz   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dd„ Zdd„ Z‡  ZS )rC   r   Nc                    sX   t t| ƒ |¡ |d |d |d | d¡| d¡dœ| _d| _d|p'| jd i| _dS )zË
        Initialize the CountryInstance

        :returns: twilio.rest.pricing.v1.phone_number.country.CountryInstance
        :rtype: twilio.rest.pricing.v1.phone_number.country.CountryInstance
        Úcountryr/   ÚurlÚphone_number_pricesÚ
price_unit)rY   r/   rZ   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 )a5  
        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.v1.phone_number.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   r`   )zW
        :returns: The ISO country code of this number
        :rtype: unicode
        r/   ra   r8   r	   r	   r   r/     rb   zCountryInstance.iso_countryc                 C   r`   )zU
        :returns: List of PhoneNumberPrices records
        :rtype: unicode
        r[   ra   r8   r	   r	   r   r[     rb   z#CountryInstance.phone_number_pricesc                 C   r`   )z‡
        :returns: The currency in which prices are measured, in ISO 4127 format (e.g. usd, eur, jpy).
        :rtype: unicode
        r\   ra   r8   r	   r	   r   r\   '  rb   zCountryInstance.price_unitc                 C   r`   )z;
        :returns: The url
        :rtype: unicode
        rZ   ra   r8   r	   r	   r   rZ   /  rb   zCountryInstance.urlc                 C   s
   | j  ¡ S )rF   )r_   rG   r8   r	   r	   r   rG   7  s   
zCountryInstance.fetchc                 C   rH   )r7   rI   c                 s   rJ   rK   rL   rM   r	   r	   r   rQ   G  rR   z+CountryInstance.__repr__.<locals>.<genexpr>z&<Twilio.Pricing.V1.CountryInstance {}>rS   rV   r	   r	   r   r9   @  rX   zCountryInstance.__repr__)N)r;   r<   r=   r>   r   Úpropertyr_   rY   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    '/