Class: CyberSourceMergedSpec::PutMerchantDefinedFieldsDefinitionsException
- Inherits:
-
APIException
- Object
- CoreLibrary::ApiException
- APIException
- CyberSourceMergedSpec::PutMerchantDefinedFieldsDefinitionsException
- Defined in:
- lib/cyber_source_merged_spec/exceptions/put_merchant_defined_fields_definitions_exception.rb
Overview
putMerchantDefinedFieldsDefinitionsException class.
Instance Attribute Summary collapse
-
#details ⇒ Array[Detail169]
The details of the validation error.
-
#message ⇒ String
The message of the response.
-
#reason ⇒ String
The reason for the response.
-
#status ⇒ Integer
The status code of the response.
-
#submit_time_utc ⇒ String
The time the response was submitted.
Instance Method Summary collapse
-
#initialize(reason, response) ⇒ PutMerchantDefinedFieldsDefinitionsException
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) ⇒ PutMerchantDefinedFieldsDefinitionsException
The constructor.
35 36 37 38 39 |
# File 'lib/cyber_source_merged_spec/exceptions/put_merchant_defined_fields_definitions_exception.rb', line 35 def initialize(reason, response) super(reason, response) hash = APIHelper.json_deserialize(@response.raw_body) unbox(hash) end |
Instance Attribute Details
#details ⇒ Array[Detail169]
The details of the validation error
30 31 32 |
# File 'lib/cyber_source_merged_spec/exceptions/put_merchant_defined_fields_definitions_exception.rb', line 30 def details @details end |
#message ⇒ String
The message of the response
26 27 28 |
# File 'lib/cyber_source_merged_spec/exceptions/put_merchant_defined_fields_definitions_exception.rb', line 26 def @message end |
#reason ⇒ String
The reason for the response
22 23 24 |
# File 'lib/cyber_source_merged_spec/exceptions/put_merchant_defined_fields_definitions_exception.rb', line 22 def reason @reason end |
#status ⇒ Integer
The status code of the response
18 19 20 |
# File 'lib/cyber_source_merged_spec/exceptions/put_merchant_defined_fields_definitions_exception.rb', line 18 def status @status end |
#submit_time_utc ⇒ String
The time the response was submitted
14 15 16 |
# File 'lib/cyber_source_merged_spec/exceptions/put_merchant_defined_fields_definitions_exception.rb', line 14 def submit_time_utc @submit_time_utc end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
72 73 74 75 76 |
# File 'lib/cyber_source_merged_spec/exceptions/put_merchant_defined_fields_definitions_exception.rb', line 72 def inspect class_name = self.class.name.split('::').last "<#{class_name} submit_time_utc: #{@submit_time_utc.inspect}, status: #{@status.inspect},"\ " reason: #{@reason.inspect}, message: #{@message.inspect}, details: #{@details.inspect}>" end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
65 66 67 68 69 |
# File 'lib/cyber_source_merged_spec/exceptions/put_merchant_defined_fields_definitions_exception.rb', line 65 def to_s class_name = self.class.name.split('::').last "<#{class_name} submit_time_utc: #{@submit_time_utc}, status: #{@status}, reason:"\ " #{@reason}, message: #{@message}, details: #{@details}>" end |
#unbox(hash) ⇒ Object
Populates this object by extracting properties from a hash. response body.
44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 |
# File 'lib/cyber_source_merged_spec/exceptions/put_merchant_defined_fields_definitions_exception.rb', line 44 def unbox(hash) return nil unless hash @submit_time_utc = hash.key?('submitTimeUtc') ? hash['submitTimeUtc'] : SKIP @status = hash.key?('status') ? hash['status'] : SKIP @reason = hash.key?('reason') ? hash['reason'] : SKIP @message = hash.key?('message') ? hash['message'] : SKIP # Parameter is an array, so we need to iterate through it @details = nil unless hash['details'].nil? @details = [] hash['details'].each do |structure| @details << (Detail169.from_hash(structure) if structure) end end @details = SKIP unless hash.key?('details') end |