/** * PagarmeApiSDKLib * * This file was automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ). */ import { dict, lazy, nullable, number, object, optional, Schema, string, } from '../schema'; import { CreateAntifraudRequest, createAntifraudRequestSchema, } from './createAntifraudRequest'; import { CreateCustomerRequest, createCustomerRequestSchema, } from './createCustomerRequest'; import { CreatePaymentRequest, createPaymentRequestSchema, } from './createPaymentRequest'; /** Request for creating a new charge */ export interface CreateChargeRequest { /** Code */ code?: string | null; /** The amount of the charge, in cents */ amount: number; /** The customer's id */ customerId?: string | null; /** Customer data */ customer?: CreateCustomerRequest | null; /** Payment data */ payment: CreatePaymentRequest; /** Metadata */ metadata?: Record | null; /** The charge due date */ dueAt?: string | null; antifraud?: CreateAntifraudRequest | null; /** Order Id */ orderId: string; } export const createChargeRequestSchema: Schema = object({ code: ['code', optional(nullable(string()))], amount: ['amount', number()], customerId: ['customer_id', optional(nullable(string()))], customer: [ 'customer', optional(nullable(lazy(() => createCustomerRequestSchema))), ], payment: ['payment', lazy(() => createPaymentRequestSchema)], metadata: ['metadata', optional(nullable(dict(string())))], dueAt: ['due_at', optional(nullable(string()))], antifraud: [ 'antifraud', optional(nullable(lazy(() => createAntifraudRequestSchema))), ], orderId: ['order_id', string()], });