o
    eG                     @   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                       s   e Zd Z fddZejejejejejejejejddf
ddZejejejejejejejejd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fdd	Zd
d Z	dd Z
dd Zdd Z  ZS )VerificationAttemptListc                    s.   t t| | i | _djdi | j| _dS )a%  
        Initialize the VerificationAttemptList

        :param Version version: Version that contains the resource

        :returns: twilio.rest.verify.v2.verification_attempt.VerificationAttemptList
        :rtype: twilio.rest.verify.v2.verification_attempt.VerificationAttemptList
        z	/AttemptsN )superr	   __init__	_solutionformat_uri)selfversion	__class__r
   ]/var/www/html/venv/lib/python3.10/site-packages/twilio/rest/verify/v2/verification_attempt.pyr      s   	z VerificationAttemptList.__init__Nc                 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: Filter verification attempts after this date.
        :param datetime date_created_before: Filter verification attempts before this date.
        :param unicode channel_data_to: Filters by destination of the verification attempt.
        :param unicode country: Filter verification attempts by destination country.
        :param VerificationAttemptInstance.Channels channel: Filter verification attempts by communication channel.
        :param unicode verify_service_sid: Filter verification attempts by verify service.
        :param unicode verification_sid: Filter attempts by verification.
        :param VerificationAttemptInstance.ConversionStatus status: Filter verification attempts by conversion status.
        :param int limit: Upper limit for the number of records to return. stream()
                          guarantees to never return more than limit.  Default is no limit
        :param int 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
        :rtype: list[twilio.rest.verify.v2.verification_attempt.VerificationAttemptInstance]
        	page_size)	date_created_afterdate_created_beforechannel_data_tocountrychannelverify_service_sidverification_sidstatusr   limit)_versionread_limitspagestream)r   r   r   r   r   r   r   r   r   r   r   limitsr!   r
   r
   r   r"   #   s   zVerificationAttemptList.streamc                 C   s"   t | j|||||||||	|
d
S )au  
        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: Filter verification attempts after this date.
        :param datetime date_created_before: Filter verification attempts before this date.
        :param unicode channel_data_to: Filters by destination of the verification attempt.
        :param unicode country: Filter verification attempts by destination country.
        :param VerificationAttemptInstance.Channels channel: Filter verification attempts by communication channel.
        :param unicode verify_service_sid: Filter verification attempts by verify service.
        :param unicode verification_sid: Filter attempts by verification.
        :param VerificationAttemptInstance.ConversionStatus status: Filter verification attempts by conversion status.
        :param int limit: Upper limit for the number of records to return. list() guarantees
                          never to return more than limit.  Default is no limit
        :param int 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: Generator that will yield up to limit results
        :rtype: list[twilio.rest.verify.v2.verification_attempt.VerificationAttemptInstance]
        )
r   r   r   r   r   r   r   r   r   r   )listr"   )r   r   r   r   r   r   r   r   r   r   r   r
   r
   r   r$   P   s   zVerificationAttemptList.listc                 C   sR   t t|t||||||||	|
|d}| jjd| j|d}t| j|| jS )a  
        Retrieve a single page of VerificationAttemptInstance records from the API.
        Request is executed immediately

        :param datetime date_created_after: Filter verification attempts after this date.
        :param datetime date_created_before: Filter verification attempts before this date.
        :param unicode channel_data_to: Filters by destination of the verification attempt.
        :param unicode country: Filter verification attempts by destination country.
        :param VerificationAttemptInstance.Channels channel: Filter verification attempts by communication channel.
        :param unicode verify_service_sid: Filter verification attempts by verify service.
        :param unicode verification_sid: Filter attempts by verification.
        :param VerificationAttemptInstance.ConversionStatus status: Filter verification attempts by conversion status.
        :param str page_token: PageToken provided by the API
        :param int page_number: Page Number, this value is simply for client state
        :param int page_size: Number of records to return, defaults to 50

        :returns: Page of VerificationAttemptInstance
        :rtype: twilio.rest.verify.v2.verification_attempt.VerificationAttemptPage
        )DateCreatedAfterDateCreatedBeforezChannelData.ToCountryChannelVerifyServiceSidVerificationSidStatus	PageTokenr   PageSizeGET)methoduriparams)	r   ofr   iso8601_datetimer   r!   r   VerificationAttemptPager   )r   r   r   r   r   r   r   r   r   
page_tokenpage_numberr   dataresponser
   r
   r   r!   y   s   zVerificationAttemptList.pagec                 C   s"   | j jjd|}t| j || jS )ab  
        Retrieve a specific page of VerificationAttemptInstance records from the API.
        Request is executed immediately

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

        :returns: Page of VerificationAttemptInstance
        :rtype: twilio.rest.verify.v2.verification_attempt.VerificationAttemptPage
        r.   )r   domaintwiliorequestr4   r   )r   
