B
    `l                 @   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 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)values)InstanceContext)InstanceResource)ListResource)Page)AccessTokenList)
EntityList)MessagingConfigurationList)RateLimitList)VerificationList)VerificationCheckList)WebhookListc                   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ejejejfddZdddZddd	Zejejejfd
dZ	dd Z
dd Zdd Zdd Z  ZS )ServiceListc                s*   t t| | i | _djf | j| _dS )z
        Initialize the ServiceList

        :param Version version: Version that contains the resource

        :returns: twilio.rest.verify.v2.service.ServiceList
        :rtype: twilio.rest.verify.v2.service.ServiceList
        z	/ServicesN)superr   __init__	_solutionformat_uri)selfversion)	__class__ U/home/dcms/DCMS/lib/python3.7/site-packages/twilio/rest/verify/v2/service/__init__.pyr      s    	zServiceList.__init__c             C   sD   t |||||||||	|
||d}| jjd| j|d}t| j|S )aL  
        Create the ServiceInstance

        :param unicode friendly_name: A string to describe the verification service
        :param unicode code_length: The length of the verification code to generate
        :param bool lookup_enabled: Whether to perform a lookup with each verification
        :param bool skip_sms_to_landlines: Whether to skip sending SMS verifications to landlines
        :param bool dtmf_input_required: Whether to ask the user to press a number before delivering the verify code in a phone call
        :param unicode tts_name: The name of an alternative text-to-speech service to use in phone calls
        :param bool psd2_enabled: Whether to pass PSD2 transaction parameters when starting a verification
        :param bool do_not_share_warning_enabled: Whether to add a security warning at the end of an SMS.
        :param bool custom_code_enabled: Whether to allow sending verifications with a custom code.
        :param bool push_include_date: Optional. Include the date in the Challenge's reponse. Default: true
        :param unicode push_apn_credential_sid: Optional. Set APN Credential for this service.
        :param unicode push_fcm_credential_sid: Optional. Set FCM Credential for this service.

        :returns: The created ServiceInstance
        :rtype: twilio.rest.verify.v2.service.ServiceInstance
        )FriendlyName
CodeLengthLookupEnabledSkipSmsToLandlinesDtmfInputRequiredTtsNamePsd2EnabledDoNotShareWarningEnabledCustomCodeEnabledzPush.IncludeDatezPush.ApnCredentialSidzPush.FcmCredentialSidPOST)methoduridata)r   of_versioncreater   ServiceInstance)r   friendly_namecode_lengthlookup_enabledskip_sms_to_landlinesdtmf_input_requiredtts_namepsd2_enableddo_not_share_warning_enabledcustom_code_enabledpush_include_datepush_apn_credential_sidpush_fcm_credential_sidr&   payloadr   r   r   r)   )   s    
zServiceList.createNc             C   s0   | j ||}| j|d d}| j ||d S )a  
        Streams ServiceInstance 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 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.service.ServiceInstance]
        	page_size)r8   limit)r(   Zread_limitspagestream)r   r9   r8   Zlimitsr:   r   r   r   r;   V   s    zServiceList.streamc             C   s   t | j||dS )aY  
        Lists ServiceInstance records from the API as a list.
        Unlike stream(), this operation is eager and will load `limit` records into
        memory before returning.

        :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.service.ServiceInstance]
        )r9   r8   )listr;   )r   r9   r8   r   r   r   r<   m   s    zServiceList.listc             C   s6   t |||d}| jjd| j|d}t| j|| jS )a  
        Retrieve a single page of ServiceInstance records from the API.
        Request is executed immediately

        :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 ServiceInstance
        :rtype: twilio.rest.verify.v2.service.ServicePage
        )Z	PageTokenr   ZPageSizeGET)r$   r%   params)r   r'   r(   r:   r   ServicePager   )r   Z
page_tokenZpage_numberr8   r&   responser   r   r   r:      s    zServiceList.pagec             C   s"   | j jjd|}t| j || jS )a1  
        Retrieve a specific page of ServiceInstance records from the API.
        Request is executed immediately

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

        :returns: Page of ServiceInstance
        :rtype: twilio.rest.verify.v2.service.ServicePage
        r=   )r(   domainZtwiliorequestr?   r   )r   
target_urlr@   r   r   r   get_page   s    

zServiceList.get_pagec             C   s   t | j|dS )z
        Constructs a ServiceContext

        :param sid: The unique string that identifies the resource

        :returns: twilio.rest.verify.v2.service.ServiceContext
        :rtype: twilio.rest.verify.v2.service.ServiceContext
        )sid)ServiceContextr(   )r   rE   r   r   r   get   s    	zServiceList.getc             C   s   t | j|dS )z
        Constructs a ServiceContext

        :param sid: The unique string that identifies the resource

        :returns: twilio.rest.verify.v2.service.ServiceContext
        :rtype: twilio.rest.verify.v2.service.ServiceContext
        )rE   )rF   r(   )r   rE   r   r   r   __call__   s    	zServiceList.__call__c             C   s   dS )zz
        Provide a friendly representation

        :returns: Machine friendly representation
        :rtype: str
        z<Twilio.Verify.V2.ServiceList>r   )r   r   r   r   __repr__   s    zServiceList.__repr__)NN)NN)__name__
__module____qualname__r   r   unsetr)   r;   r<   r:   rD   rG   rH   rI   __classcell__r   r   )r   r   r      s    '

r   c                   s,   e Zd Z fddZdd Zdd Z  ZS )r?   c                s   t t| || || _dS )a  
        Initialize the ServicePage

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

        :returns: twilio.rest.verify.v2.service.ServicePage
        :rtype: twilio.rest.verify.v2.service.ServicePage
        N)r   r?   r   r   )r   r   r@   Zsolution)r   r   r   r      s    
zServicePage.__init__c             C   s   t | j|S )z
        Build an instance of ServiceInstance

        :param dict payload: Payload response from the API

        :returns: twilio.rest.verify.v2.service.ServiceInstance
        :rtype: twilio.rest.verify.v2.service.ServiceInstance
        )r*   r(   )r   r7   r   r   r   get_instance   s    	zServicePage.get_instancec             C   s   dS )zz
        Provide a friendly representation

        :returns: Machine friendly representation
        :rtype: str
        z<Twilio.Verify.V2.ServicePage>r   )r   r   r   r   rI      s    zServicePage.__repr__)rJ   rK   rL   r   rO   rI   rN   r   r   )r   r   r?      s   r?   c                   s   e Zd Z fddZdd Z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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  ZS )rF   c                sX   t t| | d|i| _djf | j| _d| _d| _d| _d| _	d| _
d| _d| _dS )a3  
        Initialize the ServiceContext

        :param Version version: Version that contains the resource
        :param sid: The unique string that identifies the resource

        :returns: twilio.rest.verify.v2.service.ServiceContext
        :rtype: twilio.rest.verify.v2.service.ServiceContext
        rE   z/Services/{sid}N)r   rF   r   r   r   r   _verifications_verification_checks_rate_limits_messaging_configurations	_entities	_webhooks_access_tokens)r   r   rE   )r   r   r   r      s    

zServiceContext.__init__c             C   s(   | j jd| jd}t| j || jd dS )z
        Fetch the ServiceInstance

        :returns: The fetched ServiceInstance
        :rtype: twilio.rest.verify.v2.service.ServiceInstance
        r=   )r$   r%   rE   )rE   )r(   fetchr   r*   r   )r   r7   r   r   r   rW     s    zServiceContext.fetchc             C   s   | j jd| jdS )z~
        Deletes the ServiceInstance

        :returns: True if delete succeeds, False otherwise
        :rtype: bool
        DELETE)r$   r%   )r(   deleter   )r   r   r   r   rY     s    zServiceContext.deletec             C   sN   t |||||||||	|
||d}| jjd| j|d}t| j|| jd dS )aK  
        Update the ServiceInstance

        :param unicode friendly_name: A string to describe the verification service
        :param unicode code_length: The length of the verification code to generate
        :param bool lookup_enabled: Whether to perform a lookup with each verification
        :param bool skip_sms_to_landlines: Whether to skip sending SMS verifications to landlines
        :param bool dtmf_input_required: Whether to ask the user to press a number before delivering the verify code in a phone call
        :param unicode tts_name: The name of an alternative text-to-speech service to use in phone calls
        :param bool psd2_enabled: Whether to pass PSD2 transaction parameters when starting a verification
        :param bool do_not_share_warning_enabled: Whether to add a privacy warning at the end of an SMS.
        :param bool custom_code_enabled: Whether to allow sending verifications with a custom code.
        :param bool push_include_date: Optional. Include the date in the Challenge's reponse. Default: true
        :param unicode push_apn_credential_sid: Optional. Set APN Credential for this service.
        :param unicode push_fcm_credential_sid: Optional. Set FCM Credential for this service.

        :returns: The updated ServiceInstance
        :rtype: twilio.rest.verify.v2.service.ServiceInstance
        )r   r   r   r   r   r   r    r!   r"   zPush.IncludeDatezPush.ApnCredentialSidzPush.FcmCredentialSidr#   )r$   r%   r&   rE   )rE   )r   r'   r(   updater   r*   r   )r   r+   r,   r-   r.   r/   r0   r1   r2   r3   r4   r5   r6   r&   r7   r   r   r   rZ     s    
zServiceContext.updatec             C   s&   | j dkr t| j| jd d| _ | j S )z
        Access the verifications

        :returns: twilio.rest.verify.v2.service.verification.VerificationList
        :rtype: twilio.rest.verify.v2.service.verification.VerificationList
        NrE   )service_sid)rP   r   r(   r   )r   r   r   r   verificationsE  s    
zServiceContext.verificationsc             C   s&   | j dkr t| j| jd d| _ | j S )z
        Access the verification_checks

        :returns: twilio.rest.verify.v2.service.verification_check.VerificationCheckList
        :rtype: twilio.rest.verify.v2.service.verification_check.VerificationCheckList
        NrE   )r[   )rQ   r   r(   r   )r   r   r   r   verification_checksQ  s    
z"ServiceContext.verification_checksc             C   s&   | j dkr t| j| jd d| _ | j S )z
        Access the rate_limits

        :returns: twilio.rest.verify.v2.service.rate_limit.RateLimitList
        :rtype: twilio.rest.verify.v2.service.rate_limit.RateLimitList
        NrE   )r[   )rR   r   r(   r   )r   r   r   r   rate_limits]  s    
zServiceContext.rate_limitsc             C   s&   | j dkr t| j| jd d| _ | j S )z
        Access the messaging_configurations

        :returns: twilio.rest.verify.v2.service.messaging_configuration.MessagingConfigurationList
        :rtype: twilio.rest.verify.v2.service.messaging_configuration.MessagingConfigurationList
        NrE   )r[   )rS   r
   r(   r   )r   r   r   r   messaging_configurationsi  s
    
z'ServiceContext.messaging_configurationsc             C   s&   | j dkr t| j| jd d| _ | j S )z
        Access the entities

        :returns: twilio.rest.verify.v2.service.entity.EntityList
        :rtype: twilio.rest.verify.v2.service.entity.EntityList
        NrE   )r[   )rT   r	   r(   r   )r   r   r   r   entitiesx  s    
zServiceContext.entitiesc             C   s&   | j dkr t| j| jd d| _ | j S )z
        Access the webhooks

        :returns: twilio.rest.verify.v2.service.webhook.WebhookList
        :rtype: twilio.rest.verify.v2.service.webhook.WebhookList
        NrE   )r[   )rU   r   r(   r   )r   r   r   r   webhooks  s    
zServiceContext.webhooksc             C   s&   | j dkr t| j| jd d| _ | j S )z
        Access the access_tokens

        :returns: twilio.rest.verify.v2.service.access_token.AccessTokenList
        :rtype: twilio.rest.verify.v2.service.access_token.AccessTokenList
        NrE   )r[   )rV   r   r(   r   )r   r   r   r   access_tokens  s    
zServiceContext.access_tokensc             C   s$   d dd | j D }d|S )zz
        Provide a friendly representation

        :returns: Machine friendly representation
        :rtype: str
         c             s   s   | ]\}}d  ||V  qdS )z{}={}N)r   ).0kvr   r   r   	<genexpr>  s    z*ServiceContext.__repr__.<locals>.<genexpr>z$<Twilio.Verify.V2.ServiceContext {}>)joinr   itemsr   )r   contextr   r   r   rI     s    zServiceContext.__repr__)rJ   rK   rL   r   rW   rY   r   rM   rZ   propertyr\   r]   r^   r_   r`   ra   rb   rI   rN   r   r   )r   r   rF      s$   	'rF   c                   s  e Zd 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ed"d# Zed$d% Zd&d' Z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ed,d- Zed.d/ Zed0d1 Zed2d3 Zed4d5 Zed6d7 Z ed8d9 Z!d:d; Z"  Z#S )=r*   Nc                s   t t| | |d|d|dt|d|d|d|d|d|d	|d
