o
    f>h1                     @   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dedeeef dee f fddZ	e
dd
dZejejejejfdeeef deee ef deee ef deeeef ef dd f
ddZejejejejfdeeef deee ef deee ef deeeef ef dd f
ddZdef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|p5| 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__ V/var/www/html/venv/lib/python3.10/site-packages/twilio/rest/lookups/v1/phone_number.pyr   "   s   

zPhoneNumberInstance.__init__returnPhoneNumberContextc                 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    _proxy7   s   
zPhoneNumberInstance._proxyr   typer   add_ons_datac                 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. To retrieve both types of 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+   F   s   zPhoneNumberInstance.fetchc                    s   | j j||||dI dH S )6  
        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. To retrieve both types of 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    r.   ^   s   zPhoneNumberInstance.fetch_asyncc                 C   $   d dd | j D }d|S )f
        Provide a friendly representation

        :returns: Machine friendly representation
         c                 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__v      
zPhoneNumberInstance.__repr__N)r!   r"   )__name__
__module____qualname____doc__r   r   strr   r   r   propertyr&   r   unsetr   objectr   r+   r.   rA   __classcell__r   r   r   r    r      sV    




r   c                       s   e Zd Zdedef fddZejejejejfdeee	f dee
e e	f dee
e e	f deeee	f e	f d	ef
d
dZejejejejfdeee	f dee
e e	f dee
e e	f deeee	f e	f d	ef
ddZd	efddZ  ZS )r"   r   r   c                    s.   t  | d|i| _djd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}Nr   )r   r   r   r5   _uri)r   r   r   r   r   r    r      s   zPhoneNumberContext.__init__r   r'   r   r(   r!   c              	   C   sz   t |t|dd t|dd d}|t|d t i }d|d< | jjd| j||d	}t	| j|| j
d
 dS )r)   c                 S      | S rC   r   er   r   r    <lambda>       z*PhoneNumberContext.fetch.<locals>.<lambda>c                 S   rN   rC   r   rO   r   r   r    rQ      rR   CountryCodeTypeAddOnsrV   application/jsonAcceptGETmethoduriparamsheadersr   r#   )r   ofr   mapupdateprefixed_collapsible_mapr$   r+   rM   r   r   r   r   r'   r   r(   datar^   r   r   r   r    r+      s"   

zPhoneNumberContext.fetchc              	      s   t |t|dd t|dd d}|t|d t i }d|d< | jjd| j||d	I d
H }t	| j|| j
d dS )r-   c                 S   rN   rC   r   rO   r   r   r    rQ      rR   z0PhoneNumberContext.fetch_async.<locals>.<lambda>c                 S   rN   rC   r   rO   r   r   r    rQ      rR   rS   rV   rW   rX   rY   rZ   Nr   r#   )r   r_   r   r`   ra   rb   r$   r.   rM   r   r   rc   r   r   r    r.      s$   

zPhoneNumberContext.fetch_asyncc                 C   r/   )r0   r1   c                 s   r2   r3   r4   r6   r   r   r    r:      r;   z.PhoneNumberContext.__repr__.<locals>.<genexpr>z)<Twilio.Lookups.V1.PhoneNumberContext {}>r<   r?   r   r   r    rA      rB   zPhoneNumberContext.__repr__)rD   rE   rF   r   rH   r   r   rJ   r   rK   r   r   r   r+   r.   rA   rL   r   r   r   r    r"      sB    

,

*r"   c                       sT   e Zd Zdef fddZdedefddZdedefdd	Zdefd
dZ	  Z
S )PhoneNumberListr   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      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         zPhoneNumberList.getc                 C   rf   rg   rh   ri   r   r   r    __call__  rj   zPhoneNumberList.__call__c                 C   s   dS )r0   z#<Twilio.Lookups.V1.PhoneNumberList>r   r%   r   r   r    rA   
  s   zPhoneNumberList.__repr__)rD   rE   rF   r   r   rH   r"   r   rk   rA   rL   r   r   r   r    re      s
    	re   N)rG   typingr   r   r   r   r   twilio.baser   r   twilio.base.instance_contextr	   twilio.base.instance_resourcer
   twilio.base.list_resourcer   twilio.base.versionr   r   r"   re   r   r   r   r    <module>   s    io