orb-billing
Version:
The official TypeScript library for the Orb API
42 lines • 1.76 kB
JavaScript
;
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
Object.defineProperty(exports, "__esModule", { value: true });
exports.Migrations = void 0;
const resource_1 = require("../../core/resource.js");
const pagination_1 = require("../../core/pagination.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 Migrations extends resource_1.APIResource {
/**
* Fetch migration
*/
retrieve(migrationID, params, options) {
const { plan_id } = params;
return this._client.get((0, path_1.path) `/plans/${plan_id}/migrations/${migrationID}`, options);
}
/**
* This endpoint returns a list of all migrations for a plan. The list of
* migrations is ordered starting from the most recently created migration. The
* response also includes pagination_metadata, which lets the caller retrieve the
* next page of results if they exist.
*/
list(planID, query = {}, options) {
return this._client.getAPIList((0, path_1.path) `/plans/${planID}/migrations`, (pagination_1.Page), {
query,
...options,
});
}
/**
* This endpoint cancels a migration.
*/
cancel(migrationID, params, options) {
const { plan_id } = params;
return this._client.post((0, path_1.path) `/plans/${plan_id}/migrations/${migrationID}/cancel`, options);
}
}
exports.Migrations = Migrations;
//# sourceMappingURL=migrations.js.map