|
| 1 | +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. |
| 2 | + |
| 3 | +import { APIResource } from '../../core/resource'; |
| 4 | +import { APIPromise } from '../../core/api-promise'; |
| 5 | +import { RequestOptions } from '../../internal/request-options'; |
| 6 | + |
| 7 | +/** |
| 8 | + * Read and manage organization-level limits. |
| 9 | + */ |
| 10 | +export class Limits extends APIResource { |
| 11 | + /** |
| 12 | + * Get the organization's concurrent session ceiling and the default per-project |
| 13 | + * concurrency cap applied to projects without an explicit override. |
| 14 | + */ |
| 15 | + retrieve(options?: RequestOptions): APIPromise<OrgLimits> { |
| 16 | + return this._client.get('/org/limits', options); |
| 17 | + } |
| 18 | + |
| 19 | + /** |
| 20 | + * Set the default per-project concurrency cap applied to projects without an |
| 21 | + * explicit override. Set the value to 0 to remove the default; omit to leave it |
| 22 | + * unchanged. The default cannot exceed the organization's concurrent session |
| 23 | + * ceiling. |
| 24 | + */ |
| 25 | + update(body: LimitUpdateParams, options?: RequestOptions): APIPromise<OrgLimits> { |
| 26 | + return this._client.patch('/org/limits', { body, ...options }); |
| 27 | + } |
| 28 | +} |
| 29 | + |
| 30 | +export interface OrgLimits { |
| 31 | + /** |
| 32 | + * Default maximum concurrent browser sessions applied to every project that has no |
| 33 | + * explicit per-project override. Null means no org-level default, so such projects |
| 34 | + * are uncapped (only the org-wide limit applies). Applies to existing and newly |
| 35 | + * created projects. |
| 36 | + */ |
| 37 | + default_project_max_concurrent_sessions?: number | null; |
| 38 | + |
| 39 | + /** |
| 40 | + * The organization's effective concurrent browser session ceiling, from its plan |
| 41 | + * or an override. Read-only and shared across all projects in the org; a |
| 42 | + * per-project default cannot exceed it. |
| 43 | + */ |
| 44 | + max_concurrent_sessions?: number; |
| 45 | +} |
| 46 | + |
| 47 | +export interface UpdateOrgLimitsRequest { |
| 48 | + /** |
| 49 | + * Default maximum concurrent browser sessions for projects without an explicit |
| 50 | + * override. Set to 0 to remove the default; omit to leave unchanged. Cannot exceed |
| 51 | + * the organization's concurrent session ceiling. |
| 52 | + */ |
| 53 | + default_project_max_concurrent_sessions?: number | null; |
| 54 | +} |
| 55 | + |
| 56 | +export interface LimitUpdateParams { |
| 57 | + /** |
| 58 | + * Default maximum concurrent browser sessions for projects without an explicit |
| 59 | + * override. Set to 0 to remove the default; omit to leave unchanged. Cannot exceed |
| 60 | + * the organization's concurrent session ceiling. |
| 61 | + */ |
| 62 | + default_project_max_concurrent_sessions?: number | null; |
| 63 | +} |
| 64 | + |
| 65 | +export declare namespace Limits { |
| 66 | + export { |
| 67 | + type OrgLimits as OrgLimits, |
| 68 | + type UpdateOrgLimitsRequest as UpdateOrgLimitsRequest, |
| 69 | + type LimitUpdateParams as LimitUpdateParams, |
| 70 | + }; |
| 71 | +} |
0 commit comments