fuse_client 1.0.33 → 1.0.34

Sign up to get free protection for your applications and to get access to all the features.
Files changed (126) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile.lock +2 -2
  3. data/README.md +6 -1
  4. data/docs/AddAccountEventsRequest.md +18 -0
  5. data/docs/AddAccountEventsRequestEventsInner.md +51 -0
  6. data/docs/{AddSpendPowerTransactionResponse.md → AddAccountEventsResponse.md} +2 -2
  7. data/docs/AssetReportTransaction.md +1 -1
  8. data/docs/CreateSessionRequest.md +1 -1
  9. data/docs/CreateSpendPowerCustomizationRequest.md +22 -0
  10. data/docs/CreateSpendPowerRequest.md +5 -5
  11. data/docs/CreateSpendPowerResponse.md +1 -1
  12. data/docs/DeleteSpendPowerResponse.md +2 -2
  13. data/docs/EnrichTransactionsRequest.md +18 -0
  14. data/docs/EnrichTransactionsResponse.md +18 -0
  15. data/docs/EnrichedTransaction.md +46 -0
  16. data/docs/EnrichedTransactionLogo.md +18 -0
  17. data/docs/EvalSpendPowerRequest.md +22 -0
  18. data/docs/EvalSpendPowerRequestEventsInner.md +20 -0
  19. data/docs/EvalSpendPowerResponse.md +20 -0
  20. data/docs/ExternalTransactionEvent.md +36 -0
  21. data/docs/ExternalTransactionEventStatus.md +15 -0
  22. data/docs/FinancialConnectionsAccountBalance.md +2 -2
  23. data/docs/FinancialConnectionsAccountCachedBalance.md +2 -2
  24. data/docs/FinancialConnectionsHolding.md +3 -3
  25. data/docs/FinancialConnectionsInvestmentSecurity.md +1 -1
  26. data/docs/FinancialConnectionsInvestmentTransaction.md +5 -3
  27. data/docs/FinancialConnectionsInvestmentTransactionSubtype.md +15 -0
  28. data/docs/FuseApi.md +193 -35
  29. data/docs/GetFinanceScoreResponse.md +20 -0
  30. data/docs/GetInvestmentTransactionsRequest.md +4 -4
  31. data/docs/GetSpendPowerCustomizationResponse.md +20 -0
  32. data/docs/InAppTransactionEvent.md +34 -0
  33. data/docs/InAppTransactionEventStatus.md +15 -0
  34. data/docs/SpendPower.md +6 -6
  35. data/docs/SpendPowerApi.md +87 -44
  36. data/docs/SpendPowerCustomization.md +5 -3
  37. data/docs/SpendPowerTimeFrame.md +15 -0
  38. data/docs/Transaction.md +1 -1
  39. data/docs/TransactionCategory.md +20 -0
  40. data/docs/TransactionCategoryDetailed.md +15 -0
  41. data/docs/TransactionCategoryPrimary.md +15 -0
  42. data/docs/TransactionEventType.md +15 -0
  43. data/docs/TransactionToEnrich.md +26 -0
  44. data/docs/UpdateSpendPowerCustomizationRequest.md +22 -0
  45. data/docs/UpdatedBalanceEvent.md +26 -0
  46. data/lib/fuse_client/api/fuse_api.rb +176 -31
  47. data/lib/fuse_client/api/spend_power_api.rb +78 -52
  48. data/lib/fuse_client/models/add_account_events_request.rb +254 -0
  49. data/lib/fuse_client/models/add_account_events_request_events_inner.rb +106 -0
  50. data/lib/fuse_client/models/{add_spend_power_transaction_response.rb → add_account_events_response.rb} +3 -3
  51. data/lib/fuse_client/models/asset_report_transaction.rb +1 -1
  52. data/lib/fuse_client/models/country_code.rb +2 -1
  53. data/lib/fuse_client/models/create_session_request.rb +1 -1
  54. data/lib/fuse_client/models/create_spend_power_customization_request.rb +314 -0
  55. data/lib/fuse_client/models/create_spend_power_request.rb +22 -22
  56. data/lib/fuse_client/models/create_spend_power_response.rb +1 -1
  57. data/lib/fuse_client/models/delete_spend_power_response.rb +11 -10
  58. data/lib/fuse_client/models/enrich_transactions_request.rb +226 -0
  59. data/lib/fuse_client/models/enrich_transactions_response.rb +222 -0
  60. data/lib/fuse_client/models/enriched_transaction.rb +397 -0
  61. data/lib/fuse_client/models/enriched_transaction_logo.rb +220 -0
  62. data/lib/fuse_client/models/eval_spend_power_request.rb +296 -0
  63. data/lib/fuse_client/models/eval_spend_power_request_events_inner.rb +239 -0
  64. data/lib/fuse_client/models/eval_spend_power_response.rb +230 -0
  65. data/lib/fuse_client/models/external_transaction_event.rb +384 -0
  66. data/lib/fuse_client/models/external_transaction_event_status.rb +40 -0
  67. data/lib/fuse_client/models/financial_connections_account_balance.rb +2 -2
  68. data/lib/fuse_client/models/financial_connections_account_cached_balance.rb +2 -2
  69. data/lib/fuse_client/models/financial_connections_holding.rb +3 -3
  70. data/lib/fuse_client/models/financial_connections_investment_security.rb +1 -1
  71. data/lib/fuse_client/models/financial_connections_investment_transaction.rb +13 -4
  72. data/lib/fuse_client/models/financial_connections_investment_transaction_subtype.rb +87 -0
  73. data/lib/fuse_client/models/fuse_api_error_code.rb +3 -1
  74. data/lib/fuse_client/models/get_finance_score_response.rb +240 -0
  75. data/lib/fuse_client/models/get_investment_transactions_request.rb +37 -9
  76. data/lib/fuse_client/models/get_spend_power_customization_response.rb +239 -0
  77. data/lib/fuse_client/models/in_app_transaction_event.rb +364 -0
  78. data/lib/fuse_client/models/in_app_transaction_event_status.rb +41 -0
  79. data/lib/fuse_client/models/spend_power.rb +18 -18
  80. data/lib/fuse_client/models/spend_power_customization.rb +54 -14
  81. data/lib/fuse_client/models/spend_power_time_frame.rb +41 -0
  82. data/lib/fuse_client/models/transaction.rb +1 -1
  83. data/lib/fuse_client/models/transaction_category.rb +260 -0
  84. data/lib/fuse_client/models/transaction_category_detailed.rb +135 -0
  85. data/lib/fuse_client/models/transaction_category_primary.rb +59 -0
  86. data/lib/fuse_client/models/transaction_event_type.rb +65 -0
  87. data/lib/fuse_client/models/{add_spend_power_transaction_request.rb → transaction_to_enrich.rb} +47 -27
  88. data/lib/fuse_client/models/update_spend_power_customization_request.rb +291 -0
  89. data/lib/fuse_client/models/updated_balance_event.rb +308 -0
  90. data/lib/fuse_client/version.rb +1 -1
  91. data/lib/fuse_client.rb +26 -2
  92. data/spec/api/fuse_api_spec.rb +33 -7
  93. data/spec/api/spend_power_api_spec.rb +14 -17
  94. data/spec/models/add_account_events_request_events_inner_spec.rb +31 -0
  95. data/spec/models/add_account_events_request_spec.rb +34 -0
  96. data/spec/models/{add_spend_power_transaction_response_spec.rb → add_account_events_response_spec.rb} +6 -6
  97. data/spec/models/create_spend_power_customization_request_spec.rb +46 -0
  98. data/spec/models/create_spend_power_request_spec.rb +2 -2
  99. data/spec/models/delete_spend_power_response_spec.rb +1 -1
  100. data/spec/models/enrich_transactions_request_spec.rb +34 -0
  101. data/spec/models/enrich_transactions_response_spec.rb +34 -0
  102. data/spec/models/enriched_transaction_logo_spec.rb +34 -0
  103. data/spec/models/enriched_transaction_spec.rb +122 -0
  104. data/spec/models/eval_spend_power_request_events_inner_spec.rb +40 -0
  105. data/spec/models/eval_spend_power_request_spec.rb +46 -0
  106. data/spec/models/eval_spend_power_response_spec.rb +40 -0
  107. data/spec/models/external_transaction_event_spec.rb +92 -0
  108. data/spec/models/external_transaction_event_status_spec.rb +28 -0
  109. data/spec/models/financial_connections_investment_transaction_spec.rb +6 -0
  110. data/spec/models/financial_connections_investment_transaction_subtype_spec.rb +28 -0
  111. data/spec/models/get_finance_score_response_spec.rb +40 -0
  112. data/spec/models/get_spend_power_customization_response_spec.rb +40 -0
  113. data/spec/models/in_app_transaction_event_spec.rb +86 -0
  114. data/spec/models/in_app_transaction_event_status_spec.rb +28 -0
  115. data/spec/models/spend_power_customization_spec.rb +6 -4
  116. data/spec/models/spend_power_spec.rb +1 -1
  117. data/spec/models/spend_power_time_frame_spec.rb +28 -0
  118. data/spec/models/transaction_category_detailed_spec.rb +28 -0
  119. data/spec/models/transaction_category_primary_spec.rb +28 -0
  120. data/spec/models/transaction_category_spec.rb +40 -0
  121. data/spec/models/transaction_event_type_spec.rb +28 -0
  122. data/spec/models/{add_spend_power_transaction_request_spec.rb → transaction_to_enrich_spec.rb} +23 -11
  123. data/spec/models/update_spend_power_customization_request_spec.rb +46 -0
  124. data/spec/models/updated_balance_event_spec.rb +62 -0
  125. metadata +106 -10
  126. data/docs/AddSpendPowerTransactionRequest.md +0 -22
