Class: OpenApi::SecuritySchema

Inherits:
Object
  • Object
show all
Includes:
EquatableAsContent
Defined in:
lib/open_api/security_schema.rb

Overview

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods included from EquatableAsContent

#==

Constructor Details

#initialize(type:, description: nil, name:, in:, scheme:, bearer_format: nil, flows:, open_id_connect_url:) ⇒ SecuritySchema

Returns a new instance of SecuritySchema.



8
9
10
11
12
13
14
15
16
17
# File 'lib/open_api/security_schema.rb', line 8

def initialize(type:, description: nil, name:, in:, scheme:, bearer_format: nil, flows:, open_id_connect_url:)
  self.type = type
  self.description = description
  self.name = name
  self.in = binding.local_variable_get(:in)
  self.scheme = scheme
  self.bearer_format = bearer_format
  self.flows = flows
  self.open_id_connect_url = open_id_connect_url
end

Instance Attribute Details

#bearer_formatObject

Returns the value of attribute bearer_format.



6
7
8
# File 'lib/open_api/security_schema.rb', line 6

def bearer_format
  @bearer_format
end

#descriptionObject

Returns the value of attribute description.



6
7
8
# File 'lib/open_api/security_schema.rb', line 6

def description
  @description
end

#flowsObject

Returns the value of attribute flows.



6
7
8
# File 'lib/open_api/security_schema.rb', line 6

def flows
  @flows
end

#inObject

Returns the value of attribute in.



6
7
8
# File 'lib/open_api/security_schema.rb', line 6

def in
  @in
end

#nameObject

Returns the value of attribute name.



6
7
8
# File 'lib/open_api/security_schema.rb', line 6

def name
  @name
end

#open_id_connect_urlObject

Returns the value of attribute open_id_connect_url.



6
7
8
# File 'lib/open_api/security_schema.rb', line 6

def open_id_connect_url
  @open_id_connect_url
end

#schemeObject

Returns the value of attribute scheme.



6
7
8
# File 'lib/open_api/security_schema.rb', line 6

def scheme
  @scheme
end

#typeObject

Returns the value of attribute type.



6
7
8
# File 'lib/open_api/security_schema.rb', line 6

def type
  @type
end

Class Method Details

.load(hash) ⇒ Object



19
20
21
22
23
24
25
26
27
28
29
30
31
32
# File 'lib/open_api/security_schema.rb', line 19

def self.load(hash)
  return unless hash

  new(
    type: hash["type"].to_s,
    description: hash["description"]&.to_s,
    name: hash["name"].to_s,
    in: hash["in"].to_s,
    scheme: hash["scheme"].to_s,
    bearer_format: hash["bearerFormat"]&.to_s,
    flows: OAuthFlows.load(hash["flows"]),
    open_id_connect_url: hash["openIdConnectUrl"].to_s,
  )
end