Class: LockstepSdk::ErrorResult
- Inherits:
-
Object
- Object
- LockstepSdk::ErrorResult
- Defined in:
- lib/lockstep_sdk/models/error_result.rb
Overview
Represents a failed API request.
Instance Attribute Summary collapse
-
#content ⇒ String
The full content of the HTTP response.
-
#detail ⇒ String
If detailed information about this error is available, this value contains more information.
-
#instance ⇒ String
If this error corresponds to a specific instance or object, this field indicates which one.
-
#status ⇒ Int32
If an error code is applicable, this contains an error number.
-
#title ⇒ String
A short title describing the error.
-
#type ⇒ String
A description of the type of error that occurred.
Instance Method Summary collapse
-
#as_json(options = {}) ⇒ object
This object as a JSON key-value structure.
-
#initialize(params = {}) ⇒ ErrorResult
constructor
Initialize the ErrorResult using the provided prototype.
-
#to_json(*options) ⇒ String
This object converted to a JSON string.
Constructor Details
#initialize(params = {}) ⇒ ErrorResult
Initialize the ErrorResult using the provided prototype
25 26 27 28 29 30 31 32 |
# File 'lib/lockstep_sdk/models/error_result.rb', line 25 def initialize(params = {}) @type = params.dig(:type) @title = params.dig(:title) @status = params.dig(:status) @detail = params.dig(:detail) @instance = params.dig(:instance) @content = params.dig(:content) end |
Instance Attribute Details
#content ⇒ String
Returns The full content of the HTTP response.
56 57 58 |
# File 'lib/lockstep_sdk/models/error_result.rb', line 56 def content @content end |
#detail ⇒ String
Returns If detailed information about this error is available, this value contains more information.
48 49 50 |
# File 'lib/lockstep_sdk/models/error_result.rb', line 48 def detail @detail end |
#instance ⇒ String
Returns If this error corresponds to a specific instance or object, this field indicates which one.
52 53 54 |
# File 'lib/lockstep_sdk/models/error_result.rb', line 52 def instance @instance end |
#status ⇒ Int32
Returns If an error code is applicable, this contains an error number.
44 45 46 |
# File 'lib/lockstep_sdk/models/error_result.rb', line 44 def status @status end |
#title ⇒ String
Returns A short title describing the error.
40 41 42 |
# File 'lib/lockstep_sdk/models/error_result.rb', line 40 def title @title end |
#type ⇒ String
Returns A description of the type of error that occurred.
36 37 38 |
# File 'lib/lockstep_sdk/models/error_result.rb', line 36 def type @type end |
Instance Method Details
#as_json(options = {}) ⇒ object
Returns This object as a JSON key-value structure.
60 61 62 63 64 65 66 67 68 69 |
# File 'lib/lockstep_sdk/models/error_result.rb', line 60 def as_json(={}) { 'type' => @type, 'title' => @title, 'status' => @status, 'detail' => @detail, 'instance' => @instance, 'content' => @content, } end |
#to_json(*options) ⇒ String
Returns This object converted to a JSON string.
73 74 75 |
# File 'lib/lockstep_sdk/models/error_result.rb', line 73 def to_json(*) "[#{as_json(*).to_json(*)}]" end |