Class: Anthropic::Resources::Organization::ExternalKeys
- Inherits:
-
Object
- Object
- Anthropic::Resources::Organization::ExternalKeys
- Defined in:
- lib/anthropic/resources/organization/external_keys.rb,
sig/anthropic/resources/organization/external_keys.rbs
Instance Method Summary collapse
-
#create(provider_config:, display_name: nil, geo: nil, user_profile_id: nil, request_options: {}) ⇒ Anthropic::Models::Organization::ExternalKey
Create an external key config owned by the caller's organization.
-
#delete(external_key_id, request_options: {}) ⇒ Anthropic::Models::Organization::ExternalKeyDeleteResponse
Delete an external key config.
-
#initialize(client:) ⇒ ExternalKeys
constructor
private
A new instance of ExternalKeys.
-
#list(limit: nil, page: nil, request_options: {}) ⇒ Anthropic::Internal::PageCursor<Anthropic::Models::Organization::ExternalKey>
List external key configs in the caller's organization.
-
#retrieve(external_key_id, request_options: {}) ⇒ Anthropic::Models::Organization::ExternalKey
Retrieve a single external key config in the caller's organization by ID.
-
#update(external_key_id, display_name: nil, geo: nil, provider_config: nil, request_options: {}) ⇒ Anthropic::Models::Organization::ExternalKey
Partially update an external key config.
-
#validate(external_key_id, request_options: {}) ⇒ Anthropic::Models::Organization::ExternalKeyValidateResponse
Validate an external key config against the customer's KMS.
Constructor Details
#initialize(client:) ⇒ ExternalKeys
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 ExternalKeys.
198 199 200 |
# File 'lib/anthropic/resources/organization/external_keys.rb', line 198 def initialize(client:) @client = client end |
Instance Method Details
#create(provider_config:, display_name: nil, geo: nil, user_profile_id: nil, request_options: {}) ⇒ Anthropic::Models::Organization::ExternalKey
Create an external key config owned by the caller's organization.
Some parameter documentations has been truncated, see Models::Organization::ExternalKeyCreateParams for more details.
30 31 32 33 34 35 36 37 38 39 40 41 42 |
# File 'lib/anthropic/resources/organization/external_keys.rb', line 30 def create(params) parsed, = Anthropic::Organization::ExternalKeyCreateParams.dump_request(params) @client.request( span_name: Anthropic::Internal::Tracing::SpanName::ORGANIZATION_EXTERNAL_KEYS_CREATE, span_created_id: "anthropic.organization.external_key.id", span_route: "/v1/organizations/external_keys", method: :post, path: "v1/organizations/external_keys", body: parsed, model: Anthropic::Organization::ExternalKey, options: ) end |
#delete(external_key_id, request_options: {}) ⇒ Anthropic::Models::Organization::ExternalKeyDeleteResponse
Delete an external key config.
The request is rejected if any workspace still references this config.
153 154 155 156 157 158 159 160 161 162 163 |
# File 'lib/anthropic/resources/organization/external_keys.rb', line 153 def delete(external_key_id, params = {}) @client.request( span_name: Anthropic::Internal::Tracing::SpanName::ORGANIZATION_EXTERNAL_KEYS_DELETE, span_attributes: {"anthropic.organization.external_key.id" => external_key_id}, span_route: "/v1/organizations/external_keys/{external_key_id}", method: :delete, path: ["v1/organizations/external_keys/%1$s", external_key_id], model: Anthropic::Models::Organization::ExternalKeyDeleteResponse, options: params[:request_options] ) end |
#list(limit: nil, page: nil, request_options: {}) ⇒ Anthropic::Internal::PageCursor<Anthropic::Models::Organization::ExternalKey>
List external key configs in the caller's organization.
Results are ordered by creation time (newest first). Use the next_page cursor
from the response to fetch subsequent pages.
121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 |
# File 'lib/anthropic/resources/organization/external_keys.rb', line 121 def list(params = {}) parsed, = Anthropic::Organization::ExternalKeyListParams.dump_request(params) query = Anthropic::Internal::Util.encode_query_params(parsed) @client.request( span_name: Anthropic::Internal::Tracing::SpanName::ORGANIZATION_EXTERNAL_KEYS_LIST, span_route: "/v1/organizations/external_keys", span_query: %w[limit page], method: :get, path: "v1/organizations/external_keys", query: query, page: Anthropic::Internal::PageCursor, model: Anthropic::Organization::ExternalKey, options: ) end |
#retrieve(external_key_id, request_options: {}) ⇒ Anthropic::Models::Organization::ExternalKey
Retrieve a single external key config in the caller's organization by ID.
55 56 57 58 59 60 61 62 63 64 65 |
# File 'lib/anthropic/resources/organization/external_keys.rb', line 55 def retrieve(external_key_id, params = {}) @client.request( span_name: Anthropic::Internal::Tracing::SpanName::ORGANIZATION_EXTERNAL_KEYS_RETRIEVE, span_attributes: {"anthropic.organization.external_key.id" => external_key_id}, span_route: "/v1/organizations/external_keys/{external_key_id}", method: :get, path: ["v1/organizations/external_keys/%1$s", external_key_id], model: Anthropic::Organization::ExternalKey, options: params[:request_options] ) end |
#update(external_key_id, display_name: nil, geo: nil, provider_config: nil, request_options: {}) ⇒ Anthropic::Models::Organization::ExternalKey
Partially update an external key config. Omitted fields are left unchanged.
display_name is always editable. geo and provider_config cannot be changed
once any workspace references this config, and a Google Cloud key's provider and
key_name cannot be changed at all.
91 92 93 94 95 96 97 98 99 100 101 102 103 |
# File 'lib/anthropic/resources/organization/external_keys.rb', line 91 def update(external_key_id, params = {}) parsed, = Anthropic::Organization::ExternalKeyUpdateParams.dump_request(params) @client.request( span_name: Anthropic::Internal::Tracing::SpanName::ORGANIZATION_EXTERNAL_KEYS_UPDATE, span_attributes: {"anthropic.organization.external_key.id" => external_key_id}, span_route: "/v1/organizations/external_keys/{external_key_id}", method: :post, path: ["v1/organizations/external_keys/%1$s", external_key_id], body: parsed, model: Anthropic::Organization::ExternalKey, options: ) end |
#validate(external_key_id, request_options: {}) ⇒ Anthropic::Models::Organization::ExternalKeyValidateResponse
Validate an external key config against the customer's KMS.
Anthropic performs an encrypt/decrypt roundtrip against the configured KMS key
and waits up to 30 seconds for the result. The response status is success if
the roundtrip succeeded, or failure with an error message if it failed or
timed out.
183 184 185 186 187 188 189 190 191 192 193 |
# File 'lib/anthropic/resources/organization/external_keys.rb', line 183 def validate(external_key_id, params = {}) @client.request( span_name: Anthropic::Internal::Tracing::SpanName::ORGANIZATION_EXTERNAL_KEYS_VALIDATE, span_attributes: {"anthropic.organization.external_key.id" => external_key_id}, span_route: "/v1/organizations/external_keys/{external_key_id}/validate", method: :post, path: ["v1/organizations/external_keys/%1$s/validate", external_key_id], model: Anthropic::Models::Organization::ExternalKeyValidateResponse, options: params[:request_options] ) end |