/** * PayPal Server SDKLib * * This file was automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ). */ import { array, boolean, lazy, object, optional, Schema, string, } from '../schema.js'; import { MerchantPreferences, merchantPreferencesSchema, } from './merchantPreferences.js'; import { PaymentPreferences, paymentPreferencesSchema, } from './paymentPreferences.js'; import { SubscriptionBillingCycle, subscriptionBillingCycleSchema, } from './subscriptionBillingCycle.js'; import { Taxes, taxesSchema } from './taxes.js'; /** The plan details. */ export interface PlanDetails { /** The ID for the product. */ productId?: string; /** The plan name. */ name?: string; /** The detailed description of the plan. */ description?: string; /** An array of billing cycles for trial billing and regular billing. A plan can have at most two trial cycles and only one regular cycle. */ billingCycles?: SubscriptionBillingCycle[]; /** The payment preferences for a subscription. */ paymentPreferences?: PaymentPreferences; /** The merchant preferences for a subscription. */ merchantPreferences?: MerchantPreferences; /** The tax details. */ taxes?: Taxes; /** Indicates whether you can subscribe to this plan by providing a quantity for the goods or service. */ quantitySupported?: boolean; } export const planDetailsSchema: Schema = lazy(() => object({ productId: ['product_id', optional(string())], name: ['name', optional(string())], description: ['description', optional(string())], billingCycles: [ 'billing_cycles', optional(array(subscriptionBillingCycleSchema)), ], paymentPreferences: [ 'payment_preferences', optional(paymentPreferencesSchema), ], merchantPreferences: [ 'merchant_preferences', optional(merchantPreferencesSchema), ], taxes: ['taxes', optional(taxesSchema)], quantitySupported: ['quantity_supported', optional(boolean())], }) );