/** * 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 { Money, moneySchema } from './money.js'; import { PlanOverride, planOverrideSchema } from './planOverride.js'; import { ShippingDetails, shippingDetailsSchema } from './shippingDetails.js'; /** The response to a 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 ModifySubscriptionResponse { /** 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; /** 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; /** Indicates whether the subscription has overridden any plan attributes. */ planOverridden?: boolean; /** An array of request-related [HATEOAS links](/docs/api/reference/api-responses/#hateoas-links). */ links?: LinkDescription[]; } export const modifySubscriptionResponseSchema: Schema = lazy( () => object({ planId: ['plan_id', optional(string())], quantity: ['quantity', optional(string())], shippingAmount: ['shipping_amount', optional(moneySchema)], shippingAddress: ['shipping_address', optional(shippingDetailsSchema)], plan: ['plan', optional(planOverrideSchema)], planOverridden: ['plan_overridden', optional(boolean())], links: ['links', optional(array(linkDescriptionSchema))], }) );