orb-billing
Version:
The official TypeScript library for the Orb API
34 lines • 1.66 kB
JavaScript
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
import { APIResource } from "../resource.mjs";
import { isRequestOptions } from "../core.mjs";
export class SubscriptionChanges extends 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 (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);
}
}
//# sourceMappingURL=subscription-changes.mjs.map