openai
Version:
The official TypeScript library for the OpenAI API
50 lines • 1.92 kB
JavaScript
;
// File generated from our OpenAPI spec by Castiron. See CONTRIBUTING.md for details.
Object.defineProperty(exports, "__esModule", { value: true });
exports.ServiceTierSettings = void 0;
const resource_1 = require("../../../../core/resource.js");
const path_1 = require("../../../../internal/utils/path.js");
function resolveResourceRequestOptions(options, buildOptions) {
return Promise.resolve(options).then(buildOptions);
}
class ServiceTierSettings extends resource_1.APIResource {
/**
* Retrieve the configured default and enabled service tiers for a project.
*
* @example
* ```ts
* const projectServiceTierSettings =
* await client.admin.organization.projects.serviceTierSettings.retrieve(
* 'project_id',
* );
* ```
*/
retrieve(projectID, options) {
return this._client.get((0, path_1.path) `/organization/projects/${projectID}/service_tier_settings`, resolveResourceRequestOptions(options, (options) => ({
...options,
__security: { adminAPIKeyAuth: true },
})));
}
/**
* Update the default or enabled service tiers atomically. Supply at least one
* field. Omitted fields keep their current values.
*
* @example
* ```ts
* const projectServiceTierSettings =
* await client.admin.organization.projects.serviceTierSettings.update(
* 'project_id',
* { default: 'standard' },
* );
* ```
*/
update(projectID, body, options) {
return this._client.post((0, path_1.path) `/organization/projects/${projectID}/service_tier_settings`, resolveResourceRequestOptions(options, (options) => ({
body,
...options,
__security: { adminAPIKeyAuth: true },
})));
}
}
exports.ServiceTierSettings = ServiceTierSettings;
//# sourceMappingURL=service-tier-settings.js.map