Class: Anthropic::Resources::Beta::Organization::ExternalKeys
- Inherits:
-
Object
- Object
- Anthropic::Resources::Beta::Organization::ExternalKeys
- Defined in:
- lib/anthropic/resources/beta/organization/external_keys.rb,
sig/anthropic/resources/beta/organization/external_keys.rbs
Instance Method Summary collapse
-
#create(provider_config:, display_name: nil, geo: nil, request_options: {}) ⇒ Anthropic::Models::Beta::Organization::BetaExternalKey
Create an external key config owned by the caller's organization.
-
#delete(external_key_id, request_options: {}) ⇒ Anthropic::Models::Beta::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::Beta::Organization::BetaExternalKey>
List external key configs in the caller's organization.
-
#retrieve(external_key_id, request_options: {}) ⇒ Anthropic::Models::Beta::Organization::BetaExternalKey
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::Beta::Organization::BetaExternalKey
Partially update an external key config.
-
#validate(external_key_id, request_options: {}) ⇒ Anthropic::Models::Beta::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.
165 166 167 |
# File 'lib/anthropic/resources/beta/organization/external_keys.rb', line 165 def initialize(client:) @client = client end |
Instance Method Details
#create(provider_config:, display_name: nil, geo: nil, request_options: {}) ⇒ Anthropic::Models::Beta::Organization::BetaExternalKey
Create an external key config owned by the caller's organization.
23 24 25 26 27 28 29 30 31 32 |
# File 'lib/anthropic/resources/beta/organization/external_keys.rb', line 23 def create(params) parsed, = Anthropic::Beta::Organization::ExternalKeyCreateParams.dump_request(params) @client.request( method: :post, path: "v1/organizations/external_keys?beta=true", body: parsed, model: Anthropic::Beta::Organization::BetaExternalKey, options: ) end |
#delete(external_key_id, request_options: {}) ⇒ Anthropic::Models::Beta::Organization::ExternalKeyDeleteResponse
Delete an external key config.
The request is rejected if any workspace still references this config.
128 129 130 131 132 133 134 135 |
# File 'lib/anthropic/resources/beta/organization/external_keys.rb', line 128 def delete(external_key_id, params = {}) @client.request( method: :delete, path: ["v1/organizations/external_keys/%1$s?beta=true", external_key_id], model: Anthropic::Models::Beta::Organization::ExternalKeyDeleteResponse, options: params[:request_options] ) end |
#list(limit: nil, page: nil, request_options: {}) ⇒ Anthropic::Internal::PageCursor<Anthropic::Models::Beta::Organization::BetaExternalKey>
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.
102 103 104 105 106 107 108 109 110 111 112 113 |
# File 'lib/anthropic/resources/beta/organization/external_keys.rb', line 102 def list(params = {}) parsed, = Anthropic::Beta::Organization::ExternalKeyListParams.dump_request(params) query = Anthropic::Internal::Util.encode_query_params(parsed) @client.request( method: :get, path: "v1/organizations/external_keys?beta=true", query: query, page: Anthropic::Internal::PageCursor, model: Anthropic::Beta::Organization::BetaExternalKey, options: ) end |
#retrieve(external_key_id, request_options: {}) ⇒ Anthropic::Models::Beta::Organization::BetaExternalKey
Retrieve a single external key config in the caller's organization by ID.
45 46 47 48 49 50 51 52 |
# File 'lib/anthropic/resources/beta/organization/external_keys.rb', line 45 def retrieve(external_key_id, params = {}) @client.request( method: :get, path: ["v1/organizations/external_keys/%1$s?beta=true", external_key_id], model: Anthropic::Beta::Organization::BetaExternalKey, options: params[:request_options] ) end |
#update(external_key_id, display_name: nil, geo: nil, provider_config: nil, request_options: {}) ⇒ Anthropic::Models::Beta::Organization::BetaExternalKey
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, because previously encrypted data
requires the original key identity to decrypt.
75 76 77 78 79 80 81 82 83 84 |
# File 'lib/anthropic/resources/beta/organization/external_keys.rb', line 75 def update(external_key_id, params = {}) parsed, = Anthropic::Beta::Organization::ExternalKeyUpdateParams.dump_request(params) @client.request( method: :post, path: ["v1/organizations/external_keys/%1$s?beta=true", external_key_id], body: parsed, model: Anthropic::Beta::Organization::BetaExternalKey, options: ) end |
#validate(external_key_id, request_options: {}) ⇒ Anthropic::Models::Beta::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.
153 154 155 156 157 158 159 160 |
# File 'lib/anthropic/resources/beta/organization/external_keys.rb', line 153 def validate(external_key_id, params = {}) @client.request( method: :post, path: ["v1/organizations/external_keys/%1$s/validate?beta=true", external_key_id], model: Anthropic::Models::Beta::Organization::ExternalKeyValidateResponse, options: params[:request_options] ) end |