Class: CyberSourceMergedSpec::PaymentBatchSummary
- Inherits:
-
BaseModel
- Object
- CoreLibrary::BaseModel
- BaseModel
- CyberSourceMergedSpec::PaymentBatchSummary
- Defined in:
- lib/cyber_source_merged_spec/models/payment_batch_summary.rb
Overview
PaymentBatchSummary Model.
Instance Attribute Summary collapse
-
#account_id ⇒ String
TODO: Write general description for this method.
-
#account_name ⇒ String
TODO: Write general description for this method.
-
#credit_amount ⇒ String
TODO: Write general description for this method.
-
#credit_count ⇒ Integer
TODO: Write general description for this method.
-
#currency_code ⇒ String
TODO: Write general description for this method.
-
#end_time ⇒ DateTime
TODO: Write general description for this method.
-
#merchant_id ⇒ String
TODO: Write general description for this method.
-
#merchant_name ⇒ String
TODO: Write general description for this method.
-
#payment_sub_type_description ⇒ String
TODO: Write general description for this method.
-
#sales_amount ⇒ String
TODO: Write general description for this method.
-
#sales_count ⇒ Integer
TODO: Write general description for this method.
-
#start_time ⇒ DateTime
TODO: Write general description for this method.
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(currency_code: SKIP, payment_sub_type_description: SKIP, start_time: SKIP, end_time: SKIP, sales_count: SKIP, sales_amount: SKIP, credit_count: SKIP, credit_amount: SKIP, account_name: SKIP, account_id: SKIP, merchant_id: SKIP, merchant_name: SKIP, additional_properties: nil) ⇒ PaymentBatchSummary
constructor
A new instance of PaymentBatchSummary.
-
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
- #to_custom_end_time ⇒ Object
- #to_custom_start_time ⇒ Object
-
#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(currency_code: SKIP, payment_sub_type_description: SKIP, start_time: SKIP, end_time: SKIP, sales_count: SKIP, sales_amount: SKIP, credit_count: SKIP, credit_amount: SKIP, account_name: SKIP, account_id: SKIP, merchant_id: SKIP, merchant_name: SKIP, additional_properties: nil) ⇒ PaymentBatchSummary
Returns a new instance of PaymentBatchSummary.
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 |
# File 'lib/cyber_source_merged_spec/models/payment_batch_summary.rb', line 102 def initialize(currency_code: SKIP, payment_sub_type_description: SKIP, start_time: SKIP, end_time: SKIP, sales_count: SKIP, sales_amount: SKIP, credit_count: SKIP, credit_amount: SKIP, account_name: SKIP, account_id: SKIP, merchant_id: SKIP, merchant_name: SKIP, additional_properties: nil) # Add additional model properties to the instance additional_properties = {} if additional_properties.nil? @currency_code = currency_code unless currency_code == SKIP unless payment_sub_type_description == SKIP @payment_sub_type_description = payment_sub_type_description end @start_time = start_time unless start_time == SKIP @end_time = end_time unless end_time == SKIP @sales_count = sales_count unless sales_count == SKIP @sales_amount = sales_amount unless sales_amount == SKIP @credit_count = credit_count unless credit_count == SKIP @credit_amount = credit_amount unless credit_amount == SKIP @account_name = account_name unless account_name == SKIP @account_id = account_id unless account_id == SKIP @merchant_id = merchant_id unless merchant_id == SKIP @merchant_name = merchant_name unless merchant_name == SKIP @additional_properties = additional_properties end |
Instance Attribute Details
#account_id ⇒ String
TODO: Write general description for this method
51 52 53 |
# File 'lib/cyber_source_merged_spec/models/payment_batch_summary.rb', line 51 def account_id @account_id end |
#account_name ⇒ String
TODO: Write general description for this method
47 48 49 |
# File 'lib/cyber_source_merged_spec/models/payment_batch_summary.rb', line 47 def account_name @account_name end |
#credit_amount ⇒ String
TODO: Write general description for this method
43 44 45 |
# File 'lib/cyber_source_merged_spec/models/payment_batch_summary.rb', line 43 def credit_amount @credit_amount end |
#credit_count ⇒ Integer
TODO: Write general description for this method
39 40 41 |
# File 'lib/cyber_source_merged_spec/models/payment_batch_summary.rb', line 39 def credit_count @credit_count end |
#currency_code ⇒ String
TODO: Write general description for this method
15 16 17 |
# File 'lib/cyber_source_merged_spec/models/payment_batch_summary.rb', line 15 def currency_code @currency_code end |
#end_time ⇒ DateTime
TODO: Write general description for this method
27 28 29 |
# File 'lib/cyber_source_merged_spec/models/payment_batch_summary.rb', line 27 def end_time @end_time end |
#merchant_id ⇒ String
TODO: Write general description for this method
55 56 57 |
# File 'lib/cyber_source_merged_spec/models/payment_batch_summary.rb', line 55 def merchant_id @merchant_id end |
#merchant_name ⇒ String
TODO: Write general description for this method
59 60 61 |
# File 'lib/cyber_source_merged_spec/models/payment_batch_summary.rb', line 59 def merchant_name @merchant_name end |
#payment_sub_type_description ⇒ String
TODO: Write general description for this method
19 20 21 |
# File 'lib/cyber_source_merged_spec/models/payment_batch_summary.rb', line 19 def payment_sub_type_description @payment_sub_type_description end |
#sales_amount ⇒ String
TODO: Write general description for this method
35 36 37 |
# File 'lib/cyber_source_merged_spec/models/payment_batch_summary.rb', line 35 def sales_amount @sales_amount end |
#sales_count ⇒ Integer
TODO: Write general description for this method
31 32 33 |
# File 'lib/cyber_source_merged_spec/models/payment_batch_summary.rb', line 31 def sales_count @sales_count end |
#start_time ⇒ DateTime
TODO: Write general description for this method
23 24 25 |
# File 'lib/cyber_source_merged_spec/models/payment_batch_summary.rb', line 23 def start_time @start_time end |
Class Method Details
.from_element(root) ⇒ Object
186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 |
# File 'lib/cyber_source_merged_spec/models/payment_batch_summary.rb', line 186 def self.from_element(root) currency_code = XmlUtilities.from_element(root, 'currencyCode', String) payment_sub_type_description = XmlUtilities.from_element( root, 'paymentSubTypeDescription', String ) start_time = XmlUtilities.from_element(root, 'startTime', String, datetime_format: 'rfc3339') end_time = XmlUtilities.from_element(root, 'endTime', String, datetime_format: 'rfc3339') sales_count = XmlUtilities.from_element(root, 'salesCount', Integer) sales_amount = XmlUtilities.from_element(root, 'salesAmount', String) credit_count = XmlUtilities.from_element(root, 'creditCount', Integer) credit_amount = XmlUtilities.from_element(root, 'creditAmount', String) account_name = XmlUtilities.from_element(root, 'accountName', String) account_id = XmlUtilities.from_element(root, 'accountId', String) merchant_id = XmlUtilities.from_element(root, 'merchantId', String) merchant_name = XmlUtilities.from_element(root, 'merchantName', String) new(currency_code: currency_code, payment_sub_type_description: payment_sub_type_description, start_time: start_time, end_time: end_time, sales_count: sales_count, sales_amount: sales_amount, credit_count: credit_count, credit_amount: credit_amount, account_name: account_name, account_id: account_id, merchant_id: merchant_id, merchant_name: merchant_name, additional_properties: additional_properties) end |
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 |
# File 'lib/cyber_source_merged_spec/models/payment_batch_summary.rb', line 129 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. currency_code = hash.key?('currencyCode') ? hash['currencyCode'] : SKIP payment_sub_type_description = hash.key?('paymentSubTypeDescription') ? hash['paymentSubTypeDescription'] : SKIP start_time = if hash.key?('startTime') (DateTimeHelper.from_rfc3339(hash['startTime']) if hash['startTime']) else SKIP end end_time = if hash.key?('endTime') (DateTimeHelper.from_rfc3339(hash['endTime']) if hash['endTime']) else SKIP end sales_count = hash.key?('salesCount') ? hash['salesCount'] : SKIP sales_amount = hash.key?('salesAmount') ? hash['salesAmount'] : SKIP credit_count = hash.key?('creditCount') ? hash['creditCount'] : SKIP credit_amount = hash.key?('creditAmount') ? hash['creditAmount'] : SKIP account_name = hash.key?('accountName') ? hash['accountName'] : SKIP account_id = hash.key?('accountId') ? hash['accountId'] : SKIP merchant_id = hash.key?('merchantId') ? hash['merchantId'] : SKIP merchant_name = hash.key?('merchantName') ? hash['merchantName'] : 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. PaymentBatchSummary.new(currency_code: currency_code, payment_sub_type_description: payment_sub_type_description, start_time: start_time, end_time: end_time, sales_count: sales_count, sales_amount: sales_amount, credit_count: credit_count, credit_amount: credit_amount, account_name: account_name, account_id: account_id, merchant_id: merchant_id, merchant_name: merchant_name, additional_properties: additional_properties) end |
.names ⇒ Object
A mapping from model property names to API property names.
62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 |
# File 'lib/cyber_source_merged_spec/models/payment_batch_summary.rb', line 62 def self.names @_hash = {} if @_hash.nil? @_hash['currency_code'] = 'currencyCode' @_hash['payment_sub_type_description'] = 'paymentSubTypeDescription' @_hash['start_time'] = 'startTime' @_hash['end_time'] = 'endTime' @_hash['sales_count'] = 'salesCount' @_hash['sales_amount'] = 'salesAmount' @_hash['credit_count'] = 'creditCount' @_hash['credit_amount'] = 'creditAmount' @_hash['account_name'] = 'accountName' @_hash['account_id'] = 'accountId' @_hash['merchant_id'] = 'merchantId' @_hash['merchant_name'] = 'merchantName' @_hash end |
.nullables ⇒ Object
An array for nullable fields
98 99 100 |
# File 'lib/cyber_source_merged_spec/models/payment_batch_summary.rb', line 98 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 |
# File 'lib/cyber_source_merged_spec/models/payment_batch_summary.rb', line 80 def self.optionals %w[ currency_code payment_sub_type_description start_time end_time sales_count sales_amount credit_count credit_amount account_name account_id merchant_id merchant_name ] end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
255 256 257 258 259 260 261 262 263 264 |
# File 'lib/cyber_source_merged_spec/models/payment_batch_summary.rb', line 255 def inspect class_name = self.class.name.split('::').last "<#{class_name} currency_code: #{@currency_code.inspect}, payment_sub_type_description:"\ " #{@payment_sub_type_description.inspect}, start_time: #{@start_time.inspect}, end_time:"\ " #{@end_time.inspect}, sales_count: #{@sales_count.inspect}, sales_amount:"\ " #{@sales_amount.inspect}, credit_count: #{@credit_count.inspect}, credit_amount:"\ " #{@credit_amount.inspect}, account_name: #{@account_name.inspect}, account_id:"\ " #{@account_id.inspect}, merchant_id: #{@merchant_id.inspect}, merchant_name:"\ " #{@merchant_name.inspect}, additional_properties: #{@additional_properties}>" end |
#to_custom_end_time ⇒ Object
182 183 184 |
# File 'lib/cyber_source_merged_spec/models/payment_batch_summary.rb', line 182 def to_custom_end_time DateTimeHelper.to_rfc3339(end_time) end |
#to_custom_start_time ⇒ Object
178 179 180 |
# File 'lib/cyber_source_merged_spec/models/payment_batch_summary.rb', line 178 def to_custom_start_time DateTimeHelper.to_rfc3339(start_time) end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
244 245 246 247 248 249 250 251 252 |
# File 'lib/cyber_source_merged_spec/models/payment_batch_summary.rb', line 244 def to_s class_name = self.class.name.split('::').last "<#{class_name} currency_code: #{@currency_code}, payment_sub_type_description:"\ " #{@payment_sub_type_description}, start_time: #{@start_time}, end_time: #{@end_time},"\ " sales_count: #{@sales_count}, sales_amount: #{@sales_amount}, credit_count:"\ " #{@credit_count}, credit_amount: #{@credit_amount}, account_name: #{@account_name},"\ " account_id: #{@account_id}, merchant_id: #{@merchant_id}, merchant_name:"\ " #{@merchant_name}, additional_properties: #{@additional_properties}>" end |
#to_xml_element(doc, root_name) ⇒ Object
219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 |
# File 'lib/cyber_source_merged_spec/models/payment_batch_summary.rb', line 219 def to_xml_element(doc, root_name) root = doc.create_element(root_name) XmlUtilities.add_as_subelement(doc, root, 'currencyCode', currency_code) XmlUtilities.add_as_subelement(doc, root, 'paymentSubTypeDescription', payment_sub_type_description) XmlUtilities.add_as_subelement(doc, root, 'startTime', start_time, datetime_format: 'rfc3339') XmlUtilities.add_as_subelement(doc, root, 'endTime', end_time, datetime_format: 'rfc3339') XmlUtilities.add_as_subelement(doc, root, 'salesCount', sales_count) XmlUtilities.add_as_subelement(doc, root, 'salesAmount', sales_amount) XmlUtilities.add_as_subelement(doc, root, 'creditCount', credit_count) XmlUtilities.add_as_subelement(doc, root, 'creditAmount', credit_amount) XmlUtilities.add_as_subelement(doc, root, 'accountName', account_name) XmlUtilities.add_as_subelement(doc, root, 'accountId', account_id) XmlUtilities.add_as_subelement(doc, root, 'merchantId', merchant_id) XmlUtilities.add_as_subelement(doc, root, 'merchantName', merchant_name) XmlUtilities.add_as_subelement(doc, root, 'additional_properties', additional_properties) root end |