B
    `>                 @   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                   sz   e Zd 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ejejejfddZdd Zdd	 Z	d
d Z
  ZS )PaymentListz PLEASE NOTE that this class contains preview products that are subject
    to change. Use them with caution. If you currently do not have developer
    preview access, please contact help@twilio.com. c                s0   t t| | ||d| _djf | j| _dS )a  
        Initialize the PaymentList

        :param Version version: Version that contains the resource
        :param account_sid: The SID of the Account that created the Payments resource.
        :param call_sid: The SID of the Call the resource is associated with.

        :returns: twilio.rest.api.v2010.account.call.payment.PaymentList
        :rtype: twilio.rest.api.v2010.account.call.payment.PaymentList
        )account_sidcall_sidz6/Accounts/{account_sid}/Calls/{call_sid}/Payments.jsonN)superr	   __init__	_solutionformat_uri)selfversionr
   r   )	__class__ Y/home/dcms/DCMS/lib/python3.7/site-packages/twilio/rest/api/v2010/account/call/payment.pyr      s    zPaymentList.__init__c             C   sd   t ||||||||t|	|
||||||d}| jjd| j|d}t| j|| jd | jd dS )a	  
        Create the PaymentInstance

        :param unicode idempotency_key: A unique token that will be used to ensure that multiple API calls with the same information do not result in multiple transactions.
        :param unicode status_callback: Provide an absolute or relative URL to receive status updates regarding your Pay session..
        :param PaymentInstance.BankAccountType bank_account_type: Type of bank account if payment source is ACH.
        :param unicode charge_amount: A positive decimal value less than 1,000,000 to charge against the credit card or bank account.
        :param unicode currency: The currency of the `charge_amount`.
        :param unicode description: The description can be used to provide more details regarding the transaction.
        :param unicode input: A list of inputs that should be accepted. Currently only `dtmf` is supported.
        :param unicode min_postal_code_length: A positive integer that is used to validate the length of the `PostalCode` inputted by the user.
        :param dict parameter: A single level JSON string that is required when accepting certain information specific only to ACH payments.
        :param unicode payment_connector: This is the unique name corresponding to the Payment Gateway Connector installed in the Twilio Add-ons.
        :param PaymentInstance.PaymentMethod payment_method: Type of payment being captured.
        :param bool postal_code: Indicates whether the credit card PostalCode (zip code) is a required piece of payment information that must be provided by the caller.
        :param bool security_code: Indicates whether the credit card security code is a required piece of payment information that must be provided by the caller.
        :param unicode timeout: The number of seconds that <Pay> should wait for the caller to press a digit between each subsequent digit, after the first one, before moving on to validate the digits captured.
        :param PaymentInstance.TokenType token_type: Indicates whether the payment method should be tokenized as a `one-time` or `reusable` token.
        :param unicode valid_card_types: Credit card types separated by space that Pay should accept.

        :returns: The created PaymentInstance
        :rtype: twilio.rest.api.v2010.account.call.payment.PaymentInstance
        )IdempotencyKeyStatusCallbackBankAccountTypeZChargeAmountZCurrencyDescriptionZInputZMinPostalCodeLength	ParameterZPaymentConnectorPaymentMethodZ
PostalCodeZSecurityCodeTimeout	TokenTypeZValidCardTypesPOST)methoduridatar
   r   )r
   r   )	r   ofr   object_versioncreater   PaymentInstancer   )r   idempotency_keystatus_callbackZbank_account_typeZcharge_amountcurrencydescriptioninputZmin_postal_code_lengthZ	parameterZpayment_connectorZpayment_methodZpostal_codeZsecurity_codetimeout
token_typeZvalid_card_typesr!   payloadr   r   r   r%   (   s.    
zPaymentList.createc             C   s   t | j| jd | jd |dS )z
        Constructs a PaymentContext

        :param sid: The SID of Payments session

        :returns: twilio.rest.api.v2010.account.call.payment.PaymentContext
        :rtype: twilio.rest.api.v2010.account.call.payment.PaymentContext
        r
   r   )r
   r   sid)PaymentContextr$   r   )r   r/   r   r   r   getc   s
    	zPaymentList.getc             C   s   t | j| jd | jd |dS )z
        Constructs a PaymentContext

        :param sid: The SID of Payments session

        :returns: twilio.rest.api.v2010.account.call.payment.PaymentContext
        :rtype: twilio.rest.api.v2010.account.call.payment.PaymentContext
        r
   r   )r
   r   r/   )r0   r$   r   )r   r/   r   r   r   __call__s   s
    	zPaymentList.__call__c             C   s   dS )zz
        Provide a friendly representation

        :returns: Machine friendly representation
        :rtype: str
        z<Twilio.Api.V2010.PaymentList>r   )r   r   r   r   __repr__   s    zPaymentList.__repr__)__name__
__module____qualname____doc__r   r   unsetr%   r1   r2   r3   __classcell__r   r   )r   r   r	      s   4r	   c                   s0   e Zd ZdZ fddZdd Zdd Z  ZS )PaymentPagez PLEASE NOTE that this class contains preview products that are subject
    to change. Use them with caution. If you currently do not have developer
    preview access, please contact help@twilio.com. c                s   t t| || || _dS )a  
        Initialize the PaymentPage

        :param Version version: Version that contains the resource
        :param Response response: Response from the API
        :param account_sid: The SID of the Account that created the Payments resource.
        :param call_sid: The SID of the Call the resource is associated with.

        :returns: twilio.rest.api.v2010.account.call.payment.PaymentPage
        :rtype: twilio.rest.api.v2010.account.call.payment.PaymentPage
        N)r   r:   r   r   )r   r   responseZsolution)r   r   r   r      s    zPaymentPage.__init__c             C   s   t | j|| jd | jd dS )a  
        Build an instance of PaymentInstance

        :param dict payload: Payload response from the API

        :returns: twilio.rest.api.v2010.account.call.payment.PaymentInstance
        :rtype: twilio.rest.api.v2010.account.call.payment.PaymentInstance
        r
   r   )r
   r   )r&   r$   r   )r   r.   r   r   r   get_instance   s
    	zPaymentPage.get_instancec             C   s   dS )zz
        Provide a friendly representation

        :returns: Machine friendly representation
        :rtype: str
        z<Twilio.Api.V2010.PaymentPage>r   )r   r   r   r   r3      s    zPaymentPage.__repr__)r4   r5   r6   r7   r   r<   r3   r9   r   r   )r   r   r:      s   r:   c                   s:   e Zd ZdZ fddZejejfddZdd Z  Z	S )r0   z PLEASE NOTE that this class contains preview products that are subject
    to change. Use them with caution. If you currently do not have developer
    preview access, please contact help@twilio.com. c                s2   t t| | |||d| _djf | j| _dS )a  
        Initialize the PaymentContext

        :param Version version: Version that contains the resource
        :param account_sid: The SID of the Account that will update the resource
        :param call_sid: The SID of the call that will create the resource.
        :param sid: The SID of Payments session

        :returns: twilio.rest.api.v2010.account.call.payment.PaymentContext
        :rtype: twilio.rest.api.v2010.account.call.payment.PaymentContext
        )r
   r   r/   z</Accounts/{account_sid}/Calls/{call_sid}/Payments/{sid}.jsonN)r   r0   r   r   r   r   )r   r   r
   r   r/   )r   r   r   r      s    zPaymentContext.__init__c             C   sN   t ||||d}| jjd| j|d}t| j|| jd | jd | jd dS )a  
        Update the PaymentInstance

        :param unicode idempotency_key: A unique token that will be used to ensure that multiple API calls with the same information do not result in multiple transactions.
        :param unicode status_callback: Provide an absolute or relative URL to receive status updates regarding your Pay session.
        :param PaymentInstance.Capture capture: The piece of payment information that you wish the caller to enter.
        :param PaymentInstance.Status status: Indicates whether the current payment session should be cancelled or completed.

        :returns: The updated PaymentInstance
        :rtype: twilio.rest.api.v2010.account.call.payment.PaymentInstance
        )r   r   CaptureStatusr   )r   r    r!   r
   r   r/   )r
   r   r/   )r   r"   r$   updater   r&   r   )r   r'   r(   capturestatusr!   r.   r   r   r   r?      s    
zPaymentContext.updatec             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*PaymentContext.__repr__.<locals>.<genexpr>z$<Twilio.Api.V2010.PaymentContext {}>)joinr   itemsr   )r   contextr   r   r   r3      s    zPaymentContext.__repr__)
r4   r5   r6   r7   r   r   r8   r?   r3   r9   r   r   )r   r   r0      s
   r0   c                   s   e Zd 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jejfddZdd  Z  ZS )"r&   z PLEASE NOTE that this class contains preview products that are subject
    to change. Use them with caution. If you currently do not have developer
    preview access, please contact help@twilio.com. c               @   s   e Zd ZdZdZdS )zPaymentInstance.PaymentMethodzcredit-cardz	ach-debitN)r4   r5   r6   ZCREDIT_CARDZ	ACH_DEBITr   r   r   r   r     s   r   c               @   s   e Zd ZdZdZdZdS )zPaymentInstance.BankAccountTypezconsumer-checkingzconsumer-savingszcommercial-checkingN)r4   r5   r6   ZCONSUMER_CHECKINGZCONSUMER_SAVINGSZCOMMERCIAL_CHECKINGr   r   r   r   r     s   r   c               @   s   e Zd ZdZdZdS )zPaymentInstance.TokenTypezone-timeZreusableN)r4   r5   r6   ZONE_TIMEZREUSABLEr   r   r   r   r     s   r   c               @   s$   e Zd ZdZdZdZdZdZdZdS )zPaymentInstance.Capturezpayment-card-numberzexpiration-datezsecurity-codezpostal-codezbank-routing-numberzbank-account-numberN)	r4   r5   r6   ZPAYMENT_CARD_NUMBERZEXPIRATION_DATEZSECURITY_CODEZPOSTAL_CODEZBANK_ROUTING_NUMBERZBANK_ACCOUNT_NUMBERr   r   r   r   r=     s   r=   c               @   s   e Zd ZdZdZdS )zPaymentInstance.StatusZcompletecancelN)r4   r5   r6   ZCOMPLETEZCANCELr   r   r   r   r>     s   r>   Nc          	      sv   t t| | |d|d|dt|dt|d|dd| _d| _|||pj| jd d	| _dS )
z
        Initialize the PaymentInstance

        :returns: twilio.rest.api.v2010.account.call.payment.PaymentInstance
        :rtype: twilio.rest.api.v2010.account.call.payment.PaymentInstance
        r
   r   r/   date_createddate_updatedr    )r
   r   r/   rK   rL   r    N)r
   r   r/   )	r   r&   r   r1   r   Zrfc2822_datetime_properties_contextr   )r   r   r.   r
   r   r/   )r   r   r   r     s    zPaymentInstance.__init__c             C   s6   | j dkr0t| j| jd | jd | jd d| _ | j S )a4  
        Generate an instance context for the instance, the context is capable of
        performing various actions.  All instance actions are proxied to the context

        :returns: PaymentContext for this PaymentInstance
        :rtype: twilio.rest.api.v2010.account.call.payment.PaymentContext
        Nr
   r   r/   )r
   r   r/   )rN   r0   r$   r   )r   r   r   r   _proxy6  s    	
zPaymentInstance._proxyc             C   s
   | j d S )zn
        :returns: The SID of the Account that created the Payments resource.
        :rtype: unicode
        r
   )rM   )r   r   r   r   r
   H  s    zPaymentInstance.account_sidc             C   s
   | j d S )zh
        :returns: The SID of the Call the resource is associated with.
        :rtype: unicode
        r   )rM   )r   r   r   r   r   P  s    zPaymentInstance.call_sidc             C   s
   | j d S )zU
        :returns: The SID of the Payments resource.
        :rtype: unicode
        r/   )rM   )r   r   r   r   r/   X  s    zPaymentInstance.sidc             C   s
   | j d S )zt
        :returns: The RFC 2822 date and time in GMT that the resource was created
        :rtype: datetime
        rK   )rM   )r   r   r   r   rK   `  s    zPaymentInstance.date_createdc             C   s
   | j d S )zy
        :returns: The RFC 2822 date and time in GMT that the resource was last updated
        :rtype: datetime
        rL   )rM   )r   r   r   r   rL   h  s    zPaymentInstance.date_updatedc             C   s
   | j d S )zq
        :returns: The URI of the resource, relative to `https://api.twilio.com`
        :rtype: unicode
        r    )rM   )r   r   r   r   r    p  s    zPaymentInstance.uric             C   s   | j j||||dS )a  
        Update the PaymentInstance

        :param unicode idempotency_key: A unique token that will be used to ensure that multiple API calls with the same information do not result in multiple transactions.
        :param unicode status_callback: Provide an absolute or relative URL to receive status updates regarding your Pay session.
        :param PaymentInstance.Capture capture: The piece of payment information that you wish the caller to enter.
        :param PaymentInstance.Status status: Indicates whether the current payment session should be cancelled or completed.

        :returns: The updated PaymentInstance
        :rtype: twilio.rest.api.v2010.account.call.payment.PaymentInstance
        )r@   rA   )rO   r?   )r   r'   r(   r@   rA   r   r   r   r?   x  s    zPaymentInstance.updatec             C   s$   d dd | j D }d|S )zz
        Provide a friendly representation

        :returns: Machine friendly representation
        :rtype: str
        rB   c             s   s   | ]\}}d  ||V  qdS )z{}={}N)r   )rC   rD   rE   r   r   r   rF     s    z+PaymentInstance.__repr__.<locals>.<genexpr>z%<Twilio.Api.V2010.PaymentInstance {}>)rG   r   rH   r   )r   rI   r   r   r   r3     s    zPaymentInstance.__repr__)N)r4   r5   r6   r7   r#   r   r   r   r=   r>   r   propertyrO   r
   r   r/   rK   rL   r    r   r8   r?   r3   r9   r   r   )r   r   r&      s"   r&   N)r7   Ztwilio.baser   r   r   Ztwilio.base.instance_contextr   Ztwilio.base.instance_resourcer   Ztwilio.base.list_resourcer   Ztwilio.base.pager   r	   r:   r0   r&   r   r   r   r   <module>   s   {0@