a
    !fS                     @   s   d Z ddlmZ ddlmZmZmZmZmZ ddlm	Z	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 - Verify
    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.
    )datetime)AnyDictListOptionalUnion)deserialize	serializevalues)InstanceContext)InstanceResource)ListResource)Versionc                       s   e Zd ZG dd deZG dd deZdeeee	f ee
e d fddZed	d
ddZd d
ddZd d
ddZdd dddZdd dddZed
ddZ  ZS )VerificationInstancec                   @   s    e Zd ZdZdZdZdZdZdS )zVerificationInstance.ChannelZsmscallemailZwhatsappsnaN)__name__
__module____qualname__ZSMSCALLZEMAILZWHATSAPPZSNA r   r   k/var/www/html/python-backend/venv/lib/python3.9/site-packages/twilio/rest/verify/v2/service/verification.pyChannel   s
   r   c                   @   s   e Zd ZdZdZdS )VerificationInstance.StatuscanceledZapprovedN)r   r   r   ZCANCELEDZAPPROVEDr   r   r   r   Status!   s   r   N)versionpayloadservice_sidsidc                    s   t  | |d| _|d| _|d| _|d| _|d| _|d| _|d| _	|d| _
|d	| _|d
| _|d| _t|d| _t|d| _|d| _|d| _||p| jd| _d | _d S )Nr    r   account_sidtochannelstatusvalidlookupamountpayeesend_code_attemptsdate_createddate_updatedr   urlr   r    )super__init__getr    r   r!   r"   r#   r$   r%   r&   r'   r(   r)   r   iso8601_datetimer*   r+   r   r,   	_solution_context)selfr   r   r   r    	__class__r   r   r/   7   s4    zVerificationInstance.__init__VerificationContextreturnc                 C   s.   | j du r(t| j| jd | 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: VerificationContext for this VerificationInstance
        Nr   r    r-   )r3   r7   _versionr2   r4   r   r   r   _proxy\   s    
zVerificationInstance._proxyc                 C   s
   | j  S )e
        Fetch the VerificationInstance


        :returns: The fetched VerificationInstance
        )r<   fetchr;   r   r   r   r>   l   s    zVerificationInstance.fetchc                    s   | j  I dH S )
        Asynchronous coroutine to fetch the VerificationInstance


        :returns: The fetched VerificationInstance
        N)r<   fetch_asyncr;   r   r   r   r@   u   s    z VerificationInstance.fetch_asyncr   r$   r9   c                 C   s   | j j|dS )}
        Update the VerificationInstance

        :param status:

        :returns: The updated VerificationInstance
        r$   )r<   updater4   r$   r   r   r   rD   ~   s    zVerificationInstance.updatec                    s   | j j|dI dH S )
        Asynchronous coroutine to update the VerificationInstance

        :param status:

        :returns: The updated VerificationInstance
        rC   N)r<   update_asyncrE   r   r   r   rG      s    
