UNPKG

orb-billing

Version:

The official TypeScript library for the Orb API

45 lines 2.21 kB
"use strict"; // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. Object.defineProperty(exports, "__esModule", { value: true }); exports.ExternalPlanID = void 0; const resource_1 = require("../../core/resource.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 ExternalPlanID extends resource_1.APIResource { /** * This endpoint can be used to update the `external_plan_id`, `description`, and * `metadata` of an existing plan. * * Other fields on a plan are currently immutable. */ update(otherExternalPlanID, body, options) { return this._client.put((0, path_1.path) `/plans/external_plan_id/${otherExternalPlanID}`, { body, ...options }); } /** * This endpoint is used to fetch [plan](/core-concepts##plan-and-price) details * given an external_plan_id identifier. It returns information about the prices * included in the plan and their configuration, as well as the product that the * plan is attached to. * * If multiple plans are found to contain the specified external_plan_id, the * active plans will take priority over archived ones, and among those, the * endpoint will return the most recently created plan. * * ## Serialized prices * * Orb supports a few different pricing models out of the box. Each of these models * is serialized differently in a given [Price](/core-concepts#plan-and-price) * object. The `model_type` field determines the key for the configuration object * that is present. A detailed explanation of price types can be found in the * [Price schema](/core-concepts#plan-and-price). " */ fetch(externalPlanID, options) { return this._client.get((0, path_1.path) `/plans/external_plan_id/${externalPlanID}`, options); } } exports.ExternalPlanID = ExternalPlanID; //# sourceMappingURL=external-plan-id.js.map