a
    !f3                     @   s   d Z ddl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 - Lookups
    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)	serializevalues)InstanceContext)InstanceResource)ListResource)Versionc                       s  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ejejejejfeeef eee ef eee ef eeeef ef d d
ddZejejejejfeeef eee ef eee ef eeeef ef d d
ddZedddZ  ZS )PhoneNumberInstancea  
    :ivar caller_name: The name of the phone number's owner. If `null`, that information was not available.
    :ivar country_code: The [ISO country code](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) for the phone number.
    :ivar phone_number: The phone number in [E.164](https://www.twilio.com/docs/glossary/what-e164) format, which consists of a + followed by the country code and subscriber number.
    :ivar national_format: The phone number, in national format.
    :ivar carrier: The telecom company that provides the phone number.
    :ivar add_ons: A JSON string with the results of the Add-ons you specified in the `add_ons` parameters. For the format of the object, see [Using Add-ons](https://www.twilio.com/docs/add-ons).
    :ivar url: The absolute URL of the resource.
    N)versionpayloadphone_numberc                    sz   t  | |d| _|d| _|d| _|d| _|d| _|d| _|d| _	d|pj| ji| _
d | _d S )Ncaller_namecountry_coder   national_formatcarrieradd_onsurl)super__init__getr   r   r   r   r   r   r   	_solution_context)selfr   r   r   	__class__ d/var/www/html/python-backend/venv/lib/python3.9/site-packages/twilio/rest/lookups/v1/phone_number.pyr   $   s    
zPhoneNumberInstance.__init__PhoneNumberContextreturnc                 C   s&   | j du 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: PhoneNumberContext for this PhoneNumberInstance
        Nr   r   )r   r!   _versionr   r   r   r   r    _proxy9   s    
zPhoneNumberInstance._proxyr   typer   add_ons_datar#   c                 C   s   | j j||||dS )  
        Fetch the PhoneNumberInstance

        :param country_code: The [ISO country code](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) of the phone number to fetch. This is used to specify the country when the phone number is provided in a national format.
        :param type: The type of information to return. Can be: `carrier` or `caller-name`. The default is null.  Carrier information costs $0.005 per phone number looked up.  Caller Name information is currently available only in the US and costs $0.01 per phone number looked up.  To retrieve both types on information, specify this parameter twice; once with `carrier` and once with `caller-name` as the value.
        :param add_ons: The `unique_name` of an Add-on you would like to invoke. Can be the `unique_name` of an Add-on that is installed on your account. You can specify multiple instances of this parameter to invoke multiple Add-ons. For more information about  Add-ons, see the [Add-ons documentation](https://www.twilio.com/docs/add-ons).
        :param add_ons_data: Data specific to the add-on you would like to invoke. The content and format of this value depends on the add-on.

        :returns: The fetched PhoneNumberInstance
        r   r)   r   r*   )r'   fetchr   r   r)   r   r*   r   r   r    r-   H   s    zPhoneNumberInstance.fetchc                    s   | j j||||dI dH S )  
        Asynchronous coroutine to fetch the PhoneNumberInstance

        :param country_code: The [ISO country code](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) of the phone number to fetch. This is used to specify the country when the phone number is provided in a national format.
        :param type: The type of information to return. Can be: `carrier` or `caller-name`. The default is null.  Carrier information costs $0.005 per phone number looked up.  Caller Name information is currently available only in the US and costs $0.01 per phone number looked up.  To retrieve both types on information, specify this parameter twice; once with `carrier` and once with `caller-name` as the value.
        :param add_ons: The `unique_name` of an Add-on you would like to invoke. Can be the `unique_name` of an Add-on that is installed on your account. You can specify multiple instances of this parameter to invoke multiple Add-ons. For more information about  Add-ons, see the [Add-ons documentation](https://www.twilio.com/docs/add-ons).
        :param add_ons_data: Data specific to the add-on you would like to invoke. The content and format of this value depends on the add-on.

        :returns: The fetched PhoneNumberInstance
        r,   N)r'   fetch_asyncr.   r   r   r    r0   `   s    zPhoneNumberInstance.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>~       z/PhoneNumberInstance.__repr__.<locals>.<genexpr>z*<Twilio.Lookups.V1.PhoneNumberInstance {}>joinr   itemsr5   r   contextr   r   r    __repr__x   s    zPhoneNumberInstance.__repr__)N)__name__
