/**
 * Paypal Server SDKLib
 *
 * This file was automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ).
 */

import { lazy, object, optional, Schema } from '../schema';
import {
  PaymentTokenRequestCard,
  paymentTokenRequestCardSchema,
} from './paymentTokenRequestCard';
import {
  VaultTokenRequest,
  vaultTokenRequestSchema,
} from './vaultTokenRequest';

/** The payment method to vault with the instrument details. */
export interface PaymentTokenRequestPaymentSource {
  /** A Resource representing a request to vault a Card. */
  card?: PaymentTokenRequestCard;
  /** The Tokenized Payment Source representing a Request to Vault a Token. */
  token?: VaultTokenRequest;
}

export const paymentTokenRequestPaymentSourceSchema: Schema<PaymentTokenRequestPaymentSource> = object(
  {
    card: ['card', optional(lazy(() => paymentTokenRequestCardSchema))],
    token: ['token', optional(lazy(() => vaultTokenRequestSchema))],
  }
);
