Class: CyberSourceMergedSpec::TransactionBatch
- Inherits:
-
BaseModel
- Object
- CoreLibrary::BaseModel
- BaseModel
- CyberSourceMergedSpec::TransactionBatch
- Defined in:
- lib/cyber_source_merged_spec/models/transaction_batch.rb
Overview
TransactionBatch Model.
Instance Attribute Summary collapse
-
#accepted_transaction_count ⇒ Integer
Number of transactions accepted.
-
#completion_date ⇒ String
The date when the batch template processing completed.
-
#id ⇒ String
Unique identifier assigned to the batch file.
-
#rejected_transaction_count ⇒ String
Number of transactions rejected.
-
#status ⇒ String
The status of you batch template processing.
-
#transaction_count ⇒ Integer
Number of transactions in the transaction.
-
#upload_date ⇒ String
Date when the batch template was update.
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(id: SKIP, upload_date: SKIP, completion_date: SKIP, transaction_count: SKIP, accepted_transaction_count: SKIP, rejected_transaction_count: SKIP, status: SKIP, additional_properties: nil) ⇒ TransactionBatch
constructor
A new instance of TransactionBatch.
-
#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(id: SKIP, upload_date: SKIP, completion_date: SKIP, transaction_count: SKIP, accepted_transaction_count: SKIP, rejected_transaction_count: SKIP, status: SKIP, additional_properties: nil) ⇒ TransactionBatch
Returns a new instance of TransactionBatch.
71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 |
# File 'lib/cyber_source_merged_spec/models/transaction_batch.rb', line 71 def initialize(id: SKIP, upload_date: SKIP, completion_date: SKIP, transaction_count: SKIP, accepted_transaction_count: SKIP, rejected_transaction_count: SKIP, status: SKIP, additional_properties: nil) # Add additional model properties to the instance additional_properties = {} if additional_properties.nil? @id = id unless id == SKIP @upload_date = upload_date unless upload_date == SKIP @completion_date = completion_date unless completion_date == SKIP @transaction_count = transaction_count unless transaction_count == SKIP unless accepted_transaction_count == SKIP @accepted_transaction_count = accepted_transaction_count end unless rejected_transaction_count == SKIP @rejected_transaction_count = rejected_transaction_count end @status = status unless status == SKIP @additional_properties = additional_properties end |
Instance Attribute Details
#accepted_transaction_count ⇒ Integer
Number of transactions accepted.
30 31 32 |
# File 'lib/cyber_source_merged_spec/models/transaction_batch.rb', line 30 def accepted_transaction_count @accepted_transaction_count end |
#completion_date ⇒ String
The date when the batch template processing completed.
22 23 24 |
# File 'lib/cyber_source_merged_spec/models/transaction_batch.rb', line 22 def completion_date @completion_date end |
#id ⇒ String
Unique identifier assigned to the batch file.
14 15 16 |
# File 'lib/cyber_source_merged_spec/models/transaction_batch.rb', line 14 def id @id end |
#rejected_transaction_count ⇒ String
Number of transactions rejected.
34 35 36 |
# File 'lib/cyber_source_merged_spec/models/transaction_batch.rb', line 34 def rejected_transaction_count @rejected_transaction_count end |
#status ⇒ String
The status of you batch template processing.
38 39 40 |
# File 'lib/cyber_source_merged_spec/models/transaction_batch.rb', line 38 def status @status end |
#transaction_count ⇒ Integer
Number of transactions in the transaction.
26 27 28 |
# File 'lib/cyber_source_merged_spec/models/transaction_batch.rb', line 26 def transaction_count @transaction_count end |
#upload_date ⇒ String
Date when the batch template was update.
18 19 20 |
# File 'lib/cyber_source_merged_spec/models/transaction_batch.rb', line 18 def upload_date @upload_date end |
Class Method Details
.from_element(root) ⇒ Object
129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 |
# File 'lib/cyber_source_merged_spec/models/transaction_batch.rb', line 129 def self.from_element(root) id = XmlUtilities.from_element(root, 'id', String) upload_date = XmlUtilities.from_element(root, 'uploadDate', String) completion_date = XmlUtilities.from_element(root, 'completionDate', String) transaction_count = XmlUtilities.from_element(root, 'transactionCount', Integer) accepted_transaction_count = XmlUtilities.from_element( root, 'acceptedTransactionCount', Integer ) rejected_transaction_count = XmlUtilities.from_element( root, 'rejectedTransactionCount', String ) status = XmlUtilities.from_element(root, 'status', String) new(id: id, upload_date: upload_date, completion_date: completion_date, transaction_count: transaction_count, accepted_transaction_count: accepted_transaction_count, rejected_transaction_count: rejected_transaction_count, status: status, additional_properties: additional_properties) end |
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 |
# File 'lib/cyber_source_merged_spec/models/transaction_batch.rb', line 95 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. id = hash.key?('id') ? hash['id'] : SKIP upload_date = hash.key?('uploadDate') ? hash['uploadDate'] : SKIP completion_date = hash.key?('completionDate') ? hash['completionDate'] : SKIP transaction_count = hash.key?('transactionCount') ? hash['transactionCount'] : SKIP accepted_transaction_count = hash.key?('acceptedTransactionCount') ? hash['acceptedTransactionCount'] : SKIP rejected_transaction_count = hash.key?('rejectedTransactionCount') ? hash['rejectedTransactionCount'] : SKIP status = hash.key?('status') ? hash['status'] : SKIP # 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. TransactionBatch.new(id: id, upload_date: upload_date, completion_date: completion_date, transaction_count: transaction_count, accepted_transaction_count: accepted_transaction_count, rejected_transaction_count: rejected_transaction_count, status: status, additional_properties: additional_properties) end |
.names ⇒ Object
A mapping from model property names to API property names.
41 42 43 44 45 46 47 48 49 50 51 |
# File 'lib/cyber_source_merged_spec/models/transaction_batch.rb', line 41 def self.names @_hash = {} if @_hash.nil? @_hash['id'] = 'id' @_hash['upload_date'] = 'uploadDate' @_hash['completion_date'] = 'completionDate' @_hash['transaction_count'] = 'transactionCount' @_hash['accepted_transaction_count'] = 'acceptedTransactionCount' @_hash['rejected_transaction_count'] = 'rejectedTransactionCount' @_hash['status'] = 'status' @_hash end |
.nullables ⇒ Object
An array for nullable fields
67 68 69 |
# File 'lib/cyber_source_merged_spec/models/transaction_batch.rb', line 67 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
54 55 56 57 58 59 60 61 62 63 64 |
# File 'lib/cyber_source_merged_spec/models/transaction_batch.rb', line 54 def self.optionals %w[ id upload_date completion_date transaction_count accepted_transaction_count rejected_transaction_count status ] end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
185 186 187 188 189 190 191 192 |
# File 'lib/cyber_source_merged_spec/models/transaction_batch.rb', line 185 def inspect class_name = self.class.name.split('::').last "<#{class_name} id: #{@id.inspect}, upload_date: #{@upload_date.inspect}, completion_date:"\ " #{@completion_date.inspect}, transaction_count: #{@transaction_count.inspect},"\ " accepted_transaction_count: #{@accepted_transaction_count.inspect},"\ " rejected_transaction_count: #{@rejected_transaction_count.inspect}, status:"\ " #{@status.inspect}, additional_properties: #{@additional_properties}>" end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
175 176 177 178 179 180 181 182 |
# File 'lib/cyber_source_merged_spec/models/transaction_batch.rb', line 175 def to_s class_name = self.class.name.split('::').last "<#{class_name} id: #{@id}, upload_date: #{@upload_date}, completion_date:"\ " #{@completion_date}, transaction_count: #{@transaction_count}, accepted_transaction_count:"\ " #{@accepted_transaction_count}, rejected_transaction_count:"\ " #{@rejected_transaction_count}, status: #{@status}, additional_properties:"\ " #{@additional_properties}>" end |
#to_xml_element(doc, root_name) ⇒ Object
154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 |
# File 'lib/cyber_source_merged_spec/models/transaction_batch.rb', line 154 def to_xml_element(doc, root_name) root = doc.create_element(root_name) XmlUtilities.add_as_subelement(doc, root, 'id', id) XmlUtilities.add_as_subelement(doc, root, 'uploadDate', upload_date) XmlUtilities.add_as_subelement(doc, root, 'completionDate', completion_date) XmlUtilities.add_as_subelement(doc, root, 'transactionCount', transaction_count) XmlUtilities.add_as_subelement(doc, root, 'acceptedTransactionCount', accepted_transaction_count) XmlUtilities.add_as_subelement(doc, root, 'rejectedTransactionCount', rejected_transaction_count) XmlUtilities.add_as_subelement(doc, root, 'status', status) XmlUtilities.add_as_subelement(doc, root, 'additional_properties', additional_properties) root end |