UNPKG

@anthropic-ai/sdk

Version:
175 lines • 6.55 kB
import { APIResource } from "../../../../core/resource.js"; import * as MembersAPI from "./members.js"; import { BetaDeletedRBACGroupMember, BetaRBACGroupMember, BetaRBACGroupMembersPageCursor, MemberAddParams, MemberListParams, MemberRemoveParams, Members } from "./members.js"; import { APIPromise } from "../../../../core/api-promise.js"; import { NotFoundError } from "../../../../core/error.js"; import { PageCursor, type PageCursorParams, PagePromise } from "../../../../core/pagination.js"; import { RequestOptions } from "../../../../internal/request-options.js"; /** * The RBAC Group is not one of the organization's groups. */ export declare class BetaRBACGroupNotFoundError extends NotFoundError { readonly errorCode: 'rbac_group_not_found'; readonly details: BetaRBACGroupNotFoundErrorDetails; } export declare class RBACGroups extends APIResource { members: MembersAPI.Members; /** * Create an RBAC Group in the Claude Enterprise tenant. Groups created via the API * have source type `"direct"`. * * The RBAC Groups API is available to Claude Enterprise organizations only. * * @throws {SandboxEgressRestrictedError} * * @example * ```ts * const betaRBACGroup = * await client.beta.organization.rbacGroups.create({ * name: 'Engineering', * }); * ``` */ create(body: RBACGroupCreateParams, options?: RequestOptions): APIPromise<BetaRBACGroup>; /** * Retrieve an RBAC Group by ID. * * The RBAC Groups API is available to Claude Enterprise organizations only. * * @example * ```ts * const betaRBACGroup = * await client.beta.organization.rbacGroups.retrieve( * 'rbac_group_id', * ); * ``` */ retrieve(rbacGroupID: string, options?: RequestOptions): APIPromise<BetaRBACGroup>; /** * Update an RBAC Group's name. Groups provisioned by an identity provider (source * type `"scim"`) cannot be modified via the API while an organization in the * tenant uses SCIM provisioning. * * The RBAC Groups API is available to Claude Enterprise organizations only. * * @throws {SandboxEgressRestrictedError} * * @example * ```ts * const betaRBACGroup = * await client.beta.organization.rbacGroups.update( * 'rbac_group_id', * {}, * ); * ``` */ update(rbacGroupID: string, body: RBACGroupUpdateParams, options?: RequestOptions): APIPromise<BetaRBACGroup>; /** * List RBAC Groups in the Claude Enterprise tenant. * * The RBAC Groups API is available to Claude Enterprise organizations only. * * @example * ```ts * // Automatically fetches more pages as needed. * for await (const betaRBACGroup of client.beta.organization.rbacGroups.list()) { * // ... * } * ``` */ list(query?: RBACGroupListParams | null | undefined, options?: RequestOptions): PagePromise<BetaRBACGroupsPageCursor, BetaRBACGroup>; /** * Delete an RBAC Group. Groups provisioned by an identity provider (source type * `"scim"`) cannot be deleted via the API while an organization in the tenant uses * SCIM provisioning. * * The RBAC Groups API is available to Claude Enterprise organizations only. * * @throws {RBACGroupGrantsOwnerAccessError} * @throws {RBACGroupOwnerAccessUnconfirmedError} * @throws {SandboxEgressRestrictedError} * * @example * ```ts * const betaDeletedRBACGroup = * await client.beta.organization.rbacGroups.delete( * 'rbac_group_id', * ); * ``` */ delete(rbacGroupID: string, options?: RequestOptions): APIPromise<BetaDeletedRBACGroup>; } export type BetaRBACGroupsPageCursor = PageCursor<BetaRBACGroup>; export interface BetaDeletedRBACGroup { /** * ID of the RBAC Group. */ id: string; /** * Deleted object type. * * For RBAC Groups, this is always `"rbac_group_deleted"`. */ type: 'rbac_group_deleted'; } export interface BetaRBACGroup { /** * ID of the RBAC Group. */ id: string; /** * RFC 3339 timestamp of when the RBAC Group was created. */ created_at: string; /** * Name of the RBAC Group. Not uniqueness-enforced. */ name: string; /** * RBAC Role IDs attached to this RBAC Group. Role attachment is managed in the * admin settings and is read-only on this API. `null` means role data was * temporarily unavailable — retry to distinguish from an empty list. */ role_ids: Array<string> | null; /** * How the RBAC Group was created: `"direct"` for groups created directly (for * example, in the organization's admin settings), `"scim"` for groups provisioned * by the identity provider. */ source_type: 'direct' | 'scim'; /** * Object type. * * For RBAC Groups, this is always `"rbac_group"`. */ type: 'rbac_group'; /** * RFC 3339 timestamp of when the RBAC Group was last updated. */ updated_at: string; } /** * The RBAC Group is not one of the organization's groups. */ export interface BetaRBACGroupNotFoundErrorDetails { error_code: 'rbac_group_not_found'; } export interface RBACGroupCreateParams { /** * Name of the RBAC Group. Not uniqueness-enforced. */ name: string; } export interface RBACGroupUpdateParams { /** * Name of the RBAC Group. Not uniqueness-enforced. */ name?: string | null; } export interface RBACGroupListParams extends PageCursorParams { } export declare namespace RBACGroups { export { BetaRBACGroupNotFoundError as BetaRBACGroupNotFoundError, type BetaDeletedRBACGroup as BetaDeletedRBACGroup, type BetaRBACGroup as BetaRBACGroup, type BetaRBACGroupNotFoundErrorDetails as BetaRBACGroupNotFoundErrorDetails, type BetaRBACGroupsPageCursor as BetaRBACGroupsPageCursor, type RBACGroupCreateParams as RBACGroupCreateParams, type RBACGroupUpdateParams as RBACGroupUpdateParams, type RBACGroupListParams as RBACGroupListParams, }; export { Members as Members, type BetaDeletedRBACGroupMember as BetaDeletedRBACGroupMember, type BetaRBACGroupMember as BetaRBACGroupMember, type BetaRBACGroupMembersPageCursor as BetaRBACGroupMembersPageCursor, type MemberListParams as MemberListParams, type MemberAddParams as MemberAddParams, type MemberRemoveParams as MemberRemoveParams, }; } //# sourceMappingURL=rbac-groups.d.ts.map