class IdnSdkRuby::Com::Nbos::Capi::Api::V0::TokenApiModel
Attributes
access_token[RW]
expires_in[RW]
message[RW]
refresh_token[RW]
scope[RW]
token_type[RW]
Public Class Methods
new(parsed_response = nil)
click to toggle source
# 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
Public Instance Methods
add_errors(json_response)
click to toggle source
# 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)
click to toggle source
# File lib/idn_sdk_ruby/com/nbos/capi/api/v0/token_api_model.rb, line 44 def add_messages(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={})
click to toggle source
# File lib/idn_sdk_ruby/com/nbos/capi/api/v0/token_api_model.rb, line 53 def as_json(options={}) { scope: @scope, expires_in: @expires_in, token_type: @token_type, refresh_token: @refresh_token, access_token: @access_token, } end
getAccess_token()
click to toggle source
# 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()
click to toggle source
# 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()
click to toggle source
# File lib/idn_sdk_ruby/com/nbos/capi/api/v0/token_api_model.rb, line 28 def getRefresh_token() return @refresh_token end
getScope()
click to toggle source
# File lib/idn_sdk_ruby/com/nbos/capi/api/v0/token_api_model.rb, line 20 def getScope() return @scope; end
getToken_type()
click to toggle source
# 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)
click to toggle source
# File lib/idn_sdk_ruby/com/nbos/capi/api/v0/token_api_model.rb, line 63 def to_json(*options) as_json(*options).to_json(*options) end
to_s()
click to toggle source
# File lib/idn_sdk_ruby/com/nbos/capi/api/v0/token_api_model.rb, line 67 def to_s to_json end