Class: Verizon::IErrorMessage
- Defined in:
- lib/verizon/models/i_error_message.rb
Overview
Error message.
Instance Attribute Summary collapse
-
#detail_error_message ⇒ String
More detail and information about the HTML error code.
-
#error_code ⇒ ErrorResponseCodeEnum
Error Code.
-
#error_message ⇒ String
Details and additional information about the error code.
-
#http_status_code ⇒ HttpStatusCodeEnum
HTML error code and description.
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(error_code = SKIP, error_message = SKIP, http_status_code = SKIP, detail_error_message = SKIP) ⇒ IErrorMessage
constructor
A new instance of IErrorMessage.
Methods inherited from BaseModel
Constructor Details
#initialize(error_code = SKIP, error_message = SKIP, http_status_code = SKIP, detail_error_message = SKIP) ⇒ IErrorMessage
Returns a new instance of IErrorMessage.
53 54 55 56 57 58 59 60 61 |
# File 'lib/verizon/models/i_error_message.rb', line 53 def initialize(error_code = SKIP, = SKIP, http_status_code = SKIP, = SKIP) @error_code = error_code unless error_code == SKIP @error_message = unless == SKIP @http_status_code = http_status_code unless http_status_code == SKIP @detail_error_message = unless == SKIP end |
Instance Attribute Details
#detail_error_message ⇒ String
More detail and information about the HTML error code.
26 27 28 |
# File 'lib/verizon/models/i_error_message.rb', line 26 def @detail_error_message end |
#error_code ⇒ ErrorResponseCodeEnum
Error Code.
14 15 16 |
# File 'lib/verizon/models/i_error_message.rb', line 14 def error_code @error_code end |
#error_message ⇒ String
Details and additional information about the error code.
18 19 20 |
# File 'lib/verizon/models/i_error_message.rb', line 18 def @error_message end |
#http_status_code ⇒ HttpStatusCodeEnum
HTML error code and description.
22 23 24 |
# File 'lib/verizon/models/i_error_message.rb', line 22 def http_status_code @http_status_code end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 |
# File 'lib/verizon/models/i_error_message.rb', line 64 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. error_code = hash.key?('errorCode') ? hash['errorCode'] : SKIP = hash.key?('errorMessage') ? hash['errorMessage'] : SKIP http_status_code = hash.key?('httpStatusCode') ? hash['httpStatusCode'] : SKIP = hash.key?('detailErrorMessage') ? hash['detailErrorMessage'] : SKIP # Create object from extracted values. IErrorMessage.new(error_code, , http_status_code, ) end |
.names ⇒ Object
A mapping from model property names to API property names.
29 30 31 32 33 34 35 36 |
# File 'lib/verizon/models/i_error_message.rb', line 29 def self.names @_hash = {} if @_hash.nil? @_hash['error_code'] = 'errorCode' @_hash['error_message'] = 'errorMessage' @_hash['http_status_code'] = 'httpStatusCode' @_hash['detail_error_message'] = 'detailErrorMessage' @_hash end |
.nullables ⇒ Object
An array for nullable fields
49 50 51 |
# File 'lib/verizon/models/i_error_message.rb', line 49 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
39 40 41 42 43 44 45 46 |
# File 'lib/verizon/models/i_error_message.rb', line 39 def self.optionals %w[ error_code error_message http_status_code detail_error_message ] end |