Class: Anthropic::Models::Beta::Organization::BetaAPIKey

Inherits:
Internal::Type::BaseModel show all
Defined in:
lib/anthropic/models/beta/organization/beta_api_key.rb,
sig/anthropic/models/beta/organization/beta_api_key.rbs

Overview

See Also:

  • Anthropic::Resources::Beta::Organization::APIKeys#retrieve

Defined Under Namespace

Modules: Principal, Scope, Status

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Internal::Type::BaseModel

==, #==, #[], coerce, #deconstruct_keys, #deep_to_h, dump, fields, hash, #hash, inherited, inspect, #inspect, known_fields, optional, recursively_to_h, required, #to_h, #to_json, #to_s, to_sorbet_type, #to_yaml

Methods included from Internal::Type::Converter

#coerce, coerce, #dump, dump, #inspect, inspect, meta_info, new_coerce_state, type_info

Methods included from Internal::Util::SorbetRuntimeSupport

#const_missing, #define_sorbet_constant!, #sorbet_constant_defined?, #to_sorbet_type, to_sorbet_type

Constructor Details

#initialize(id:, created_at:, created_by:, expires_at:, name:, partial_key_hint:, principal:, scope:, status:, workspace_id:, type: :api_key) ⇒ Object

Some parameter documentations has been truncated, see Anthropic::Models::Beta::Organization::BetaAPIKey for more details.

Parameters:



# File 'lib/anthropic/models/beta/organization/beta_api_key.rb', line 90

Instance Attribute Details

#created_atTime

RFC 3339 datetime string indicating when the API Key was created.

Parameters:

  • value (Time)

Returns:

  • (Time)


19
# File 'lib/anthropic/models/beta/organization/beta_api_key.rb', line 19

required :created_at, Time

#created_byAnthropic::Models::Beta::Organization::BetaAPIKeyCreatedBy?

The ID and type of the actor that created the API key, or null when the creator is not recorded (legacy, workload-identity-federated, or system-created keys).

Parameters:

  • value (Anthropic::Beta::Organization::BetaAPIKeyCreatedBy, nil)

Returns:



27
# File 'lib/anthropic/models/beta/organization/beta_api_key.rb', line 27

required :created_by, -> { Anthropic::Beta::Organization::BetaAPIKeyCreatedBy }, nil?: true

#expires_atTime?

RFC 3339 datetime string indicating when the API Key expires, or null if it never expires.

Parameters:

  • value (Time, nil)

Returns:

  • (Time, nil)


34
# File 'lib/anthropic/models/beta/organization/beta_api_key.rb', line 34

required :expires_at, Time, nil?: true

#idString

ID of the API key.

Parameters:

  • value (String)

Returns:

  • (String)


13
# File 'lib/anthropic/models/beta/organization/beta_api_key.rb', line 13

required :id, String

#nameString

Name of the API key.

Parameters:

  • value (String)

Returns:

  • (String)


40
# File 'lib/anthropic/models/beta/organization/beta_api_key.rb', line 40

required :name, String

#partial_key_hintString?

Partially redacted hint for the API key.

Parameters:

  • value (String, nil)

Returns:

  • (String, nil)


46
# File 'lib/anthropic/models/beta/organization/beta_api_key.rb', line 46

required :partial_key_hint, String, nil?: true

#principalAnthropic::Models::Beta::Organization::BetaAPIKeyUserActor, ...

The principal the API key acts as (a User or a Service Account), or null if the API key is not bound to a principal.

Parameters:

  • value (Anthropic::Models::Beta::Organization::BetaAPIKey::principal, nil)

Returns:



53
# File 'lib/anthropic/models/beta/organization/beta_api_key.rb', line 53

required :principal, union: -> { Anthropic::Beta::Organization::BetaAPIKey::Principal }, nil?: true

#scopeAnthropic::Models::Beta::Organization::BetaAPIKeyOrganizationScope, Anthropic::Models::Beta::Organization::BetaAPIKeyWorkspaceScope

Where the API key belongs: its Workspace ({"type": "workspace", "workspace_id": "wrkspc_..."}, with the Workspace's real ID even when it is the organization's default Workspace), or the organization ({"type": "organization"}) for a principal-bound API key that has no Workspace.

Parameters:

  • value (Anthropic::Models::Beta::Organization::BetaAPIKey::scope)

Returns:



63
# File 'lib/anthropic/models/beta/organization/beta_api_key.rb', line 63

required :scope, union: -> { Anthropic::Beta::Organization::BetaAPIKey::Scope }

#statusSymbol, Anthropic::Models::Beta::Organization::BetaAPIKey::Status

Status of the API key.

Parameters:

  • value (Anthropic::Models::Beta::Organization::BetaAPIKey::status)

Returns:



69
# File 'lib/anthropic/models/beta/organization/beta_api_key.rb', line 69

required :status, enum: -> { Anthropic::Beta::Organization::BetaAPIKey::Status }

#typeSymbol, :api_key

Object type.

For API Keys, this is always "api_key".

Parameters:

  • value (:api_key)

Returns:

  • (Symbol, :api_key)


77
# File 'lib/anthropic/models/beta/organization/beta_api_key.rb', line 77

required :type, const: :api_key

#workspace_idString?

Deprecated.

Use scope instead. workspace_id is null both for an API key in the default

Workspace and for a principal-bound API key that has no Workspace.

Deprecated: use scope instead. ID of the Workspace associated with the API key, or null if the API key belongs to the default Workspace. Also null for a principal-bound API key that has no Workspace; scope tells the two apart.

Parameters:

  • value (String, nil)

Returns:

  • (String, nil)


88
# File 'lib/anthropic/models/beta/organization/beta_api_key.rb', line 88

required :workspace_id, String, nil?: true

Instance Method Details

#to_hash{

Returns:

  • ({)


57
# File 'sig/anthropic/models/beta/organization/beta_api_key.rbs', line 57

def to_hash: -> {