UNPKG

openai

Version:

The official TypeScript library for the OpenAI API

46 lines • 1.72 kB
// File generated from our OpenAPI spec by Castiron. See CONTRIBUTING.md for details. import { APIResource } from "../../../../core/resource.mjs"; import { path } from "../../../../internal/utils/path.mjs"; function resolveResourceRequestOptions(options, buildOptions) { return Promise.resolve(options).then(buildOptions); } export class ServiceTierSettings extends 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(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(path `/organization/projects/${projectID}/service_tier_settings`, resolveResourceRequestOptions(options, (options) => ({ body, ...options, __security: { adminAPIKeyAuth: true }, }))); } } //# sourceMappingURL=service-tier-settings.mjs.map