__module____qualname____doc__r   r   strr   r   r   propertyr'   r   unsetr   objectr   r-   r0   rA   __classcell__r   r   r   r    r      s@    


r   c                       s   e Zd Zeed fddZejejejejfeee	f ee
e e	f ee
e e	f eeee	f e	f edddZejejejejfeee	f ee
e e	f ee
e e	f eeee	f e	f edddZed	d
dZ  ZS )r!   )r   r   c                    s.   t  | d|i| _djf i | j| _dS )a4  
        Initialize the PhoneNumberContext

        :param version: Version that contains the resource
        :param phone_number: The phone number to lookup in [E.164](https://www.twilio.com/docs/glossary/what-e164) format, which consists of a + followed by the country code and subscriber number.
        r   z/PhoneNumbers/{phone_number}N)r   r   r   r5   _uri)r   r   r   r   r   r    r      s    zPhoneNumberContext.__init__r(   c              	   C   sf   t |t|dd t|dd d}|t|d | jjd| j|d}t	| j|| j
d d	S )
r+   c                 S   s   | S Nr   er   r   r    <lambda>   r;   z*PhoneNumberContext.fetch.<locals>.<lambda>c                 S   s   | S rL   r   rM   r   r   r    rO      r;   ZCountryCodeTypeAddOnsrR   GETmethoduriparamsr   r$   )r   ofr   mapupdateprefixed_collapsible_mapr%   r-   rK   r   r   r   r   r)   r   r*   datar   r   r   r    r-      s    zPhoneNumberContext.fetchc              	      sl   t |t|dd t|dd d}|t|d | jjd| j|dI dH }t	| j|| j
d	 d
S )r/   c                 S   s   | S rL   r   rM   r   r   r    rO      r;   z0PhoneNumberContext.fetch_async.<locals>.<lambda>c                 S   s   | S rL   r   rM   r   r   r    rO      r;   rP   rR   rS   rT   Nr   r$   )r   rX   r   rY   rZ   r[   r%   r0   rK   r   r   r\   r   r   r    r0      s    zPhoneNumberContext.fetch_asyncr"   c                 C   s$   d dd | j D }d|S )r1   r2   c                 s   s   | ]\}}d  ||V  qdS r3   r4   r6   r   r   r    r:      r;   z.PhoneNumberContext.__repr__.<locals>.<genexpr>z)<Twilio.Lookups.V1.PhoneNumberContext {}>r<   r?   r   r   r    rA      s    zPhoneNumberContext.__repr__)rB   rC   rD   r   rF   r   r   rH   r   rI   r   r   r   r-   r0   rA   rJ   r   r   r   r    r!      s0   
%
%r!   c                       sP   e Zd Zed fddZeedddZeedddZed	d
dZ	  Z
S )PhoneNumberList)r   c                    s   t  | dS )zm
        Initialize the PhoneNumberList

        :param version: Version that contains the resource

        N)r   r   )r   r   r   r   r    r      s    zPhoneNumberList.__init__)r   r#   c                 C   s   t | j|dS z
        Constructs a PhoneNumberContext

        :param phone_number: The phone number to lookup in [E.164](https://www.twilio.com/docs/glossary/what-e164) format, which consists of a + followed by the country code and subscriber number.
        r$   r!   r%   r   r   r   r   r    r      s    zPhoneNumberList.getc                 C   s   t | j|dS r_   r`   ra   r   r   r    __call__   s    zPhoneNumberList.__call__r"   c                 C   s   dS )r1   z#<Twilio.Lookups.V1.PhoneNumberList>r   r&   r   r   r    rA      s    zPhoneNumberList.__repr__)rB   rC   rD   r   r   rF   r!   r   rb   rA   rJ   r   r   r   r    r^      s   	r^   N)rE   typingr   r   r   r   r   Ztwilio.baser   r   Ztwilio.base.instance_contextr	   Ztwilio.base.instance_resourcer
   Ztwilio.base.list_resourcer   Ztwilio.base.versionr   r   r!   r^   r   r   r   r    <module>   s   jb