Class: VisaAcceptanceMergedSpec::TransactionBatch
- Inherits:
-
BaseModel
- Object
- CoreLibrary::BaseModel
- BaseModel
- VisaAcceptanceMergedSpec::TransactionBatch
- Defined in:
- lib/visa_acceptance_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_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.
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/visa_acceptance_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/visa_acceptance_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/visa_acceptance_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/visa_acceptance_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/visa_acceptance_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/visa_acceptance_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/visa_acceptance_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/visa_acceptance_merged_spec/models/transaction_batch.rb', line 18 def upload_date @upload_date end |
Class Method Details
.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/visa_acceptance_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/visa_acceptance_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/visa_acceptance_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/visa_acceptance_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.
140 141 142 143 144 145 146 147 |
# File 'lib/visa_acceptance_merged_spec/models/transaction_batch.rb', line 140 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.
130 131 132 133 134 135 136 137 |
# File 'lib/visa_acceptance_merged_spec/models/transaction_batch.rb', line 130 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 |