z!VerificationInstance.update_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>       z0VerificationInstance.__repr__.<locals>.<genexpr>z*<Twilio.Verify.V2.VerificationInstance {}>joinr2   itemsrL   r4   contextr   r   r   __repr__   s    zVerificationInstance.__repr__)N)r   r   r   objectr   r   r   r   strr   r   r/   propertyr<   r>   r@   rD   rG   rX   __classcell__r   r   r5   r   r      s$    
%		r   c                       sp   e Zd Zeeed fddZedddZedddZd	ed
ddZ	d	ed
ddZ
edddZ  ZS )r7   )r   r   r    c                    s0   t  | ||d| _djf i | j| _dS )al  
        Initialize the VerificationContext

        :param version: Version that contains the resource
        :param service_sid: The SID of the verification [Service](https://www.twilio.com/docs/verify/api/service) to update the resource from.
        :param sid: The Twilio-provided string that uniquely identifies the Verification resource to update.
        r-   z+/Services/{service_sid}/Verifications/{sid}Nr.   r/   r2   rL   _uri)r4   r   r   r    r5   r   r   r/      s    zVerificationContext.__init__r8   c                 C   s0   | j jd| jd}t| j || jd | jd dS )r=   GETmethodurir   r    r-   )r:   r>   r^   r   r2   r4   r   r   r   r   r>      s    zVerificationContext.fetchc                    s6   | j jd| jdI dH }t| j || jd | jd dS )r?   r_   r`   Nr   r    r-   )r:   r@   r^   r   r2   rc   r   r   r   r@      s    zVerificationContext.fetch_asyncr   rA   c                 C   s@   t d|i}| jjd| j|d}t| j|| jd | jd dS )rB   r   POSTra   rb   datar   r    r-   )r
   ofr:   rD   r^   r   r2   r4   r$   rf   r   r   r   r   rD      s    zVerificationContext.updatec                    sF   t d|i}| jjd| j|dI dH }t| j|| jd | jd dS )rF   r   rd   re   Nr   r    r-   )r
   rg   r:   rG   r^   r   r2   rh   r   r   r   rG      s    
z VerificationContext.update_asyncc                 C   s$   d dd | j D }d|S )rH   rI   c                 s   s   | ]\}}d  ||V  qdS rJ   rK   rM   r   r   r   rQ     rR   z/VerificationContext.__repr__.<locals>.<genexpr>z)<Twilio.Verify.V2.VerificationContext {}>rS   rV   r   r   r   rX     s    zVerificationContext.__repr__)r   r   r   r   rZ   r/   r   r>   r@   rD   rG   rX   r\   r   r   r5   r   r7      s   r7   c                       s  e Zd Zeed 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ejfeeeee	f eee	f eee	f eee	f eee	f eee	f eee	f ee	e	f ee	e	f eee	f eee	f eee	f eee	f e
d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ejfeeeee	f eee	f eee	f eee	f eee	f eee	f eee	f ee	e	f ee	e	f eee	f eee	f eee	f eee	f e
dddZeed	d
dZeed	ddZedddZ  ZS )VerificationList)r   r   c                    s.   t  | d|i| _djf i | j| _dS )z
        Initialize the VerificationList

        :param version: Version that contains the resource
        :param service_sid: The SID of the verification [Service](https://www.twilio.com/docs/verify/api/service) to create the resource under.

        r   z%/Services/{service_sid}/VerificationsNr]   )r4   r   r   r5   r   r   r/   !  s    zVerificationList.__init__)r"   r#   custom_friendly_namecustom_messagesend_digitslocalecustom_coder'   r(   rate_limitschannel_configurationapp_hashtemplate_sidtemplate_custom_substitutions	device_ipr9   c                 C   s`   t |||||||||	t|
