a
    !fr                     @   s   d Z ddlmZ ddlmZmZ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 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 )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IteratorAsyncIterator)deserialize	serializevalues)InstanceContext)InstanceResource)ListResource)Version)Pagec                       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 d fddZed	d
ddZd d
ddZd d
ddZed
ddZ  ZS )VerificationAttemptInstancec                   @   s   e Zd ZdZdZdZdZdS )$VerificationAttemptInstance.ChannelsZsmscallemailZwhatsappN)__name__
__module____qualname__ZSMSCALLZEMAILZWHATSAPP r   r   k/var/www/html/python-backend/venv/lib/python3.9/site-packages/twilio/rest/verify/v2/verification_attempt.pyChannels   s   r   c                   @   s   e Zd ZdZdZdS ),VerificationAttemptInstance.ConversionStatusZ	convertedZunconvertedN)r   r   r   Z	CONVERTEDZUNCONVERTEDr   r   r   r   ConversionStatus!   s   r   N)versionpayloadsidc                    s   t  | |d| _|d| _|d| _|d| _t|d| _	t|d| _
|d| _|d| _|d	| _|d
| _|d| _d|p| ji| _d | _d S )Nr!   account_sidservice_sidverification_siddate_createddate_updatedconversion_statuschannelpricechannel_dataurl)super__init__getr!   r"   r#   r$   r
   iso8601_datetimer%   r&   r'   r(   r)   r*   r+   	_solution_context)selfr   r    r!   	__class__r   r   r-   3   s,    
z$VerificationAttemptInstance.__init__VerificationAttemptContextreturnc                 C   s&   | j du r t| j| jd d| _ | j S )a  
        Generate an instance context for the instance, the context is capable of
        performing various actions. All instance actions are proxied to the context

        :returns: VerificationAttemptContext for this VerificationAttemptInstance
        Nr!   r!   )r1   r5   _versionr0   r2   r   r   r   _proxyQ   s    
