Class: Anthropic::Resources::Beta::Organization::Workspaces

Inherits:
Object
  • Object
show all
Defined in:
lib/anthropic/resources/beta/organization/workspaces.rb,
lib/anthropic/resources/beta/organization/workspaces/members.rb,
lib/anthropic/resources/beta/organization/workspaces/rate_limits.rb,
lib/anthropic/resources/beta/organization/workspaces/service_accounts.rb,
sig/anthropic/resources/beta/organization/workspaces.rbs,
sig/anthropic/resources/beta/organization/workspaces/members.rbs,
sig/anthropic/resources/beta/organization/workspaces/rate_limits.rbs,
sig/anthropic/resources/beta/organization/workspaces/service_accounts.rbs

Defined Under Namespace

Classes: Members, RateLimits, ServiceAccounts

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(client:) ⇒ Workspaces

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns a new instance of Workspaces.

Parameters:



164
165
166
167
168
169
170
# File 'lib/anthropic/resources/beta/organization/workspaces.rb', line 164

def initialize(client:)
  @client = client
  @rate_limits = Anthropic::Resources::Beta::Organization::Workspaces::RateLimits.new(client: client)
  @members = Anthropic::Resources::Beta::Organization::Workspaces::Members.new(client: client)
  @service_accounts =
    Anthropic::Resources::Beta::Organization::Workspaces::ServiceAccounts.new(client: client)
end

Instance Attribute Details

#membersAnthropic::Resources::Beta::Organization::Workspaces::Members (readonly)



12
13
14
# File 'lib/anthropic/resources/beta/organization/workspaces.rb', line 12

def members
  @members
end

#rate_limitsAnthropic::Resources::Beta::Organization::Workspaces::RateLimits (readonly)



9
10
11
# File 'lib/anthropic/resources/beta/organization/workspaces.rb', line 9

def rate_limits
  @rate_limits
end

#service_accountsAnthropic::Resources::Beta::Organization::Workspaces::ServiceAccounts (readonly)



15
16
17
# File 'lib/anthropic/resources/beta/organization/workspaces.rb', line 15

def service_accounts
  @service_accounts
end

Instance Method Details

#archive(workspace_id, request_options: {}) ⇒ Anthropic::Models::Beta::Organization::BetaWorkspace

Archive Workspace

Parameters:

Returns:

See Also:



152
153
154
155
156
157
158
159
# File 'lib/anthropic/resources/beta/organization/workspaces.rb', line 152

def archive(workspace_id, params = {})
  @client.request(
    method: :post,
    path: ["v1/organizations/workspaces/%1$s/archive?beta=true", workspace_id],
    model: Anthropic::Beta::Organization::BetaWorkspace,
    options: params[:request_options]
  )
end

#create(name:, data_residency: nil, display_color: nil, external_key_id: nil, tags: nil, betas: nil, request_options: {}) ⇒ Anthropic::Models::Beta::Organization::BetaWorkspace

Create Workspace

Some parameter documentations has been truncated, see Models::Beta::Organization::WorkspaceCreateParams for more details.

Parameters:

  • name (String)

    Body param: Name of the Workspace.

  • data_residency (Anthropic::Models::Beta::Organization::BetaDataResidencyCreateConfig, nil)

    Body param: Data residency configuration for the workspace. If omitted, defaults

  • display_color (String, nil)

    Body param: Hex color code representing the Workspace in the Anthropic Console.

  • external_key_id (String, nil)

    Body param: ID of the customer-managed encryption key (CMEK) configuration to us

  • tags (Hash{Symbol=>String}, nil)

    Body param: User-defined tags as string key-value pairs. Keys may not begin with

  • betas (Array<String, Symbol, Anthropic::Models::AnthropicBeta>)

    Header param: Optional header to specify the beta version(s) you want to use.

  • request_options (Anthropic::RequestOptions, Hash{Symbol=>Object}, nil)

Returns:

See Also:



41
42
43
44
45
46
47
48
49
50
51
52
# File 'lib/anthropic/resources/beta/organization/workspaces.rb', line 41

