Class: OpenAI::Models::Admin::Organization::Projects::APIKeyUpdateParams

Inherits:
Internal::Type::BaseModel show all
Extended by:
Internal::Type::RequestParameters::Converter
Includes:
Internal::Type::RequestParameters
Defined in:
lib/openai/models/admin/organization/projects/api_key_update_params.rb,
sig/openai/models/admin/organization/projects/api_key_update_params.rbs

Overview

See Also:

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

Instance Attribute Summary collapse

Attributes included from Internal::Type::RequestParameters

#request_options

Attributes inherited from Internal::Type::BaseModel

#last_response

Instance Method Summary collapse

Methods included from Internal::Type::RequestParameters::Converter

dump_request

Methods included from Internal::Type::RequestParameters

included

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(project_id:, api_key_id:, expires_in_seconds: nil, scopes: nil, request_options: {}) ⇒ APIKeyUpdateParams

Returns a new instance of APIKeyUpdateParams.

Parameters:

  • expires_in_seconds (defaults to: nil) —

    Number of seconds from this request until the API key expires. Must comply with the organization and project expiry policies. Expired keys cannot be updated. Retrying resets the expiry relative to the new request. Omit to keep the current expiration.

  • scopes (defaults to: nil) —

    Replace the API key scope restrictions. Omit to leave scopes unchanged. An empty array removes key restrictions (All permissions), subject to the owner's effective permissions. Use ["api.all.read"] for read-only access. Scopes do not change the owner's roles or grant administrative permissions.

  • project_id: (String)
  • api_key_id: (String)
  • expires_in_seconds: (Integer) (defaults to: nil)
  • scopes: (::Array[String]) (defaults to: nil)
  • request_options: (OpenAI::request_opts) (defaults to: {})


# File 'lib/openai/models/admin/organization/projects/api_key_update_params.rb', line 41

Instance Attribute Details

#api_key_id ⇒ String

Parameters:

  • value (String)

Returns:

  • (String)


21
# File 'lib/openai/models/admin/organization/projects/api_key_update_params.rb', line 21

required :api_key_id, String

#expires_in_seconds ⇒ Integer?

Number of seconds from this request until the API key expires. Must comply with the organization and project expiry policies. Expired keys cannot be updated. Retrying resets the expiry relative to the new request. Omit to keep the current expiration.

Returns:

  • (Integer, nil)


30
# File 'lib/openai/models/admin/organization/projects/api_key_update_params.rb', line 30

optional :expires_in_seconds, Integer

#project_id ⇒ String

Parameters:

  • value (String)

Returns:

  • (String)


16
# File 'lib/openai/models/admin/organization/projects/api_key_update_params.rb', line 16

required :project_id, String

#scopes ⇒ ::Array[String]?

Replace the API key scope restrictions. Omit to leave scopes unchanged. An empty array removes key restrictions (All permissions), subject to the owner's effective permissions. Use ["api.all.read"] for read-only access. Scopes do not change the owner's roles or grant administrative permissions.

Returns:

  • (::Array[String], nil)


39
# File 'lib/openai/models/admin/organization/projects/api_key_update_params.rb', line 39

optional :scopes, OpenAI::Internal::Type::ArrayOf[String]

Instance Method Details

#to_hash ⇒ { project_id: String, api_key_id: String, ?expires_in_seconds: Integer, ?scopes: ::Array[String], ?request_options: OpenAI::RequestOptions }

Returns:

  • ({ project_id: String, api_key_id: String, ?expires_in_seconds: Integer, ?scopes: ::Array[String], ?request_options: OpenAI::RequestOptions })


65
66
67
68
69
70
71
# File 'sig/openai/models/admin/organization/projects/api_key_update_params.rbs', line 65

def to_hash: -> {
  project_id: String,
  api_key_id: String,
  ?expires_in_seconds: Integer,
  ?scopes: ::Array[String],
  ?request_options: OpenAI::RequestOptions
}