Class: CyberSourceMergedSpec::V1FileDetailsGet401ResponseException
- Inherits:
-
APIException
- Object
- CoreLibrary::ApiException
- APIException
- CyberSourceMergedSpec::V1FileDetailsGet401ResponseException
- Defined in:
- lib/cyber_source_merged_spec/exceptions/v1_file_details_get401_response_exception.rb
Overview
Error Bean
Instance Attribute Summary collapse
-
#code ⇒ String
Error code.
-
#correlation_id ⇒ String
Correlation Id.
-
#detail ⇒ String
Error Detail.
-
#fields ⇒ Array[Field]
Error fields List.
-
#localization_key ⇒ String
Localization Key Name.
-
#message ⇒ String
Error message.
Instance Method Summary collapse
-
#initialize(reason, response) ⇒ V1FileDetailsGet401ResponseException
constructor
The constructor.
-
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
-
#to_s ⇒ Object
Provides a human-readable string representation of the object.
-
#unbox(hash) ⇒ Object
Populates this object by extracting properties from a hash.
Constructor Details
#initialize(reason, response) ⇒ V1FileDetailsGet401ResponseException
The constructor.
39 40 41 42 43 |
# File 'lib/cyber_source_merged_spec/exceptions/v1_file_details_get401_response_exception.rb', line 39 def initialize(reason, response) super(reason, response) hash = APIHelper.json_deserialize(@response.raw_body) unbox(hash) end |
Instance Attribute Details
#code ⇒ String
Error code
14 15 16 |
# File 'lib/cyber_source_merged_spec/exceptions/v1_file_details_get401_response_exception.rb', line 14 def code @code end |
#correlation_id ⇒ String
Correlation Id
26 27 28 |
# File 'lib/cyber_source_merged_spec/exceptions/v1_file_details_get401_response_exception.rb', line 26 def correlation_id @correlation_id end |
#detail ⇒ String
Error Detail
30 31 32 |
# File 'lib/cyber_source_merged_spec/exceptions/v1_file_details_get401_response_exception.rb', line 30 def detail @detail end |
#fields ⇒ Array[Field]
Error fields List
34 35 36 |
# File 'lib/cyber_source_merged_spec/exceptions/v1_file_details_get401_response_exception.rb', line 34 def fields @fields end |
#localization_key ⇒ String
Localization Key Name
22 23 24 |
# File 'lib/cyber_source_merged_spec/exceptions/v1_file_details_get401_response_exception.rb', line 22 def localization_key @localization_key end |
#message ⇒ String
Error message
18 19 20 |
# File 'lib/cyber_source_merged_spec/exceptions/v1_file_details_get401_response_exception.rb', line 18 def @message end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
79 80 81 82 83 84 |
# File 'lib/cyber_source_merged_spec/exceptions/v1_file_details_get401_response_exception.rb', line 79 def inspect class_name = self.class.name.split('::').last "<#{class_name} code: #{@code.inspect}, message: #{@message.inspect}, localization_key:"\ " #{@localization_key.inspect}, correlation_id: #{@correlation_id.inspect}, detail:"\ " #{@detail.inspect}, fields: #{@fields.inspect}>" end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
71 72 73 74 75 76 |
# File 'lib/cyber_source_merged_spec/exceptions/v1_file_details_get401_response_exception.rb', line 71 def to_s class_name = self.class.name.split('::').last "<#{class_name} code: #{@code}, message: #{@message}, localization_key:"\ " #{@localization_key}, correlation_id: #{@correlation_id}, detail: #{@detail}, fields:"\ " #{@fields}>" end |
#unbox(hash) ⇒ Object
Populates this object by extracting properties from a hash. response body.
48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 |
# File 'lib/cyber_source_merged_spec/exceptions/v1_file_details_get401_response_exception.rb', line 48 def unbox(hash) return nil unless hash @code = hash.key?('code') ? hash['code'] : nil @message = hash.key?('message') ? hash['message'] : nil @localization_key = hash.key?('localizationKey') ? hash['localizationKey'] : SKIP @correlation_id = hash.key?('correlationId') ? hash['correlationId'] : SKIP @detail = hash.key?('detail') ? hash['detail'] : SKIP # Parameter is an array, so we need to iterate through it @fields = nil unless hash['fields'].nil? @fields = [] hash['fields'].each do |structure| @fields << (Field.from_hash(structure) if structure) end end @fields = SKIP unless hash.key?('fields') end |