U
    ^g%i^                     @   s   d Z ddlmZ ddl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 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 - Api
    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OptionalUnion)deserialize	serializevalues)InstanceContext)InstanceResource)ListResource)Versionc                       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e	e
eef eeee d fddZeddddZejejfeeedef edef d dddZejejfeeedef edef d dddZedddZ  ZS )PaymentInstancec                   @   s   e Zd ZdZdZdZdS )PaymentInstance.BankAccountTypezconsumer-checkingzconsumer-savingszcommercial-checkingN)__name__
__module____qualname__ZCONSUMER_CHECKINGZCONSUMER_SAVINGSZCOMMERCIAL_CHECKING r   r   i/var/www/html/api-medvista/venv/lib/python3.8/site-packages/twilio/rest/api/v2010/account/call/payment.pyBankAccountType   s   r   c                   @   s$   e Zd ZdZdZdZdZdZdZdS )PaymentInstance.Capturezpayment-card-numberzexpiration-datezsecurity-codezpostal-codezbank-routing-numberzbank-account-numberN)	r   r   r   ZPAYMENT_CARD_NUMBERZEXPIRATION_DATEZSECURITY_CODEZPOSTAL_CODEZBANK_ROUTING_NUMBERZBANK_ACCOUNT_NUMBERr   r   r   r   Capture   s   r   c                   @   s   e Zd ZdZdZdS )PaymentInstance.PaymentMethodzcredit-cardz	ach-debitN)r   r   r   ZCREDIT_CARDZ	ACH_DEBITr   r   r   r   PaymentMethod'   s   r   c                   @   s   e Zd ZdZdZdS )PaymentInstance.StatusZcompletecancelN)r   r   r   ZCOMPLETEZCANCELr   r   r   r   Status+   s   r   c                   @   s   e Zd ZdZdZdZdS )PaymentInstance.TokenTypezone-timeZreusablezpayment-methodN)r   r   r   ZONE_TIMEZREUSABLEZPAYMENT_METHODr   r   r   r   	TokenType/   s   r   N)versionpayloadaccount_sidcall_sidsidc                    s~   t  | |d| _|d| _|d| _t|d| _t|d| _	|d| _
|||pl| jd| _d | _d S )Nr!   r"   r#   date_createddate_updatedurir!   r"   r#   )super__init__getr!   r"   r#   r   Zrfc2822_datetimer$   r%   r&   	_solution_context)selfr   r    r!   r"   r#   	__class__r   r   r)   =   s     zPaymentInstance.__init__PaymentContextreturnc                 C   s6   | j dkr0t| j| jd | jd | jd d| _ | j S )z
        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
        Nr!   r"   r#   r'   )r,   r0   _versionr+   r-   r   r   r   _proxyY   s    
zPaymentInstance._proxyr   r   idempotency_keystatus_callbackcapturestatusr2   c                 C   s   | j j||||dS )  
        Update the PaymentInstance

        :param 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. This should be a unique string value per API call and can be a randomly generated.
        :param status_callback: Provide an absolute or relative URL to receive status updates regarding your Pay session. Read more about the [Update](https://www.twilio.com/docs/voice/api/payment-resource#statuscallback-update) and [Complete/Cancel](https://www.twilio.com/docs/voice/api/payment-resource#statuscallback-cancelcomplete) POST requests.
        :param capture:
        :param status:

        :returns: The updated PaymentInstance
        r7   r8   r9   r:   )r5   updater-   r7   r8   r9   r:   r   r   r   r=   j   s    zPaymentInstance.updatec                    s   | j j||||dI dH S )  
        Asynchronous coroutine to update the PaymentInstance

        :param 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. This should be a unique string value per API call and can be a randomly generated.
        :param status_callback: Provide an absolute or relative URL to receive status updates regarding your Pay session. Read more about the [Update](https://www.twilio.com/docs/voice/api/payment-resource#statuscallback-update) and [Complete/Cancel](https://www.twilio.com/docs/voice/api/payment-resource#statuscallback-cancelcomplete) POST requests.
        :param capture:
        :param status:

        :returns: The updated PaymentInstance
        r<   N)r5   update_asyncr>   r   r   r   r@      s    zPaymentInstance.update_asyncc                 C   s$   d dd | j D }d|S )f
        Provide a friendly representation

        :returns: Machine friendly representation
         c                 s   s   | ]\}}d  ||V  qdS z{}={}Nformat.0kvr   r   r   	<genexpr>   s     z+PaymentInstance.__repr__.<locals>.<genexpr>z%<Twilio.Api.V2010.PaymentInstance {}>joinr+   itemsrE   r-   contextr   r   r   __repr__   s    zPaymentInstance.__repr__)N)r   r   r   objectr   r   r   r   r   r   r   strr   r   r)   propertyr5   r	   unsetr   r=   r@   rP   __classcell__r   r   r.   r   r      sD    