@@ -0,0 +1,397 @@
1
+ =begin
2
+ #Fuse
3
+
4
+ #No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
5
+
6
+ The version of the OpenAPI document: 1.0.0
7
+
8
+ Generated by: https://openapi-generator.tech
9
+ OpenAPI Generator version: 6.5.0
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module FuseClient
17
+ class EnrichedTransaction
18
+ # A original ID for the transaction that to help you tie data back to your systems.
19
+ attr_accessor :id
20
+
21
+ # The original or enhanced name of the merchant.
22
+ attr_accessor :name
23
+
24
+ attr_accessor :logo
25
+
26
+ # The amount of the transaction in cents, in the currency of the account.
27
+ attr_accessor :amount
28
+
29
+ attr_accessor :category
30
+
31
+ # Whether the transaction is a bill pay.
32
+ attr_accessor :is_bill_pay
33
+
34
+ # Whether the transaction is a direct deposit.
35
+ attr_accessor :is_direct_deposit
36
+
37
+ # Whether the transaction is a an expense
38
+ attr_accessor :is_expense
39
+
40
+ # Whether the transaction is a fee.
41
+ attr_accessor :is_fee
42
+
43
+ # Whether the transaction is income.
44
+ attr_accessor :is_income
45
+
46
+ # Whether the transaction is international.
47
+ attr_accessor :is_international
48
+
49
+ # This indicates whether the transaction represents an overdraft fee.
50
+ attr_accessor :is_overdraft_fee
51
+
52
+ # Whether the transaction is a payroll advance.
53
+ attr_accessor :is_payroll_advance
54
+
55
+ # Whether the transaction is a subscription.
56
+ attr_accessor :is_subscription
57
+
58
+ # The type of transaction
59
+ attr_accessor :type
60
+
61
+ class EnumAttributeValidator
62
+ attr_reader :datatype
63
+ attr_reader :allowable_values
64
+
65
+ def initialize(datatype, allowable_values)
66
+ @allowable_values = allowable_values.map do |value|
67
+ case datatype.to_s
68
+ when /Integer/i
69
+ value.to_i
70
+ when /Float/i
71
+ value.to_f
72
+ else
73
+ value
74
+ end
75
+ end
76
+ end
77
+
78
+ def valid?(value)
79
+ !value || allowable_values.include?(value)
80
+ end
81
+ end
82
+
83
+ # Attribute mapping from ruby-style variable name to JSON key.
84
+ def self.attribute_map
85
+ {
86
+ :'id' => :'id',
87
+ :'name' => :'name',
88
+ :'logo' => :'logo',
89
+ :'amount' => :'amount',
90
+ :'category' => :'category',
91
+ :'is_bill_pay' => :'is_bill_pay',
92
+ :'is_direct_deposit' => :'is_direct_deposit',
93
+ :'is_expense' => :'is_expense',
94
+ :'is_fee' => :'is_fee',
95
+ :'is_income' => :'is_income',
96
+ :'is_international' => :'is_international',
97
+ :'is_overdraft_fee' => :'is_overdraft_fee',
98
+ :'is_payroll_advance' => :'is_payroll_advance',
99
+ :'is_subscription' => :'is_subscription',
100
+ :'type' => :'type'
101
+ }
102
+ end
103
+
104
+ # Returns all the JSON keys this model knows about
105
+ def self.acceptable_attributes
106
+ attribute_map.values
107
+ end
108
+
109
+ # Attribute type mapping.
110
+ def self.openapi_types
111
+ {
112
+ :'id' => :'String',
113
+ :'name' => :'String',
114
+ :'logo' => :'EnrichedTransactionLogo',
115
+ :'amount' => :'Float',
116
+ :'category' => :'TransactionCategory',
117
+ :'is_bill_pay' => :'Boolean',
118
+ :'is_direct_deposit' => :'Boolean',
119
+ :'is_expense' => :'Boolean',
120
+ :'is_fee' => :'Boolean',
121
+ :'is_income' => :'Boolean',
122
+ :'is_international' => :'Boolean',
123
+ :'is_overdraft_fee' => :'Boolean',
124
+ :'is_payroll_advance' => :'Boolean',
125
+ :'is_subscription' => :'Boolean',
126
+ :'type' => :'String'
127
+ }
128
+ end
129
+
130
+ # List of attributes with nullable: true
131
+ def self.openapi_nullable
132
+ Set.new([
133
+ ])
134
+ end
135
+
136
+ # Initializes the object
137
+ # @param [Hash] attributes Model attributes in the form of hash
138
+ def initialize(attributes = {})
139
+ if (!attributes.is_a?(Hash))
140
+ fail ArgumentError, "The input argument (attributes) must be a hash in `FuseClient::EnrichedTransaction` initialize method"
141
+ end
142
+
143
+ # check to see if the attribute exists and convert string to symbol for hash key
144
+ attributes = attributes.each_with_object({}) { |(k, v), h|
145
+ if (!self.class.attribute_map.key?(k.to_sym))
146
+ fail ArgumentError, "`#{k}` is not a valid attribute in `FuseClient::EnrichedTransaction`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
147
+ end
148
+ h[k.to_sym] = v
149
+ }
150
+
151
+ if attributes.key?(:'id')
152
+ self.id = attributes[:'id']
153
+ end
154
+
155
+ if attributes.key?(:'name')
156
+ self.name = attributes[:'name']
157
+ end
158
+
159
+ if attributes.key?(:'logo')
160
+ self.logo = attributes[:'logo']
161
+ end
162
+
163
+ if attributes.key?(:'amount')
164
+ self.amount = attributes[:'amount']
165
+ end
166
+
167
+ if attributes.key?(:'category')
168
+ self.category = attributes[:'category']
169
+ end
170
+
171
+ if attributes.key?(:'is_bill_pay')
172
+ self.is_bill_pay = attributes[:'is_bill_pay']
173
+ end
174
+
175
+ if attributes.key?(:'is_direct_deposit')
176
+ self.is_direct_deposit = attributes[:'is_direct_deposit']
177
+ end
178
+
179
+ if attributes.key?(:'is_expense')
180
+ self.is_expense = attributes[:'is_expense']
181
+ end
182
+
183
+ if attributes.key?(:'is_fee')
184
+ self.is_fee = attributes[:'is_fee']
185
+ end
186
+
187
+ if attributes.key?(:'is_income')
188
+ self.is_income = attributes[:'is_income']
189
+ end
190
+
191
+ if attributes.key?(:'is_international')
192
+ self.is_international = attributes[:'is_international']
193
+ end
194
+
195
+ if attributes.key?(:'is_overdraft_fee')
196
+ self.is_overdraft_fee = attributes[:'is_overdraft_fee']
197
+ end
198
+
199
+ if attributes.key?(:'is_payroll_advance')
200
+ self.is_payroll_advance = attributes[:'is_payroll_advance']
201
+ end
202
+
203
+ if attributes.key?(:'is_subscription')
204
+ self.is_subscription = attributes[:'is_subscription']
205
+ end
206
+
207
+ if attributes.key?(:'type')
208
+ self.type = attributes[:'type']
209
+ end
210
+ end
211
+
212
+ # Show invalid properties with the reasons. Usually used together with valid?
213
+ # @return Array for valid properties with the reasons
214
+ def list_invalid_properties
215
+ invalid_properties = Array.new
216
+ if @id.nil?
217
+ invalid_properties.push('invalid value for "id", id cannot be nil.')
218
+ end
219
+
220
+ invalid_properties
221
+ end
222
+
223
+ # Check to see if the all the properties in the model are valid
224
+ # @return true if the model is valid
225
+ def valid?
226
+ return false if @id.nil?
227
+ type_validator = EnumAttributeValidator.new('String', ["debit", "credit"])
228
+ return false unless type_validator.valid?(@type)
229
+ true
230
+ end
231
+
232
+ # Custom attribute writer method checking allowed values (enum).
233
+ # @param [Object] type Object to be assigned
234
+ def type=(type)
235
+ validator = EnumAttributeValidator.new('String', ["debit", "credit"])
236
+ unless validator.valid?(type)
237
+ fail ArgumentError, "invalid value for \"type\", must be one of #{validator.allowable_values}."
238
+ end
239
+ @type = type
240
+ end
241
+
242
+ # Checks equality by comparing each attribute.
243
+ # @param [Object] Object to be compared
244
+ def ==(o)
245
+ return true if self.equal?(o)
246
+ self.class == o.class &&
247
+ id == o.id &&
248
+ name == o.name &&
249
+ logo == o.logo &&
250
+ amount == o.amount &&
251
+ category == o.category &&
252
+ is_bill_pay == o.is_bill_pay &&
253
+ is_direct_deposit == o.is_direct_deposit &&
254
+ is_expense == o.is_expense &&
255
+ is_fee == o.is_fee &&
256
+ is_income == o.is_income &&
257
+ is_international == o.is_international &&
258
+ is_overdraft_fee == o.is_overdraft_fee &&
259
+ is_payroll_advance == o.is_payroll_advance &&
260
+ is_subscription == o.is_subscription &&
261
+ type == o.type
262
+ end
263
+
264
+ # @see the `==` method
265
+ # @param [Object] Object to be compared
266
+ def eql?(o)
267
+ self == o
268
+ end
269
+
270
+ # Calculates hash code according to all attributes.
271
+ # @return [Integer] Hash code
272
+ def hash
273
+ [id, name, logo, amount, category, is_bill_pay, is_direct_deposit, is_expense, is_fee, is_income, is_international, is_overdraft_fee, is_payroll_advance, is_subscription, type].hash
274
+ end
275
+
276
+ # Builds the object from hash
277
+ # @param [Hash] attributes Model attributes in the form of hash
278
+ # @return [Object] Returns the model itself
279
+ def self.build_from_hash(attributes)
280
+ new.build_from_hash(attributes)
281
+ end
282
+
283
+ # Builds the object from hash
284
+ # @param [Hash] attributes Model attributes in the form of hash
285
+ # @return [Object] Returns the model itself
286
+ def build_from_hash(attributes)
287
+ return nil unless attributes.is_a?(Hash)
288
+ attributes = attributes.transform_keys(&:to_sym)
289
+ self.class.openapi_types.each_pair do |key, type|
290
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
291
+ self.send("#{key}=", nil)
292
+ elsif type =~ /\AArray<(.*)>/i
293
+ # check to ensure the input is an array given that the attribute
294
+ # is documented as an array but the input is not
295
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
296
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
297
+ end
298
+ elsif !attributes[self.class.attribute_map[key]].nil?
299
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
300
+ end
301
+ end
302
+
303
+ self
304
+ end
305
+
306
+ # Deserializes the data based on type
307
+ # @param string type Data type
308
+ # @param string value Value to be deserialized
309
+ # @return [Object] Deserialized data
310
+ def _deserialize(type, value)
311
+ case type.to_sym
312
+ when :Time
313
+ Time.parse(value)
314
+ when :Date
315
+ Date.parse(value)
316
+ when :String
317
+ value.to_s
318
+ when :Integer
319
+ value.to_i
320
+ when :Float
321
+ value.to_f
322
+ when :Boolean
323
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
324
+ true
325
+ else
326
+ false
327
+ end
328
+ when :Object
329
+ # generic object (usually a Hash), return directly
330
+ value
331
+ when /\AArray<(?<inner_type>.+)>\z/
332
+ inner_type = Regexp.last_match[:inner_type]
333
+ value.map { |v| _deserialize(inner_type, v) }
334
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
335
+ k_type = Regexp.last_match[:k_type]
336
+ v_type = Regexp.last_match[:v_type]
337
+ {}.tap do |hash|
338
+ value.each do |k, v|
339
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
340
+ end
341
+ end
342
+ else # model
343
+ # models (e.g. Pet) or oneOf
344
+ klass = FuseClient.const_get(type)
345
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
346
+ end
347
+ end
348
+
349
+ # Returns the string representation of the object
350
+ # @return [String] String presentation of the object
351
+ def to_s
352
+ to_hash.to_s
353
+ end
354
+
355
+ # to_body is an alias to to_hash (backward compatibility)
356
+ # @return [Hash] Returns the object in the form of hash
357
+ def to_body
358
+ to_hash
359
+ end
360
+
361
+ # Returns the object in the form of hash
362
+ # @return [Hash] Returns the object in the form of hash
363
+ def to_hash
364
+ hash = {}
365
+ self.class.attribute_map.each_pair do |attr, param|
366
+ value = self.send(attr)
367
+ if value.nil?
368
+ is_nullable = self.class.openapi_nullable.include?(attr)
369
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
370
+ end
371
+
372
+ hash[param] = _to_hash(value)
373
+ end
374
+ hash
375
+ end
376
+
377
+ # Outputs non-array value in the form of hash
378
+ # For object, use to_hash. Otherwise, just return the value
379
+ # @param [Object] value Any valid value
380
+ # @return [Hash] Returns the value in the form of hash
381
+ def _to_hash(value)
382
+ if value.is_a?(Array)
383
+ value.compact.map { |v| _to_hash(v) }
384
+ elsif value.is_a?(Hash)
385
+ {}.tap do |hash|
386
+ value.each { |k, v| hash[k] = _to_hash(v) }
387
+ end
388
+ elsif value.respond_to? :to_hash
389
+ value.to_hash
390
+ else
391
+ value
392
+ end
393
+ end
394
+
395
+ end
396
+
397
+ end
@@ -0,0 +1,220 @@
1
+ =begin
2
+ #Fuse
3
+
4
+ #No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
5
+
6
+ The version of the OpenAPI document: 1.0.0
7
+
8
+ Generated by: https://openapi-generator.tech
9
+ OpenAPI Generator version: 6.5.0
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module FuseClient
17
+ class EnrichedTransactionLogo
18
+ # The URL of the logo.
19
+ attr_accessor :url
20
+
21
+ # Attribute mapping from ruby-style variable name to JSON key.
22
+ def self.attribute_map
23
+ {
24
+ :'url' => :'url'
25
+ }
26
+ end
27
+
28
+ # Returns all the JSON keys this model knows about
29
+ def self.acceptable_attributes
30
+ attribute_map.values
31
+ end
32
+
33
+ # Attribute type mapping.
34
+ def self.openapi_types
35
+ {
36
+ :'url' => :'String'
37
+ }
38
+ end
39
+
40
+ # List of attributes with nullable: true
41
+ def self.openapi_nullable
42
+ Set.new([
43
+ ])
44
+ end
45
+
46
+ # Initializes the object
47
+ # @param [Hash] attributes Model attributes in the form of hash
48
+ def initialize(attributes = {})
49
+ if (!attributes.is_a?(Hash))
50
+ fail ArgumentError, "The input argument (attributes) must be a hash in `FuseClient::EnrichedTransactionLogo` initialize method"
51
+ end
52
+
53
+ # check to see if the attribute exists and convert string to symbol for hash key
54
+ attributes = attributes.each_with_object({}) { |(k, v), h|
55
+ if (!self.class.attribute_map.key?(k.to_sym))
56
+ fail ArgumentError, "`#{k}` is not a valid attribute in `FuseClient::EnrichedTransactionLogo`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
57
+ end
58
+ h[k.to_sym] = v
59
+ }
60
+
61
+ if attributes.key?(:'url')
62
+ self.url = attributes[:'url']
63
+ end
64
+ end
65
+
66
+ # Show invalid properties with the reasons. Usually used together with valid?
67
+ # @return Array for valid properties with the reasons
68
+ def list_invalid_properties
69
+ invalid_properties = Array.new
70
+ invalid_properties
71
+ end
72
+
73
+ # Check to see if the all the properties in the model are valid
74
+ # @return true if the model is valid
75
+ def valid?
76
+ true
77
+ end
78
+
79
+ # Checks equality by comparing each attribute.
80
+ # @param [Object] Object to be compared
81
+ def ==(o)
82
+ return true if self.equal?(o)
83
+ self.class == o.class &&
84
+ url == o.url
85
+ end
86
+
87
+ # @see the `==` method
88
+ # @param [Object] Object to be compared
89
+ def eql?(o)
90
+ self == o
91
+ end
92
+
93
+ # Calculates hash code according to all attributes.
94
+ # @return [Integer] Hash code
95
+ def hash
96
+ [url].hash
97
+ end
98
+
99
+ # Builds the object from hash
100
+ # @param [Hash] attributes Model attributes in the form of hash
101
+ # @return [Object] Returns the model itself
102
+ def self.build_from_hash(attributes)
103
+ new.build_from_hash(attributes)
104
+ end
105
+
106
+ # Builds the object from hash
107
+ # @param [Hash] attributes Model attributes in the form of hash
108
+ # @return [Object] Returns the model itself
109
+ def build_from_hash(attributes)
110
+ return nil unless attributes.is_a?(Hash)
111
+ attributes = attributes.transform_keys(&:to_sym)
112
+ self.class.openapi_types.each_pair do |key, type|
113
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
114
+ self.send("#{key}=", nil)
115
+ elsif type =~ /\AArray<(.*)>/i
116
+ # check to ensure the input is an array given that the attribute
117
+ # is documented as an array but the input is not
118
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
119
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
120
+ end
121
+ elsif !attributes[self.class.attribute_map[key]].nil?
122
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
123
+ end
124
+ end
125
+
126
+ self
127
+ end
128
+
129
+ # Deserializes the data based on type
130
+ # @param string type Data type
131
+ # @param string value Value to be deserialized
132
+ # @return [Object] Deserialized data
133
+ def _deserialize(type, value)
134
+ case type.to_sym
135
+ when :Time
136
+ Time.parse(value)
137
+ when :Date
138
+ Date.parse(value)
139
+ when :String
140
+ value.to_s
141
+ when :Integer
142
+ value.to_i
143
+ when :Float
144
+ value.to_f
145
+ when :Boolean
146
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
147
+ true
148
+ else
149
+ false
150
+ end
151
+ when :Object
152
+ # generic object (usually a Hash), return directly
153
+ value
154
+ when /\AArray<(?<inner_type>.+)>\z/
155
+ inner_type = Regexp.last_match[:inner_type]
156
+ value.map { |v| _deserialize(inner_type, v) }
157
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
158
+ k_type = Regexp.last_match[:k_type]
159
+ v_type = Regexp.last_match[:v_type]
160
+ {}.tap do |hash|
161
+ value.each do |k, v|
162
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
163
+ end
164
+ end
165
+ else # model
166
+ # models (e.g. Pet) or oneOf
167
+ klass = FuseClient.const_get(type)
168
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
169
+ end
170
+ end
171
+
172
+ # Returns the string representation of the object
173
+ # @return [String] String presentation of the object
174
+ def to_s
175
+ to_hash.to_s
176
+ end
177
+
178
+ # to_body is an alias to to_hash (backward compatibility)
179
+ # @return [Hash] Returns the object in the form of hash
180
+ def to_body
181
+ to_hash
182
+ end
183
+
184
+ # Returns the object in the form of hash
185
+ # @return [Hash] Returns the object in the form of hash
186
+ def to_hash
187
+ hash = {}
188
+ self.class.attribute_map.each_pair do |attr, param|
189
+ value = self.send(attr)
190
+ if value.nil?
191
+ is_nullable = self.class.openapi_nullable.include?(attr)
192
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
193
+ end
194
+
195
+ hash[param] = _to_hash(value)
196
+ end
197
+ hash
198
+ end
199
+
200
+ # Outputs non-array value in the form of hash
201
+ # For object, use to_hash. Otherwise, just return the value
202
+ # @param [Object] value Any valid value
203
+ # @return [Hash] Returns the value in the form of hash
204
+ def _to_hash(value)
205
+ if value.is_a?(Array)
206
+ value.compact.map { |v| _to_hash(v) }
207
+ elsif value.is_a?(Hash)
208
+ {}.tap do |hash|
209
+ value.each { |k, v| hash[k] = _to_hash(v) }
210
+ end
211
+ elsif value.respond_to? :to_hash
212
+ value.to_hash
213
+ else
214
+ value
215
+ end
216
+ end
217
+
218
+ end
219
+
220
+ end