openai
Version:
The official TypeScript library for the OpenAI API
62 lines • 1.99 kB
JavaScript
;
// File generated from our OpenAPI spec by Castiron. See CONTRIBUTING.md for details.
Object.defineProperty(exports, "__esModule", { value: true });
exports.SpendLimit = void 0;
const resource_1 = require("../../../core/resource.js");
function resolveResourceRequestOptions(options, buildOptions) {
return Promise.resolve(options).then(buildOptions);
}
class SpendLimit extends resource_1.APIResource {
/**
* Get the organization's hard spend limit.
*
* @example
* ```ts
* const organizationSpendLimit =
* await client.admin.organization.spendLimit.retrieve();
* ```
*/
retrieve(options) {
return this._client.get('/organization/spend_limit', resolveResourceRequestOptions(options, (options) => ({
...options,
__security: { adminAPIKeyAuth: true },
})));
}
/**
* Create or replace the organization's hard spend limit.
*
* @example
* ```ts
* const organizationSpendLimit =
* await client.admin.organization.spendLimit.update({
* currency: 'USD',
* interval: 'month',
* threshold_amount: 1,
* });
* ```
*/
update(body, options) {
return this._client.post('/organization/spend_limit', resolveResourceRequestOptions(options, (options) => ({
body,
...options,
__security: { adminAPIKeyAuth: true },
})));
}
/**
* Delete the organization's hard spend limit.
*
* @example
* ```ts
* const organizationSpendLimitDeleted =
* await client.admin.organization.spendLimit.delete();
* ```
*/
delete(options) {
return this._client.delete('/organization/spend_limit', resolveResourceRequestOptions(options, (options) => ({
...options,
__security: { adminAPIKeyAuth: true },
})));
}
}
exports.SpendLimit = SpendLimit;
//# sourceMappingURL=spend-limit.js.map