r   c                       s   e Zd Zeeeed fddZejejfeeede	f ede	f e
dddZejejfeeede	f ede	f e
dd	d
ZedddZ  ZS )r0   )r   r!   r"   r#   c                    s.   t  | |||d| _djf | j| _dS )a  
        Initialize the PaymentContext

        :param version: Version that contains the resource
        :param account_sid: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that will update the resource.
        :param call_sid: The SID of the call that will update the resource. This should be the same call sid that was used to create payments resource.
        :param sid: The SID of Payments session that needs to be updated.
        r'   z</Accounts/{account_sid}/Calls/{call_sid}/Payments/{sid}.jsonNr(   r)   r+   rE   _uri)r-   r   r!   r"   r#   r.   r   r   r)      s    	zPaymentContext.__init__r   r   r6   c                 C   sj   t ||||d}t i }d|d< d|d< | jjd| j||d}t| j|| jd | jd	 | jd
 dS )r;   IdempotencyKeyStatusCallbackr   r   !application/x-www-form-urlencodedContent-Typeapplication/jsonAcceptPOSTmethodr&   dataheadersr!   r"   r#   r'   )r	   ofr3   r=   rW   r   r+   r-   r7   r8   r9   r:   rb   rc   r    r   r   r   r=      s.    
   zPaymentContext.updatec                    sp   t ||||d}t i }d|d< d|d< | jjd| j||dI dH }t| j|| jd	 | jd
 | jd dS )r?   rX   r[   r\   r]   r^   r_   r`   Nr!   r"   r#   r'   )r	   rd   r3   r@   rW   r   r+   re   r   r   r   r@      s.    
   zPaymentContext.update_asyncr1   c                 C   s$   d dd | j D }d|S )rA   rB   c                 s   s   | ]\}}d  ||V  qdS rC   rD   rF   r   r   r   rJ     s     z*PaymentContext.__repr__.<locals>.<genexpr>z$<Twilio.Api.V2010.PaymentContext {}>rK   rN   r   r   r   rP     s    zPaymentContext.__repr__)r   r   r   r   rR   r)   r	   rT   r   rQ   r   r=   r@   rP   rU   r   r   r.   r   r0      s(   

0

,r0   c                       s  e Zd Zeee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ejejejfeeede	f ee
e	f eee	f eee	f eee	f eee	f ee	e	f eee	f ede	f eee	f eee	f eee	f ede	f eee	f ed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eeede	f ee
e	f eee	f eee	f eee	f eee	f ee	e	f eee	f ede	f eee	f eee	f eee	f ede	f eee	f edd
dZeedddZeedddZedddZ  ZS )PaymentList)r   r!   r"   c                    s,   t  | ||d| _djf | j| _dS )a  
        Initialize the PaymentList

        :param version: Version that contains the resource
        :param account_sid: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that will create the resource.
        :param call_sid: The SID of the call that will create the resource. Call leg associated with this sid is expected to provide payment information thru DTMF.

        r!   r"   z6/Accounts/{account_sid}/Calls/{call_sid}/Payments.jsonNrV   )r-   r   r!   r"   r.   r   r   r)   !  s    	zPaymentList.__init__r   r   r   )r7   r8   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_typesr2   c                 C   s   t ||||||||t|	|
|t|t||||d}t ddi}d|d< d|d< | jjd| j||d}t| j|| j	d | j	d	 d
S )a  
        Create the PaymentInstance

        :param 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. This should be a unique string value per API call and can be a randomly generated.
        :param status_callback: Provide an absolute or relative URL to receive status updates regarding your Pay session. Read more about the [expected StatusCallback values](https://www.twilio.com/docs/voice/api/payment-resource#statuscallback)
        :param bank_account_type:
        :param charge_amount: A positive decimal value less than 1,000,000 to charge against the credit card or bank account. Default currency can be overwritten with `currency` field. Leave blank or set to 0 to tokenize.
        :param currency: The currency of the `charge_amount`, formatted as [ISO 4127](http://www.iso.org/iso/home/standards/currency_codes.htm) format. The default value is `USD` and all values allowed from the Pay Connector are accepted.
        :param description: The description can be used to provide more details regarding the transaction. This information is submitted along with the payment details to the Payment Connector which are then posted on the transactions.
        :param input: A list of inputs that should be accepted. Currently only `dtmf` is supported. All digits captured during a pay session are redacted from the logs.
        :param min_postal_code_length: A positive integer that is used to validate the length of the `PostalCode` inputted by the user. User must enter this many digits.
        :param parameter: A single-level JSON object used to pass custom parameters to payment processors. (Required for ACH payments). The information that has to be included here depends on the <Pay> Connector. [Read more](https://www.twilio.com/console/voice/pay-connectors).
        :param payment_connector: This is the unique name corresponding to the Pay Connector installed in the Twilio Add-ons. Learn more about [<Pay> Connectors](https://www.twilio.com/console/voice/pay-connectors). The default value is `Default`.
        :param payment_method:
        :param postal_code: Indicates whether the credit card postal code (zip code) is a required piece of payment information that must be provided by the caller. The default is `true`.
        :param security_code: Indicates whether the credit card security code is a required piece of payment information that must be provided by the caller. The default is `true`.
        :param 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. The default is `5`, maximum is `600`.
        :param token_type:
        :param valid_card_types: Credit card types separated by space that Pay should accept. The default value is `visa mastercard amex`

        :returns: The created PaymentInstance
        rY   rZ   r   ZChargeAmountZCurrencyDescriptionZInputZMinPostalCodeLength	ParameterZPaymentConnectorr   Z
PostalCodeZSecurityCodeTimeoutr   ZValidCardTypesr\   r[   r]   r^   r_   r`   r!   r"   rg   )
r	   rd   r   rQ   boolean_to_stringr3   createrW   r   r+   r-   r7   r8   rh   ri   rj   rk   rl   rm   rn   ro   rp   rq   rr   rs   rt   ru   rb   rc   r    r   r   r   r{   5  sD    ,   zPaymentList.createc                    s   t ||||||||t|	|
|t|t||||d}t ddi}d|d< d|d< | jjd| j||dI dH }t| j|| j	d	 | j	d
 dS )a  
        Asynchronously create the PaymentInstance

        :param 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. This should be a unique string value per API call and can be a randomly generated.
        :param status_callback: Provide an absolute or relative URL to receive status updates regarding your Pay session. Read more about the [expected StatusCallback values](https://www.twilio.com/docs/voice/api/payment-resource#statuscallback)
        :param bank_account_type:
        :param charge_amount: A positive decimal value less than 1,000,000 to charge against the credit card or bank account. Default currency can be overwritten with `currency` field. Leave blank or set to 0 to tokenize.
        :param currency: The currency of the `charge_amount`, formatted as [ISO 4127](http://www.iso.org/iso/home/standards/currency_codes.htm) format. The default value is `USD` and all values allowed from the Pay Connector are accepted.
        :param description: The description can be used to provide more details regarding the transaction. This information is submitted along with the payment details to the Payment Connector which are then posted on the transactions.
        :param input: A list of inputs that should be accepted. Currently only `dtmf` is supported. All digits captured during a pay session are redacted from the logs.
        :param min_postal_code_length: A positive integer that is used to validate the length of the `PostalCode` inputted by the user. User must enter this many digits.
        :param parameter: A single-level JSON object used to pass custom parameters to payment processors. (Required for ACH payments). The information that has to be included here depends on the <Pay> Connector. [Read more](https://www.twilio.com/console/voice/pay-connectors).
        :param payment_connector: This is the unique name corresponding to the Pay Connector installed in the Twilio Add-ons. Learn more about [<Pay> Connectors](https://www.twilio.com/console/voice/pay-connectors). The default value is `Default`.
        :param payment_method:
        :param postal_code: Indicates whether the credit card postal code (zip code) is a required piece of payment information that must be provided by the caller. The default is `true`.
        :param security_code: Indicates whether the credit card security code is a required piece of payment information that must be provided by the caller. The default is `true`.
        :param 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. The default is `5`, maximum is `600`.
        :param token_type:
        :param valid_card_types: Credit card types separated by space that Pay should accept. The default value is `visa mastercard amex`

        :returns: The created PaymentInstance
        rv   r\   r[   r]   r^   r_   r`   Nr!   r"   rg   )
r	   rd   r   rQ   rz   r3   create_asyncrW   r   r+   r|   r   r   r   r}     sD    ,   zPaymentList.create_async)r#   r2   c                 C   s   t | j| jd | jd |dS zx
        Constructs a PaymentContext

        :param sid: The SID of Payments session that needs to be updated.
        r!   r"   r'   r0   r3   r+   r-   r#   r   r   r   r*     s    zPaymentList.getc                 C   s   t | j| jd | jd |dS r~   r   r   r   r   r   __call__  s    zPaymentList.__call__r1   c                 C   s   dS )rA   z<Twilio.Api.V2010.PaymentList>r   r4   r   r   r   rP     s    zPaymentList.__repr__)r   r   r   r   rR   r)   r	   rT   r   rQ   floatintboolr   r{   r}   r0   r*   r   rP   rU   r   r   r.   r   rf     s   












W












Qrf   N)__doc__r   typingr   r   r   r   Ztwilio.baser   r   r	   Ztwilio.base.instance_contextr
   Ztwilio.base.instance_resourcer   Ztwilio.base.list_resourcer   Ztwilio.base.versionr   r   r0   rf   r   r   r   r   <module>   s    {