z"VerificationAttemptInstance._proxyc                 C   s
   | j  S )s
        Fetch the VerificationAttemptInstance


        :returns: The fetched VerificationAttemptInstance
        )r;   fetchr:   r   r   r   r=   `   s    z!VerificationAttemptInstance.fetchc                    s   | j  I dH S )
        Asynchronous coroutine to fetch the VerificationAttemptInstance


        :returns: The fetched VerificationAttemptInstance
        N)r;   fetch_asyncr:   r   r   r   r?   i   s    z'VerificationAttemptInstance.fetch_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>x       z7VerificationAttemptInstance.__repr__.<locals>.<genexpr>z1<Twilio.Verify.V2.VerificationAttemptInstance {}>joinr0   itemsrD   r2   contextr   r   r   __repr__r   s    z$VerificationAttemptInstance.__repr__)N)r   r   r   objectr   r   r   r   strr   r   r-   propertyr;   r=   r?   rP   __classcell__r   r   r3   r   r      s    		r   c                       sN   e Zd Zeed fddZedddZedddZedd	d
Z	  Z
S )r5   )r   r!   c                    s.   t  | d|i| _djf i | j| _dS )z
        Initialize the VerificationAttemptContext

        :param version: Version that contains the resource
        :param sid: The unique SID identifier of a Verification Attempt
        r!   z/Attempts/{sid}N)r,   r-   r0   rD   _uri)r2   r   r!   r3   r   r   r-   }   s    z#VerificationAttemptContext.__init__r6   c                 C   s(   | j jd| jd}t| j || jd dS )r<   GETmethodurir!   r8   )r9   r=   rU   r   r0   r2   r    r   r   r   r=      s    z VerificationAttemptContext.fetchc                    s.   | j jd| jdI dH }t| j || jd dS )r>   rV   rW   Nr!   r8   )r9   r?   rU   r   r0   rZ   r   r   r   r?      s    z&VerificationAttemptContext.fetch_asyncc                 C   s$   d dd | j D }d|S )r@   rA   c                 s   s   | ]\}}d  ||V  qdS rB   rC   rE   r   r   r   rI      rJ   z6VerificationAttemptContext.__repr__.<locals>.<genexpr>z0<Twilio.Verify.V2.VerificationAttemptContext {}>rK   rN   r   r   r   rP      s    z#VerificationAttemptContext.__repr__)r   r   r   r   rR   r-   r   r=   r?   rP   rT   r   r   r3   r   r5   |   s   r5   c                   @   s2   e Zd Zeeef edddZedddZdS )VerificationAttemptPage)r    r7   c                 C   s   t | j|S )zy
        Build an instance of VerificationAttemptInstance

        :param payload: Payload response from the API
        )r   r9   rZ   r   r   r   get_instance   s    z$VerificationAttemptPage.get_instancer6   c                 C   s   dS )r@   z*<Twilio.Verify.V2.VerificationAttemptPage>r   r:   r   r   r   rP      s    z VerificationAttemptPage.__repr__N)	r   r   r   r   rR   r   r   r\   rP   r   r   r   r   r[      s   r[   c                       s  e Zd Zed fddZejejejejejejejejddf
eee	f eee	f ee
e	f ee
e	f ede	f ee
e	f ee
e	f ede	f ee ee ee ddd	Zejejejejejejejejddf
eee	f eee	f ee
e	f ee
e	f ede	f ee
e	f ee
e	f ede	f ee ee ee dd
dZejejejejejejejejddf
eee	f eee	f ee
e	f ee
e	f ede	f ee
e	f ee
e	f ede	f ee ee ee dddZejejejejejejejejddf
eee	f eee	f ee
e	f ee
e	f ede	f ee
e	f ee
e	f ede	f ee ee e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feee	f eee	f ee
e	f ee
e	f ede	f ee
e	f ee
e	f ed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feee	f eee	f ee
e	f ee
e	f ede	f ee
e	f ee
e	f ed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
edddZe
edddZe
dd d!Z  ZS )"VerificationAttemptList)r   c                    s   t  | d| _dS )zu
        Initialize the VerificationAttemptList

        :param version: Version that contains the resource

        z	/AttemptsN)r,   r-   rU   )r2   r   r3   r   r   r-      s    z VerificationAttemptList.__init__Nr   r   )date_created_afterdate_created_beforechannel_data_tocountryr(   verify_service_sidr$   statuslimit	page_sizer7   c                 C   s@   | j |	|
}| j|||||||||d d	}| j ||d S )a  
        Streams VerificationAttemptInstance records from the API as a generator stream.
        This operation lazily loads records as efficiently as possible until the limit
        is reached.
        The results are returned as a generator, so this operation is memory efficient.

        :param datetime date_created_after: Datetime filter used to query Verification Attempts created after this datetime. Given as GMT in RFC 2822 format.
        :param datetime date_created_before: Datetime filter used to query Verification Attempts created before this datetime. Given as GMT in RFC 2822 format.
        :param str channel_data_to: Destination of a verification. It is phone number in E.164 format.
        :param str country: Filter used to query Verification Attempts sent to the specified destination country.
        :param &quot;VerificationAttemptInstance.Channels&quot; channel: Filter used to query Verification Attempts by communication channel. Valid values are `SMS` and `CALL`
        :param str verify_service_sid: Filter used to query Verification Attempts by verify service. Only attempts of the provided SID will be returned.
        :param str verification_sid: Filter used to return all the Verification Attempts of a single verification. Only attempts of the provided verification SID will be returned.
        :param &quot;VerificationAttemptInstance.ConversionStatus&quot; status: Filter used to query Verification Attempts by conversion status. Valid values are `UNCONVERTED`, for attempts that were not converted, and `CONVERTED`, for attempts that were confirmed.
        :param limit: Upper limit for the number of records to return. stream()
                      guarantees to never return more than limit.  Default is no limit
        :param page_size: Number of records to fetch per request, when not set will use
                          the default value of 50 records.  If no page_size is defined
                          but a limit is defined, stream() will attempt to read the
                          limit with the most efficient page size, i.e. min(limit, 1000)

        :returns: Generator that will yield up to limit results
        re   	r^   r_   r`   ra   r(   rb   r$   rc   re   rd   )r9   read_limitspagestreamr2   r^   r_   r`   ra   r(   rb   r$   rc   rd   re   Zlimitsrh   r   r   r   ri      s    &zVerificationAttemptList.streamc                    sF   | j |	|
}| j|||||||||d d	I dH }| j ||d S )a  
        Asynchronously streams VerificationAttemptInstance records from the API as a generator stream.
        This operation lazily loads records as efficiently as possible until the limit
        is reached.
        The results are returned as a generator, so this operation is memory efficient.

        :param datetime date_created_after: Datetime filter used to query Verification Attempts created after this datetime. Given as GMT in RFC 2822 format.
        :param datetime date_created_before: Datetime filter used to query Verification Attempts created before this datetime. Given as GMT in RFC 2822 format.
        :param str channel_data_to: Destination of a verification. It is phone number in E.164 format.
        :param str country: Filter used to query Verification Attempts sent to the specified destination country.
        :param &quot;VerificationAttemptInstance.Channels&quot; channel: Filter used to query Verification Attempts by communication channel. Valid values are `SMS` and `CALL`
        :param str verify_service_sid: Filter used to query Verification Attempts by verify service. Only attempts of the provided SID will be returned.
        :param str verification_sid: Filter used to return all the Verification Attempts of a single verification. Only attempts of the provided verification SID will be returned.
        :param &quot;VerificationAttemptInstance.ConversionStatus&quot; status: Filter used to query Verification Attempts by conversion status. Valid values are `UNCONVERTED`, for attempts that were not converted, and `CONVERTED`, for attempts that were confirmed.
        :param limit: Upper limit for the number of records to return. stream()
                      guarantees to never return more than limit.  Default is no limit
        :param page_size: Number of records to fetch per request, when not set will use
                          the default value of 50 records.  If no page_size is defined
                          but a limit is defined, stream() will attempt to read the
                          limit with the most efficient page size, i.e. min(limit, 1000)

        :returns: Generator that will yield up to limit results
        re   rf   Nrd   )r9   rg   
page_asyncstream_asyncrj   r   r   r   rl     s    &z$VerificationAttemptList.stream_asyncc                 C   s"   t | j|||||||||	|
d
S )a$  
        Lists VerificationAttemptInstance records from the API as a list.
        Unlike stream(), this operation is eager and will load `limit` records into
        memory before returning.

        :param datetime date_created_after: Datetime filter used to query Verification Attempts created after this datetime. Given as GMT in RFC 2822 format.
        :param datetime date_created_before: Datetime filter used to query Verification Attempts created before this datetime. Given as GMT in RFC 2822 format.
        :param str channel_data_to: Destination of a verification. It is phone number in E.164 format.
        :param str country: Filter used to query Verification Attempts sent to the specified destination country.
        :param &quot;VerificationAttemptInstance.Channels&quot; channel: Filter used to query Verification Attempts by communication channel. Valid values are `SMS` and `CALL`
        :param str verify_service_sid: Filter used to query Verification Attempts by verify service. Only attempts of the provided SID will be returned.
        :param str verification_sid: Filter used to return all the Verification Attempts of a single verification. Only attempts of the provided verification SID will be returned.
        :param &quot;VerificationAttemptInstance.ConversionStatus&quot; status: Filter used to query Verification Attempts by conversion status. Valid values are `UNCONVERTED`, for attempts that were not converted, and `CONVERTED`, for attempts that were confirmed.
        :param limit: Upper limit for the number of records to return. list() guarantees
                      never to return more than limit.  Default is no limit
        :param page_size: Number of records to fetch per request, when not set will use
                          the default value of 50 records.  If no page_size is defined
                          but a limit is defined, list() will attempt to read the limit
                          with the most efficient page size, i.e. min(limit, 1000)

        :returns: list that will contain up to limit results
        
r^   r_   r`   ra   r(   rb   r$   rc   rd   re   )listri   r2   r^   r_   r`   ra   r(   rb   r$   rc   rd   re   r   r   r   rn   D  s    %zVerificationAttemptList.listc                    s4   dd | j |||||||||	|
d
I dH 2 I dH S )a3  
        Asynchronously lists VerificationAttemptInstance records from the API as a list.
        Unlike stream(), this operation is eager and will load `limit` records into
        memory before returning.

        :param datetime date_created_after: Datetime filter used to query Verification Attempts created after this datetime. Given as GMT in RFC 2822 format.
        :param datetime date_created_before: Datetime filter used to query Verification Attempts created before this datetime. Given as GMT in RFC 2822 format.
        :param str channel_data_to: Destination of a verification. It is phone number in E.164 format.
        :param str country: Filter used to query Verification Attempts sent to the specified destination country.
        :param &quot;VerificationAttemptInstance.Channels&quot; channel: Filter used to query Verification Attempts by communication channel. Valid values are `SMS` and `CALL`
        :param str verify_service_sid: Filter used to query Verification Attempts by verify service. Only attempts of the provided SID will be returned.
        :param str verification_sid: Filter used to return all the Verification Attempts of a single verification. Only attempts of the provided verification SID will be returned.
        :param &quot;VerificationAttemptInstance.ConversionStatus&quot; status: Filter used to query Verification Attempts by conversion status. Valid values are `UNCONVERTED`, for attempts that were not converted, and `CONVERTED`, for attempts that were confirmed.
        :param limit: Upper limit for the number of records to return. list() guarantees
                      never to return more than limit.  Default is no limit
        :param page_size: Number of records to fetch per request, when not set will use
                          the default value of 50 records.  If no page_size is defined
                          but a limit is defined, list() will attempt to read the limit
                          with the most efficient page size, i.e. min(limit, 1000)

        :returns: list that will contain up to limit results
        c                    s   g | z3 d H W }|q6 S )Nr   )rF   recordr   r   r   
<listcomp>  s   z6VerificationAttemptList.list_async.<locals>.<listcomp>rm   N)rl   ro   r   r   r   
list_asyncx  s    %
z"VerificationAttemptList.list_async)r^   r_   r`   ra   r(   rb   r$   rc   
page_tokenpage_numberre   r7   c                 C   sN   t t|t||||||||	|
|d}| jjd| j|d}t| j|S )a  
        Retrieve a single page of VerificationAttemptInstance records from the API.
        Request is executed immediately

        :param date_created_after: Datetime filter used to query Verification Attempts created after this datetime. Given as GMT in RFC 2822 format.
        :param date_created_before: Datetime filter used to query Verification Attempts created before this datetime. Given as GMT in RFC 2822 format.
        :param channel_data_to: Destination of a verification. It is phone number in E.164 format.
        :param country: Filter used to query Verification Attempts sent to the specified destination country.
        :param channel: Filter used to query Verification Attempts by communication channel. Valid values are `SMS` and `CALL`
        :param verify_service_sid: Filter used to query Verification Attempts by verify service. Only attempts of the provided SID will be returned.
        :param verification_sid: Filter used to return all the Verification Attempts of a single verification. Only attempts of the provided verification SID will be returned.
        :param status: Filter used to query Verification Attempts by conversion status. Valid values are `UNCONVERTED`, for attempts that were not converted, and `CONVERTED`, for attempts that were confirmed.
        :param page_token: PageToken provided by the API
        :param page_number: Page Number, this value is simply for client state
        :param page_size: Number of records to return, defaults to 50

        :returns: Page of VerificationAttemptInstance
        ZDateCreatedAfterZDateCreatedBeforezChannelData.ToZCountryZChannelZVerifyServiceSidZVerificationSidStatusZ	PageTokenr   ZPageSizerV   rX   rY   params)r   ofr   r/   r9   rh   rU   r[   r2   r^   r_   r`   ra   r(   rb   r$   rc   rs   rt   re   dataresponser   r   r   rh     s     "zVerificationAttemptList.pagec                    sT   t t|t||||||||	|
|d}| jjd| j|dI dH }t| j|S )a,  
        Asynchronously retrieve a single page of VerificationAttemptInstance records from the API.
        Request is executed immediately

        :param date_created_after: Datetime filter used to query Verification Attempts created after this datetime. Given as GMT in RFC 2822 format.
        :param date_created_before: Datetime filter used to query Verification Attempts created before this datetime. Given as GMT in RFC 2822 format.
        :param channel_data_to: Destination of a verification. It is phone number in E.164 format.
        :param country: Filter used to query Verification Attempts sent to the specified destination country.
        :param channel: Filter used to query Verification Attempts by communication channel. Valid values are `SMS` and `CALL`
        :param verify_service_sid: Filter used to query Verification Attempts by verify service. Only attempts of the provided SID will be returned.
        :param verification_sid: Filter used to return all the Verification Attempts of a single verification. Only attempts of the provided verification SID will be returned.
        :param status: Filter used to query Verification Attempts by conversion status. Valid values are `UNCONVERTED`, for attempts that were not converted, and `CONVERTED`, for attempts that were confirmed.
        :param page_token: PageToken provided by the API
        :param page_number: Page Number, this value is simply for client state
        :param page_size: Number of records to return, defaults to 50

        :returns: Page of VerificationAttemptInstance
        ru   rV   rw   N)r   ry   r   r/   r9   rk   rU   r[   rz   r   r   r   rk     s$    "z"VerificationAttemptList.page_async)
target_urlr7   c                 C   s   | j jjd|}t| j |S )a  
        Retrieve a specific page of VerificationAttemptInstance records from the API.
        Request is executed immediately

        :param target_url: API-generated URL for the requested results page

        :returns: Page of VerificationAttemptInstance
        rV   )r9   domaintwiliorequestr[   r2   r}   r|   r   r   r   get_page  s    	z VerificationAttemptList.get_pagec                    s$   | j jjd|I dH }t| j |S )a  
        Asynchronously retrieve a specific page of VerificationAttemptInstance records from the API.
        Request is executed immediately

        :param target_url: API-generated URL for the requested results page

        :returns: Page of VerificationAttemptInstance
        rV   N)r9   r~   r   Zrequest_asyncr[   r   r   r   r   get_page_async%  s    	z&VerificationAttemptList.get_page_async)r!   r7   c                 C   s   t | j|dS z
        Constructs a VerificationAttemptContext

        :param sid: The unique SID identifier of a Verification Attempt
        r8   r5   r9   r2   r!   r   r   r   r.   1  s    zVerificationAttemptList.getc                 C   s   t | j|dS r   r   r   r   r   r   __call__9  s    z VerificationAttemptList.__call__r6   c                 C   s   dS )r@   z*<Twilio.Verify.V2.VerificationAttemptList>r   r:   r   r   r   rP   A  s    z VerificationAttemptList.__repr__)r   r   r   r   r-   r   unsetr   r   rQ   rR   r   intr   r   ri   r	   rl   r   rn   rr   r[   rh   rk   r   r   r5   r.   r   rP   rT   r   r   r3   r   r]      s@  






7






7






6






7









7









7r]   N)__doc__r   typingr   r   r   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   Ztwilio.base.pager   r   r5   r[   r]   r   r   r   r   <module>   s   $b@