Class: A2A::Types::OAuth2SecurityScheme

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

Overview

OAuth 2.0 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(flows:, scopes: nil) ⇒ OAuth2SecurityScheme

Initialize a new OAuth 2.0 security scheme

Parameters:

  • flows (Hash)

    OAuth 2.0 flows configuration

  • scopes (Hash, nil) (defaults to: nil)

    Available scopes



117
118
119
120
121
# File 'lib/a2a/types/security.rb', line 117

def initialize(flows:, scopes: nil)
  @flows = flows
  @scopes = scopes
  super(type: SECURITY_TYPE_OAUTH2)
end

Instance Attribute Details

#flowsObject (readonly)

Returns the value of attribute flows.



110
111
112
# File 'lib/a2a/types/security.rb', line 110

def flows
  @flows
end

#scopesObject (readonly)

Returns the value of attribute scopes.



110
111
112
# File 'lib/a2a/types/security.rb', line 110

def scopes
  @scopes
end

Instance Method Details

#validate!Object (private)



125
126
127
128
129
# File 'lib/a2a/types/security.rb', line 125

def validate!
  super
  validate_required(:flows)
  validate_type(:flows, Hash)
end