Class: A2A::Types::ApiKeySecurityScheme

Inherits:
SecurityScheme show all
Defined in:
lib/a2a/types/security.rb

Overview

API Key security scheme

Instance Attribute Summary collapse

Attributes inherited from SecurityScheme

#type

Instance Method Summary collapse

Methods inherited from SecurityScheme

from_h

Methods inherited from BaseModel

#==, #camelize, from_h, from_json, #hash, #to_h, #to_json, underscore, #valid?, #validate_array_type, #validate_inclusion, #validate_required, #validate_type

Constructor Details

#initialize(name:, location:) ⇒ ApiKeySecurityScheme

Initialize a new API key security scheme

Parameters:

  • name (String)

    The name of the API key parameter

  • location (String)

    Where the API key is sent ("query", "header", "cookie")



65
66
67
68
69
# File 'lib/a2a/types/security.rb', line 65

def initialize(name:, location:)
  @name = name
  @location = location
  super(type: SECURITY_TYPE_API_KEY)
end

Instance Attribute Details

#locationObject (readonly)

Returns the value of attribute location.



58
59
60
# File 'lib/a2a/types/security.rb', line 58

def location
  @location
end

#nameObject (readonly)

Returns the value of attribute name.



58
59
60
# File 'lib/a2a/types/security.rb', line 58

def name
  @name
end

Instance Method Details

#validate!Object (private)



73
74
75
76
77
# File 'lib/a2a/types/security.rb', line 73

def validate!
  super
  validate_required(:name, :location)
  validate_inclusion(:location, %w[query header cookie])
end