biz_api 3.9.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (136) hide show
  1. checksums.yaml +7 -0
  2. data/Gemfile +9 -0
  3. data/README.md +155 -0
  4. data/Rakefile +10 -0
  5. data/biz_api.gemspec +39 -0
  6. data/docs/AppInfo.md +22 -0
  7. data/docs/AuthRequest.md +26 -0
  8. data/docs/BizEvent.md +50 -0
  9. data/docs/BizEventsHelpdeskApi.md +157 -0
  10. data/docs/CartItem.md +28 -0
  11. data/docs/Creditor.md +26 -0
  12. data/docs/CtReceiptModelResponse.md +72 -0
  13. data/docs/Debtor.md +36 -0
  14. data/docs/DebtorPosition.md +24 -0
  15. data/docs/Details.md +22 -0
  16. data/docs/HomeApi.md +81 -0
  17. data/docs/IOTransactionsRESTAPIsApi.md +328 -0
  18. data/docs/Info.md +34 -0
  19. data/docs/InfoNotice.md +38 -0
  20. data/docs/InfoTransaction.md +26 -0
  21. data/docs/InfoTransactionView.md +38 -0
  22. data/docs/MBD.md +26 -0
  23. data/docs/MapEntry.md +20 -0
  24. data/docs/NoticeDetailResponse.md +20 -0
  25. data/docs/NoticeListItem.md +32 -0
  26. data/docs/NoticeListWrapResponse.md +18 -0
  27. data/docs/PageInfo.md +24 -0
  28. data/docs/PaidNoticeRESTAPIsApi.md +322 -0
  29. data/docs/Payer.md +36 -0
  30. data/docs/PaymentAuthorizationRequest.md +28 -0
  31. data/docs/PaymentInfo.md +50 -0
  32. data/docs/PaymentReceiptsRESTAPIsApi.md +161 -0
  33. data/docs/ProblemJson.md +22 -0
  34. data/docs/Psp.md +30 -0
  35. data/docs/Transaction.md +44 -0
  36. data/docs/TransactionDetailResponse.md +20 -0
  37. data/docs/TransactionDetails.md +28 -0
  38. data/docs/TransactionListItem.md +32 -0
  39. data/docs/TransactionListWrapResponse.md +20 -0
  40. data/docs/TransactionPsp.md +22 -0
  41. data/docs/Transfer.md +34 -0
  42. data/docs/TransferPA.md +32 -0
  43. data/docs/User.md +30 -0
  44. data/docs/UserDetail.md +20 -0
  45. data/docs/WalletInfo.md +24 -0
  46. data/docs/WalletItem.md +34 -0
  47. data/git_push.sh +57 -0
  48. data/lib/biz_api/api/biz_events_helpdesk_api.rb +156 -0
  49. data/lib/biz_api/api/home_api.rb +82 -0
  50. data/lib/biz_api/api/io_transactions_restapis_api.rb +334 -0
  51. data/lib/biz_api/api/paid_notice_restapis_api.rb +328 -0
  52. data/lib/biz_api/api/payment_receipts_restapis_api.rb +168 -0
  53. data/lib/biz_api/api_client.rb +394 -0
  54. data/lib/biz_api/api_error.rb +58 -0
  55. data/lib/biz_api/configuration.rb +333 -0
  56. data/lib/biz_api/models/app_info.rb +232 -0
  57. data/lib/biz_api/models/auth_request.rb +250 -0
  58. data/lib/biz_api/models/biz_event.rb +396 -0
  59. data/lib/biz_api/models/cart_item.rb +287 -0
  60. data/lib/biz_api/models/creditor.rb +250 -0
  61. data/lib/biz_api/models/ct_receipt_model_response.rb +552 -0
  62. data/lib/biz_api/models/debtor.rb +295 -0
  63. data/lib/biz_api/models/debtor_position.rb +241 -0
  64. data/lib/biz_api/models/details.rb +232 -0
  65. data/lib/biz_api/models/info.rb +286 -0
  66. data/lib/biz_api/models/info_notice.rb +392 -0
  67. data/lib/biz_api/models/info_transaction.rb +250 -0
  68. data/lib/biz_api/models/info_transaction_view.rb +350 -0
  69. data/lib/biz_api/models/map_entry.rb +223 -0
  70. data/lib/biz_api/models/mbd.rb +250 -0
  71. data/lib/biz_api/models/notice_detail_response.rb +225 -0
  72. data/lib/biz_api/models/notice_list_item.rb +326 -0
  73. data/lib/biz_api/models/notice_list_wrap_response.rb +223 -0
  74. data/lib/biz_api/models/page_info.rb +273 -0
  75. data/lib/biz_api/models/payer.rb +295 -0
  76. data/lib/biz_api/models/payment_authorization_request.rb +259 -0
  77. data/lib/biz_api/models/payment_info.rb +360 -0
  78. data/lib/biz_api/models/problem_json.rb +259 -0
  79. data/lib/biz_api/models/psp.rb +268 -0
  80. data/lib/biz_api/models/transaction.rb +331 -0
  81. data/lib/biz_api/models/transaction_detail_response.rb +225 -0
  82. data/lib/biz_api/models/transaction_details.rb +259 -0
  83. data/lib/biz_api/models/transaction_list_item.rb +277 -0
  84. data/lib/biz_api/models/transaction_list_wrap_response.rb +225 -0
  85. data/lib/biz_api/models/transaction_psp.rb +232 -0
  86. data/lib/biz_api/models/transfer.rb +288 -0
  87. data/lib/biz_api/models/transfer_pa.rb +345 -0
  88. data/lib/biz_api/models/user.rb +302 -0
  89. data/lib/biz_api/models/user_detail.rb +230 -0
  90. data/lib/biz_api/models/wallet_info.rb +241 -0
  91. data/lib/biz_api/models/wallet_item.rb +322 -0
  92. data/lib/biz_api/version.rb +15 -0
  93. data/lib/biz_api.rb +80 -0
  94. data/spec/api/biz_events_helpdesk_api_spec.rb +60 -0
  95. data/spec/api/home_api_spec.rb +47 -0
  96. data/spec/api/io_transactions_restapis_api_spec.rb +96 -0
  97. data/spec/api/paid_notice_restapis_api_spec.rb +93 -0
  98. data/spec/api/payment_receipts_restapis_api_spec.rb +62 -0
  99. data/spec/models/app_info_spec.rb +48 -0
  100. data/spec/models/auth_request_spec.rb +60 -0
  101. data/spec/models/biz_event_spec.rb +136 -0
  102. data/spec/models/cart_item_spec.rb +66 -0
  103. data/spec/models/creditor_spec.rb +60 -0
  104. data/spec/models/ct_receipt_model_response_spec.rb +198 -0
  105. data/spec/models/debtor_position_spec.rb +54 -0
  106. data/spec/models/debtor_spec.rb +90 -0
  107. data/spec/models/details_spec.rb +48 -0
  108. data/spec/models/info_notice_spec.rb +104 -0
  109. data/spec/models/info_spec.rb +84 -0
  110. data/spec/models/info_transaction_spec.rb +60 -0
  111. data/spec/models/info_transaction_view_spec.rb +104 -0
  112. data/spec/models/map_entry_spec.rb +42 -0
  113. data/spec/models/mbd_spec.rb +60 -0
  114. data/spec/models/notice_detail_response_spec.rb +42 -0
  115. data/spec/models/notice_list_item_spec.rb +78 -0
  116. data/spec/models/notice_list_wrap_response_spec.rb +36 -0
  117. data/spec/models/page_info_spec.rb +54 -0
  118. data/spec/models/payer_spec.rb +90 -0
  119. data/spec/models/payment_authorization_request_spec.rb +66 -0
  120. data/spec/models/payment_info_spec.rb +132 -0
  121. data/spec/models/problem_json_spec.rb +48 -0
  122. data/spec/models/psp_spec.rb +72 -0
  123. data/spec/models/transaction_detail_response_spec.rb +42 -0
  124. data/spec/models/transaction_details_spec.rb +66 -0
  125. data/spec/models/transaction_list_item_spec.rb +78 -0
  126. data/spec/models/transaction_list_wrap_response_spec.rb +42 -0
  127. data/spec/models/transaction_psp_spec.rb +48 -0
  128. data/spec/models/transaction_spec.rb +114 -0
  129. data/spec/models/transfer_pa_spec.rb +78 -0
  130. data/spec/models/transfer_spec.rb +84 -0
  131. data/spec/models/user_detail_spec.rb +42 -0
  132. data/spec/models/user_spec.rb +76 -0
  133. data/spec/models/wallet_info_spec.rb +54 -0
  134. data/spec/models/wallet_item_spec.rb +88 -0
  135. data/spec/spec_helper.rb +111 -0
  136. metadata +259 -0
