/** * PayPal Server SDKLib * * This file was automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ). */ import { lazy, number, object, optional, Schema } from '../schema.js'; import { Frequency, frequencySchema } from './frequency.js'; import { SubscriptionPricingScheme, subscriptionPricingSchemeSchema, } from './subscriptionPricingScheme.js'; import { TenureType, tenureTypeSchema } from './tenureType.js'; /** The billing cycle details. */ export interface SubscriptionBillingCycle { /** The pricing scheme details. */ pricingScheme?: SubscriptionPricingScheme; /** The frequency of the billing cycle. */ frequency: Frequency; /** The tenure type of the billing cycle. In case of a plan having trial cycle, only 2 trial cycles are allowed per plan. */ tenureType: TenureType; /** The order in which this cycle is to run among other billing cycles. For example, a trial billing cycle has a `sequence` of `1` while a regular billing cycle has a `sequence` of `2`, so that trial cycle runs before the regular cycle. */ sequence: number; /** The number of times this billing cycle gets executed. Trial billing cycles can only be executed a finite number of times (value between 1 and 999 for total_cycles). Regular billing cycles can be executed infinite times (value of 0 for total_cycles) or a finite number of times (value between 1 and 999 for total_cycles). */ totalCycles?: number; } export const subscriptionBillingCycleSchema: Schema = lazy( () => object({ pricingScheme: [ 'pricing_scheme', optional(subscriptionPricingSchemeSchema), ], frequency: ['frequency', frequencySchema], tenureType: ['tenure_type', tenureTypeSchema], sequence: ['sequence', number()], totalCycles: ['total_cycles', optional(number())], }) );