Class: OCI::GenerativeAiAgent::Models::HttpEndpointApiKeyAuthScopeConfig
- Inherits:
-
HttpEndpointAuthScopeConfig
- Object
- HttpEndpointAuthScopeConfig
- OCI::GenerativeAiAgent::Models::HttpEndpointApiKeyAuthScopeConfig
- Defined in:
- lib/oci/generative_ai_agent/models/http_endpoint_api_key_auth_scope_config.rb
Overview
Specifies authentication using an API key injected either as a header or query parameter.
-
If
authScope = AGENT: The API key is retrieved from OCI Vault using the agentu2019s identity.
Constant Summary collapse
- KEY_LOCATION_ENUM =
[ KEY_LOCATION_HEADER = 'HEADER'.freeze, KEY_LOCATION_QUERY_PARAMETER = 'QUERY_PARAMETER'.freeze, KEY_LOCATION_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze ].freeze
Constants inherited from HttpEndpointAuthScopeConfig
Instance Attribute Summary collapse
-
#key_location ⇒ String
[Required] The location of the API key in the request.
-
#key_name ⇒ String
[Required] The name of the key parameter in the location.
-
#vault_secret_id ⇒ String
The OCID of the vault secret with API key.
Attributes inherited from HttpEndpointAuthScopeConfig
#http_endpoint_auth_scope_config_type
Class Method Summary collapse
-
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
-
.swagger_types ⇒ Object
Attribute type mapping.
Instance Method Summary collapse
-
#==(other) ⇒ Object
Checks equality by comparing each attribute.
-
#build_from_hash(attributes) ⇒ Object
Builds the object from hash.
- #eql?(other) ⇒ Boolean
-
#hash ⇒ Fixnum
Calculates hash code according to all attributes.
-
#initialize(attributes = {}) ⇒ HttpEndpointApiKeyAuthScopeConfig
constructor
Initializes the object.
-
#to_hash ⇒ Hash
Returns the object in the form of hash.
-
#to_s ⇒ String
Returns the string representation of the object.
Methods inherited from HttpEndpointAuthScopeConfig
Constructor Details
#initialize(attributes = {}) ⇒ HttpEndpointApiKeyAuthScopeConfig
Initializes the object
69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 |
# File 'lib/oci/generative_ai_agent/models/http_endpoint_api_key_auth_scope_config.rb', line 69 def initialize(attributes = {}) return unless attributes.is_a?(Hash) attributes['httpEndpointAuthScopeConfigType'] = 'HTTP_ENDPOINT_API_KEY_AUTH_SCOPE_CONFIG' super(attributes) # convert string to symbol for hash key attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } self.vault_secret_id = attributes[:'vaultSecretId'] if attributes[:'vaultSecretId'] raise 'You cannot provide both :vaultSecretId and :vault_secret_id' if attributes.key?(:'vaultSecretId') && attributes.key?(:'vault_secret_id') self.vault_secret_id = attributes[:'vault_secret_id'] if attributes[:'vault_secret_id'] self.key_location = attributes[:'keyLocation'] if attributes[:'keyLocation'] raise 'You cannot provide both :keyLocation and :key_location' if attributes.key?(:'keyLocation') && attributes.key?(:'key_location') self.key_location = attributes[:'key_location'] if attributes[:'key_location'] self.key_name = attributes[:'keyName'] if attributes[:'keyName'] raise 'You cannot provide both :keyName and :key_name' if attributes.key?(:'keyName') && attributes.key?(:'key_name') self.key_name = attributes[:'key_name'] if attributes[:'key_name'] end |
Instance Attribute Details
#key_location ⇒ String
[Required] The location of the API key in the request.
30 31 32 |
# File 'lib/oci/generative_ai_agent/models/http_endpoint_api_key_auth_scope_config.rb', line 30 def key_location @key_location end |
#key_name ⇒ String
[Required] The name of the key parameter in the location.
34 35 36 |
# File 'lib/oci/generative_ai_agent/models/http_endpoint_api_key_auth_scope_config.rb', line 34 def key_name @key_name end |
#vault_secret_id ⇒ String
The OCID of the vault secret with API key. Required when authScope is AGENT.
26 27 28 |
# File 'lib/oci/generative_ai_agent/models/http_endpoint_api_key_auth_scope_config.rb', line 26 def vault_secret_id @vault_secret_id end |
Class Method Details
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
37 38 39 40 41 42 43 44 45 46 |
# File 'lib/oci/generative_ai_agent/models/http_endpoint_api_key_auth_scope_config.rb', line 37 def self.attribute_map { # rubocop:disable Style/SymbolLiteral 'http_endpoint_auth_scope_config_type': :'httpEndpointAuthScopeConfigType', 'vault_secret_id': :'vaultSecretId', 'key_location': :'keyLocation', 'key_name': :'keyName' # rubocop:enable Style/SymbolLiteral } end |
.swagger_types ⇒ Object
Attribute type mapping.
49 50 51 52 53 54 55 56 57 58 |
# File 'lib/oci/generative_ai_agent/models/http_endpoint_api_key_auth_scope_config.rb', line 49 def self.swagger_types { # rubocop:disable Style/SymbolLiteral 'http_endpoint_auth_scope_config_type': :'String', 'vault_secret_id': :'String', 'key_location': :'String', 'key_name': :'String' # rubocop:enable Style/SymbolLiteral } end |
Instance Method Details
#==(other) ⇒ Object
Checks equality by comparing each attribute.
118 119 120 121 122 123 124 125 126 |
# File 'lib/oci/generative_ai_agent/models/http_endpoint_api_key_auth_scope_config.rb', line 118 def ==(other) return true if equal?(other) self.class == other.class && http_endpoint_auth_scope_config_type == other.http_endpoint_auth_scope_config_type && vault_secret_id == other.vault_secret_id && key_location == other.key_location && key_name == other.key_name end |
#build_from_hash(attributes) ⇒ Object
Builds the object from hash
151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 |
# File 'lib/oci/generative_ai_agent/models/http_endpoint_api_key_auth_scope_config.rb', line 151 def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) self.class.swagger_types.each_pair do |key, type| if type =~ /^Array<(.*)>/i # check to ensure the input is an array given that the the attribute # is documented as an array but the input is not if attributes[self.class.attribute_map[key]].is_a?(Array) public_method("#{key}=").call( attributes[self.class.attribute_map[key]] .map { |v| OCI::Internal::Util.convert_to_type(Regexp.last_match(1), v) } ) end elsif !attributes[self.class.attribute_map[key]].nil? public_method("#{key}=").call( OCI::Internal::Util.convert_to_type(type, attributes[self.class.attribute_map[key]]) ) end # or else data not found in attributes(hash), not an issue as the data can be optional end self end |
#eql?(other) ⇒ Boolean
131 132 133 |
# File 'lib/oci/generative_ai_agent/models/http_endpoint_api_key_auth_scope_config.rb', line 131 def eql?(other) self == other end |
#hash ⇒ Fixnum
Calculates hash code according to all attributes.
140 141 142 |
# File 'lib/oci/generative_ai_agent/models/http_endpoint_api_key_auth_scope_config.rb', line 140 def hash [http_endpoint_auth_scope_config_type, vault_secret_id, key_location, key_name].hash end |
#to_hash ⇒ Hash
Returns the object in the form of hash
184 185 186 187 188 189 190 191 192 193 |
# File 'lib/oci/generative_ai_agent/models/http_endpoint_api_key_auth_scope_config.rb', line 184 def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = public_method(attr).call next if value.nil? && !instance_variable_defined?("@#{attr}") hash[param] = _to_hash(value) end hash end |
#to_s ⇒ String
Returns the string representation of the object
178 179 180 |
# File 'lib/oci/generative_ai_agent/models/http_endpoint_api_key_auth_scope_config.rb', line 178 def to_s to_hash.to_s end |