import { type Client } from '../core.js'; import { type RequestOptions } from '../lib/types.js'; import type { CreateSubscriptionRequest, CreateSubscriptionResponse, ListSubscriptionsRequest, ListSubscriptionsResponse, GetSubscriptionRequest, GetSubscriptionResponse, CancelSubscriptionRequest, CancelSubscriptionResponse, UnscheduleCancelationRequest, UnscheduleCancelationResponse, UnscheduleSubscriptionRequest, UnscheduleSubscriptionResponse, RestoreSubscriptionRequest, RestoreSubscriptionResponse, ChangeSubscriptionRequest, ChangeSubscriptionResponse, MigrateSubscriptionRequest, MigrateSubscriptionResponse, EditSubscriptionRequest, EditSubscriptionResponse, ListSubscriptionAddonsRequest, ListSubscriptionAddonsResponse, GetSubscriptionAddonRequest, GetSubscriptionAddonResponse } from '../models/operations/subscriptions.js'; import type { Subscription, SubscriptionAddon } from '../models/types.js'; export declare class Subscriptions { private readonly _client; constructor(_client: Client); /** * Create subscription * * POST /openmeter/subscriptions */ create(request: CreateSubscriptionRequest, options?: RequestOptions): Promise; /** * List subscriptions * * GET /openmeter/subscriptions */ list(request?: ListSubscriptionsRequest, options?: RequestOptions): Promise; /** * List subscriptions * * Iterates every item across all pages, fetching more as the returned iterable is consumed. * * GET /openmeter/subscriptions */ listAll(request?: ListSubscriptionsRequest, options?: RequestOptions): AsyncIterable; /** * Get subscription * * GET /openmeter/subscriptions/{subscriptionId} */ get(request: GetSubscriptionRequest, options?: RequestOptions): Promise; /** * Cancel subscription * * Cancels the subscription. Will result in a scheduling conflict if there are * other subscriptions scheduled to start after the cancelation time. * * POST /openmeter/subscriptions/{subscriptionId}/cancel */ cancel(request: CancelSubscriptionRequest, options?: RequestOptions): Promise; /** * Unschedule subscription cancelation * * Unschedules the subscription cancelation. * * POST /openmeter/subscriptions/{subscriptionId}/unschedule-cancelation */ unscheduleCancelation(request: UnscheduleCancelationRequest, options?: RequestOptions): Promise; /** * Unschedule subscription * * Deletes a scheduled subscription that has not yet become active, removing it and * resolving any scheduling conflict it was holding. This is distinct from * canceling: cancel ends a running subscription, whereas unscheduling removes a * not-yet-active one. Only scheduled subscriptions can be unscheduled; * unscheduling an active or already-started subscription is rejected. * * POST /openmeter/subscriptions/{subscriptionId}/unschedule */ unschedule(request: UnscheduleSubscriptionRequest, options?: RequestOptions): Promise; /** * Restore subscription * * Restores the subscription by deleting any later-scheduled successor * subscriptions and continuing this one indefinitely. This is the inverse of a * future-dated change, which schedules a successor. Restore is not available when * multi-subscription is enabled. * * POST /openmeter/subscriptions/{subscriptionId}/restore */ restore(request: RestoreSubscriptionRequest, options?: RequestOptions): Promise; /** * Change subscription * * Closes a running subscription and starts a new one according to the * specification. Can be used for upgrades, downgrades, and plan changes. * * POST /openmeter/subscriptions/{subscriptionId}/change */ change(request: ChangeSubscriptionRequest, options?: RequestOptions): Promise; /** * Migrate subscription * * Migrates to a later version of the current plan. With starting_phase omitted and * billing_anchor omitted or unchanged, migration amends the subscription in place: * unchanged items retain their service periods and both response entries have the * same ID. Existing addons must remain compatible with the target plan. * Incompatible phase timelines or billing settings return an error. Providing * starting_phase or a different billing_anchor explicitly requests replacement, * which resets the phase timeline, may produce billing adjustments, and does not * transfer addons. Custom subscriptions cannot be migrated. * * POST /openmeter/subscriptions/{subscriptionId}/migrate */ migrate(request: MigrateSubscriptionRequest, options?: RequestOptions): Promise; /** * Edit subscription * * Edits a running subscription by applying an ordered batch of customizations * (adding or removing items, adding, removing, or stretching phases, or * unscheduling a pending edit). The changes may take effect immediately or at the * next billing cycle. Subscriptions that have add-ons cannot be edited. * * POST /openmeter/subscriptions/{subscriptionId}/edit */ edit(request: EditSubscriptionRequest, options?: RequestOptions): Promise; /** * List subscription addons * * List the add-ons of a subscription. * * GET /openmeter/subscriptions/{subscriptionId}/addons */ listAddons(request: ListSubscriptionAddonsRequest, options?: RequestOptions): Promise; /** * List subscription addons * * List the add-ons of a subscription. * * Iterates every item across all pages, fetching more as the returned iterable is consumed. * * GET /openmeter/subscriptions/{subscriptionId}/addons */ listAddonsAll(request: ListSubscriptionAddonsRequest, options?: RequestOptions): AsyncIterable; /** * Get add-on association for subscription * * Get an add-on association for a subscription. * * GET /openmeter/subscriptions/{subscriptionId}/addons/{subscriptionAddonId} */ getAddon(request: GetSubscriptionAddonRequest, options?: RequestOptions): Promise; }