target_urlr8   r
   r
   r   get_page   s
   

z VerificationAttemptList.get_pagec                 C      t | j|dS a  
        Constructs a VerificationAttemptContext

        :param sid: Verification Attempt Sid.

        :returns: twilio.rest.verify.v2.verification_attempt.VerificationAttemptContext
        :rtype: twilio.rest.verify.v2.verification_attempt.VerificationAttemptContext
        sidVerificationAttemptContextr   r   rA   r
   r
   r   get      	zVerificationAttemptList.getc                 C   r>   r?   rB   rD   r
   r
   r   __call__   rF   z VerificationAttemptList.__call__c                 C      dS )z
        Provide a friendly representation

        :returns: Machine friendly representation
        :rtype: str
        z*<Twilio.Verify.V2.VerificationAttemptList>r
   r   r
   r
   r   __repr__      z VerificationAttemptList.__repr__)__name__
__module____qualname__r   r   unsetr"   r$   r!   r=   rE   rG   rK   __classcell__r
   r
   r   r   r	      s2    
-
)
+r	   c                       ,   e Zd Z fddZdd Zdd Z  ZS )r4   c                    s   t t| || || _dS )a]  
        Initialize the VerificationAttemptPage

        :param Version version: Version that contains the resource
        :param Response response: Response from the API

        :returns: twilio.rest.verify.v2.verification_attempt.VerificationAttemptPage
        :rtype: twilio.rest.verify.v2.verification_attempt.VerificationAttemptPage
        N)r   r4   r   r   )r   r   r8   solutionr   r
   r   r      s   

z VerificationAttemptPage.__init__c                 C   s   t | j|S )a/  
        Build an instance of VerificationAttemptInstance

        :param dict payload: Payload response from the API

        :returns: twilio.rest.verify.v2.verification_attempt.VerificationAttemptInstance
        :rtype: twilio.rest.verify.v2.verification_attempt.VerificationAttemptInstance
        )VerificationAttemptInstancer   r   payloadr
   r
   r   get_instance   s   	z$VerificationAttemptPage.get_instancec                 C   rH   )rI   z*<Twilio.Verify.V2.VerificationAttemptPage>r
   rJ   r
   r
   r   rK      rL   z VerificationAttemptPage.__repr__)rM   rN   rO   r   rW   rK   rQ   r
   r
   r   r   r4      s    r4   c                       rR   )rC   c                    s2   t t| | d|i| _djdi | j| _dS )a\  
        Initialize the VerificationAttemptContext

        :param Version version: Version that contains the resource
        :param sid: Verification Attempt Sid.

        :returns: twilio.rest.verify.v2.verification_attempt.VerificationAttemptContext
        :rtype: twilio.rest.verify.v2.verification_attempt.VerificationAttemptContext
        rA   z/Attempts/{sid}Nr
   )r   rC   r   r   r   r   )r   r   rA   r   r
   r   r      s   

z#VerificationAttemptContext.__init__c                 C   s(   | j jd| jd}t| j || jd dS )
        Fetch the VerificationAttemptInstance

        :returns: The fetched VerificationAttemptInstance
        :rtype: twilio.rest.verify.v2.verification_attempt.VerificationAttemptInstance
        r.   )r/   r0   rA   r@   )r   fetchr   rT   r   rU   r
   r
   r   rY     s   z VerificationAttemptContext.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>      z6VerificationAttemptContext.__repr__.<locals>.<genexpr>z0<Twilio.Verify.V2.VerificationAttemptContext {}>joinr   itemsr   r   contextr
   r
   r   rK        
z#VerificationAttemptContext.__repr__)rM   rN   rO   r   rY   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G dd de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d&d' Zd(d) Z  ZS )+rT   c                   @   s   e Zd ZdZdZdZdZdS )z$VerificationAttemptInstance.ChannelssmscallemailwhatsappN)rM   rN   rO   SMSCALLEMAILWHATSAPPr
   r
   r
   r   Channels%  s
    rs   c                   @   s,   e Zd ZdZdZdZdZdZdZdZ	dZ
d	S )
z&VerificationAttemptInstance.CallStatusqueuedzin-progress	completedbusyfailedz	no-answerringingcanceledN)rM   rN   rO   QUEUEDIN_PROGRESS	COMPLETEDBUSYFAILED	NO_ANSWERRINGINGCANCELEDr
   r
   r
   r   
