Class: Anthropic::Resources::Beta::Organization::Workspaces
- Inherits:
-
Object
- Object
- Anthropic::Resources::Beta::Organization::Workspaces
- 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
- #members ⇒ Anthropic::Resources::Beta::Organization::Workspaces::Members readonly
- #rate_limits ⇒ Anthropic::Resources::Beta::Organization::Workspaces::RateLimits readonly
- #service_accounts ⇒ Anthropic::Resources::Beta::Organization::Workspaces::ServiceAccounts readonly
Instance Method Summary collapse
-
#archive(workspace_id, betas: nil, request_options: {}) ⇒ Anthropic::Models::Beta::Organization::BetaWorkspace
Archive Workspace.
-
#create(name:, data_residency: nil, display_color: nil, external_key_id: nil, inference_data_privacy: nil, tags: nil, user_profile_id: nil, betas: nil, request_options: {}) ⇒ Anthropic::Models::Beta::Organization::BetaWorkspace
Create Workspace.
-
#initialize(client:) ⇒ Workspaces
constructor
private
A new instance of Workspaces.
-
#list(after_id: nil, before_id: nil, ids: nil, include_archived: nil, include_default: nil, limit: nil, betas: nil, request_options: {}) ⇒ Anthropic::Internal::Page<Anthropic::Models::Beta::Organization::BetaWorkspace>
List Workspaces.
-
#retrieve(workspace_id, betas: nil, request_options: {}) ⇒ Anthropic::Models::Beta::Organization::BetaWorkspace
Get Workspace.
-
#update(workspace_id, data_residency: nil, display_color: nil, external_key_id: nil, inference_data_privacy: nil, name: nil, tags: nil, user_profile_id: nil, betas: nil, request_options: {}) ⇒ Anthropic::Models::Beta::Organization::BetaWorkspace
Update Workspace.
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.
270 271 272 273 274 275 276 |
# File 'lib/anthropic/resources/beta/organization/workspaces.rb', line 270 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
#members ⇒ Anthropic::Resources::Beta::Organization::Workspaces::Members (readonly)
12 13 14 |
# File 'lib/anthropic/resources/beta/organization/workspaces.rb', line 12 def members @members end |
#rate_limits ⇒ Anthropic::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_accounts ⇒ Anthropic::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, betas: nil, request_options: {}) ⇒ Anthropic::Models::Beta::Organization::BetaWorkspace
Archive Workspace
Some parameter documentations has been truncated, see Models::Beta::Organization::WorkspaceArchiveParams for more details.
252 253 254 255 256 257 258 259 260 261 262 263 264 265 |
# File 'lib/anthropic/resources/beta/organization/workspaces.rb', line 252 def archive(workspace_id, params = {}) parsed, = Anthropic::Beta::Organization::WorkspaceArchiveParams.dump_request(params) @client.request( qualifiers: {beta: "true"}, span_name: Anthropic::Internal::Tracing::SpanName::ORGANIZATION_WORKSPACES_ARCHIVE, span_attributes: {"anthropic.organization.workspace.id" => workspace_id}, span_route: "/v1/organizations/workspaces/{workspace_id}/archive", method: :post, path: ["v1/organizations/workspaces/%1$s/archive", workspace_id], headers: parsed.transform_keys(betas: "anthropic-beta"), model: Anthropic::Beta::Organization::BetaWorkspace, options: ) end |
#create(name:, data_residency: nil, display_color: nil, external_key_id: nil, inference_data_privacy: nil, tags: nil, user_profile_id: 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.
66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 |
# File 'lib/anthropic/resources/beta/organization/workspaces.rb', line 66 def create(params) parsed, = Anthropic::Beta::Organization::WorkspaceCreateParams.dump_request(params) header_params = {betas: "anthropic-beta"} @client.request( qualifiers: {beta: "true"}, span_name: Anthropic::Internal::Tracing::SpanName::ORGANIZATION_WORKSPACES_CREATE, span_created_id: "anthropic.organization.workspace.id", span_route: "/v1/organizations/workspaces", method: :post, path: "v1/organizations/workspaces", headers: parsed.slice(*header_params.keys).transform_keys(header_params), body: parsed.except(*header_params.keys), model: Anthropic::Beta::Organization::BetaWorkspace, options: ) end |
#list(after_id: nil, before_id: nil, ids: nil, include_archived: nil, include_default: nil, limit: nil, betas: 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.
213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 |
# File 'lib/anthropic/resources/beta/organization/workspaces.rb', line 213 def list(params = {}) query_params = [:after_id, :before_id, :ids, :include_archived, :include_default, :limit] parsed, = Anthropic::Beta::Organization::WorkspaceListParams.dump_request(params) query = Anthropic::Internal::Util.encode_query_params(parsed.slice(*query_params)) @client.request( qualifiers: {beta: "true"}, span_name: Anthropic::Internal::Tracing::SpanName::ORGANIZATION_WORKSPACES_LIST, span_route: "/v1/organizations/workspaces", span_query: %w[after_id before_id ids include_archived include_default limit], method: :get, path: "v1/organizations/workspaces", query: query, headers: parsed.except(*query_params).transform_keys(betas: "anthropic-beta"), page: Anthropic::Internal::Page, model: Anthropic::Beta::Organization::BetaWorkspace, options: ) end |
#retrieve(workspace_id, betas: nil, request_options: {}) ⇒ Anthropic::Models::Beta::Organization::BetaWorkspace
Get Workspace
Some parameter documentations has been truncated, see Models::Beta::Organization::WorkspaceRetrieveParams for more details.
100 101 102 103 104 105 106 107 108 109 110 111 112 113 |
# File 'lib/anthropic/resources/beta/organization/workspaces.rb', line 100 def retrieve(workspace_id, params = {}) parsed, = Anthropic::Beta::Organization::WorkspaceRetrieveParams.dump_request(params) @client.request( qualifiers: {beta: "true"}, span_name: Anthropic::Internal::Tracing::SpanName::ORGANIZATION_WORKSPACES_RETRIEVE, span_attributes: {"anthropic.organization.workspace.id" => workspace_id}, span_route: "/v1/organizations/workspaces/{workspace_id}", method: :get, path: ["v1/organizations/workspaces/%1$s", workspace_id], headers: parsed.transform_keys(betas: "anthropic-beta"), model: Anthropic::Beta::Organization::BetaWorkspace, options: ) end |
#update(workspace_id, data_residency: nil, display_color: nil, external_key_id: nil, inference_data_privacy: nil, name: nil, tags: nil, user_profile_id: nil, betas: nil, request_options: {}) ⇒ Anthropic::Models::Beta::Organization::BetaWorkspace
Update Workspace
Some parameter documentations has been truncated, see Models::Beta::Organization::WorkspaceUpdateParams for more details.
170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 |
# File 'lib/anthropic/resources/beta/organization/workspaces.rb', line 170 def update(workspace_id, params = {}) parsed, = Anthropic::Beta::Organization::WorkspaceUpdateParams.dump_request(params) header_params = {betas: "anthropic-beta"} @client.request( qualifiers: {beta: "true"}, span_name: Anthropic::Internal::Tracing::SpanName::ORGANIZATION_WORKSPACES_UPDATE, span_attributes: {"anthropic.organization.workspace.id" => workspace_id}, span_route: "/v1/organizations/workspaces/{workspace_id}", method: :post, path: ["v1/organizations/workspaces/%1$s", workspace_id], headers: parsed.slice(*header_params.keys).transform_keys(header_params), body: parsed.except(*header_params.keys), model: Anthropic::Beta::Organization::BetaWorkspace, options: ) end |