B
    `5                 @   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
 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
      /       /
    )deserialize)	serialize)values)InstanceContext)InstanceResource)ListResource)Pagec            
       sf   e Zd Z fddZejejejejejejejejejejf
ddZdd Zdd Zd	d
 Z	  Z
S )VerificationListc                s.   t t| | d|i| _djf | j| _dS )ah  
        Initialize the VerificationList

        :param Version version: Version that contains the resource
        :param service_sid: The SID of the Service that the resource is associated with

        :returns: twilio.rest.verify.v2.service.verification.VerificationList
        :rtype: twilio.rest.verify.v2.service.verification.VerificationList
        service_sidz%/Services/{service_sid}/VerificationsN)superr	   __init__	_solutionformat_uri)selfversionr
   )	__class__ Y/home/dcms/DCMS/lib/python3.7/site-packages/twilio/rest/verify/v2/service/verification.pyr      s    

zVerificationList.__init__c             C   sZ   t |||||||||	t|
t||d}| jjd| j|d}t| j|| jd dS )az  
        Create the VerificationInstance

        :param unicode to: The phone number or email to verify
        :param unicode channel: The verification method to use
        :param unicode custom_friendly_name: A custom user defined friendly name
        :param unicode custom_message: The text of a custom message to use for the verification
        :param unicode send_digits: The digits to send after a phone call is answered
        :param unicode locale: The locale to use for the verification SMS or call
        :param unicode custom_code: A pre-generated code
        :param unicode amount: The amount of the associated PSD2 compliant transaction.
        :param unicode payee: The payee of the associated PSD2 compliant transaction
        :param dict rate_limits: The custom key-value pairs of Programmable Rate Limits.
        :param dict channel_configuration: Channel specific configuration in json format.
        :param unicode app_hash: Your App Hash to be appended at the end of an SMS.

        :returns: The created VerificationInstance
        :rtype: twilio.rest.verify.v2.service.verification.VerificationInstance
        )ToChannelZCustomFriendlyNameZCustomMessageZ
SendDigitsZLocaleZ
CustomCodeZAmountZPayeeZ
RateLimitsZChannelConfigurationZAppHashPOST)methoduridatar
   )r
   )	r   ofr   object_versioncreater   VerificationInstancer   )r   tochannelZcustom_friendly_nameZcustom_messageZsend_digitslocaleZcustom_codeamountpayeeZrate_limitsZchannel_configurationZapp_hashr   payloadr   r   r   r   $   s    
zVerificationList.createc             C   s   t | j| jd |dS )a  
        Constructs a VerificationContext

        :param sid: The unique string that identifies the resource

        :returns: twilio.rest.verify.v2.service.verification.VerificationContext
        :rtype: twilio.rest.verify.v2.service.verification.VerificationContext
        r
   )r
   sid)VerificationContextr   r   )r   r&   r   r   r   getO   s    	zVerificationList.getc             C   s   t | j| jd |dS )a  
        Constructs a VerificationContext

        :param sid: The unique string that identifies the resource

        :returns: twilio.rest.verify.v2.service.verification.VerificationContext
        :rtype: twilio.rest.verify.v2.service.verification.VerificationContext
        r
   )r
   r&   )r'   r   r   )r   r&   r   r   r   __call__Z   s    	zVerificationList.__call__c             C   s   dS )zz
        Provide a friendly representation

        :returns: Machine friendly representation
        :rtype: str
        z#<Twilio.Verify.V2.VerificationList>r   )r   r   r   r   __repr__e   s    zVerificationList.__repr__)__name__
__module____qualname__r   r   Zunsetr   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 )VerificationPagec                s   t t| || || _dS )a  
        Initialize the VerificationPage

        :param Version version: Version that contains the resource
        :param Response response: Response from the API
        :param service_sid: The SID of the Service that the resource is associated with

        :returns: twilio.rest.verify.v2.service.verification.VerificationPage
        :rtype: twilio.rest.verify.v2.service.verification.VerificationPage
        N)r   r/   r   r   )r   r   responseZsolution)r   r   r   r   q   s    zVerificationPage.__init__c             C   s   t | j|| jd dS )a  
        Build an instance of VerificationInstance

        :param dict payload: Payload response from the API

        :returns: twilio.rest.verify.v2.service.verification.VerificationInstance
        :rtype: twilio.rest.verify.v2.service.verification.VerificationInstance
        r
   )r
   )r   r   r   )r   r%   r   r   r   get_instance   s    	zVerificationPage.get_instancec             C   s   dS )zz
        Provide a friendly representation

        :returns: Machine friendly representation
        :rtype: str
        z#<Twilio.Verify.V2.VerificationPage>r   )r   r   r   r   r*      s    zVerificationPage.__repr__)r+   r,   r-   r   r1   r*   r.   r   r   )r   r   r/   o   s   r/   c                   s4   e Zd Z fddZdd Zdd Zdd Z  ZS )	r'   c                s0   t t| | ||d| _djf | j| _dS )a  
        Initialize the VerificationContext

        :param Version version: Version that contains the resource
        :param service_sid: The SID of the verification Service to fetch the resource from
        :param sid: The unique string that identifies the resource

        :returns: twilio.rest.verify.v2.service.verification.VerificationContext
        :rtype: twilio.rest.verify.v2.service.verification.VerificationContext
        )r
   r&   z+/Services/{service_sid}/Verifications/{sid}N)r   r'   r   r   r   r   )r   r   r
   r&   )r   r   r   r      s    zVerificationContext.__init__c             C   s@   t d|i}| jjd| j|d}t| j|| jd | jd dS )a  
        Update the VerificationInstance

        :param VerificationInstance.Status status: The new status of the resource

        :returns: The updated VerificationInstance
        :rtype: twilio.rest.verify.v2.service.verification.VerificationInstance
        Statusr   )r   r   r   r
   r&   )r
   r&   )r   r   r   updater   r   r   )r   statusr   r%   r   r   r   r3      s    	zVerificationContext.updatec             C   s0   | j jd| jd}t| j || jd | jd dS )z
        Fetch the VerificationInstance

        :returns: The fetched VerificationInstance
        :rtype: twilio.rest.verify.v2.service.verification.VerificationInstance
        GET)r   r   r
   r&   )r
   r&   )r   fetchr   r   r   )r   r%   r   r   r   r6      s    zVerificationContext.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/VerificationContext.__repr__.<locals>.<genexpr>z)<Twilio.Verify.V2.VerificationContext {}>)joinr   itemsr   )r   contextr   r   r   r*      s    zVerificationContext.__repr__)r+   r,   r-   r   r3   r6   r*   r.   r   r   )r   r   r'      s   r'   c                   s
  e Zd ZG dd de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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d*d+ Z  ZS )-r   c               @   s   e Zd ZdZdZdZdS )zVerificationInstance.ChannelZsmscallemailN)r+   r,   r-   ZSMSCALLZEMAILr   r   r   r   r      s   r   c               @   s   e Zd ZdZdZdS )zVerificationInstance.StatuscanceledZapprovedN)r+   r,   r-   ZCANCELEDZAPPROVEDr   r   r   r   r2      s   r2   Nc                s   t t| | |d|d|d|d|d|d|d|d|d	|d
|dt|dt|d|dd| _d| _||p| jd d| _dS )z
        Initialize the VerificationInstance

        :returns: twilio.rest.verify.v2.service.verification.VerificationInstance
        :rtype: twilio.rest.verify.v2.service.verification.VerificationInstance
        r&   r
   account_sidr    r!   r4   validlookupr#   r$   send_code_attemptsdate_createddate_updatedurl)r&   r
   rC   r    r!   r4   rD   rE   r#   r$   rF   rG   rH   rI   N)r
   r&   )	r   r   r   r(   r   iso8601_datetime_properties_contextr   )r   r   r%   r
   r&   )r   r   r   r      s"    zVerificationInstance.__init__c             C   s.   | j dkr(t| j| jd | jd d| _ | j S )aC  
        Generate an instance context for the instance, the context is capable of
        performing various actions.  All instance actions are proxied to the context

        :returns: VerificationContext for this VerificationInstance
        :rtype: twilio.rest.verify.v2.service.verification.VerificationContext
        Nr
   r&   )r
   r&   )rL   r'   r   r   )r   r   r   r   _proxy  s    	
zVerificationInstance._proxyc             C   s
   | j d S )zb
        :returns: The unique string that identifies the resource
        :rtype: unicode
        r&   )rK   )r   r   r   r   r&     s    zVerificationInstance.sidc             C   s
   | j d S )zo
        :returns: The SID of the Service that the resource is associated with
        :rtype: unicode
        r
   )rK   )r   r   r   r   r
     s    z VerificationInstance.service_sidc             C   s
   | j d S )zd
        :returns: The SID of the Account that created the resource
        :rtype: unicode
        rC   )rK   )r   r   r   r   rC   #  s    z VerificationInstance.account_sidc             C   s
   | j d S )z\
        :returns: The phone number or email being verified
        :rtype: unicode
        r    )rK   )r   r   r   r   r    +  s    zVerificationInstance.toc             C   s
   | j d S )zf
        :returns: The verification method used.
        :rtype: VerificationInstance.Channel
        r!   )rK   )r   r   r   r   r!   3  s    zVerificationInstance.channelc             C   s
   | j d S )z[
        :returns: The status of the verification resource
        :rtype: unicode
        r4   )rK   )r   r   r   r   r4   ;  s    zVerificationInstance.statusc             C   s
   | j d S )zX
        :returns: Whether the verification was successful
        :rtype: bool
        rD   )rK   )r   r   r   r   rD   C  s    zVerificationInstance.validc             C   s
   | j d S )zb
        :returns: Information about the phone number being verified
        :rtype: dict
        rE   )rK   )r   r   r   r   rE   K  s    zVerificationInstance.lookupc             C   s
   | j d S )zl
        :returns: The amount of the associated PSD2 compliant transaction.
        :rtype: unicode
        r#   )rK   )r   r   r   r   r#   S  s    zVerificationInstance.amountc             C   s
   | j d S )zj
        :returns: The payee of the associated PSD2 compliant transaction
        :rtype: unicode
        r$   )rK   )r   r   r   r   r$   [  s    zVerificationInstance.payeec             C   s
   | j d S )zZ
        :returns: An array of verification attempt objects.
        :rtype: dict
        rF   )rK   )r   r   r   r   rF   c  s    z'VerificationInstance.send_code_attemptsc             C   s
   | j d S )zt
        :returns: The RFC 2822 date and time in GMT when the resource was created
        :rtype: datetime
        rG   )rK   )r   r   r   r   rG   k  s    z!VerificationInstance.date_createdc             C   s
   | j d S )zy
        :returns: The RFC 2822 date and time in GMT when the resource was last updated
        :rtype: datetime
        rH   )rK   )r   r   r   r   rH   s  s    z!VerificationInstance.date_updatedc             C   s
   | j d S )za
        :returns: The absolute URL of the Verification resource
        :rtype: unicode
        rI   )rK   )r   r   r   r   rI   {  s    zVerificationInstance.urlc             C   s   | j |S )a  
        Update the VerificationInstance

        :param VerificationInstance.Status status: The new status of the resource

        :returns: The updated VerificationInstance
        :rtype: twilio.rest.verify.v2.service.verification.VerificationInstance
        )rM   r3   )r   r4   r   r   r   r3     s    	zVerificationInstance.updatec             C   s
   | j  S )z
        Fetch the VerificationInstance

        :returns: The fetched VerificationInstance
        :rtype: twilio.rest.verify.v2.service.verification.VerificationInstance
        )rM   r6   )r   r   r   r   r6     s    zVerificationInstance.fetchc             C   s$   d dd | j D }d|S )zz
        Provide a friendly representation

        :returns: Machine friendly representation
        :rtype: str
        r7   c             s   s   | ]\}}d  ||V  qdS )z{}={}N)r   )r8   r9   r:   r   r   r   r;     s    z0VerificationInstance.__repr__.<locals>.<genexpr>z*<Twilio.Verify.V2.VerificationInstance {}>)r<   r   r=   r   )r   r>   r   r   r   r*     s    zVerificationInstance.__repr__)N)r+   r,   r-   r   r   r2   r   propertyrM   r&   r
   rC   r    r!   r4   rD   rE   r#   r$   rF   rG   rH   rI   r3   r6   r*   r.   r   r   )r   r   r      s*   	r   N)__doc__Ztwilio.baser   r   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   ]'B