/** * PagarmeApiSDKLib * * This file was automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ). */ import { boolean, lazy, object, Schema, string } from '../schema'; import { CreateBankTransferPaymentRequest, createBankTransferPaymentRequestSchema, } from './createBankTransferPaymentRequest'; import { CreateBoletoPaymentRequest, createBoletoPaymentRequestSchema, } from './createBoletoPaymentRequest'; import { CreateCashPaymentRequest, createCashPaymentRequestSchema, } from './createCashPaymentRequest'; import { CreateCreditCardPaymentRequest, createCreditCardPaymentRequestSchema, } from './createCreditCardPaymentRequest'; import { CreateDebitCardPaymentRequest, createDebitCardPaymentRequestSchema, } from './createDebitCardPaymentRequest'; import { CreatePrivateLabelPaymentRequest, createPrivateLabelPaymentRequestSchema, } from './createPrivateLabelPaymentRequest'; import { CreateVoucherPaymentRequest, createVoucherPaymentRequestSchema, } from './createVoucherPaymentRequest'; /** Request for updating the payment method of a charge */ export interface UpdateChargePaymentMethodRequest { /** Indicates if the payment method from the subscription must also be updated */ updateSubscription: boolean; /** The new payment method */ paymentMethod: string; /** Credit card data */ creditCard: CreateCreditCardPaymentRequest; /** Debit card data */ debitCard: CreateDebitCardPaymentRequest; /** Boleto data */ boleto: CreateBoletoPaymentRequest; /** Voucher data */ voucher: CreateVoucherPaymentRequest; /** Cash data */ cash: CreateCashPaymentRequest; /** Bank Transfer data */ bankTransfer: CreateBankTransferPaymentRequest; privateLabel: CreatePrivateLabelPaymentRequest; } export const updateChargePaymentMethodRequestSchema: Schema = object( { updateSubscription: ['update_subscription', boolean()], paymentMethod: ['payment_method', string()], creditCard: [ 'credit_card', lazy(() => createCreditCardPaymentRequestSchema), ], debitCard: ['debit_card', lazy(() => createDebitCardPaymentRequestSchema)], boleto: ['boleto', lazy(() => createBoletoPaymentRequestSchema)], voucher: ['voucher', lazy(() => createVoucherPaymentRequestSchema)], cash: ['cash', lazy(() => createCashPaymentRequestSchema)], bankTransfer: [ 'bank_transfer', lazy(() => createBankTransferPaymentRequestSchema), ], privateLabel: [ 'private_label', lazy(() => createPrivateLabelPaymentRequestSchema), ], } );