Class: Anthropic::Resources::Beta::Organization::APIKeys
- Inherits:
-
Object
- Object
- Anthropic::Resources::Beta::Organization::APIKeys
- Defined in:
- lib/anthropic/resources/beta/organization/api_keys.rb,
sig/anthropic/resources/beta/organization/api_keys.rbs
Instance Method Summary collapse
-
#initialize(client:) ⇒ APIKeys
constructor
private
A new instance of APIKeys.
-
#list(after_id: nil, before_id: nil, created_by_user_id: nil, limit: nil, status: nil, workspace_id: nil, request_options: {}) ⇒ Anthropic::Internal::Page<Anthropic::Models::Beta::Organization::BetaAPIKey>
List API Keys.
-
#retrieve(api_key_id, request_options: {}) ⇒ Anthropic::Models::Beta::Organization::BetaAPIKey
Get API Key.
-
#update(api_key_id, name: nil, status: nil, request_options: {}) ⇒ Anthropic::Models::Beta::Organization::BetaAPIKey
Update API Key.
Constructor Details
#initialize(client:) ⇒ APIKeys
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 APIKeys.
110 111 112 |
# File 'lib/anthropic/resources/beta/organization/api_keys.rb', line 110 def initialize(client:) @client = client end |
Instance Method Details
#list(after_id: nil, before_id: nil, created_by_user_id: nil, limit: nil, status: nil, workspace_id: nil, request_options: {}) ⇒ Anthropic::Internal::Page<Anthropic::Models::Beta::Organization::BetaAPIKey>
List API Keys
Some parameter documentations has been truncated, see Models::Beta::Organization::APIKeyListParams for more details.
90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 |
# File 'lib/anthropic/resources/beta/organization/api_keys.rb', line 90 def list(params = {}) parsed, = Anthropic::Beta::Organization::APIKeyListParams.dump_request(params) query = Anthropic::Internal::Util.encode_query_params(parsed) @client.request( qualifiers: {beta: "true"}, span_name: Anthropic::Internal::Tracing::SpanName::ORGANIZATION_API_KEYS_LIST, span_route: "/v1/organizations/api_keys", span_query: %w[after_id before_id created_by_user_id limit status workspace_id], method: :get, path: "v1/organizations/api_keys", query: query, page: Anthropic::Internal::Page, model: Anthropic::Beta::Organization::BetaAPIKey, options: ) end |
#retrieve(api_key_id, request_options: {}) ⇒ Anthropic::Models::Beta::Organization::BetaAPIKey
Get API Key
19 20 21 22 23 24 25 26 27 28 29 30 |
# File 'lib/anthropic/resources/beta/organization/api_keys.rb', line 19 def retrieve(api_key_id, params = {}) @client.request( qualifiers: {beta: "true"}, span_name: Anthropic::Internal::Tracing::SpanName::ORGANIZATION_API_KEYS_RETRIEVE, span_attributes: {"anthropic.organization.api_key.id" => api_key_id}, span_route: "/v1/organizations/api_keys/{api_key_id}", method: :get, path: ["v1/organizations/api_keys/%1$s", api_key_id], model: Anthropic::Beta::Organization::BetaAPIKey, options: params[:request_options] ) end |
#update(api_key_id, name: nil, status: nil, request_options: {}) ⇒ Anthropic::Models::Beta::Organization::BetaAPIKey
Update API Key
51 52 53 54 55 56 57 58 59 60 61 62 63 64 |
# File 'lib/anthropic/resources/beta/organization/api_keys.rb', line 51 def update(api_key_id, params = {}) parsed, = Anthropic::Beta::Organization::APIKeyUpdateParams.dump_request(params) @client.request( qualifiers: {beta: "true"}, span_name: Anthropic::Internal::Tracing::SpanName::ORGANIZATION_API_KEYS_UPDATE, span_attributes: {"anthropic.organization.api_key.id" => api_key_id}, span_route: "/v1/organizations/api_keys/{api_key_id}", method: :post, path: ["v1/organizations/api_keys/%1$s", api_key_id], body: parsed, model: Anthropic::Beta::Organization::BetaAPIKey, options: ) end |