Class: Raas::RaasClientErrorModel
- Defined in:
- lib/raas/models/raas_client_error_model.rb
Overview
Represents a RaaS 4xx Error
Instance Attribute Summary collapse
-
#constraint ⇒ String
The constraint validated.
-
#invalid_value ⇒ String
The value that was invalid.
-
#message ⇒ String
The error message.
-
#path ⇒ String
The path to the invalid value.
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.
Instance Method Summary collapse
-
#initialize(path = nil, message = nil, constraint = nil, invalid_value = nil) ⇒ RaasClientErrorModel
constructor
A new instance of RaasClientErrorModel.
Methods inherited from BaseModel
Constructor Details
#initialize(path = nil, message = nil, constraint = nil, invalid_value = nil) ⇒ RaasClientErrorModel
Returns a new instance of RaasClientErrorModel.
33 34 35 36 37 38 39 40 41 |
# File 'lib/raas/models/raas_client_error_model.rb', line 33 def initialize(path = nil, = nil, constraint = nil, invalid_value = nil) @path = path @message = @constraint = constraint @invalid_value = invalid_value end |
Instance Attribute Details
#constraint ⇒ String
The constraint validated
17 18 19 |
# File 'lib/raas/models/raas_client_error_model.rb', line 17 def constraint @constraint end |
#invalid_value ⇒ String
The value that was invalid
21 22 23 |
# File 'lib/raas/models/raas_client_error_model.rb', line 21 def invalid_value @invalid_value end |
#message ⇒ String
The error message
13 14 15 |
# File 'lib/raas/models/raas_client_error_model.rb', line 13 def @message end |
#path ⇒ String
The path to the invalid value
9 10 11 |
# File 'lib/raas/models/raas_client_error_model.rb', line 9 def path @path 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 55 56 57 58 |
# File 'lib/raas/models/raas_client_error_model.rb', line 44 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. path = hash['path'] = hash['message'] constraint = hash['constraint'] invalid_value = hash['invalidValue'] # Create object from extracted values. RaasClientErrorModel.new(path, , constraint, invalid_value) end |
.names ⇒ Object
A mapping from model property names to API property names.
24 25 26 27 28 29 30 31 |
# File 'lib/raas/models/raas_client_error_model.rb', line 24 def self.names @_hash = {} if @_hash.nil? @_hash['path'] = 'path' @_hash['message'] = 'message' @_hash['constraint'] = 'constraint' @_hash['invalid_value'] = 'invalidValue' @_hash end |