Class: ShellDataReportingApIs::ErrorDetails
- Inherits:
-
BaseModel
- Object
- CoreLibrary::BaseModel
- BaseModel
- ShellDataReportingApIs::ErrorDetails
- Defined in:
- lib/shell_data_reporting_ap_is/models/error_details.rb
Overview
ErrorDetails Model.
Instance Attribute Summary collapse
-
#additional_info ⇒ Hash[String, String]
Applicable when more details related to error to be returned.
-
#code ⇒ String
Error code representing the error encountered.
-
#detail ⇒ String
Detailed inforamtion about the error.
-
#title ⇒ String
Error type 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(code = SKIP, title = SKIP, detail = SKIP, additional_info = SKIP) ⇒ ErrorDetails
constructor
A new instance of ErrorDetails.
Methods inherited from BaseModel
Constructor Details
#initialize(code = SKIP, title = SKIP, detail = SKIP, additional_info = SKIP) ⇒ ErrorDetails
Returns a new instance of ErrorDetails.
53 54 55 56 57 58 59 |
# File 'lib/shell_data_reporting_ap_is/models/error_details.rb', line 53 def initialize(code = SKIP, title = SKIP, detail = SKIP, additional_info = SKIP) @code = code unless code == SKIP @title = title unless title == SKIP @detail = detail unless detail == SKIP @additional_info = additional_info unless additional_info == SKIP end |
Instance Attribute Details
#additional_info ⇒ Hash[String, String]
Applicable when more details related to error to be returned
26 27 28 |
# File 'lib/shell_data_reporting_ap_is/models/error_details.rb', line 26 def additional_info @additional_info end |
#code ⇒ String
Error code representing the error encountered
14 15 16 |
# File 'lib/shell_data_reporting_ap_is/models/error_details.rb', line 14 def code @code end |
#detail ⇒ String
Detailed inforamtion about the error
22 23 24 |
# File 'lib/shell_data_reporting_ap_is/models/error_details.rb', line 22 def detail @detail end |
#title ⇒ String
Error type description
18 19 20 |
# File 'lib/shell_data_reporting_ap_is/models/error_details.rb', line 18 def title @title end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 |
# File 'lib/shell_data_reporting_ap_is/models/error_details.rb', line 62 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. code = hash.key?('Code') ? hash['Code'] : SKIP title = hash.key?('Title') ? hash['Title'] : SKIP detail = hash.key?('Detail') ? hash['Detail'] : SKIP additional_info = hash.key?('AdditionalInfo') ? hash['AdditionalInfo'] : SKIP # Create object from extracted values. ErrorDetails.new(code, title, detail, additional_info) end |
.names ⇒ Object
A mapping from model property names to API property names.
29 30 31 32 33 34 35 36 |
# File 'lib/shell_data_reporting_ap_is/models/error_details.rb', line 29 def self.names @_hash = {} if @_hash.nil? @_hash['code'] = 'Code' @_hash['title'] = 'Title' @_hash['detail'] = 'Detail' @_hash['additional_info'] = 'AdditionalInfo' @_hash end |
.nullables ⇒ Object
An array for nullable fields
49 50 51 |
# File 'lib/shell_data_reporting_ap_is/models/error_details.rb', line 49 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
39 40 41 42 43 44 45 46 |
# File 'lib/shell_data_reporting_ap_is/models/error_details.rb', line 39 def self.optionals %w[ code title detail additional_info ] end |