Class: CyberSourceMergedSpec::ReportingV3PurchaseRefundDetailsGet400ResponseException
- Inherits:
-
APIException
- Object
- CoreLibrary::ApiException
- APIException
- CyberSourceMergedSpec::ReportingV3PurchaseRefundDetailsGet400ResponseException
- Defined in:
- lib/cyber_source_merged_spec/exceptions/reporting_v3_purchase_refund_details_get400_response_exception.rb
Overview
HTTP status code for client application
Instance Attribute Summary collapse
-
#details ⇒ Array[Detail131]
Error field list.
-
#message ⇒ String
Short descriptive message to the user.
-
#reason ⇒ String
Documented reason code.
-
#submit_time_utc ⇒ DateTime
Time of request in UTC.
Instance Method Summary collapse
-
#initialize(reason, response) ⇒ ReportingV3PurchaseRefundDetailsGet400ResponseException
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) ⇒ ReportingV3PurchaseRefundDetailsGet400ResponseException
The constructor.
32 33 34 35 36 |
# File 'lib/cyber_source_merged_spec/exceptions/reporting_v3_purchase_refund_details_get400_response_exception.rb', line 32 def initialize(reason, response) super(reason, response) hash = APIHelper.json_deserialize(@response.raw_body) unbox(hash) end |
Instance Attribute Details
#details ⇒ Array[Detail131]
Error field list
27 28 29 |
# File 'lib/cyber_source_merged_spec/exceptions/reporting_v3_purchase_refund_details_get400_response_exception.rb', line 27 def details @details end |
#message ⇒ String
Short descriptive message to the user.
23 24 25 |
# File 'lib/cyber_source_merged_spec/exceptions/reporting_v3_purchase_refund_details_get400_response_exception.rb', line 23 def @message end |
#reason ⇒ String
Documented reason code
19 20 21 |
# File 'lib/cyber_source_merged_spec/exceptions/reporting_v3_purchase_refund_details_get400_response_exception.rb', line 19 def reason @reason end |
#submit_time_utc ⇒ DateTime
Time of request in UTC.
15 16 17 |
# File 'lib/cyber_source_merged_spec/exceptions/reporting_v3_purchase_refund_details_get400_response_exception.rb', line 15 def submit_time_utc @submit_time_utc end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
69 70 71 72 73 |
# File 'lib/cyber_source_merged_spec/exceptions/reporting_v3_purchase_refund_details_get400_response_exception.rb', line 69 def inspect class_name = self.class.name.split('::').last "<#{class_name} submit_time_utc: #{@submit_time_utc.inspect}, reason: #{@reason.inspect},"\ " message: #{@message.inspect}, details: #{@details.inspect}>" end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
62 63 64 65 66 |
# File 'lib/cyber_source_merged_spec/exceptions/reporting_v3_purchase_refund_details_get400_response_exception.rb', line 62 def to_s class_name = self.class.name.split('::').last "<#{class_name} submit_time_utc: #{@submit_time_utc}, reason: #{@reason}, message:"\ " #{@message}, details: #{@details}>" end |
#unbox(hash) ⇒ Object
Populates this object by extracting properties from a hash. response body.
41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 |
# File 'lib/cyber_source_merged_spec/exceptions/reporting_v3_purchase_refund_details_get400_response_exception.rb', line 41 def unbox(hash) return nil unless hash @submit_time_utc = if hash.key?('submitTimeUtc') (DateTimeHelper.from_rfc3339(hash['submitTimeUtc']) if hash['submitTimeUtc']) end @reason = hash.key?('reason') ? hash['reason'] : nil @message = hash.key?('message') ? hash['message'] : nil # Parameter is an array, so we need to iterate through it @details = nil unless hash['details'].nil? @details = [] hash['details'].each do |structure| @details << (Detail131.from_hash(structure) if structure) end end @details = nil unless hash.key?('details') end |