def create(params)
  parsed, options = Anthropic::Beta::Organization::WorkspaceCreateParams.dump_request(params)
  header_params = {betas: "anthropic-beta"}
  @client.request(
    method: :post,
    path: "v1/organizations/workspaces?beta=true",
    headers: parsed.slice(*header_params.keys).transform_keys(header_params),
    body: parsed.except(*header_params.keys),
    model: Anthropic::Beta::Organization::BetaWorkspace,
    options: options
  )
end

#list(after_id: nil, before_id: nil, include_archived: nil, limit: nil, request_options: {}) ⇒ Anthropic::Internal::Page<Anthropic::Models::Beta::Organization::BetaWorkspace>

List Workspaces

Some parameter documentations has been truncated, see Models::Beta::Organization::WorkspaceListParams for more details.

Parameters:

  • after_id (String)

    ID of the object to use as a cursor for pagination. When provided, returns the p

  • before_id (String)

    ID of the object to use as a cursor for pagination. When provided, returns the p

  • include_archived (Boolean)

    Whether to include Workspaces that have been archived in the response

  • limit (Integer)

    Number of items to return per page.

  • request_options (Anthropic::RequestOptions, Hash{Symbol=>Object}, nil)

Returns:

See Also:



129
130
131
132
133
134
135
136
137
138
139
140
# File 'lib/anthropic/resources/beta/organization/workspaces.rb', line 129

def list(params = {})
  parsed, options = Anthropic::Beta::Organization::WorkspaceListParams.dump_request(params)
  query = Anthropic::Internal::Util.encode_query_params(parsed)
  @client.request(
    method: :get,
    path: "v1/organizations/workspaces?beta=true",
    query: query,
    page: Anthropic::Internal::Page,
    model: Anthropic::Beta::Organization::BetaWorkspace,
    options: options
  )
end

#retrieve(workspace_id, request_options: {}) ⇒ Anthropic::Models::Beta::Organization::BetaWorkspace

Get Workspace

Parameters:

Returns:

See Also:



65
66
67
68
69
70
71
72
# File 'lib/anthropic/resources/beta/organization/workspaces.rb', line 65

def retrieve(workspace_id, params = {})
  @client.request(
    method: :get,
    path: ["v1/organizations/workspaces/%1$s?beta=true", workspace_id],
    model: Anthropic::Beta::Organization::BetaWorkspace,
    options: params[:request_options]
  )
end

#update(workspace_id, data_residency: nil, display_color: nil, external_key_id: nil, name: nil, tags: nil, request_options: {}) ⇒ Anthropic::Models::Beta::Organization::BetaWorkspace

Update Workspace

Some parameter documentations has been truncated, see Models::Beta::Organization::WorkspaceUpdateParams for more details.

Parameters:

  • workspace_id (String)
  • data_residency (Anthropic::Models::Beta::Organization::BetaDataResidencyUpdateConfig, nil)

    Data residency configuration for the workspace.

  • display_color (String)

    Hex color code representing the Workspace in the Anthropic Console.

  • external_key_id (String)

    ID of the customer-managed encryption key (CMEK) configuration to use for this

  • name (String)

    Name of the Workspace.

  • tags (Hash{Symbol=>String, nil}, nil)

    User-defined tags as string key-value pairs. Keys may not begin with anthropic

  • request_options (Anthropic::RequestOptions, Hash{Symbol=>Object}, nil)

Returns:

See Also:



98
99
100
101
102
103
104
105
106
107
# File 'lib/anthropic/resources/beta/organization/workspaces.rb', line 98

def update(workspace_id, params = {})
  parsed, options = Anthropic::Beta::Organization::WorkspaceUpdateParams.dump_request(params)
  @client.request(
    method: :post,
    path: ["v1/organizations/workspaces/%1$s?beta=true", workspace_id],
    body: parsed,
    model: Anthropic::Beta::Organization::BetaWorkspace,
    options: options
  )
end