o
    e>                     @   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 )PaymentList 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                    s4   t t| | ||d| _djdi | 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__r   ]/var/www/html/venv/lib/python3.10/site-packages/twilio/rest/api/v2010/account/call/payment.pyr      s   zPaymentList.__init__c                 C   s   t i d|d|d|d|d|d|d|d|d	t|	d
|
d|d|d|d|d|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 object used to pass custom parameters to payment processors. (Required for 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BankAccountTypeChargeAmountCurrencyDescriptionInputMinPostalCodeLength	ParameterPaymentConnectorPaymentMethod
PostalCodeSecurityCodeTimeout	TokenTypeValidCardTypesPOSTmethoduridatar   r   r   )	r   ofr   object_versioncreater   PaymentInstancer   )r   idempotency_keystatus_callbackbank_account_typecharge_amountcurrencydescriptioninputmin_postal_code_length	parameterpayment_connectorpayment_methodpostal_codesecurity_codetimeout
token_typevalid_card_typesr-   payloadr   r   r   r1   (   sP   
	
zPaymentList.createc                 C      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PaymentContextr0   r   r   rG   r   r   r   getc      	zPaymentList.getc                 C   rD   rE   rH   rJ   r   r   r   __call__s   rL   zPaymentList.__call__c                 C      dS )z
        Provide a friendly representation

        :returns: Machine friendly representation
        :rtype: str
        z<Twilio.Api.V2010.PaymentList>r   r   r   r   r   __repr__      zPaymentList.__repr__)__name__
__module____qualname____doc__r   r   unsetr1   rK   rM   rQ   __classcell__r   r   r   r   r	      s    
;r	   c                       s0   e Zd ZdZ fddZdd Zdd Z  ZS )PaymentPager
   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   rY   r   r   )r   r   responsesolutionr   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   )r2   r0   r   )r   rC   r   r   r   get_instance   s   	zPaymentPage.get_instancec                 C   rN   )rO   z<Twilio.Api.V2010.PaymentPage>r   rP   r   r   r   rQ      rR   zPaymentPage.__repr__)rS   rT   rU   rV   r   r\   rQ   rX   r   r   r   r   rY      s
    rY   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 )rI   r
   c                    s6   t t| | |||d| _djdi | 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
        rF   z</Accounts/{account_sid}/Calls/{call_sid}/Payments/{sid}.jsonNr   )r   rI   r   r   r   r   )r   r   r   r   rG   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 )  
        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   rG   rF   )r   r.   r0   updater   r2   r   )r   r3   r4   capturestatusr-   rC   r   r   r   r`      s   zPaymentContext.updatec                 C   $   d dd | j D }d|S )rO    c                 s        | ]\}}d  ||V  qdS z{}={}Nr   .0kvr   r   r   	<genexpr>       z*PaymentContext.__repr__.<locals>.<genexpr>z$<Twilio.Api.V2010.PaymentContext {}>joinr   itemsr   r   contextr   r   r   rQ         
zPaymentContext.__repr__)
rS   rT   rU   rV   r   r   rW   r`   rQ   rX   r   r   r   r   rI      s    
rI   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 )"r2   r
   c                   @      e Zd ZdZdZdS )zPaymentInstance.PaymentMethodzcredit-cardz	ach-debitN)rS   rT   rU   CREDIT_CARD	ACH_DEBITr   r   r   r   r#         r#   c                   @   s   e Zd ZdZdZdZdS )zPaymentInstance.BankAccountTypezconsumer-checkingzconsumer-savingszcommercial-checkingN)rS   rT   rU   CONSUMER_CHECKINGCONSUMER_SAVINGSCOMMERCIAL_CHECKINGr   r   r   r   r     s    r   c                   @   rt   )zPaymentInstance.TokenTypezone-timereusableN)rS   rT   rU   ONE_TIMEREUSABLEr   r   r   r   r'     rw   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)	rS   rT   rU   PAYMENT_CARD_NUMBEREXPIRATION_DATESECURITY_CODEPOSTAL_CODEBANK_ROUTING_NUMBERBANK_ACCOUNT_NUMBERr   r   r   r   r^     s    r^   c                   @   rt   )zPaymentInstance.StatuscompletecancelN)rS   rT   rU   COMPLETECANCELr   r   r   r   r_     rw   r_   Nc              	      sv   t t| | |d|d|dt|dt|d|dd| _d| _|||p5| 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   rG   date_createddate_updatedr,   )r   r   rG   r   r   r,   NrF   )	r   r2   r   rK   r   rfc2822_datetime_properties_contextr   )r   r   rC   r   r   rG   r   r   r   r     s   
zPaymentInstance.__init__c                 C   s6   | j du rt| 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   rG   rF   )r   rI   r0   r   rP   r   r   r   _proxy6  s   
	zPaymentInstance._proxyc                 C   
   | j d S )zn
        :returns: The SID of the Account that created the Payments resource.
        :rtype: unicode
        r   r   rP   r   r   r   r   H     
zPaymentInstance.account_sidc                 C   r   )zh
        :returns: The SID of the Call the resource is associated with.
        :rtype: unicode
        r   r   rP   r   r   r   r   P  r   zPaymentInstance.call_sidc                 C   r   )zU
        :returns: The SID of the Payments resource.
        :rtype: unicode
        rG   r   rP   r   r   r   rG   X  r   zPaymentInstance.sidc                 C   r   )zt
        :returns: The RFC 2822 date and time in GMT that the resource was created
        :rtype: datetime
        r   r   rP   r   r   r   r   `  r   zPaymentInstance.date_createdc                 C   r   )zy
        :returns: The RFC 2822 date and time in GMT that the resource was last updated
        :rtype: datetime
        r   r   rP   r   r   r   r   h  r   zPaymentInstance.date_updatedc                 C   r   )zq
        :returns: The URI of the resource, relative to `https://api.twilio.com`
        :rtype: unicode
        r,   r   rP   r   r   r   r,   p  r   zPaymentInstance.uric                 C   s   | j j||||dS )r]   )ra   rb   )r   r`   )r   r3   r4   ra   rb   r   r   r   r`   x  s   zPaymentInstance.updatec                 C   rc   )rO   rd   c                 s   re   rf   rg   rh   r   r   r   rl     rm   z+PaymentInstance.__repr__.<locals>.<genexpr>z%<Twilio.Api.V2010.PaymentInstance {}>rn   rq   r   r   r   rQ     rs   zPaymentInstance.__repr__)N)rS   rT   rU   rV   r/   r#   r   r'   r^   r_   r   propertyr   r   r   rG   r   r   r,   r   rW   r`   rQ   rX   r   r   r   r   r2      s4    







r2   N)rV   twilio.baser   r   r   twilio.base.instance_contextr   twilio.base.instance_resourcer   twilio.base.list_resourcer   twilio.base.pager   r	   rY   rI   r2   r   r   r   r   <module>   s   {0@