CallStatus+  s    r   c                   @   s@   e Zd ZdZdZdZdZdZdZdZ	dZ
d	Zd
ZdZdZdZdS )z)VerificationAttemptInstance.MessageStatusrt   sendingsentrw   	deliveredundelivered	receivingreceivedaccepted	scheduledreadpartially_deliveredry   N)rM   rN   rO   rz   SENDINGSENTr~   	DELIVEREDUNDELIVERED	RECEIVINGRECEIVEDACCEPTED	SCHEDULEDREADPARTIALLY_DELIVEREDr   r
   r
   r
   r   MessageStatus5  s    r   c                   @   s   e Zd ZdZdZdS )z,VerificationAttemptInstance.ConversionStatus	convertedunconvertedN)rM   rN   rO   	CONVERTEDUNCONVERTEDr
   r
   r
   r   ConversionStatusD  s    r   c                   @   s   e Zd ZdZdZdZdS )z)VerificationAttemptInstance.AttemptStatus	confirmedunconfirmedexpiredN)rM   rN   rO   	CONFIRMEDUNCONFIRMEDEXPIREDr
   r
   r
   r   AttemptStatusH  s    r   Nc                    s   t t| | |d|d|d|dt|dt|d|d|d|d	|d
|dd| _d| _d|pH| jd i| _dS )z
        Initialize the VerificationAttemptInstance

        :returns: twilio.rest.verify.v2.verification_attempt.VerificationAttemptInstance
        :rtype: twilio.rest.verify.v2.verification_attempt.VerificationAttemptInstance
        rA   account_sidservice_sidr   date_createddate_updatedconversion_statusr   pricechannel_dataurl)rA   r   r   r   r   r   r   r   r   r   r   N)	r   rT   r   rE   r   r3   _properties_contextr   )r   r   rV   rA   r   r
   r   r   M  s   z$VerificationAttemptInstance.__init__c                 C   s&   | j du rt| j| jd d| _ | j S )aX  
        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
        :rtype: twilio.rest.verify.v2.verification_attempt.VerificationAttemptContext
        NrA   r@   )r   rC   r   r   rJ   r
   r
   r   _proxyi  s   
	z"VerificationAttemptInstance._proxyc                 C   
   | j d S )zn
        :returns: The SID that uniquely identifies the verification attempt.
        :rtype: unicode
        rA   r   rJ   r
   r
   r   rA   v     
zVerificationAttemptInstance.sidc                 C   r   )zi
        :returns: The SID of the Account that created the verification.
        :rtype: unicode
        r   r   rJ   r
   r
   r   r   ~  r   z'VerificationAttemptInstance.account_sidc                 C   r   )zn
        :returns: The SID of the verify service that generated this attempt.
        :rtype: unicode
        r   r   rJ   r
   r
   r   r     r   z'VerificationAttemptInstance.service_sidc                 C   r   )zl
        :returns: The SID of the verification that generated this attempt.
        :rtype: unicode
        r   r   rJ   r
   r
   r   r     r   z,VerificationAttemptInstance.verification_sidc                 C   r   )zV
        :returns: The date this Attempt was created
        :rtype: datetime
        r   r   rJ   r
   r
   r   r     r   z(VerificationAttemptInstance.date_createdc                 C   r   )zV
        :returns: The date this Attempt was updated
        :rtype: datetime
        r   r   rJ   r
   r
   r   r     r   z(VerificationAttemptInstance.date_updatedc                 C   r   )z
        :returns: Status of the conversion for the verification.
        :rtype: VerificationAttemptInstance.ConversionStatus
        r   r   rJ   r
   r
   r   r     r   z-VerificationAttemptInstance.conversion_statusc                 C   r   )z|
        :returns: Communication channel used for the attempt.
        :rtype: VerificationAttemptInstance.Channels
        r   r   rJ   r
   r
   r   r     r   z#VerificationAttemptInstance.channelc                 C   r   )zo
        :returns: An object containing the charge for this verification attempt.
        :rtype: dict
        r   r   rJ   r
   r
   r   r     r   z!VerificationAttemptInstance.pricec                 C   r   )zv
        :returns: An object containing the channel specific information for an attempt.
        :rtype: dict
        r   r   rJ   r
   r
   r   r     r   z(VerificationAttemptInstance.channel_datac                 C   r   )z;
        :returns: The url
        :rtype: unicode
        r   r   rJ   r
   r
   r   r     r   zVerificationAttemptInstance.urlc                 C   s
   | j  S )rX   )r   rY   rJ   r
   r
   r   rY     s   
z!VerificationAttemptInstance.fetchc                 C   rZ   )rI   r[   c                 s   r\   r]   r^   r_   r
   r
   r   rc     rd   z7VerificationAttemptInstance.__repr__.<locals>.<genexpr>z1<Twilio.Verify.V2.VerificationAttemptInstance {}>re   rh   r
   r
   r   rK     rj   z$VerificationAttemptInstance.__repr__)N)rM   rN   rO   objectrs   r   r   r   r   r   propertyr   rA   r   r   r   r   r   r   r   r   r   r   rY   rK   rQ   r
   r
   r   r   rT   #  sB    












	rT   N)__doc__twilio.baser   r   r   twilio.base.instance_contextr   twilio.base.instance_resourcer   twilio.base.list_resourcer   twilio.base.pager   r	   r4   rC   rT   r
   r
   r
   r   <module>   s    D&(