UNPKG

orb-billing

Version:

The official TypeScript library for the Orb API

38 lines 1.83 kB
"use strict"; // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. Object.defineProperty(exports, "__esModule", { value: true }); exports.SubscriptionChanges = void 0; const resource_1 = require("../resource.js"); const core_1 = require("../core.js"); class SubscriptionChanges extends resource_1.APIResource { /** * This endpoint returns a subscription change given an identifier. * * A subscription change is created by including * `Create-Pending-Subscription-Change: True` in the header of a subscription * mutation API call (e.g. * [create subscription endpoint](/api-reference/subscription/create-subscription), * [schedule plan change endpoint](/api-reference/subscription/schedule-plan-change), * ...). The subscription change will be referenced by the * `pending_subscription_change` field in the response. */ retrieve(subscriptionChangeId, options) { return this._client.get(`/subscription_changes/${subscriptionChangeId}`, options); } apply(subscriptionChangeId, body = {}, options) { if ((0, core_1.isRequestOptions)(body)) { return this.apply(subscriptionChangeId, {}, body); } return this._client.post(`/subscription_changes/${subscriptionChangeId}/apply`, { body, ...options }); } /** * Cancel a subscription change. The change can no longer be applied. A * subscription can only have one "pending" change at a time - use this endpoint to * cancel an existing change before creating a new one. */ cancel(subscriptionChangeId, options) { return this._client.post(`/subscription_changes/${subscriptionChangeId}/cancel`, options); } } exports.SubscriptionChanges = SubscriptionChanges; //# sourceMappingURL=subscription-changes.js.map