Class: CyberSourceMergedSpec::ErrorInformation27
- Inherits:
-
BaseModel
- Object
- CoreLibrary::BaseModel
- BaseModel
- CyberSourceMergedSpec::ErrorInformation27
- Defined in:
- lib/cyber_source_merged_spec/models/error_information27.rb
Overview
ErrorInformation27 Model.
Instance Attribute Summary collapse
-
#details ⇒ Array[Detail]
The detail message related to the status and reason listed above.
-
#message ⇒ String
The detail message related to the status and reason listed above.
-
#reason ⇒ String
The reason of the status.
Class Method Summary collapse
- .from_element(root) ⇒ Object
-
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
-
.names ⇒ Object
A mapping from model property names to API property names.
-
.nullables ⇒ Object
An array for nullable fields.
-
.optionals ⇒ Object
An array for optional fields.
Instance Method Summary collapse
-
#initialize(reason: SKIP, message: SKIP, details: SKIP, additional_properties: nil) ⇒ ErrorInformation27
constructor
A new instance of ErrorInformation27.
-
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
-
#to_s ⇒ Object
Provides a human-readable string representation of the object.
- #to_xml_element(doc, root_name) ⇒ Object
Methods inherited from BaseModel
#check_for_conflict, #process_additional_properties, #process_array, #process_basic_value, #process_hash, #to_hash, #to_json
Constructor Details
#initialize(reason: SKIP, message: SKIP, details: SKIP, additional_properties: nil) ⇒ ErrorInformation27
Returns a new instance of ErrorInformation27.
60 61 62 63 64 65 66 67 68 69 |
# File 'lib/cyber_source_merged_spec/models/error_information27.rb', line 60 def initialize(reason: SKIP, message: SKIP, details: SKIP, additional_properties: nil) # Add additional model properties to the instance additional_properties = {} if additional_properties.nil? @reason = reason unless reason == SKIP @message = unless == SKIP @details = details unless details == SKIP @additional_properties = additional_properties end |
Instance Attribute Details
#details ⇒ Array[Detail]
The detail message related to the status and reason listed above.
35 36 37 |
# File 'lib/cyber_source_merged_spec/models/error_information27.rb', line 35 def details @details end |
#message ⇒ String
The detail message related to the status and reason listed above.
31 32 33 |
# File 'lib/cyber_source_merged_spec/models/error_information27.rb', line 31 def @message end |
#reason ⇒ String
The reason of the status. Value can be
APARTMENT_NUMBER_NOT_FOUNDINSUFFICIENT_ADDRESS_INFORMATIONHOUSE_OR_BOX_NUMBER_NOT_FOUNDMULTIPLE_ADDRESS_MATCHESBOX_NUMBER_NOT_FOUNDROUTE_SERVICE_NOT_FOUNDSTREET_NAME_NOT_FOUNDPOSTAL_CODE_NOT_FOUNDUNVERIFIABLE_ADDRESSMULTIPLE_ADDRESS_MATCHES_INTERNATIONALADDRESS_MATCH_NOT_FOUNDUNSUPPORTED_CHARACTER_SETINVALID_MERCHANT_CONFIGURATION
27 28 29 |
# File 'lib/cyber_source_merged_spec/models/error_information27.rb', line 27 def reason @reason end |
Class Method Details
.from_element(root) ⇒ Object
103 104 105 106 107 108 109 110 111 112 |
# File 'lib/cyber_source_merged_spec/models/error_information27.rb', line 103 def self.from_element(root) reason = XmlUtilities.from_element(root, 'reason', String) = XmlUtilities.from_element(root, 'message', String) details = XmlUtilities.from_element_to_array(root, 'Detail', Detail) new(reason: reason, message: , details: details, additional_properties: additional_properties) end |
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 |
# File 'lib/cyber_source_merged_spec/models/error_information27.rb', line 72 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. reason = hash.key?('reason') ? hash['reason'] : SKIP = 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 << (Detail.from_hash(structure) if structure) end end details = SKIP unless hash.key?('details') # Create a new hash for additional properties, removing known properties. new_hash = hash.reject { |k, _| names.value?(k) } additional_properties = APIHelper.get_additional_properties( new_hash, proc { |value| value } ) # Create object from extracted values. ErrorInformation27.new(reason: reason, message: , details: details, additional_properties: additional_properties) end |
.names ⇒ Object
A mapping from model property names to API property names.
38 39 40 41 42 43 44 |
# File 'lib/cyber_source_merged_spec/models/error_information27.rb', line 38 def self.names @_hash = {} if @_hash.nil? @_hash['reason'] = 'reason' @_hash['message'] = 'message' @_hash['details'] = 'details' @_hash end |
.nullables ⇒ Object
An array for nullable fields
56 57 58 |
# File 'lib/cyber_source_merged_spec/models/error_information27.rb', line 56 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
47 48 49 50 51 52 53 |
# File 'lib/cyber_source_merged_spec/models/error_information27.rb', line 47 def self.optionals %w[ reason message details ] end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
134 135 136 137 138 |
# File 'lib/cyber_source_merged_spec/models/error_information27.rb', line 134 def inspect class_name = self.class.name.split('::').last "<#{class_name} reason: #{@reason.inspect}, message: #{@message.inspect}, details:"\ " #{@details.inspect}, additional_properties: #{@additional_properties}>" end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
127 128 129 130 131 |
# File 'lib/cyber_source_merged_spec/models/error_information27.rb', line 127 def to_s class_name = self.class.name.split('::').last "<#{class_name} reason: #{@reason}, message: #{@message}, details: #{@details},"\ " additional_properties: #{@additional_properties}>" end |
#to_xml_element(doc, root_name) ⇒ Object
114 115 116 117 118 119 120 121 122 123 124 |
# File 'lib/cyber_source_merged_spec/models/error_information27.rb', line 114 def to_xml_element(doc, root_name) root = doc.create_element(root_name) XmlUtilities.add_as_subelement(doc, root, 'reason', reason) XmlUtilities.add_as_subelement(doc, root, 'message', ) XmlUtilities.add_array_as_subelement(doc, root, 'Detail', details) XmlUtilities.add_as_subelement(doc, root, 'additional_properties', additional_properties) root end |