o
    f>hx                     @   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dedeee	f de
e f fd	d
ZedddZdddZdddZdefddZ  ZS )VerificationAttemptInstancec                   @   s   e Zd ZdZdZdZdZdS )$VerificationAttemptInstance.ChannelssmscallemailwhatsappN)__name__
__module____qualname__SMSCALLEMAILWHATSAPP r   r   ]/var/www/html/venv/lib/python3.10/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.ConversionStatus	convertedunconvertedN)r   r   r   	CONVERTED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|pS| 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/   r0   r1   r2   r3   r4   	_solution_context)selfr(   r)   r*   	__class__r   r    r6   3   s,   

z$VerificationAttemptInstance.__init__returnVerificationAttemptContextc                 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*   )r:   r?   _versionr9   r;   r   r   r    _proxyQ   s   
z"VerificationAttemptInstance._proxyc                 C   s
   | j  S )s
        Fetch the VerificationAttemptInstance


        :returns: The fetched VerificationAttemptInstance
        )rC   fetchrB   r   r   r    rE   `   s   
z!VerificationAttemptInstance.fetchc                    s   | j  I dH S )
        Asynchronous coroutine to fetch the VerificationAttemptInstance


        :returns: The fetched VerificationAttemptInstance
        N)rC   fetch_asyncrB   r   r   r    rG   i   s   z'VerificationAttemptInstance.fetch_asyncc                 C   $   d dd | j D }d|S )f
        Provide a friendly representation

        :returns: Machine friendly representation
         c                 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 {}>joinr9   itemsrN   r;   contextr   r   r    __repr__r      
z$VerificationAttemptInstance.__repr__N)r>   r?   )r>   r   )r   r   r   objectr!   r'   r   r   strr   r   r6   propertyrC   rE   rG   rZ   __classcell__r   r   r<   r    r      s"    


		r   c                       sP   e Zd Zdedef fddZdefddZdefdd	Zdefd
dZ	  Z
S )r?   r(   r*   c                    s.   t  | d|i| _djd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}Nr   )r5   r6   r9   rN   _uri)r;   r(   r*   r<   r   r    r6   ~   s   z#VerificationAttemptContext.__init__r>   c                 C   s<   t i }d|d< | jjd| j|d}t| j|| jd dS )rD   application/jsonAcceptGETmethoduriheadersr*   r@   )r   ofrA   rE   ra   r   r9   r;   rh   r)   r   r   r    rE      s   
z VerificationAttemptContext.fetchc                    sD   t i }d|d< | jjd| j|dI dH }t| j|| jd dS )rF   rb   rc   rd   re   Nr*   r@   )r   ri   rA   rG   ra   r   r9   rj   r   r   r    rG      s   
z&VerificationAttemptContext.fetch_asyncc                 C   rH   )rI   rJ   c                 s   rK   rL   rM   rO   r   r   r    rS      rT   z6VerificationAttemptContext.__repr__.<locals>.<genexpr>z0<Twilio.Verify.V2.VerificationAttemptContext {}>rU   rX   r   r   r    rZ      r[   z#VerificationAttemptContext.__repr__)r   r   r   r   r^   r6   r   rE   rG   rZ   r`   r   r   r<   r    r?   |   s
    r?   c                   @   s4   e Zd Zdeeef defddZdefddZdS )VerificationAttemptPager)   r>   c                 C   s   t | j|S )zy
        Build an instance of VerificationAttemptInstance

        :param payload: Payload response from the API
        )r   rA   )r;   r)   r   r   r    get_instance   s   z$VerificationAttemptPage.get_instancec                 C      dS )rI   z*<Twilio.Verify.V2.VerificationAttemptPage>r   rB   r   r   r    rZ         z VerificationAttemptPage.__repr__N)	r   r   r   r   r^   r   r   rl   rZ   r   r   r   r    rk      s    rk   c                       s  e Zd Zdef fddZejejejejejejejejddf
deee	f deee	f dee
e	f dee
e	f d	ed
e	f dee
e	f dee
e	f dede	f dee dee dee fddZejejejejejejejejddf
deee	f deee	f dee
e	f dee
e	f d	ed
e	f dee
e	f dee
e	f dede	f dee dee dee fddZejejejejejejejejddf
deee	f deee	f dee
e	f dee
e	f d	ed
e	f dee
e	f dee
e	f dede	f dee dee dee fddZejejejejejejejejddf
deee	f deee	f dee
e	f dee
e	f d	ed
e	f dee
e	f dee
e	f dede	f dee dee dee 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fdeee	f deee	f dee
e	f dee
e	f d	ed
e	f dee
e	f dee
e	f dede	f dee
e	f deee	f deee	f de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fdeee	f deee	f dee
e	f dee
e	f d	ed
e	f dee
e	f dee
e	f dede	f dee
e	f deee	f deee	f defddZd e
defd!d"Zd e
defd#d$Zd%e
defd&d'Zd%e
defd(d)Zde
fd*d+Z  ZS ),VerificationAttemptListr(   c                    s   t  | d| _dS )zu
        Initialize the VerificationAttemptList

        :param version: Version that contains the resource

        z	/AttemptsN)r5   r6   ra   )r;   r(   r<   r   r    r6      s   
z VerificationAttemptList.__init__Ndate_created_afterdate_created_beforechannel_data_tocountryr1   r   verify_service_sidr-   statusr"   limit	page_sizer>   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 consider only Verification Attempts created after this datetime on the summary aggregation. Given as GMT in ISO 8601 formatted datetime string: yyyy-MM-dd'T'HH:mm:ss'Z.
        :param datetime date_created_before: Datetime filter used to consider only Verification Attempts created before this datetime on the summary aggregation. Given as GMT in ISO 8601 formatted datetime string: yyyy-MM-dd'T'HH:mm:ss'Z.
        :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
        rw   	rp   rq   rr   rs   r1   rt   r-   ru   rw   rv   )rA   read_limitspagestreamr;   rp   rq   rr   rs   r1   rt   r-   ru   rv   rw   limitsrz   r   r   r    r{      s   &zVerificationAttemptList.streamc                    sH   | j |	|
}| j|||||||||d d	I dH }| j ||d S )a4	  
        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 consider only Verification Attempts created after this datetime on the summary aggregation. Given as GMT in ISO 8601 formatted datetime string: yyyy-MM-dd'T'HH:mm:ss'Z.
        :param datetime date_created_before: Datetime filter used to consider only Verification Attempts created before this datetime on the summary aggregation. Given as GMT in ISO 8601 formatted datetime string: yyyy-MM-dd'T'HH:mm:ss'Z.
        :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
        rw   rx   Nrv   )rA   ry   
