Class: OpenApi::OAuthFlows

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

Overview

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods included from EquatableAsContent

#==

Constructor Details

#initialize(implicit: nil, password: nil, client_credentials: nil, authorization_code: nil) ⇒ OAuthFlows

Returns a new instance of OAuthFlows.



8
9
10
11
12
13
# File 'lib/open_api/o_auth_flows.rb', line 8

def initialize(implicit: nil, password: nil, client_credentials: nil, authorization_code: nil)
  self.implicit = implicit
  self.password = password
  self.client_credentials = client_credentials
  self.authorization_code = authorization_code
end

Instance Attribute Details

#authorization_codeObject

Returns the value of attribute authorization_code.



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

def authorization_code
  @authorization_code
end

#client_credentialsObject

Returns the value of attribute client_credentials.



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

def client_credentials
  @client_credentials
end

#implicitObject

Returns the value of attribute implicit.



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

def implicit
  @implicit
end

#passwordObject

Returns the value of attribute password.



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

def password
  @password
end

Class Method Details

.load(hash) ⇒ Object



15
16
17
18
19
20
21
22
23
24
# File 'lib/open_api/o_auth_flows.rb', line 15

def self.load(hash)
  return unless hash

  new(
    implicit: OAuthFlow.load(hash["implicit"]),
    password: OAuthFlow.load(hash["password"]),
    client_credentials: OAuthFlow.load(hash["clientCredentials"]),
    authorization_code: OAuthFlow.load(hash["authorizationCode"]),
  )
end