Class: Verizon::ApiResponseCode
- Defined in:
- lib/verizon/models/api_response_code.rb
Overview
ResponseCode and/or a message indicating success or failure of the request.
Instance Attribute Summary collapse
-
#message ⇒ String
More details about the responseCode received.
-
#response_code ⇒ ResponseCodeEnum
Possible response codes.
Class Method Summary collapse
-
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
-
.names ⇒ Object
A mapping from model property names to API property names.
-
.nullables ⇒ Object
An array for nullable fields.
-
.optionals ⇒ Object
An array for optional fields.
Instance Method Summary collapse
-
#initialize(response_code = nil, message = nil) ⇒ ApiResponseCode
constructor
A new instance of ApiResponseCode.
Methods inherited from BaseModel
Constructor Details
#initialize(response_code = nil, message = nil) ⇒ ApiResponseCode
Returns a new instance of ApiResponseCode.
38 39 40 41 |
# File 'lib/verizon/models/api_response_code.rb', line 38 def initialize(response_code = nil, = nil) @response_code = response_code @message = end |
Instance Attribute Details
#message ⇒ String
More details about the responseCode received.
18 19 20 |
# File 'lib/verizon/models/api_response_code.rb', line 18 def @message end |
#response_code ⇒ ResponseCodeEnum
Possible response codes.
14 15 16 |
# File 'lib/verizon/models/api_response_code.rb', line 14 def response_code @response_code end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
44 45 46 47 48 49 50 51 52 53 54 |
# File 'lib/verizon/models/api_response_code.rb', line 44 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. response_code = hash.key?('responseCode') ? hash['responseCode'] : nil = hash.key?('message') ? hash['message'] : nil # Create object from extracted values. ApiResponseCode.new(response_code, ) end |
.names ⇒ Object
A mapping from model property names to API property names.
21 22 23 24 25 26 |
# File 'lib/verizon/models/api_response_code.rb', line 21 def self.names @_hash = {} if @_hash.nil? @_hash['response_code'] = 'responseCode' @_hash['message'] = 'message' @_hash end |
.nullables ⇒ Object
An array for nullable fields
34 35 36 |
# File 'lib/verizon/models/api_response_code.rb', line 34 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
29 30 31 |
# File 'lib/verizon/models/api_response_code.rb', line 29 def self.optionals [] end |