orb-billing
Version:
The official TypeScript library for the Orb API
38 lines • 1.56 kB
JavaScript
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
import { APIResource } from "../../core/resource.mjs";
import { Page } from "../../core/pagination.mjs";
import { path } from "../../internal/utils/path.mjs";
/**
* 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).
*/
export class Migrations extends APIResource {
/**
* Fetch migration
*/
retrieve(migrationID, params, options) {
const { plan_id } = params;
return this._client.get(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(path `/plans/${planID}/migrations`, (Page), {
query,
...options,
});
}
/**
* This endpoint cancels a migration.
*/
cancel(migrationID, params, options) {
const { plan_id } = params;
return this._client.post(path `/plans/${plan_id}/migrations/${migrationID}/cancel`, options);
}
}
//# sourceMappingURL=migrations.mjs.map