Class: Anthropic::Resources::Beta::Organization::TelemetryDestinations::Workspaces
- Inherits:
-
Object
- Object
- Anthropic::Resources::Beta::Organization::TelemetryDestinations::Workspaces
- Defined in:
- lib/anthropic/resources/beta/organization/telemetry_destinations/workspaces.rb,
sig/anthropic/resources/beta/organization/telemetry_destinations/workspaces.rbs
Instance Method Summary collapse
-
#add(workspace_id, destination_id:, betas: nil, request_options: {}) ⇒ Anthropic::Models::Beta::Organization::TelemetryDestinations::BetaTelemetryDestinationWorkspace
Add one workspace to a destination's workspace list.
-
#initialize(client:) ⇒ Workspaces
constructor
private
A new instance of Workspaces.
-
#list(destination_id, limit: nil, page: nil, betas: nil, request_options: {}) ⇒ Anthropic::Internal::PageCursor<Anthropic::Models::Beta::Organization::TelemetryDestinations::BetaTelemetryDestinationWorkspace>
List the workspaces on a destination's workspace list, newest entry first.
-
#remove(workspace_id, destination_id:, betas: nil, request_options: {}) ⇒ Anthropic::Models::Beta::Organization::TelemetryDestinations::BetaDeletedTelemetryDestinationWorkspace
Remove one workspace from a destination's workspace list.
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.
176 177 178 |
# File 'lib/anthropic/resources/beta/organization/telemetry_destinations/workspaces.rb', line 176 def initialize(client:) @client = client end |
Instance Method Details
#add(workspace_id, destination_id:, betas: nil, request_options: {}) ⇒ Anthropic::Models::Beta::Organization::TelemetryDestinations::BetaTelemetryDestinationWorkspace
Add one workspace to a destination's workspace list.
Under include the workspace's spans start going to the destination. Under
exclude they stop. A list holds at most 1,000 workspaces.
Adding a workspace that is already on the list changes nothing and returns the
existing entry. An archived workspace that isn't on the list yet can't be added.
A destination whose workspaces.type is all doesn't have a list, so the API
returns 400. To change which workspaces such a destination covers, update its
workspaces.
See the OpenTelemetry export guide to learn more about choosing the workspaces of a destination.
Some parameter documentations has been truncated, see Models::Beta::Organization::TelemetryDestinations::WorkspaceAddParams for more details.
90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 |
# File 'lib/anthropic/resources/beta/organization/telemetry_destinations/workspaces.rb', line 90 def add(workspace_id, params) parsed, = Anthropic::Beta::Organization::TelemetryDestinations::WorkspaceAddParams.dump_request(params) destination_id = parsed.delete(:destination_id) do raise ArgumentError.new("missing required path argument #{_1}") end @client.request( qualifiers: {beta: "true"}, span_name: Anthropic::Internal::Tracing::SpanName::ORGANIZATION_TELEMETRY_DESTINATIONS_WORKSPACES_ADD, span_attributes: { "anthropic.organization.telemetry_destination.id" => destination_id, "anthropic.organization.telemetry_destination.workspace.id" => workspace_id }, span_route: "/v1/organizations/telemetry_destinations/{destination_id}/workspaces/{workspace_id}", method: :post, path: [ "v1/organizations/telemetry_destinations/%1$s/workspaces/%2$s", destination_id, workspace_id ], headers: parsed.transform_keys(betas: "anthropic-beta"), model: Anthropic::Beta::Organization::TelemetryDestinations::BetaTelemetryDestinationWorkspace, options: {extra_headers: {"anthropic-beta" => "telemetry-destinations-2026-08-11"}, **} ) end |
#list(destination_id, limit: nil, page: nil, betas: nil, request_options: {}) ⇒ Anthropic::Internal::PageCursor<Anthropic::Models::Beta::Organization::TelemetryDestinations::BetaTelemetryDestinationWorkspace>
List the workspaces on a destination's workspace list, newest entry first.
A destination whose workspaces.type is all doesn't have a list, so its page
is empty. The list includes archived workspaces.
See the OpenTelemetry export guide to learn more about choosing the workspaces of a destination.
Some parameter documentations has been truncated, see Models::Beta::Organization::TelemetryDestinations::WorkspaceListParams for more details.
37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 |
# File 'lib/anthropic/resources/beta/organization/telemetry_destinations/workspaces.rb', line 37 def list(destination_id, params = {}) query_params = [:limit, :page] parsed, = Anthropic::Beta::Organization::TelemetryDestinations::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_TELEMETRY_DESTINATIONS_WORKSPACES_LIST, span_attributes: {"anthropic.organization.telemetry_destination.id" => destination_id}, span_route: "/v1/organizations/telemetry_destinations/{destination_id}/workspaces", span_query: %w[limit page], method: :get, path: ["v1/organizations/telemetry_destinations/%1$s/workspaces", destination_id], query: query, headers: parsed.except(*query_params).transform_keys(betas: "anthropic-beta"), page: Anthropic::Internal::PageCursor, model: Anthropic::Beta::Organization::TelemetryDestinations::BetaTelemetryDestinationWorkspace, options: {extra_headers: {"anthropic-beta" => "telemetry-destinations-2026-08-11"}, **} ) end |
#remove(workspace_id, destination_id:, betas: nil, request_options: {}) ⇒ Anthropic::Models::Beta::Organization::TelemetryDestinations::BetaDeletedTelemetryDestinationWorkspace
Remove one workspace from a destination's workspace list.
Under include the workspace's spans stop going to the destination. Under
exclude they start. An archived workspace can be removed too.
The API returns 404 when the workspace isn't on the list. A destination whose
workspaces.type is all doesn't have a list, so the API returns 400.
See the OpenTelemetry export guide to learn more about choosing the workspaces of a destination.
Some parameter documentations has been truncated, see Models::Beta::Organization::TelemetryDestinations::WorkspaceRemoveParams for more details.
146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 |
# File 'lib/anthropic/resources/beta/organization/telemetry_destinations/workspaces.rb', line 146 def remove(workspace_id, params) parsed, = Anthropic::Beta::Organization::TelemetryDestinations::WorkspaceRemoveParams.dump_request(params) destination_id = parsed.delete(:destination_id) do raise ArgumentError.new("missing required path argument #{_1}") end @client.request( qualifiers: {beta: "true"}, span_name: Anthropic::Internal::Tracing::SpanName::ORGANIZATION_TELEMETRY_DESTINATIONS_WORKSPACES_REMOVE, span_attributes: { "anthropic.organization.telemetry_destination.id" => destination_id, "anthropic.organization.telemetry_destination.workspace.id" => workspace_id }, span_route: "/v1/organizations/telemetry_destinations/{destination_id}/workspaces/{workspace_id}", method: :delete, path: [ "v1/organizations/telemetry_destinations/%1$s/workspaces/%2$s", destination_id, workspace_id ], headers: parsed.transform_keys(betas: "anthropic-beta"), model: Anthropic::Beta::Organization::TelemetryDestinations::BetaDeletedTelemetryDestinationWorkspace, options: {extra_headers: {"anthropic-beta" => "telemetry-destinations-2026-08-11"}, **} ) end |