/** * PayPal Server SDKLib * * This file was automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ). */ import { lazy, object, optional, Schema, string } from '../schema.js'; import { Money, moneySchema } from './money.js'; import { PlanOverride, planOverrideSchema } from './planOverride.js'; import { ShippingDetails, shippingDetailsSchema } from './shippingDetails.js'; import { SubscriptionPatchApplicationContext, subscriptionPatchApplicationContextSchema, } from './subscriptionPatchApplicationContext.js'; /** The request to update the quantity of the product or service in a subscription. You can also use this method to switch the plan and update the `shipping_amount` and `shipping_address` values for the subscription. This type of update requires the buyer's consent. */ export interface ModifySubscriptionRequest { /** The unique PayPal-generated ID for the plan. */ planId?: string; /** The quantity of the product or service in the subscription. */ quantity?: string; /** The currency and amount for a financial transaction, such as a balance or payment due. */ shippingAmount?: Money; /** The shipping details. */ shippingAddress?: ShippingDetails; /** The application context, which customizes the payer experience during the subscription approval process with PayPal. */ applicationContext?: SubscriptionPatchApplicationContext; /** An inline plan object to customise the subscription. You can override plan level default attributes by providing customised values for the subscription in this object. */ plan?: PlanOverride; } export const modifySubscriptionRequestSchema: Schema = lazy( () => object({ planId: ['plan_id', optional(string())], quantity: ['quantity', optional(string())], shippingAmount: ['shipping_amount', optional(moneySchema)], shippingAddress: ['shipping_address', optional(shippingDetailsSchema)], applicationContext: [ 'application_context', optional(subscriptionPatchApplicationContextSchema), ], plan: ['plan', optional(planOverrideSchema)], }) );