Class: ShellEv::M404ErrorResponseError1Exception
- Inherits:
-
APIException
- Object
- CoreLibrary::ApiException
- APIException
- ShellEv::M404ErrorResponseError1Exception
- Defined in:
- lib/shell_ev/exceptions/m404_error_response_error1_exception.rb
Overview
Invalid charge token with given EmaId was not found. Backend HTTP 410 should be transformed to 404.
Instance Attribute Summary collapse
-
#errors ⇒ Array[M404ErrorResponseError]
Indicates overall status of the request.
-
#request_id ⇒ String
Mandatory UUID (according to RFC 4122 standards) for requests and responses.
-
#status ⇒ String
Indicates overall status of the request.
Instance Method Summary collapse
-
#initialize(reason, response) ⇒ M404ErrorResponseError1Exception
constructor
The constructor.
-
#unbox(hash) ⇒ Object
Populates this object by extracting properties from a hash.
Constructor Details
#initialize(reason, response) ⇒ M404ErrorResponseError1Exception
The constructor.
29 30 31 32 33 |
# File 'lib/shell_ev/exceptions/m404_error_response_error1_exception.rb', line 29 def initialize(reason, response) super(reason, response) hash = APIHelper.json_deserialize(@response.raw_body) unbox(hash) end |
Instance Attribute Details
#errors ⇒ Array[M404ErrorResponseError]
Indicates overall status of the request
24 25 26 |
# File 'lib/shell_ev/exceptions/m404_error_response_error1_exception.rb', line 24 def errors @errors end |
#request_id ⇒ String
Mandatory UUID (according to RFC 4122 standards) for requests and responses. This will be played back in the response from the request.
16 17 18 |
# File 'lib/shell_ev/exceptions/m404_error_response_error1_exception.rb', line 16 def request_id @request_id end |
#status ⇒ String
Indicates overall status of the request
20 21 22 |
# File 'lib/shell_ev/exceptions/m404_error_response_error1_exception.rb', line 20 def status @status end |
Instance Method Details
#unbox(hash) ⇒ Object
Populates this object by extracting properties from a hash. response body.
38 39 40 41 42 43 44 45 46 47 48 49 50 51 |
# File 'lib/shell_ev/exceptions/m404_error_response_error1_exception.rb', line 38 def unbox(hash) @request_id = hash.key?('RequestId') ? hash['RequestId'] : nil @status = hash.key?('Status') ? hash['Status'] : nil # Parameter is an array, so we need to iterate through it @errors = nil unless hash['Errors'].nil? @errors = [] hash['Errors'].each do |structure| @errors << (M404ErrorResponseError.from_hash(structure) if structure) end end @errors = SKIP unless hash.key?('Errors') end |