import { APIResource } from "../../../core/resource.mjs"; import { PageCursor } from "../../../core/pagination.mjs"; import { startApiCallSpan } from "../../../internal/tracing.mjs"; import { path } from "../../../internal/utils/path.mjs"; export class RateLimits extends APIResource { /** * List a workspace's rate limits. * * By default, returns only the groups and limiter types that have a * workspace-level override. With `include_inherited=true`, returns every group * with organization-level limits the workspace can see, listing for each the * values it inherits from the organization as well as its own overrides. Each * value's `source` says which it is. * * When `limit` is omitted, every matching entry is returned in a single page; when * `limit` truncates the result, follow `next_page` to fetch the remaining entries. * * @example * ```ts * // Automatically fetches more pages as needed. * for await (const workspaceRateLimit of client.organization.workspaces.rateLimits.list( * 'workspace_id', * )) { * // ... * } * ``` */ list(workspaceID, query = {}, options) { return this._client.getAPIList(path `/v1/organizations/workspaces/${workspaceID}/rate_limits`, (PageCursor), { query, ...options, __span: startApiCallSpan(this._client, 'anthropic.organization.workspaces.rate_limits.list', options, { route: '/v1/organizations/workspaces/{workspace_id}/rate_limits', queryParams: ['group_type', 'include_inherited', 'limit', 'page'], attributes: { 'anthropic.organization.workspace.id': workspaceID }, }), }); } } //# sourceMappingURL=rate-limits.mjs.map