orb-billing
Version:
The official TypeScript library for the Orb API
52 lines • 2.48 kB
JavaScript
;
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
Object.defineProperty(exports, "__esModule", { value: true });
exports.SubscriptionChangeListResponsesPage = exports.SubscriptionChanges = void 0;
const resource_1 = require("../resource.js");
const core_1 = require("../core.js");
const pagination_1 = require("../pagination.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);
}
list(query = {}, options) {
if ((0, core_1.isRequestOptions)(query)) {
return this.list({}, query);
}
return this._client.getAPIList('/subscription_changes', SubscriptionChangeListResponsesPage, {
query,
...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;
class SubscriptionChangeListResponsesPage extends pagination_1.Page {
}
exports.SubscriptionChangeListResponsesPage = SubscriptionChangeListResponsesPage;
SubscriptionChanges.SubscriptionChangeListResponsesPage = SubscriptionChangeListResponsesPage;
//# sourceMappingURL=subscription-changes.js.map