Class: OpenAI::Models::Admin::Organization::Projects::ProjectAPIKey

Inherits:
Internal::Type::BaseModel show all
Defined in:
lib/openai/models/admin/organization/projects/project_api_key.rb,
sig/openai/models/admin/organization/projects/project_api_key.rbs

Overview

See Also:

  • OpenAI::Resources::Admin::Organization::Projects::APIKeys#retrieve

Defined Under Namespace

Modules: OwnerProjectAccess Classes: Owner

Instance Attribute Summary collapse

Attributes inherited from Internal::Type::BaseModel

#last_response

Instance Method Summary collapse

Methods inherited from Internal::Type::BaseModel

==, #==, #[], #_request_id, #_set_last_response, coerce, #deconstruct_keys, #deep_to_h, dump, #encode_with, 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, coerce_cached, coerce_with_error, #dump, dump, #inspect, inspect, meta_info, new_coerce_state, resolve_type, 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:, email:, name:, role:) ⇒ ProjectAPIKey

Returns a new instance of ProjectAPIKey.

Parameters:

  • id —

    The identifier, which can be referenced in API endpoints

  • created_at —

    The Unix timestamp (in seconds) of when the API key was created

  • last_used_at —

    The Unix timestamp (in seconds) of when the API key was last used.

  • name —

    The name of the API key

  • owner_project_access —

    Whether the API key's owner currently has effective access to the project.

  • redacted_value —

    The redacted value of the API key

  • expires_at —

    The Unix timestamp (in seconds) when the API key expires, or null if it does not expire.

  • object —

    The object type, which is always organization.project.api_key

  • id: (String)
  • created_at: (Integer)
  • last_used_at: (Integer, nil)
  • name: (String)
  • owner: (OpenAI::Admin::Organization::Projects::ProjectAPIKey::Owner)
  • owner_project_access: (OpenAI::Models::Admin::Organization::Projects::ProjectAPIKey::owner_project_access)
  • redacted_value: (String)
  • expires_at: (Integer, nil)
  • object: (:"organization.project.api_key")


# File 'lib/openai/models/admin/organization/projects/project_api_key.rb', line 67

Instance Attribute Details

#created_at ⇒ Integer

The Unix timestamp (in seconds) of when the API key was created

Returns:

  • (Integer)


20
# File 'lib/openai/models/admin/organization/projects/project_api_key.rb', line 20

required :created_at, Integer

#expires_at ⇒ Integer?

The Unix timestamp (in seconds) when the API key expires, or null if it does not expire.

Returns:

  • (Integer, nil)


65
# File 'lib/openai/models/admin/organization/projects/project_api_key.rb', line 65

optional :expires_at, Integer, nil?: true

#id ⇒ String

The identifier, which can be referenced in API endpoints

Returns:

  • (String)


14
# File 'lib/openai/models/admin/organization/projects/project_api_key.rb', line 14

required :id, String

#last_used_at ⇒ Integer?

The Unix timestamp (in seconds) of when the API key was last used.

Returns:

  • (Integer, nil)


26
# File 'lib/openai/models/admin/organization/projects/project_api_key.rb', line 26

required :last_used_at, Integer, nil?: true

#name ⇒ String

The name of the API key

Returns:

  • (String)


32
# File 'lib/openai/models/admin/organization/projects/project_api_key.rb', line 32

required :name, String

#object ⇒ :"organization.project.api_key"

The object type, which is always organization.project.api_key

Returns:

  • (:"organization.project.api_key")


38
# File 'lib/openai/models/admin/organization/projects/project_api_key.rb', line 38

required :object, const: :"organization.project.api_key"

#owner ⇒ OpenAI::Models::Admin::Organization::Projects::ProjectAPIKey::Owner

Parameters:

  • value (OpenAI::Admin::Organization::Projects::ProjectAPIKey::Owner)

Returns:



43
# File 'lib/openai/models/admin/organization/projects/project_api_key.rb', line 43

required :owner, -> { OpenAI::Admin::Organization::Projects::ProjectAPIKey::Owner }

#owner_project_access ⇒ OpenAI::Models::Admin::Organization::Projects::ProjectAPIKey::owner_project_access

Whether the API key's owner currently has effective access to the project.

Returns:

  • (OpenAI::Models::Admin::Organization::Projects::ProjectAPIKey::owner_project_access)


49
50
51
52
# File 'lib/openai/models/admin/organization/projects/project_api_key.rb', line 49

required(
  :owner_project_access,
  enum: -> { OpenAI::Admin::Organization::Projects::ProjectAPIKey::OwnerProjectAccess }
)

#redacted_value ⇒ String

The redacted value of the API key

Returns:

  • (String)


58
# File 'lib/openai/models/admin/organization/projects/project_api_key.rb', line 58

required :redacted_value, String

Instance Method Details

#to_hash ⇒ { id: String, created_at: Integer, last_used_at: Integer?, name: String, ?object: :"organization.project.api_key", owner: OpenAI::Admin::Organization::Projects::ProjectAPIKey::Owner, owner_project_access: OpenAI::Models::Admin::Organization::Projects::ProjectAPIKey::owner_project_access, redacted_value: String, ?expires_at: Integer? }

Returns:

  • ({ id: String, created_at: Integer, last_used_at: Integer?, name: String, ?object: :"organization.project.api_key", owner: OpenAI::Admin::Organization::Projects::ProjectAPIKey::Owner, owner_project_access: OpenAI::Models::Admin::Organization::Projects::ProjectAPIKey::owner_project_access, redacted_value: String, ?expires_at: Integer? })


78
79
80
81
82
83
84
85
86
87
88
# File 'sig/openai/models/admin/organization/projects/project_api_key.rbs', line 78

def to_hash: -> {
  id: String,
  created_at: Integer,
  last_used_at: Integer?,
  name: String,
  ?object: :"organization.project.api_key",
  owner: OpenAI::Admin::Organization::Projects::ProjectAPIKey::Owner,
  owner_project_access: OpenAI::Models::Admin::Organization::Projects::ProjectAPIKey::owner_project_access,
  redacted_value: String,
  ?expires_at: Integer?
}