|d|dt|dt|d|d|dd| _d| _d|p| jd i| _	dS )z
        Initialize the ServiceInstance

        :returns: twilio.rest.verify.v2.service.ServiceInstance
        :rtype: twilio.rest.verify.v2.service.ServiceInstance
        rE   account_sidr+   r,   r-   r1   r.   r/   r0   r2   r3   pushdate_createddate_updatedurllinks)rE   rl   r+   r,   r-   r1   r.   r/   r0   r2   r3   rm   rn   ro   rp   rq   N)
r   r*   r   rG   r   integeriso8601_datetime_properties_contextr   )r   r   r7   rE   )r   r   r   r     s&    zServiceInstance.__init__c             C   s&   | j dk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: ServiceContext for this ServiceInstance
        :rtype: twilio.rest.verify.v2.service.ServiceContext
        NrE   )rE   )ru   rF   r(   r   )r   r   r   r   _proxy  s    	
zServiceInstance._proxyc             C   s
   | j d S )zb
        :returns: The unique string that identifies the resource
        :rtype: unicode
        rE   )rt   )r   r   r   r   rE     s    zServiceInstance.sidc             C   s
   | j d S )zd
        :returns: The SID of the Account that created the resource
        :rtype: unicode
        rl   )rt   )r   r   r   r   rl     s    zServiceInstance.account_sidc             C   s
   | j d S )zu
        :returns: The string that you assigned to describe the verification service
        :rtype: unicode
        r+   )rt   )r   r   r   r   r+     s    zServiceInstance.friendly_namec             C   s
   | j d S )zW
        :returns: The length of the verification code
        :rtype: unicode
        r,   )rt   )r   r   r   r   r,     s    zServiceInstance.code_lengthc             C   s
   | j d S )zc
        :returns: Whether to perform a lookup with each verification
        :rtype: bool
        r-   )rt   )r   r   r   r   r-     s    zServiceInstance.lookup_enabledc             C   s
   | j d S )zy
        :returns: Whether to pass PSD2 transaction parameters when starting a verification
        :rtype: bool
        r1   )rt   )r   r   r   r   r1     s    zServiceInstance.psd2_enabledc             C   s
   | j d S )zg
        :returns: Whether to skip sending SMS verifications to landlines
        :rtype: bool
        r.   )rt   )r   r   r   r   r.     s    z%ServiceInstance.skip_sms_to_landlinesc             C   s
   | j d S )z
        :returns: Whether to ask the user to press a number before delivering the verify code in a phone call
        :rtype: bool
        r/   )rt   )r   r   r   r   r/     s    z#ServiceInstance.dtmf_input_requiredc             C   s
   | j d S )z{
        :returns: The name of an alternative text-to-speech service to use in phone calls
        :rtype: unicode
        r0   )rt   )r   r   r   r   r0     s    zServiceInstance.tts_namec             C   s
   | j d S )zh
        :returns: Whether to add a security warning at the end of an SMS.
        :rtype: bool
        r2   )rt   )r   r   r   r   r2     s    z,ServiceInstance.do_not_share_warning_enabledc             C   s
   | j d S )zk
        :returns: Whether to allow sending verifications with a custom code.
        :rtype: bool
        r3   )rt   )r   r   r   r   r3   '  s    z#ServiceInstance.custom_code_enabledc             C   s
   | j d S )ze
        :returns: The service level configuration of factor push type.
        :rtype: dict
        rm   )rt   )r   r   r   r   rm   /  s    zServiceInstance.pushc             C   s
   | j d S )zt
        :returns: The RFC 2822 date and time in GMT when the resource was created
        :rtype: datetime
        rn   )rt   )r   r   r   r   rn   7  s    zServiceInstance.date_createdc             C   s
   | j d S )zy
        :returns: The RFC 2822 date and time in GMT when the resource was last updated
        :rtype: datetime
        ro   )rt   )r   r   r   r   ro   ?  s    zServiceInstance.date_updatedc             C   s
   | j d S )zT
        :returns: The absolute URL of the resource
        :rtype: unicode
        rp   )rt   )r   r   r   r   rp   G  s    zServiceInstance.urlc             C   s
   | j d S )zQ
        :returns: The URLs of related resources
        :rtype: unicode
        rq   )rt   )r   r   r   r   rq   O  s    zServiceInstance.linksc             C   s
   | j  S )z
        Fetch the ServiceInstance

        :returns: The fetched ServiceInstance
        :rtype: twilio.rest.verify.v2.service.ServiceInstance
        )rv   rW   )r   r   r   r   rW   W  s    zServiceInstance.fetchc             C   s
   | j  S )z~
        Deletes the ServiceInstance

        :returns: True if delete succeeds, False otherwise
        :rtype: bool
        )rv   rY   )r   r   r   r   rY   `  s    zServiceInstance.deletec             C   s$   | j j|||||||||	|
||dS )aK  
        Update the ServiceInstance

        :param unicode friendly_name: A string to describe the verification service
        :param unicode code_length: The length of the verification code to generate
        :param bool lookup_enabled: Whether to perform a lookup with each verification
        :param bool skip_sms_to_landlines: Whether to skip sending SMS verifications to landlines
        :param bool dtmf_input_required: Whether to ask the user to press a number before delivering the verify code in a phone call
        :param unicode tts_name: The name of an alternative text-to-speech service to use in phone calls
        :param bool psd2_enabled: Whether to pass PSD2 transaction parameters when starting a verification
        :param bool do_not_share_warning_enabled: Whether to add a privacy warning at the end of an SMS.
        :param bool custom_code_enabled: Whether to allow sending verifications with a custom code.
        :param bool push_include_date: Optional. Include the date in the Challenge's reponse. Default: true
        :param unicode push_apn_credential_sid: Optional. Set APN Credential for this service.
        :param unicode push_fcm_credential_sid: Optional. Set FCM Credential for this service.

        :returns: The updated ServiceInstance
        :rtype: twilio.rest.verify.v2.service.ServiceInstance
        )r+   r,   r-   r.   r/   r0   r1   r2   r3   r4   r5   r6   )rv   rZ   )r   r+   r,   r-   r.   r/   r0   r1   r2   r3   r4   r5   r6   r   r   r   rZ   i  s    zServiceInstance.updatec             C   s   | j jS )z
        Access the verifications

        :returns: twilio.rest.verify.v2.service.verification.VerificationList
        :rtype: twilio.rest.verify.v2.service.verification.VerificationList
        )rv   r\   )r   r   r   r   r\     s    zServiceInstance.verificationsc             C   s   | j jS )z
        Access the verification_checks

        :returns: twilio.rest.verify.v2.service.verification_check.VerificationCheckList
        :rtype: twilio.rest.verify.v2.service.verification_check.VerificationCheckList
        )rv   r]   )r   r   r   r   r]     s    z#ServiceInstance.verification_checksc             C   s   | j jS )z
        Access the rate_limits

        :returns: twilio.rest.verify.v2.service.rate_limit.RateLimitList
        :rtype: twilio.rest.verify.v2.service.rate_limit.RateLimitList
        )rv   r^   )r   r   r   r   r^     s    zServiceInstance.rate_limitsc             C   s   | j jS )z
        Access the messaging_configurations

        :returns: twilio.rest.verify.v2.service.messaging_configuration.MessagingConfigurationList
        :rtype: twilio.rest.verify.v2.service.messaging_configuration.MessagingConfigurationList
        )rv   r_   )r   r   r   r   r_     s    z(ServiceInstance.messaging_configurationsc             C   s   | j jS )z
        Access the entities

        :returns: twilio.rest.verify.v2.service.entity.EntityList
        :rtype: twilio.rest.verify.v2.service.entity.EntityList
        )rv   r`   )r   r   r   r   r`     s    zServiceInstance.entitiesc             C   s   | j jS )z
        Access the webhooks

        :returns: twilio.rest.verify.v2.service.webhook.WebhookList
        :rtype: twilio.rest.verify.v2.service.webhook.WebhookList
        )rv   ra   )r   r   r   r   ra     s    zServiceInstance.webhooksc             C   s   | j jS )z
        Access the access_tokens

        :returns: twilio.rest.verify.v2.service.access_token.AccessTokenList
        :rtype: twilio.rest.verify.v2.service.access_token.AccessTokenList
        )rv   rb   )r   r   r   r   rb     s    zServiceInstance.access_tokensc             C   s$   d dd | j D }d|S )zz
        Provide a friendly representation

        :returns: Machine friendly representation
        :rtype: str
        rc   c             s   s   | ]\}}d  ||V  qdS )z{}={}N)r   )rd   re   rf   r   r   r   rg     s    z+ServiceInstance.__repr__.<locals>.<genexpr>z%<Twilio.Verify.V2.ServiceInstance {}>)rh   r   ri   r   )r   rj   r   r   r   rI     s    zServiceInstance.__repr__)N)$rJ   rK   rL   r   rk   rv   rE   rl   r+   r,   r-   r1   r.   r/   r0   r2   r3   rm   rn   ro   rp   rq   rW   rY   r   rM   rZ   r\   r]   r^   r_   r`   ra   rb   rI   rN   r   r   )r   r   r*     sF   !		#






r*   N)__doc__Ztwilio.baser   r   Ztwilio.base.instance_contextr   Ztwilio.base.instance_resourcer   Ztwilio.base.list_resourcer   Ztwilio.base.pager   Z*twilio.rest.verify.v2.service.access_tokenr   Z$twilio.rest.verify.v2.service.entityr	   Z5twilio.rest.verify.v2.service.messaging_configurationr
   Z(twilio.rest.verify.v2.service.rate_limitr   Z*twilio.rest.verify.v2.service.verificationr   Z0twilio.rest.verify.v2.service.verification_checkr   Z%twilio.rest.verify.v2.service.webhookr   r   r?   rF   r*   r   r   r   r   <module>   s&    ,& ?