import { FlexpriceCore } from "../core.js"; import { RequestOptions } from "../lib/sdks.js"; import { FlexPriceError } from "../sdk/models/flex-price-error.js"; import { ConnectionError, InvalidRequestError, RequestAbortedError, RequestTimeoutError, UnexpectedClientError } from "../sdk/models/http-client-errors.js"; import * as models from "../sdk/models/index.js"; import { ResponseValidationError } from "../sdk/models/response-validation-error.js"; import { SDKValidationError } from "../sdk/models/sdk-validation-error.js"; import { APIPromise } from "../types/async.js"; import { Result } from "../types/fp.js"; /** * Execute a plan change (v2, swap in place) * * @remarks * Change a subscription's plan in place. Subscription id, billing anchor and period bounds are preserved; line items are sliced and settled in one transaction. * * change_at controls timing. Omitted or 'immediate' applies the change now. 'end_of_period' records a pending schedule that executes at the subscription's current period end: the response returns is_scheduled, schedule_id and scheduled_at instead of a completed change, and nothing is swapped or billed until the boundary. * * scheduled_at is resolved from the subscription's current period end at request time. If that period end is already in the past (a backdated start date, a resumed pause, or worker downtime can all leave a subscription behind), the change is due immediately and fires on the next billing scan rather than a period away — inspect scheduled_at to see this. * * Only one plan change may be pending per subscription. By default (on_conflict_policies.on_pending_schedule = 'reject') a second request returns 400; cancel the existing schedule via POST /subscriptions/schedules/{schedule_id}/cancel first. Pending schedules are listable via GET /subscriptions/{id}/schedules. * * Set on_conflict_policies.on_pending_schedule to 'supersede' to replace the queued change instead: the pending schedule is cancelled and this request applied in the same transaction, so both land or neither does. The cancelled schedule ids are returned in superseded_schedules, and preview reports the same list without writing. */ export declare function subscriptionsExecuteSubscriptionPlanChangeV2(client: FlexpriceCore, id: string, body: models.SubscriptionChangeV2Request, options?: RequestOptions): APIPromise>; //# sourceMappingURL=subscriptions-execute-subscription-plan-change-v2.d.ts.map