Class: IdnSdkRuby::Com::Nbos::Capi::Api::V0::TokenApiModel
- Inherits:
-
Modules::Identity::V0::BasicActiveModel
- Object
- Modules::Identity::V0::BasicActiveModel
- IdnSdkRuby::Com::Nbos::Capi::Api::V0::TokenApiModel
- Defined in:
- lib/idn_sdk_ruby/com/nbos/capi/api/v0/token_api_model.rb
Instance Attribute Summary collapse
-
#access_token ⇒ Object
Returns the value of attribute access_token.
-
#expires_in ⇒ Object
Returns the value of attribute expires_in.
-
#message ⇒ Object
Returns the value of attribute message.
-
#refresh_token ⇒ Object
Returns the value of attribute refresh_token.
-
#scope ⇒ Object
Returns the value of attribute scope.
-
#token_type ⇒ Object
Returns the value of attribute token_type.
Instance Method Summary collapse
- #add_errors(json_response) ⇒ Object
- #add_messages(json_response) ⇒ Object
- #as_json(options = {}) ⇒ Object
- #getAccess_token ⇒ Object
- #getExpires_in ⇒ Object
- #getRefresh_token ⇒ Object
- #getScope ⇒ Object
- #getToken_type ⇒ Object
-
#initialize(parsed_response = nil) ⇒ TokenApiModel
constructor
A new instance of TokenApiModel.
- #to_json(*options) ⇒ Object
- #to_s ⇒ Object
Constructor Details
#initialize(parsed_response = nil) ⇒ TokenApiModel
Returns a new instance of TokenApiModel.
6 7 8 9 10 11 12 13 14 |
# File 'lib/idn_sdk_ruby/com/nbos/capi/api/v0/token_api_model.rb', line 6 def initialize(parsed_response = nil) if !parsed_response.nil? @access_token = parsed_response["access_token"] @token_type = parsed_response["token_type"] @expires_in = parsed_response["expires_in"] @scope = parsed_response["scope"] @refresh_token = parsed_response["refresh_token"] end end |
Instance Attribute Details
#access_token ⇒ Object
Returns the value of attribute access_token.
4 5 6 |
# File 'lib/idn_sdk_ruby/com/nbos/capi/api/v0/token_api_model.rb', line 4 def access_token @access_token end |
#expires_in ⇒ Object
Returns the value of attribute expires_in.
4 5 6 |
# File 'lib/idn_sdk_ruby/com/nbos/capi/api/v0/token_api_model.rb', line 4 def expires_in @expires_in end |
#message ⇒ Object
Returns the value of attribute message.
4 5 6 |
# File 'lib/idn_sdk_ruby/com/nbos/capi/api/v0/token_api_model.rb', line 4 def @message end |
#refresh_token ⇒ Object
Returns the value of attribute refresh_token.
4 5 6 |
# File 'lib/idn_sdk_ruby/com/nbos/capi/api/v0/token_api_model.rb', line 4 def refresh_token @refresh_token end |
#scope ⇒ Object
Returns the value of attribute scope.
4 5 6 |
# File 'lib/idn_sdk_ruby/com/nbos/capi/api/v0/token_api_model.rb', line 4 def scope @scope end |
#token_type ⇒ Object
Returns the value of attribute token_type.
4 5 6 |
# File 'lib/idn_sdk_ruby/com/nbos/capi/api/v0/token_api_model.rb', line 4 def token_type @token_type end |
Instance Method Details
#add_errors(json_response) ⇒ Object
36 37 38 39 40 41 42 |
# File 'lib/idn_sdk_ruby/com/nbos/capi/api/v0/token_api_model.rb', line 36 def add_errors(json_response) json_response["errors"].each do |e| property_name = e['propertyName'] msg = e['message'] self.errors[property_name] << msg end end |
#add_messages(json_response) ⇒ Object
44 45 46 47 48 49 50 51 |
# File 'lib/idn_sdk_ruby/com/nbos/capi/api/v0/token_api_model.rb', line 44 def (json_response) if json_response["message"].present? @message = json_response["message"] elsif json_response["error"].present? @message = json_response["error"] end end |
#as_json(options = {}) ⇒ Object
53 54 55 56 57 58 59 60 61 |
# File 'lib/idn_sdk_ruby/com/nbos/capi/api/v0/token_api_model.rb', line 53 def as_json(={}) { scope: @scope, expires_in: @expires_in, token_type: @token_type, refresh_token: @refresh_token, access_token: @access_token, } end |
#getAccess_token ⇒ Object
32 33 34 |
# File 'lib/idn_sdk_ruby/com/nbos/capi/api/v0/token_api_model.rb', line 32 def getAccess_token() return @access_token end |
#getExpires_in ⇒ Object
16 17 18 |
# File 'lib/idn_sdk_ruby/com/nbos/capi/api/v0/token_api_model.rb', line 16 def getExpires_in() return @expires_in end |
#getRefresh_token ⇒ Object
28 29 30 |
# File 'lib/idn_sdk_ruby/com/nbos/capi/api/v0/token_api_model.rb', line 28 def getRefresh_token() return @refresh_token end |
#getScope ⇒ Object
20 21 22 |
# File 'lib/idn_sdk_ruby/com/nbos/capi/api/v0/token_api_model.rb', line 20 def getScope() return @scope; end |
#getToken_type ⇒ Object
24 25 26 |
# File 'lib/idn_sdk_ruby/com/nbos/capi/api/v0/token_api_model.rb', line 24 def getToken_type() return @token_type end |
#to_json(*options) ⇒ Object
63 64 65 |
# File 'lib/idn_sdk_ruby/com/nbos/capi/api/v0/token_api_model.rb', line 63 def to_json(*) as_json(*).to_json(*) end |
#to_s ⇒ Object
67 68 69 |
# File 'lib/idn_sdk_ruby/com/nbos/capi/api/v0/token_api_model.rb', line 67 def to_s to_json end |