UNPKG

@anthropic-ai/sdk

Version:
83 lines • 3.87 kB
import { APIResource } from "../../../../../core/resource.mjs"; import { buildHeaders } from "../../../../../internal/headers.mjs"; import { startApiCallSpan } from "../../../../../internal/tracing.mjs"; export class RBACGroupDefault extends APIResource { /** * Retrieve the default Claude Code managed settings, which members who belong to * no RBAC Group in `rbac_group_order` receive in `rbac_groups` mode. * * **Accepted credentials:** an organization-level Admin API key with the * `read:claude_code_managed_settings` scope. * * Every request must include the beta header * `anthropic-beta: ce-claude-code-managed-settings-2026-10-06`. A request without * it, or from an organization not enabled for this beta, returns `404`. The Claude * Code Managed Settings API is in beta and is available to Claude Enterprise * organizations only. * * @throws {BetaCMEKFeatureUnsupportedError} * @throws {CMEKKeyDisabledError} * * @example * ```ts * const betaClaudeCodeRBACGroupDefaultManagedSettings = * await client.beta.organization.claudeCode.managedSettings.rbacGroupDefault.retrieve(); * ``` */ retrieve(params = {}, options) { const { betas } = params ?? {}; return this._client.get('/v1/organizations/claude_code/managed_settings/rbac_group_default', { ...options, headers: buildHeaders([ { 'anthropic-beta': [...(betas ?? []), 'ce-claude-code-managed-settings-2026-10-06'].toString() }, options?.headers, ]), __qualifiers: { beta: 'true' }, __span: startApiCallSpan(this._client, 'anthropic.organization.claude_code.managed_settings.rbac_group_default.retrieve', options, { route: '/v1/organizations/claude_code/managed_settings/rbac_group_default' }), }); } /** * Set or replace the default Claude Code managed settings, or clear them with * `null`. * * **Accepted credentials:** an organization-level Admin API key with the * `write:claude_code_managed_settings` scope. * * Every request must include the beta header * `anthropic-beta: ce-claude-code-managed-settings-2026-10-06`. A request without * it, or from an organization not enabled for this beta, returns `404`. The Claude * Code Managed Settings API is in beta and is available to Claude Enterprise * organizations only. * * A write that returns `503` may have applied. Retrying it is safe. * * @throws {BetaCMEKFeatureUnsupportedError} * @throws {CMEKKeyDisabledError} * @throws {BetaRequestBodyTimeoutError} * @throws {BetaSettingsDocumentLimitExceededError} * @throws {BetaSettingsHistoryLimitExceededError} * @throws {SandboxEgressRestrictedError} * * @example * ```ts * const betaClaudeCodeRBACGroupDefaultManagedSettings = * await client.beta.organization.claudeCode.managedSettings.rbacGroupDefault.update( * { settings: { foo: 'bar' } }, * ); * ``` */ update(params, options) { const { betas, ...body } = params; return this._client.post('/v1/organizations/claude_code/managed_settings/rbac_group_default', { body, ...options, headers: buildHeaders([ { 'anthropic-beta': [...(betas ?? []), 'ce-claude-code-managed-settings-2026-10-06'].toString() }, options?.headers, ]), __qualifiers: { beta: 'true' }, __span: startApiCallSpan(this._client, 'anthropic.organization.claude_code.managed_settings.rbac_group_default.update', options, { route: '/v1/organizations/claude_code/managed_settings/rbac_group_default' }), }); } } //# sourceMappingURL=rbac-group-default.mjs.map