Class: A2A::OAuthFlow::AuthorizationCode
- Inherits:
-
Object
- Object
- A2A::OAuthFlow::AuthorizationCode
- Defined in:
- lib/a2a/oauth_flow/authorization_code.rb
Instance Attribute Summary collapse
-
#authorization_url ⇒ Object
readonly
Returns the value of attribute authorization_url.
-
#pkce_required ⇒ Object
readonly
Returns the value of attribute pkce_required.
-
#refresh_url ⇒ Object
readonly
Returns the value of attribute refresh_url.
-
#scopes ⇒ Object
readonly
Returns the value of attribute scopes.
-
#token_url ⇒ Object
readonly
Returns the value of attribute token_url.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(authorization_url:, token_url:, scopes:, refresh_url: nil, pkce_required: nil) ⇒ AuthorizationCode
constructor
A new instance of AuthorizationCode.
- #to_h ⇒ Object
Constructor Details
#initialize(authorization_url:, token_url:, scopes:, refresh_url: nil, pkce_required: nil) ⇒ AuthorizationCode
Returns a new instance of AuthorizationCode.
8 9 10 11 12 13 14 |
# File 'lib/a2a/oauth_flow/authorization_code.rb', line 8 def initialize(authorization_url:, token_url:, scopes:, refresh_url: nil, pkce_required: nil) @authorization_url = @token_url = token_url @scopes = scopes @refresh_url = refresh_url @pkce_required = pkce_required end |
Instance Attribute Details
#authorization_url ⇒ Object (readonly)
Returns the value of attribute authorization_url.
6 7 8 |
# File 'lib/a2a/oauth_flow/authorization_code.rb', line 6 def @authorization_url end |
#pkce_required ⇒ Object (readonly)
Returns the value of attribute pkce_required.
6 7 8 |
# File 'lib/a2a/oauth_flow/authorization_code.rb', line 6 def pkce_required @pkce_required end |
#refresh_url ⇒ Object (readonly)
Returns the value of attribute refresh_url.
6 7 8 |
# File 'lib/a2a/oauth_flow/authorization_code.rb', line 6 def refresh_url @refresh_url end |
#scopes ⇒ Object (readonly)
Returns the value of attribute scopes.
6 7 8 |
# File 'lib/a2a/oauth_flow/authorization_code.rb', line 6 def scopes @scopes end |
#token_url ⇒ Object (readonly)
Returns the value of attribute token_url.
6 7 8 |
# File 'lib/a2a/oauth_flow/authorization_code.rb', line 6 def token_url @token_url end |
Class Method Details
.from_h(hash) ⇒ Object
16 17 18 19 20 21 22 23 24 |
# File 'lib/a2a/oauth_flow/authorization_code.rb', line 16 def self.from_h(hash) new( authorization_url: hash.fetch("authorizationUrl"), scopes: hash.fetch("scopes"), token_url: hash.fetch("tokenUrl"), refresh_url: hash["refreshUrl"], pkce_required: hash["pkceRequired"] ) end |
Instance Method Details
#to_h ⇒ Object
26 27 28 29 30 31 32 33 34 |
# File 'lib/a2a/oauth_flow/authorization_code.rb', line 26 def to_h { "authorizationUrl" => , "tokenUrl" => token_url, "scopes" => scopes, "refreshUrl" => refresh_url, "pkceRequired" => pkce_required }.compact end |