/** * 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 { LinkDescription, linkDescriptionSchema } from './linkDescription.js'; import { MerchantPreferences, merchantPreferencesSchema, } from './merchantPreferences.js'; import { PaymentPreferences, paymentPreferencesSchema, } from './paymentPreferences.js'; import { SubscriptionBillingCycle, subscriptionBillingCycleSchema, } from './subscriptionBillingCycle.js'; import { SubscriptionPlanStatus, subscriptionPlanStatusSchema, } from './subscriptionPlanStatus.js'; import { Taxes, taxesSchema } from './taxes.js'; /** The plan details. */ export interface BillingPlan { /** The unique PayPal-generated ID for the plan. */ id?: string; /** The ID for the product. */ productId?: string; /** The plan name. */ name?: string; /** The plan status. */ status?: SubscriptionPlanStatus; /** 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; /** The date and time, in [Internet date and time format](https://tools.ietf.org/html/rfc3339#section-5.6). Seconds are required while fractional seconds are optional. Note: The regular expression provides guidance but does not reject all invalid dates. */ createTime?: string; /** The date and time, in [Internet date and time format](https://tools.ietf.org/html/rfc3339#section-5.6). Seconds are required while fractional seconds are optional. Note: The regular expression provides guidance but does not reject all invalid dates. */ updateTime?: string; /** An array of request-related [HATEOAS links](/docs/api/reference/api-responses/#hateoas-links). */ links?: LinkDescription[]; } export const billingPlanSchema: Schema = lazy(() => object({ id: ['id', optional(string())], productId: ['product_id', optional(string())], name: ['name', optional(string())], status: ['status', optional(subscriptionPlanStatusSchema)], 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())], createTime: ['create_time', optional(string())], updateTime: ['update_time', optional(string())], links: ['links', optional(array(linkDescriptionSchema))], }) );