@@ -0,0 +1,392 @@
1
+ =begin
2
+ #Biz-Events Service
3
+
4
+ #Microservice for exposing REST APIs about payment receipts.
5
+
6
+ The version of the OpenAPI document: 0.1.72
7
+
8
+ Generated by: https://openapi-generator.tech
9
+ Generator version: 7.11.0
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module BizReceipts
17
+ class InfoNotice
18
+ attr_accessor :event_id
19
+
20
+ attr_accessor :auth_code
21
+
22
+ attr_accessor :rrn
23
+
24
+ attr_accessor :notice_date
25
+
26
+ attr_accessor :psp_name
27
+
28
+ attr_accessor :wallet_info
29
+
30
+ attr_accessor :payment_method
31
+
32
+ attr_accessor :payer
33
+
34
+ attr_accessor :amount
35
+
36
+ attr_accessor :fee
37
+
38
+ attr_accessor :origin
39
+
40
+ class EnumAttributeValidator
41
+ attr_reader :datatype
42
+ attr_reader :allowable_values
43
+
44
+ def initialize(datatype, allowable_values)
45
+ @allowable_values = allowable_values.map do |value|
46
+ case datatype.to_s
47
+ when /Integer/i
48
+ value.to_i
49
+ when /Float/i
50
+ value.to_f
51
+ else
52
+ value
53
+ end
54
+ end
55
+ end
56
+
57
+ def valid?(value)
58
+ !value || allowable_values.include?(value)
59
+ end
60
+ end
61
+
62
+ # Attribute mapping from ruby-style variable name to JSON key.
63
+ def self.attribute_map
64
+ {
65
+ :'event_id' => :'eventId',
66
+ :'auth_code' => :'authCode',
67
+ :'rrn' => :'rrn',
68
+ :'notice_date' => :'noticeDate',
69
+ :'psp_name' => :'pspName',
70
+ :'wallet_info' => :'walletInfo',
71
+ :'payment_method' => :'paymentMethod',
72
+ :'payer' => :'payer',
73
+ :'amount' => :'amount',
74
+ :'fee' => :'fee',
75
+ :'origin' => :'origin'
76
+ }
77
+ end
78
+
79
+ # Returns all the JSON keys this model knows about
80
+ def self.acceptable_attributes
81
+ attribute_map.values
82
+ end
83
+
84
+ # Attribute type mapping.
85
+ def self.openapi_types
86
+ {
87
+ :'event_id' => :'String',
88
+ :'auth_code' => :'String',
89
+ :'rrn' => :'String',
90
+ :'notice_date' => :'String',
91
+ :'psp_name' => :'String',
92
+ :'wallet_info' => :'WalletInfo',
93
+ :'payment_method' => :'String',
94
+ :'payer' => :'UserDetail',
95
+ :'amount' => :'String',
96
+ :'fee' => :'String',
97
+ :'origin' => :'String'
98
+ }
99
+ end
100
+
101
+ # List of attributes with nullable: true
102
+ def self.openapi_nullable
103
+ Set.new([
104
+ ])
105
+ end
106
+
107
+ # Initializes the object
108
+ # @param [Hash] attributes Model attributes in the form of hash
109
+ def initialize(attributes = {})
110
+ if (!attributes.is_a?(Hash))
111
+ fail ArgumentError, "The input argument (attributes) must be a hash in `BizReceipts::InfoNotice` initialize method"
112
+ end
113
+
114
+ # check to see if the attribute exists and convert string to symbol for hash key
115
+ attributes = attributes.each_with_object({}) { |(k, v), h|
116
+ if (!self.class.attribute_map.key?(k.to_sym))
117
+ fail ArgumentError, "`#{k}` is not a valid attribute in `BizReceipts::InfoNotice`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
118
+ end
119
+ h[k.to_sym] = v
120
+ }
121
+
122
+ if attributes.key?(:'event_id')
123
+ self.event_id = attributes[:'event_id']
124
+ else
125
+ self.event_id = nil
126
+ end
127
+
128
+ if attributes.key?(:'auth_code')
129
+ self.auth_code = attributes[:'auth_code']
130
+ end
131
+
132
+ if attributes.key?(:'rrn')
133
+ self.rrn = attributes[:'rrn']
134
+ else
135
+ self.rrn = nil
136
+ end
137
+
138
+ if attributes.key?(:'notice_date')
139
+ self.notice_date = attributes[:'notice_date']
140
+ else
141
+ self.notice_date = nil
142
+ end
143
+
144
+ if attributes.key?(:'psp_name')
145
+ self.psp_name = attributes[:'psp_name']
146
+ else
147
+ self.psp_name = nil
148
+ end
149
+
150
+ if attributes.key?(:'wallet_info')
151
+ self.wallet_info = attributes[:'wallet_info']
152
+ end
153
+
154
+ if attributes.key?(:'payment_method')
155
+ self.payment_method = attributes[:'payment_method']
156
+ end
157
+
158
+ if attributes.key?(:'payer')
159
+ self.payer = attributes[:'payer']
160
+ end
161
+
162
+ if attributes.key?(:'amount')
163
+ self.amount = attributes[:'amount']
164
+ else
165
+ self.amount = nil
166
+ end
167
+
168
+ if attributes.key?(:'fee')
169
+ self.fee = attributes[:'fee']
170
+ end
171
+
172
+ if attributes.key?(:'origin')
173
+ self.origin = attributes[:'origin']
174
+ else
175
+ self.origin = nil
176
+ end
177
+ end
178
+
179
+ # Show invalid properties with the reasons. Usually used together with valid?
180
+ # @return Array for valid properties with the reasons
181
+ def list_invalid_properties
182
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
183
+ invalid_properties = Array.new
184
+ if @event_id.nil?
185
+ invalid_properties.push('invalid value for "event_id", event_id cannot be nil.')
186
+ end
187
+
188
+ if @rrn.nil?
189
+ invalid_properties.push('invalid value for "rrn", rrn cannot be nil.')
190
+ end
191
+
192
+ if @notice_date.nil?
193
+ invalid_properties.push('invalid value for "notice_date", notice_date cannot be nil.')
194
+ end
195
+
196
+ if @psp_name.nil?
197
+ invalid_properties.push('invalid value for "psp_name", psp_name cannot be nil.')
198
+ end
199
+
200
+ if @amount.nil?
201
+ invalid_properties.push('invalid value for "amount", amount cannot be nil.')
202
+ end
203
+
204
+ if @origin.nil?
205
+ invalid_properties.push('invalid value for "origin", origin cannot be nil.')
206
+ end
207
+
208
+ invalid_properties
209
+ end
210
+
211
+ # Check to see if the all the properties in the model are valid
212
+ # @return true if the model is valid
213
+ def valid?
214
+ warn '[DEPRECATED] the `valid?` method is obsolete'
215
+ return false if @event_id.nil?
216
+ return false if @rrn.nil?
217
+ return false if @notice_date.nil?
218
+ return false if @psp_name.nil?
219
+ payment_method_validator = EnumAttributeValidator.new('String', ["BBT", "BP", "AD", "CP", "PO", "OBEP", "JIF", "MYBK", "PPAL", "UNKNOWN"])
220
+ return false unless payment_method_validator.valid?(@payment_method)
221
+ return false if @amount.nil?
222
+ return false if @origin.nil?
223
+ origin_validator = EnumAttributeValidator.new('String', ["INTERNAL", "PM", "NDP001PROD", "NDP002PROD", "NDP003PROD", "UNKNOWN"])
224
+ return false unless origin_validator.valid?(@origin)
225
+ true
226
+ end
227
+
228
+ # Custom attribute writer method checking allowed values (enum).
229
+ # @param [Object] payment_method Object to be assigned
230
+ def payment_method=(payment_method)
231
+ validator = EnumAttributeValidator.new('String', ["BBT", "BP", "AD", "CP", "PO", "OBEP", "JIF", "MYBK", "PPAL", "UNKNOWN"])
232
+ unless validator.valid?(payment_method)
233
+ fail ArgumentError, "invalid value for \"payment_method\", must be one of #{validator.allowable_values}."
234
+ end
235
+ @payment_method = payment_method
236
+ end
237
+
238
+ # Custom attribute writer method checking allowed values (enum).
239
+ # @param [Object] origin Object to be assigned
240
+ def origin=(origin)
241
+ validator = EnumAttributeValidator.new('String', ["INTERNAL", "PM", "NDP001PROD", "NDP002PROD", "NDP003PROD", "UNKNOWN"])
242
+ unless validator.valid?(origin)
243
+ fail ArgumentError, "invalid value for \"origin\", must be one of #{validator.allowable_values}."
244
+ end
245
+ @origin = origin
246
+ end
247
+
248
+ # Checks equality by comparing each attribute.
249
+ # @param [Object] Object to be compared
250
+ def ==(o)
251
+ return true if self.equal?(o)
252
+ self.class == o.class &&
253
+ event_id == o.event_id &&
254
+ auth_code == o.auth_code &&
255
+ rrn == o.rrn &&
256
+ notice_date == o.notice_date &&
257
+ psp_name == o.psp_name &&
258
+ wallet_info == o.wallet_info &&
259
+ payment_method == o.payment_method &&
260
+ payer == o.payer &&
261
+ amount == o.amount &&
262
+ fee == o.fee &&
263
+ origin == o.origin
264
+ end
265
+
266
+ # @see the `==` method
267
+ # @param [Object] Object to be compared
268
+ def eql?(o)
269
+ self == o
270
+ end
271
+
272
+ # Calculates hash code according to all attributes.
273
+ # @return [Integer] Hash code
274
+ def hash
275
+ [event_id, auth_code, rrn, notice_date, psp_name, wallet_info, payment_method, payer, amount, fee, origin].hash
276
+ end
277
+
278
+ # Builds the object from hash
279
+ # @param [Hash] attributes Model attributes in the form of hash
280
+ # @return [Object] Returns the model itself
281
+ def self.build_from_hash(attributes)
282
+ return nil unless attributes.is_a?(Hash)
283
+ attributes = attributes.transform_keys(&:to_sym)
284
+ transformed_hash = {}
285
+ openapi_types.each_pair do |key, type|
286
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
287
+ transformed_hash["#{key}"] = nil
288
+ elsif type =~ /\AArray<(.*)>/i
289
+ # check to ensure the input is an array given that the attribute
290
+ # is documented as an array but the input is not
291
+ if attributes[attribute_map[key]].is_a?(Array)
292
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
293
+ end
294
+ elsif !attributes[attribute_map[key]].nil?
295
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
296
+ end
297
+ end
298
+ new(transformed_hash)
299
+ end
300
+
301
+ # Deserializes the data based on type
302
+ # @param string type Data type
303
+ # @param string value Value to be deserialized
304
+ # @return [Object] Deserialized data
305
+ def self._deserialize(type, value)
306
+ case type.to_sym
307
+ when :Time
308
+ Time.parse(value)
309
+ when :Date
310
+ Date.parse(value)
311
+ when :String
312
+ value.to_s
313
+ when :Integer
314
+ value.to_i
315
+ when :Float
316
+ value.to_f
317
+ when :Boolean
318
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
319
+ true
320
+ else
321
+ false
322
+ end
323
+ when :Object
324
+ # generic object (usually a Hash), return directly
325
+ value
326
+ when /\AArray<(?<inner_type>.+)>\z/
327
+ inner_type = Regexp.last_match[:inner_type]
328
+ value.map { |v| _deserialize(inner_type, v) }
329
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
330
+ k_type = Regexp.last_match[:k_type]
331
+ v_type = Regexp.last_match[:v_type]
332
+ {}.tap do |hash|
333
+ value.each do |k, v|
334
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
335
+ end
336
+ end
337
+ else # model
338
+ # models (e.g. Pet) or oneOf
339
+ klass = BizReceipts.const_get(type)
340
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
341
+ end
342
+ end
343
+
344
+ # Returns the string representation of the object
345
+ # @return [String] String presentation of the object
346
+ def to_s
347
+ to_hash.to_s
348
+ end
349
+
350
+ # to_body is an alias to to_hash (backward compatibility)
351
+ # @return [Hash] Returns the object in the form of hash
352
+ def to_body
353
+ to_hash
354
+ end
355
+
356
+ # Returns the object in the form of hash
357
+ # @return [Hash] Returns the object in the form of hash
358
+ def to_hash
359
+ hash = {}
360
+ self.class.attribute_map.each_pair do |attr, param|
361
+ value = self.send(attr)
362
+ if value.nil?
363
+ is_nullable = self.class.openapi_nullable.include?(attr)
364
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
365
+ end
366
+
367
+ hash[param] = _to_hash(value)
368
+ end
369
+ hash
370
+ end
371
+
372
+ # Outputs non-array value in the form of hash
373
+ # For object, use to_hash. Otherwise, just return the value
374
+ # @param [Object] value Any valid value
375
+ # @return [Hash] Returns the value in the form of hash
376
+ def _to_hash(value)
377
+ if value.is_a?(Array)
378
+ value.compact.map { |v| _to_hash(v) }
379
+ elsif value.is_a?(Hash)
380
+ {}.tap do |hash|
381
+ value.each { |k, v| hash[k] = _to_hash(v) }
382
+ end
383
+ elsif value.respond_to? :to_hash
384
+ value.to_hash
385
+ else
386
+ value
387
+ end
388
+ end
389
+
390
+ end
391
+
392
+ end
@@ -0,0 +1,250 @@
1
+ =begin
2
+ #Biz-Events Service
3
+
4
+ #Microservice for exposing REST APIs about payment receipts.
5
+
6
+ The version of the OpenAPI document: 0.1.72
7
+
8
+ Generated by: https://openapi-generator.tech
9
+ Generator version: 7.11.0
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module BizReceipts
17
+ class InfoTransaction
18
+ attr_accessor :brand
19
+
20
+ attr_accessor :brand_logo
21
+
22
+ attr_accessor :client_id
23
+
24
+ attr_accessor :payment_method_name
25
+
26
+ attr_accessor :type
27
+
28
+ # Attribute mapping from ruby-style variable name to JSON key.
29
+ def self.attribute_map
30
+ {
31
+ :'brand' => :'brand',
32
+ :'brand_logo' => :'brandLogo',
33
+ :'client_id' => :'clientId',
34
+ :'payment_method_name' => :'paymentMethodName',
35
+ :'type' => :'type'
36
+ }
37
+ end
38
+
39
+ # Returns all the JSON keys this model knows about
40
+ def self.acceptable_attributes
41
+ attribute_map.values
42
+ end
43
+
44
+ # Attribute type mapping.
45
+ def self.openapi_types
46
+ {
47
+ :'brand' => :'String',
48
+ :'brand_logo' => :'String',
49
+ :'client_id' => :'String',
50
+ :'payment_method_name' => :'String',
51
+ :'type' => :'String'
52
+ }
53
+ end
54
+
55
+ # List of attributes with nullable: true
56
+ def self.openapi_nullable
57
+ Set.new([
58
+ ])
59
+ end
60
+
61
+ # Initializes the object
62
+ # @param [Hash] attributes Model attributes in the form of hash
63
+ def initialize(attributes = {})
64
+ if (!attributes.is_a?(Hash))
65
+ fail ArgumentError, "The input argument (attributes) must be a hash in `BizReceipts::InfoTransaction` initialize method"
66
+ end
67
+
68
+ # check to see if the attribute exists and convert string to symbol for hash key
69
+ attributes = attributes.each_with_object({}) { |(k, v), h|
70
+ if (!self.class.attribute_map.key?(k.to_sym))
71
+ fail ArgumentError, "`#{k}` is not a valid attribute in `BizReceipts::InfoTransaction`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
72
+ end
73
+ h[k.to_sym] = v
74
+ }
75
+
76
+ if attributes.key?(:'brand')
77
+ self.brand = attributes[:'brand']
78
+ end
79
+
80
+ if attributes.key?(:'brand_logo')
81
+ self.brand_logo = attributes[:'brand_logo']
82
+ end
83
+
84
+ if attributes.key?(:'client_id')
85
+ self.client_id = attributes[:'client_id']
86
+ end
87
+
88
+ if attributes.key?(:'payment_method_name')
89
+ self.payment_method_name = attributes[:'payment_method_name']
90
+ end
91
+
92
+ if attributes.key?(:'type')
93
+ self.type = attributes[:'type']
94
+ end
95
+ end
96
+
97
+ # Show invalid properties with the reasons. Usually used together with valid?
98
+ # @return Array for valid properties with the reasons
99
+ def list_invalid_properties
100
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
101
+ invalid_properties = Array.new
102
+ invalid_properties
103
+ end
104
+
105
+ # Check to see if the all the properties in the model are valid
106
+ # @return true if the model is valid
107
+ def valid?
108
+ warn '[DEPRECATED] the `valid?` method is obsolete'
109
+ true
110
+ end
111
+
112
+ # Checks equality by comparing each attribute.
113
+ # @param [Object] Object to be compared
114
+ def ==(o)
115
+ return true if self.equal?(o)
116
+ self.class == o.class &&
117
+ brand == o.brand &&
118
+ brand_logo == o.brand_logo &&
119
+ client_id == o.client_id &&
120
+ payment_method_name == o.payment_method_name &&
121
+ type == o.type
122
+ end
123
+
124
+ # @see the `==` method
125
+ # @param [Object] Object to be compared
126
+ def eql?(o)
127
+ self == o
128
+ end
129
+
130
+ # Calculates hash code according to all attributes.
131
+ # @return [Integer] Hash code
132
+ def hash
133
+ [brand, brand_logo, client_id, payment_method_name, type].hash
134
+ end
135
+
136
+ # Builds the object from hash
137
+ # @param [Hash] attributes Model attributes in the form of hash
138
+ # @return [Object] Returns the model itself
139
+ def self.build_from_hash(attributes)
140
+ return nil unless attributes.is_a?(Hash)
141
+ attributes = attributes.transform_keys(&:to_sym)
142
+ transformed_hash = {}
143
+ openapi_types.each_pair do |key, type|
144
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
145
+ transformed_hash["#{key}"] = nil
146
+ elsif type =~ /\AArray<(.*)>/i
147
+ # check to ensure the input is an array given that the attribute
148
+ # is documented as an array but the input is not
149
+ if attributes[attribute_map[key]].is_a?(Array)
150
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
151
+ end
152
+ elsif !attributes[attribute_map[key]].nil?
153
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
154
+ end
155
+ end
156
+ new(transformed_hash)
157
+ end
158
+
159
+ # Deserializes the data based on type
160
+ # @param string type Data type
161
+ # @param string value Value to be deserialized
162
+ # @return [Object] Deserialized data
163
+ def self._deserialize(type, value)
164
+ case type.to_sym
165
+ when :Time
166
+ Time.parse(value)
167
+ when :Date
168
+ Date.parse(value)
169
+ when :String
170
+ value.to_s
171
+ when :Integer
172
+ value.to_i
173
+ when :Float
174
+ value.to_f
175
+ when :Boolean
176
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
177
+ true
178
+ else
179
+ false
180
+ end
181
+ when :Object
182
+ # generic object (usually a Hash), return directly
183
+ value
184
+ when /\AArray<(?<inner_type>.+)>\z/
185
+ inner_type = Regexp.last_match[:inner_type]
186
+ value.map { |v| _deserialize(inner_type, v) }
187
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
188
+ k_type = Regexp.last_match[:k_type]
189
+ v_type = Regexp.last_match[:v_type]
190
+ {}.tap do |hash|
191
+ value.each do |k, v|
192
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
193
+ end
194
+ end
195
+ else # model
196
+ # models (e.g. Pet) or oneOf
197
+ klass = BizReceipts.const_get(type)
198
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
199
+ end
200
+ end
201
+
202
+ # Returns the string representation of the object
203
+ # @return [String] String presentation of the object
204
+ def to_s
205
+ to_hash.to_s
206
+ end
207
+
208
+ # to_body is an alias to to_hash (backward compatibility)
209
+ # @return [Hash] Returns the object in the form of hash
210
+ def to_body
211
+ to_hash
212
+ end
213
+
214
+ # Returns the object in the form of hash
215
+ # @return [Hash] Returns the object in the form of hash
216
+ def to_hash
217
+ hash = {}
218
+ self.class.attribute_map.each_pair do |attr, param|
219
+ value = self.send(attr)
220
+ if value.nil?
221
+ is_nullable = self.class.openapi_nullable.include?(attr)
222
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
223
+ end
224
+
225
+ hash[param] = _to_hash(value)
226
+ end
227
+ hash
228
+ end
229
+
230
+ # Outputs non-array value in the form of hash
231
+ # For object, use to_hash. Otherwise, just return the value
232
+ # @param [Object] value Any valid value
233
+ # @return [Hash] Returns the value in the form of hash
234
+ def _to_hash(value)
235
+ if value.is_a?(Array)
236
+ value.compact.map { |v| _to_hash(v) }
237
+ elsif value.is_a?(Hash)
238
+ {}.tap do |hash|
239
+ value.each { |k, v| hash[k] = _to_hash(v) }
240
+ end
241
+ elsif value.respond_to? :to_hash
242
+ value.to_hash
243
+ else
244
+ value
245
+ end
246
+ end
247
+
248
+ end
249
+
250
+ end