o
    e7                     @   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                       sn   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ejejfddZdd Zdd Zd	d
 Z	  Z
S )VerificationListc                    s2   t t| | d|i| _djdi | 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__r   ]/var/www/html/venv/lib/python3.10/site-packages/twilio/rest/verify/v2/service/verification.pyr      s   

zVerificationList.__init__c                 C   s^   t |||||||||	t|
t||||d}| jjd| j|d}t| j|| jd dS )aM  
        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, WhatsApp 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.
        :param unicode template_sid: The verification template SMS messages.
        :param unicode template_custom_substitutions: The values of the special variables declared on the message template.

        :returns: The created VerificationInstance
        :rtype: twilio.rest.verify.v2.service.verification.VerificationInstance
        )ToChannelCustomFriendlyNameCustomMessage
SendDigitsLocale
CustomCodeAmountPayee
RateLimitsChannelConfigurationAppHashTemplateSidTemplateCustomSubstitutionsPOSTmethoduridatar
   r
   )	r   ofr   object_versioncreater   VerificationInstancer   )r   tochannelcustom_friendly_namecustom_messagesend_digitslocalecustom_codeamountpayeerate_limitschannel_configurationapp_hashtemplate_sidtemplate_custom_substitutionsr(   payloadr   r   r   r-   $   s$   zVerificationList.createc                 C      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   rA   r   r   r   getU      	zVerificationList.getc                 C   r>   r?   rB   rD   r   r   r   __call__`   rF   zVerificationList.__call__c                 C      dS )z
        Provide a friendly representation

        :returns: Machine friendly representation
        :rtype: str
        z#<Twilio.Verify.V2.VerificationList>r   r   r   r   r   __repr__k      zVerificationList.__repr__)__name__
__module____qualname__r   r   unsetr-   rE   rG   rK   __classcell__r   r   r   r   r	      s    
1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   rR   r   r   )r   r   responsesolutionr   r   r   r   w   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   rF   zVerificationPage.get_instancec                 C   rH   )rI   z#<Twilio.Verify.V2.VerificationPage>r   rJ   r   r   r   rK      rL   zVerificationPage.__repr__)rM   rN   rO   r   rV   rK   rQ   r   r   r   r   rR   u   s    rR   c                       s4   e Zd Z fddZdd Zdd Zdd Z  ZS )	rC   c                    s4   t t| | ||d| _djdi | 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@   z+/Services/{service_sid}/Verifications/{sid}Nr   )r   rC   r   r   r   r   )r   r   r
   rA   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 )  
        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
   rA   r@   )r   r*   r,   updater   r.   r   )r   statusr(   r=   r   r   r   rY      s   	zVerificationContext.updatec                 C   s0   | j jd| jd}t| j || jd | jd dS )
        Fetch the VerificationInstance

        :returns: The fetched VerificationInstance
        :rtype: twilio.rest.verify.v2.service.verification.VerificationInstance
        GET)r&   r'   r
   rA   r@   )r,   fetchr   r.   r   rU   r   r   r   r]      s   zVerificationContext.fetchc                 C   $   d dd | j D }d|S )rI    c                 s        | ]\}}d  ||V  qdS z{}={}Nr   .0kvr   r   r   	<genexpr>       z/VerificationContext.__repr__.<locals>.<genexpr>z)<Twilio.Verify.V2.VerificationContext {}>joinr   itemsr   r   contextr   r   r   rK         
zVerificationContext.__repr__)rM   rN   rO   r   rY   r]   rK   rQ   r   r   r   r   rC      s
    rC   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ZdS )zVerificationInstance.ChannelsmscallemailwhatsappN)rM   rN   rO   SMSCALLEMAILWHATSAPPr   r   r   r   r      s
    r   c                   @   s   e Zd ZdZdZdS )zVerificationInstance.StatuscanceledapprovedN)rM   rN   rO   CANCELEDAPPROVEDr   r   r   r   rX      s    rX   Nc                    s   t t| | |d|d|d|d|d|d|d|d|d	|d
|dt|dt|d|dd| _d| _||pT| 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
        rA   r
   account_sidr/   r0   rZ   validlookupr6   r7   send_code_attemptsdate_createddate_updatedurl)rA   r
   r{   r/   r0   rZ   r|   r}   r6   r7   r~   r   r   r   Nr@   )	r   r.   r   rE   r   iso8601_datetime_properties_contextr   )r   r   r=   r
   rA   r   r   r   r      s$   zVerificationInstance.__init__c                 C   s.   | j du 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
   rA   r@   )r   rC   r,   r   rJ   r   r   r   _proxy	  s   
	zVerificationInstance._proxyc                 C   
   | j d S )zb
        :returns: The unique string that identifies the resource
        :rtype: unicode
        rA   r   rJ   r   r   r   rA        
zVerificationInstance.sidc                 C   r   )zo
        :returns: The SID of the Service that the resource is associated with
        :rtype: unicode
        r
   r   rJ   r   r   r   r
   "  r   z VerificationInstance.service_sidc                 C   r   )zd
        :returns: The SID of the Account that created the resource
        :rtype: unicode
        r{   r   rJ   r   r   r   r{   *  r   z VerificationInstance.account_sidc                 C   r   )z\
        :returns: The phone number or email being verified
        :rtype: unicode
        r/   r   rJ   r   r   r   r/   2  r   zVerificationInstance.toc                 C   r   )zf
        :returns: The verification method used.
        :rtype: VerificationInstance.Channel
        r0   r   rJ   r   r   r   r0   :  r   zVerificationInstance.channelc                 C   r   )z[
        :returns: The status of the verification resource
        :rtype: unicode
        rZ   r   rJ   r   r   r   rZ   B  r   zVerificationInstance.statusc                 C   r   )zX
        :returns: Whether the verification was successful
        :rtype: bool
        r|   r   rJ   r   r   r   r|   J  r   zVerificationInstance.validc                 C   r   )zb
        :returns: Information about the phone number being verified
        :rtype: dict
        r}   r   rJ   r   r   r   r}   R  r   zVerificationInstance.lookupc                 C   r   )zl
        :returns: The amount of the associated PSD2 compliant transaction.
        :rtype: unicode
        r6   r   rJ   r   r   r   r6   Z  r   zVerificationInstance.amountc                 C   r   )zj
        :returns: The payee of the associated PSD2 compliant transaction
        :rtype: unicode
        r7   r   rJ   r   r   r   r7   b  r   zVerificationInstance.payeec                 C   r   )z`
        :returns: An array of verification attempt objects.
        :rtype: list[dict]
        r~   r   rJ   r   r   r   r~   j  r   z'VerificationInstance.send_code_attemptsc                 C   r   )zt
        :returns: The RFC 2822 date and time in GMT when the resource was created
        :rtype: datetime
        r   r   rJ   r   r   r   r   r  r   z!VerificationInstance.date_createdc                 C   r   )zy
        :returns: The RFC 2822 date and time in GMT when the resource was last updated
        :rtype: datetime
        r   r   rJ   r   r   r   r   z  r   z!VerificationInstance.date_updatedc                 C   r   )za
        :returns: The absolute URL of the Verification resource
        :rtype: unicode
        r   r   rJ   r   r   r   r     r   zVerificationInstance.urlc                 C   s   | j |S )rW   )r   rY   )r   rZ   r   r   r   rY     s   	zVerificationInstance.updatec                 C   s
   | j  S )r[   )r   r]   rJ   r   r   r   r]     s   
zVerificationInstance.fetchc                 C   r^   )rI   r_   c                 s   r`   ra   rb   rc   r   r   r   rg     rh   z0VerificationInstance.__repr__.<locals>.<genexpr>z*<Twilio.Verify.V2.VerificationInstance {}>ri   rl   r   r   r   rK     rn   zVerificationInstance.__repr__)N)rM   rN   rO   r+   r   rX   r   propertyr   rA   r
   r{   r/   r0   rZ   r|   r}   r6   r7   r~   r   r   r   rY   r]   rK   rQ   r   r   r   r   r.      sJ    














	r.   N)__doc__twilio.baser   r   r   twilio.base.instance_contextr   twilio.base.instance_resourcer   twilio.base.list_resourcer   twilio.base.pager   r	   rR   rC   r.   r   r   r   r   <module>   s   c'B