t|||||d}| jjd| j|d}t| j|| jd dS )uh  
        Create the VerificationInstance

        :param to: The phone number or [email](https://www.twilio.com/docs/verify/email) to verify. Phone numbers must be in [E.164 format](https://www.twilio.com/docs/glossary/what-e164).
        :param channel: The verification method to use. One of: [`email`](https://www.twilio.com/docs/verify/email), `sms`, `whatsapp`, `call`, `sna` or `auto`.
        :param custom_friendly_name: A custom user defined friendly name that overwrites the existing one in the verification message
        :param custom_message: The text of a custom message to use for the verification.
        :param send_digits: The digits to send after a phone call is answered, for example, to dial an extension. For more information, see the Programmable Voice documentation of [sendDigits](https://www.twilio.com/docs/voice/twiml/number#attributes-sendDigits).
        :param locale: Locale will automatically resolve based on phone number country code for SMS, WhatsApp, and call channel verifications. It will fallback to English or the template’s default translation if the selected translation is not available. This parameter will override the automatic locale resolution. [See supported languages and more information here](https://www.twilio.com/docs/verify/supported-languages).
        :param custom_code: A pre-generated code to use for verification. The code can be between 4 and 10 characters, inclusive.
        :param amount: The amount of the associated PSD2 compliant transaction. Requires the PSD2 Service flag enabled.
        :param payee: The payee of the associated PSD2 compliant transaction. Requires the PSD2 Service flag enabled.
        :param rate_limits: The custom key-value pairs of Programmable Rate Limits. Keys correspond to `unique_name` fields defined when [creating your Rate Limit](https://www.twilio.com/docs/verify/api/service-rate-limits). Associated value pairs represent values in the request that you are rate limiting on. You may include multiple Rate Limit values in each request.
        :param channel_configuration: [`email`](https://www.twilio.com/docs/verify/email) channel configuration in json format. The fields 'from' and 'from_name' are optional but if included the 'from' field must have a valid email address.
        :param app_hash: Your [App Hash](https://developers.google.com/identity/sms-retriever/verify#computing_your_apps_hash_string) to be appended at the end of your verification SMS body. Applies only to SMS. Example SMS body: `<#> Your AppName verification code is: 1234 He42w354ol9`.
        :param template_sid: The message [template](https://www.twilio.com/docs/verify/api/templates). If provided, will override the default template for the Service. SMS and Voice channels only.
        :param template_custom_substitutions: A stringified JSON object in which the keys are the template's special variables and the values are the variables substitutions.
        :param device_ip: Strongly encouraged if using the auto channel. The IP address of the client's device. If provided, it has to be a valid IPv4 or IPv6 address.

        :returns: The created VerificationInstance
        Tor   ZCustomFriendlyNameZCustomMessageZ
SendDigitsZLocaleZ
CustomCodeZAmountZPayeeZ
RateLimitsZChannelConfigurationZAppHashZTemplateSidZTemplateCustomSubstitutionsZDeviceIprd   re   r   r   )	r
   rg   r	   rY   r:   creater^   r   r2   r4   r"   r#   rj   rk   rl   rm   rn   r'   r(   ro   rp   rq   rr   rs   rt   rf   r   r   r   r   rx   1  s4    'zVerificationList.createc                    sf   t |||||||||	t|
t|||||d}| jjd| j|dI dH }t| j|| jd dS )uw  
        Asynchronously create the VerificationInstance

        :param to: The phone number or [email](https://www.twilio.com/docs/verify/email) to verify. Phone numbers must be in [E.164 format](https://www.twilio.com/docs/glossary/what-e164).
        :param channel: The verification method to use. One of: [`email`](https://www.twilio.com/docs/verify/email), `sms`, `whatsapp`, `call`, `sna` or `auto`.
        :param custom_friendly_name: A custom user defined friendly name that overwrites the existing one in the verification message
        :param custom_message: The text of a custom message to use for the verification.
        :param send_digits: The digits to send after a phone call is answered, for example, to dial an extension. For more information, see the Programmable Voice documentation of [sendDigits](https://www.twilio.com/docs/voice/twiml/number#attributes-sendDigits).
        :param locale: Locale will automatically resolve based on phone number country code for SMS, WhatsApp, and call channel verifications. It will fallback to English or the template’s default translation if the selected translation is not available. This parameter will override the automatic locale resolution. [See supported languages and more information here](https://www.twilio.com/docs/verify/supported-languages).
        :param custom_code: A pre-generated code to use for verification. The code can be between 4 and 10 characters, inclusive.
        :param amount: The amount of the associated PSD2 compliant transaction. Requires the PSD2 Service flag enabled.
        :param payee: The payee of the associated PSD2 compliant transaction. Requires the PSD2 Service flag enabled.
        :param rate_limits: The custom key-value pairs of Programmable Rate Limits. Keys correspond to `unique_name` fields defined when [creating your Rate Limit](https://www.twilio.com/docs/verify/api/service-rate-limits). Associated value pairs represent values in the request that you are rate limiting on. You may include multiple Rate Limit values in each request.
        :param channel_configuration: [`email`](https://www.twilio.com/docs/verify/email) channel configuration in json format. The fields 'from' and 'from_name' are optional but if included the 'from' field must have a valid email address.
        :param app_hash: Your [App Hash](https://developers.google.com/identity/sms-retriever/verify#computing_your_apps_hash_string) to be appended at the end of your verification SMS body. Applies only to SMS. Example SMS body: `<#> Your AppName verification code is: 1234 He42w354ol9`.
        :param template_sid: The message [template](https://www.twilio.com/docs/verify/api/templates). If provided, will override the default template for the Service. SMS and Voice channels only.
        :param template_custom_substitutions: A stringified JSON object in which the keys are the template's special variables and the values are the variables substitutions.
        :param device_ip: Strongly encouraged if using the auto channel. The IP address of the client's device. If provided, it has to be a valid IPv4 or IPv6 address.

        :returns: The created VerificationInstance
        ru   rd   re   Nr   rw   )	r
   rg   r	   rY   r:   create_asyncr^   r   r2   ry   r   r   r   rz   v  s4    'zVerificationList.create_async)r    r9   c                 C   s   t | j| jd |dS z
        Constructs a VerificationContext

        :param sid: The Twilio-provided string that uniquely identifies the Verification resource to update.
        r   r-   r7   r:   r2   r4   r    r   r   r   r0     s    zVerificationList.getc                 C   s   t | j| jd |dS r{   r|   r}   r   r   r   __call__  s    zVerificationList.__call__r8   c                 C   s   dS )rH   z#<Twilio.Verify.V2.VerificationList>r   r;   r   r   r   rX     s    zVerificationList.__repr__)r   r   r   r   rZ   r/   r
   unsetr   rY   r   rx   rz   r7   r0   r~   rX   r\   r   r   r5   r   ri      s   












I












E

ri   N)__doc__r   typingr   r   r   r   r   Ztwilio.baser   r	   r
   Ztwilio.base.instance_contextr   Ztwilio.base.instance_resourcer   Ztwilio.base.list_resourcer   Ztwilio.base.versionr   r   r7   ri   r   r   r   r   <module>   s    
~