orb-billing
Version:
The official TypeScript library for the Orb API
43 lines • 1.92 kB
JavaScript
;
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
Object.defineProperty(exports, "__esModule", { value: true });
exports.Beta = void 0;
const tslib_1 = require("../../internal/tslib.js");
const resource_1 = require("../../core/resource.js");
const ExternalPlanIDAPI = tslib_1.__importStar(require("./external-plan-id.js"));
const external_plan_id_1 = require("./external-plan-id.js");
const path_1 = require("../../internal/utils/path.js");
/**
* The [Plan](/core-concepts#plan-and-price) resource represents a plan that can be subscribed to by a
* customer. Plans define the billing behavior of the subscription. You can see more about how to configure prices
* in the [Price resource](/reference/price).
*/
class Beta extends resource_1.APIResource {
constructor() {
super(...arguments);
this.externalPlanID = new ExternalPlanIDAPI.ExternalPlanID(this._client);
}
/**
* This endpoint allows the creation of a new plan version for an existing plan.
*/
createPlanVersion(planID, body, options) {
return this._client.post((0, path_1.path) `/plans/${planID}/versions`, { body, ...options });
}
/**
* This endpoint is used to fetch a plan version. It returns the phases, prices,
* and adjustments present on this version of the plan.
*/
fetchPlanVersion(version, params, options) {
const { plan_id } = params;
return this._client.get((0, path_1.path) `/plans/${plan_id}/versions/${version}`, options);
}
/**
* This endpoint allows setting the default version of a plan.
*/
setDefaultPlanVersion(planID, body, options) {
return this._client.post((0, path_1.path) `/plans/${planID}/set_default_version`, { body, ...options });
}
}
exports.Beta = Beta;
Beta.ExternalPlanID = external_plan_id_1.ExternalPlanID;
//# sourceMappingURL=beta.js.map