B
    `#                 @   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	 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
      /       /
    )	serialize)values)InstanceContext)InstanceResource)ListResource)Pagec                   s4   e Zd Z fddZdd Zdd Zdd Z  ZS )	PhoneNumberListc                s   t t| | i | _dS )z
        Initialize the PhoneNumberList

        :param Version version: Version that contains the resource

        :returns: twilio.rest.lookups.v1.phone_number.PhoneNumberList
        :rtype: twilio.rest.lookups.v1.phone_number.PhoneNumberList
        N)superr   __init__	_solution)selfversion)	__class__ R/home/dcms/DCMS/lib/python3.7/site-packages/twilio/rest/lookups/v1/phone_number.pyr
      s    	zPhoneNumberList.__init__c             C   s   t | j|dS )a
  
        Constructs a PhoneNumberContext

        :param phone_number: The phone number to fetch in E.164 format

        :returns: twilio.rest.lookups.v1.phone_number.PhoneNumberContext
        :rtype: twilio.rest.lookups.v1.phone_number.PhoneNumberContext
        )phone_number)PhoneNumberContext_version)r   r   r   r   r   get!   s    	zPhoneNumberList.getc             C   s   t | j|dS )a
  
        Constructs a PhoneNumberContext

        :param phone_number: The phone number to fetch in E.164 format

        :returns: twilio.rest.lookups.v1.phone_number.PhoneNumberContext
        :rtype: twilio.rest.lookups.v1.phone_number.PhoneNumberContext
        )r   )r   r   )r   r   r   r   r   __call__,   s    	zPhoneNumberList.__call__c             C   s   dS )zz
        Provide a friendly representation

        :returns: Machine friendly representation
        :rtype: str
        z#<Twilio.Lookups.V1.PhoneNumberList>r   )r   r   r   r   __repr__7   s    zPhoneNumberList.__repr__)__name__
__module____qualname__r
   r   r   r   __classcell__r   r   )r   r   r      s   r   c                   s,   e Zd Z fddZdd Zdd Z  ZS )PhoneNumberPagec                s   t t| || || _dS )a7  
        Initialize the PhoneNumberPage

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

        :returns: twilio.rest.lookups.v1.phone_number.PhoneNumberPage
        :rtype: twilio.rest.lookups.v1.phone_number.PhoneNumberPage
        N)r	   r   r
   r   )r   r   responseZsolution)r   r   r   r
   C   s    
zPhoneNumberPage.__init__c             C   s   t | j|S )a	  
        Build an instance of PhoneNumberInstance

        :param dict payload: Payload response from the API

        :returns: twilio.rest.lookups.v1.phone_number.PhoneNumberInstance
        :rtype: twilio.rest.lookups.v1.phone_number.PhoneNumberInstance
        )PhoneNumberInstancer   )r   payloadr   r   r   get_instanceR   s    	zPhoneNumberPage.get_instancec             C   s   dS )zz
        Provide a friendly representation

        :returns: Machine friendly representation
        :rtype: str
        z#<Twilio.Lookups.V1.PhoneNumberPage>r   )r   r   r   r   r   ]   s    zPhoneNumberPage.__repr__)r   r   r   r
   r   r   r   r   r   )r   r   r   A   s   r   c                   s>   e Zd Z fddZejejejejfddZdd Z  ZS )r   c                s.   t t| | d|i| _djf | j| _dS )aO  
        Initialize the PhoneNumberContext

        :param Version version: Version that contains the resource
        :param phone_number: The phone number to fetch in E.164 format

        :returns: twilio.rest.lookups.v1.phone_number.PhoneNumberContext
        :rtype: twilio.rest.lookups.v1.phone_number.PhoneNumberContext
        r   z/PhoneNumbers/{phone_number}N)r	   r   r
   r   format_uri)r   r   r   )r   r   r   r
   i   s    

zPhoneNumberContext.__init__c          	   C   sf   t |t|dd t|dd d}|t|d | jjd| j|d}t	| j|| j
d d	S )
a  
        Fetch the PhoneNumberInstance

        :param unicode country_code: The ISO country code of the phone number
        :param unicode type: The type of information to return
        :param unicode add_ons: The unique_name of an Add-on you would like to invoke
        :param dict add_ons_data: Data specific to the add-on you would like to invoke

        :returns: The fetched PhoneNumberInstance
        :rtype: twilio.rest.lookups.v1.phone_number.PhoneNumberInstance
        c             S   s   | S )Nr   )er   r   r   <lambda>       z*PhoneNumberContext.fetch.<locals>.<lambda>c             S   s   | S )Nr   )r"   r   r   r   r#      r$   )ZCountryCodeTypeAddOnsr&   GET)methoduriparamsr   )r   )r   Zofr   mapupdateZprefixed_collapsible_mapr   fetchr!   r   r   )r   country_codetypeadd_onsadd_ons_datadatar   r   r   r   r-   y   s    zPhoneNumberContext.fetchc             C   s$   d dd | j D }d|S )zz
        Provide a friendly representation

        :returns: Machine friendly representation
        :rtype: str
         c             s   s   | ]\}}d  ||V  qdS )z{}={}N)r    ).0kvr   r   r   	<genexpr>   s    z.PhoneNumberContext.__repr__.<locals>.<genexpr>z)<Twilio.Lookups.V1.PhoneNumberContext {}>)joinr   itemsr    )r   contextr   r   r   r      s    zPhoneNumberContext.__repr__)	r   r   r   r
   r   unsetr-   r   r   r   r   )r   r   r   g   s   r   c                   s   e Zd ZG dd de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edd ZejejejejfddZdd Z  ZS )r   c               @   s   e Zd ZdZdZdZdS )zPhoneNumberInstance.TypeZlandlineZmobileZvoipN)r   r   r   ZLANDLINEZMOBILEZVOIPr   r   r   r   r%      s   r%   Nc          	      sn   t t| | |d|d|d|d|d|d|dd| _d	| _d|pd| jd i| _d	S )
z
        Initialize the PhoneNumberInstance

        :returns: twilio.rest.lookups.v1.phone_number.PhoneNumberInstance
        :rtype: twilio.rest.lookups.v1.phone_number.PhoneNumberInstance
        caller_namer.   r   national_formatcarrierr0   url)r<   r.   r   r=   r>   r0   r?   N)r	   r   r
   r   _properties_contextr   )r   r   r   r   )r   r   r   r
      s    zPhoneNumberInstance.__init__c             C   s&   | j dkr t| j| jd d| _ | j S )a9  
        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
        :rtype: twilio.rest.lookups.v1.phone_number.PhoneNumberContext
        Nr   )r   )rA   r   r   r   )r   r   r   r   _proxy   s    	
zPhoneNumberInstance._proxyc             C   s
   | j d S )zU
        :returns: The name of the phone number's owner
        :rtype: dict
        r<   )r@   )r   r   r   r   r<      s    zPhoneNumberInstance.caller_namec             C   s
   | j d S )z]
        :returns: The ISO country code for the phone number
        :rtype: unicode
        r.   )r@   )r   r   r   r   r.      s    z PhoneNumberInstance.country_codec             C   s
   | j d S )zT
        :returns: The phone number in E.164 format
        :rtype: unicode
        r   )r@   )r   r   r   r   r      s    z PhoneNumberInstance.phone_numberc             C   s
   | j d S )zX
        :returns: The phone number, in national format
        :rtype: unicode
        r=   )r@   )r   r   r   r   r=      s    z#PhoneNumberInstance.national_formatc             C   s
   | j d S )zc
        :returns: The telecom company that provides the phone number
        :rtype: dict
        r>   )r@   )r   r   r   r   r>      s    zPhoneNumberInstance.carrierc             C   s
   | j d S )zl
        :returns: A JSON string with the results of the Add-ons you specified
        :rtype: dict
        r0   )r@   )r   r   r   r   r0      s    zPhoneNumberInstance.add_onsc             C   s
   | j d S )zT
        :returns: The absolute URL of the resource
        :rtype: unicode
        r?   )r@   )r   r   r   r   r?      s    zPhoneNumberInstance.urlc             C   s   | j j||||dS )a  
        Fetch the PhoneNumberInstance

        :param unicode country_code: The ISO country code of the phone number
        :param unicode type: The type of information to return
        :param unicode add_ons: The unique_name of an Add-on you would like to invoke
        :param dict add_ons_data: Data specific to the add-on you would like to invoke

        :returns: The fetched PhoneNumberInstance
        :rtype: twilio.rest.lookups.v1.phone_number.PhoneNumberInstance
        )r.   r/   r0   r1   )rB   r-   )r   r.   r/   r0   r1   r   r   r   r-      s
    zPhoneNumberInstance.fetchc             C   s$   d dd | j D }d|S )zz
        Provide a friendly representation

        :returns: Machine friendly representation
        :rtype: str
        r3   c             s   s   | ]\}}d  ||V  qdS )z{}={}N)r    )r4   r5   r6   r   r   r   r7     s    z/PhoneNumberInstance.__repr__.<locals>.<genexpr>z*<Twilio.Lookups.V1.PhoneNumberInstance {}>)r8   r   r9   r    )r   r:   r   r   r   r     s    zPhoneNumberInstance.__repr__)N)r   r   r   objectr%   r
   propertyrB   r<   r.   r   r=   r>   r0   r?   r   r;   r-   r   r   r   r   )r   r   r      s   r   N)__doc__Ztwilio.baser   r   Ztwilio.base.instance_contextr   Ztwilio.base.instance_resourcer   Ztwilio.base.list_resourcer   Ztwilio.base.pager   r   r   r   r   r   r   r   r   <module>   s   0&5