page_asyncstream_asyncr|   r   r   r    r     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 consider only Verification Attempts created after this datetime on the summary aggregation. Given as GMT in ISO 8601 formatted datetime string: yyyy-MM-dd'T'HH:mm:ss'Z.
        :param datetime date_created_before: Datetime filter used to consider only Verification Attempts created before this datetime on the summary aggregation. Given as GMT in ISO 8601 formatted datetime string: yyyy-MM-dd'T'HH:mm:ss'Z.
        :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
        
rp   rq   rr   rs   r1   rt   r-   ru   rv   rw   )listr{   r;   rp   rq   rr   rs   r1   rt   r-   ru   rv   rw   r   r   r    r   K  s   %zVerificationAttemptList.listc                    s6   dd | j |||||||||	|
d
I dH 2 I dH S )a  
        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 consider only Verification Attempts created after this datetime on the summary aggregation. Given as GMT in ISO 8601 formatted datetime string: yyyy-MM-dd'T'HH:mm:ss'Z.
        :param datetime date_created_before: Datetime filter used to consider only Verification Attempts created before this datetime on the summary aggregation. Given as GMT in ISO 8601 formatted datetime string: yyyy-MM-dd'T'HH:mm:ss'Z.
        :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 r\   r   )rP   recordr   r   r    
<listcomp>  s
    z6VerificationAttemptList.list_async.<locals>.<listcomp>r   N)r   r   r   r   r    
list_async  s   %
z"VerificationAttemptList.list_async
page_tokenpage_numberc                 C   sf   t t|t||||||||	|
|d}t ddi}d|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 consider only Verification Attempts created after this datetime on the summary aggregation. Given as GMT in ISO 8601 formatted datetime string: yyyy-MM-dd'T'HH:mm:ss'Z.
        :param date_created_before: Datetime filter used to consider only Verification Attempts created before this datetime on the summary aggregation. Given as GMT in ISO 8601 formatted datetime string: yyyy-MM-dd'T'HH:mm:ss'Z.
        :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
        DateCreatedAfterDateCreatedBeforezChannelData.ToCountryChannelVerifyServiceSidVerificationSidStatus	PageTokenr   PageSizeContent-Type!application/x-www-form-urlencodedrb   rc   rd   rf   rg   paramsrh   )r   ri   r   r8   rA   rz   ra   rk   r;   rp   rq   rr   rs   r1   rt   r-   ru   r   r   rw   datarh   responser   r   r    rz     s(   "
zVerificationAttemptList.pagec                    sn   t t|t||||||||	|
|d}t ddi}d|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 consider only Verification Attempts created after this datetime on the summary aggregation. Given as GMT in ISO 8601 formatted datetime string: yyyy-MM-dd'T'HH:mm:ss'Z.
        :param date_created_before: Datetime filter used to consider only Verification Attempts created before this datetime on the summary aggregation. Given as GMT in ISO 8601 formatted datetime string: yyyy-MM-dd'T'HH:mm:ss'Z.
        :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
        r   r   r   rb   rc   rd   r   N)r   ri   r   r8   rA   r~   ra   rk   r   r   r   r    r~     s*   "
z"VerificationAttemptList.page_async
target_urlc                 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
        rd   )rA   domaintwiliorequestrk   r;   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
        rd   N)rA   r   r   request_asyncrk   r   r   r   r    get_page_async6  s   	z&VerificationAttemptList.get_page_asyncr*   c                 C      t | j|dS z
        Constructs a VerificationAttemptContext

        :param sid: The unique SID identifier of a Verification Attempt
        r@   r?   rA   r;   r*   r   r   r    r7   B     zVerificationAttemptList.getc                 C   r   r   r   r   r   r   r    __call__J  r   z VerificationAttemptList.__call__c                 C   rm   )rI   z*<Twilio.Verify.V2.VerificationAttemptList>r   rB   r   r   r    rZ   R  rn   z VerificationAttemptList.__repr__)r   r   r   r   r6   r   unsetr   r   r]   r^   r   intr   r   r{   r	   r   r   r   r   rk   rz   r~   r   r   r?   r7   r   rZ   r`   r   r   r<   r    ro      s   






	
7






	
7






	
6






	
7






	



=






	



;ro   N)__doc__r   typingr   r   r   r   r   r   r	   twilio.baser
   r   r   twilio.base.instance_contextr   twilio.base.instance_resourcer   twilio.base.list_resourcer   twilio.base.versionr   twilio.base.pager   r   r?   rk   ro   r   r   r   r    <module>   s    $cE