fuse_client 1.0.37 → 1.0.40

Sign up to get free protection for your applications and to get access to all the features.
Files changed (113) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile.lock +4 -4
  3. data/docs/{SpendPower.md → ConsumerRiskReport.md} +5 -5
  4. data/docs/{SpendPowerCustomization.md → ConsumerRiskReportCustomization.md} +6 -6
  5. data/docs/{SpendPowerTimeFrame.md → ConsumerRiskReportTimeFrame.md} +2 -2
  6. data/docs/{CreateSpendPowerCustomizationRequest.md → CreateConsumerRiskReportCustomizationRequest.md} +5 -5
  7. data/docs/{CreateSpendPowerCustomizationResponse.md → CreateConsumerRiskReportCustomizationResponse.md} +2 -2
  8. data/docs/CreateConsumerRiskReportRequest.md +24 -0
  9. data/docs/{DeleteSpendPowerResponse.md → CreateConsumerRiskReportResponse.md} +3 -3
  10. data/docs/CreateLinkTokenRequest.md +3 -1
  11. data/docs/CreateLinkTokenRequestSnaptrade.md +18 -0
  12. data/docs/CreateLinkTokenRequestSnaptradeConfig.md +18 -0
  13. data/docs/{CreateSpendPowerResponse.md → DeleteConsumerRiskReportResponse.md} +3 -3
  14. data/docs/EnrichedTransaction.md +4 -26
  15. data/docs/EvalConsumerRiskReportRequest.md +22 -0
  16. data/docs/{EvalSpendPowerRequestEventsInner.md → EvalConsumerRiskReportRequestEventsInner.md} +2 -2
  17. data/docs/{EvalSpendPowerResponse.md → EvalConsumerRiskReportResponse.md} +2 -2
  18. data/docs/ExternalTransactionEvent.md +8 -2
  19. data/docs/FinancialConnectionDetails.md +5 -1
  20. data/docs/FinancialConnectionDetailsBasiq.md +20 -0
  21. data/docs/FinancialConnectionDetailsBelvo.md +20 -0
  22. data/docs/FinancialConnectionsAccount.md +2 -0
  23. data/docs/FinancialConnectionsAccountLiability.md +2 -0
  24. data/docs/FinancialConnectionsInvestmentSecurityExchange.md +3 -1
  25. data/docs/FinancialConnectionsOwnerAddressesInnerData.md +2 -0
  26. data/docs/FuseApi.md +153 -149
  27. data/docs/{GetSpendPowerCustomizationResponse.md → GetConsumerRiskReportCustomizationResponse.md} +4 -4
  28. data/docs/{GetSpendPowerResponse.md → GetConsumerRiskReportResponse.md} +4 -4
  29. data/docs/InAppTransactionEvent.md +1 -1
  30. data/docs/RiskReportApi.md +165 -0
  31. data/docs/Transaction.md +1 -1
  32. data/docs/TransactionToEnrich.md +13 -5
  33. data/docs/{UpdateSpendPowerCustomizationRequest.md → UpdateConsumerRiskReportCustomizationRequest.md} +5 -5
  34. data/docs/{UpdateSpendPowerCustomizationResponse.md → UpdateConsumerRiskReportCustomizationResponse.md} +2 -2
  35. data/docs/UpdatedBalanceEvent.md +2 -2
  36. data/lib/fuse_client/api/fuse_api.rb +142 -139
  37. data/lib/fuse_client/api/{spend_power_api.rb → risk_report_api.rb} +39 -39
  38. data/lib/fuse_client/configuration.rb +5 -1
  39. data/lib/fuse_client/models/account_subtype.rb +3 -2
  40. data/lib/fuse_client/models/aggregator.rb +3 -1
  41. data/lib/fuse_client/models/{spend_power.rb → consumer_risk_report.rb} +4 -6
  42. data/lib/fuse_client/models/{spend_power_customization.rb → consumer_risk_report_customization.rb} +6 -7
  43. data/lib/fuse_client/models/{spend_power_time_frame.rb → consumer_risk_report_time_frame.rb} +3 -3
  44. data/lib/fuse_client/models/{create_spend_power_customization_request.rb → create_consumer_risk_report_customization_request.rb} +6 -6
  45. data/lib/fuse_client/models/{create_spend_power_customization_response.rb → create_consumer_risk_report_customization_response.rb} +3 -3
  46. data/lib/fuse_client/models/{create_spend_power_request.rb → create_consumer_risk_report_request.rb} +16 -6
  47. data/lib/fuse_client/models/{delete_spend_power_response.rb → create_consumer_risk_report_response.rb} +3 -4
  48. data/lib/fuse_client/models/create_link_token_request.rb +13 -4
  49. data/lib/fuse_client/models/create_link_token_request_snaptrade.rb +220 -0
  50. data/lib/fuse_client/models/create_link_token_request_snaptrade_config.rb +256 -0
  51. data/lib/fuse_client/models/{create_spend_power_response.rb → delete_consumer_risk_report_response.rb} +3 -4
  52. data/lib/fuse_client/models/enriched_transaction.rb +17 -158
  53. data/lib/fuse_client/models/{eval_spend_power_request.rb → eval_consumer_risk_report_request.rb} +5 -5
  54. data/lib/fuse_client/models/{eval_spend_power_request_events_inner.rb → eval_consumer_risk_report_request_events_inner.rb} +3 -3
  55. data/lib/fuse_client/models/{eval_spend_power_response.rb → eval_consumer_risk_report_response.rb} +3 -3
  56. data/lib/fuse_client/models/external_transaction_event.rb +45 -7
  57. data/lib/fuse_client/models/financial_connection_details.rb +22 -4
  58. data/lib/fuse_client/models/financial_connection_details_basiq.rb +241 -0
  59. data/lib/fuse_client/models/financial_connection_details_belvo.rb +236 -0
  60. data/lib/fuse_client/models/financial_connections_account.rb +16 -1
  61. data/lib/fuse_client/models/financial_connections_account_balance.rb +2 -0
  62. data/lib/fuse_client/models/financial_connections_account_cached_balance.rb +2 -0
  63. data/lib/fuse_client/models/financial_connections_account_liability.rb +16 -1
  64. data/lib/fuse_client/models/financial_connections_investment_security_exchange.rb +14 -4
  65. data/lib/fuse_client/models/financial_connections_owner_addresses_inner_data.rb +11 -1
  66. data/lib/fuse_client/models/fuse_api_error_code.rb +6 -3
  67. data/lib/fuse_client/models/get_consumer_risk_report_customization_response.rb +239 -0
  68. data/lib/fuse_client/models/{get_spend_power_response.rb → get_consumer_risk_report_response.rb} +13 -13
  69. data/lib/fuse_client/models/in_app_transaction_event.rb +0 -5
  70. data/lib/fuse_client/models/transaction.rb +1 -1
  71. data/lib/fuse_client/models/transaction_to_enrich.rb +130 -27
  72. data/lib/fuse_client/models/{update_spend_power_customization_request.rb → update_consumer_risk_report_customization_request.rb} +6 -6
  73. data/lib/fuse_client/models/{update_spend_power_customization_response.rb → update_consumer_risk_report_customization_response.rb} +3 -3
  74. data/lib/fuse_client/models/updated_balance_event.rb +2 -2
  75. data/lib/fuse_client/version.rb +1 -1
  76. data/lib/fuse_client.rb +20 -16
  77. data/spec/api/fuse_api_spec.rb +37 -36
  78. data/spec/api/{spend_power_api_spec.rb → risk_report_api_spec.rb} +16 -16
  79. data/spec/models/asset_report_transaction_spec.rb +1 -1
  80. data/spec/models/{spend_power_customization_spec.rb → consumer_risk_report_customization_spec.rb} +6 -6
  81. data/spec/models/{spend_power_spec.rb → consumer_risk_report_spec.rb} +6 -6
  82. data/spec/models/{spend_power_time_frame_spec.rb → consumer_risk_report_time_frame_spec.rb} +6 -6
  83. data/spec/models/{create_spend_power_customization_request_spec.rb → create_consumer_risk_report_customization_request_spec.rb} +6 -6
  84. data/spec/models/{create_spend_power_customization_response_spec.rb → create_consumer_risk_report_customization_response_spec.rb} +6 -6
  85. data/spec/models/{create_spend_power_request_spec.rb → create_consumer_risk_report_request_spec.rb} +12 -6
  86. data/spec/models/{delete_spend_power_response_spec.rb → create_consumer_risk_report_response_spec.rb} +6 -6
  87. data/spec/models/create_link_token_request_snaptrade_config_spec.rb +38 -0
  88. data/spec/models/create_link_token_request_snaptrade_spec.rb +34 -0
  89. data/spec/models/create_link_token_request_spec.rb +6 -0
  90. data/spec/models/{create_spend_power_response_spec.rb → delete_consumer_risk_report_response_spec.rb} +6 -6
  91. data/spec/models/enriched_transaction_spec.rb +2 -72
  92. data/spec/models/{eval_spend_power_request_events_inner_spec.rb → eval_consumer_risk_report_request_events_inner_spec.rb} +6 -6
  93. data/spec/models/{eval_spend_power_request_spec.rb → eval_consumer_risk_report_request_spec.rb} +6 -6
  94. data/spec/models/{eval_spend_power_response_spec.rb → eval_consumer_risk_report_response_spec.rb} +6 -6
  95. data/spec/models/external_transaction_event_spec.rb +22 -0
  96. data/spec/models/financial_connection_details_basiq_spec.rb +40 -0
  97. data/spec/models/financial_connection_details_belvo_spec.rb +40 -0
  98. data/spec/models/financial_connection_details_spec.rb +12 -0
  99. data/spec/models/financial_connections_account_liability_spec.rb +6 -0
  100. data/spec/models/financial_connections_account_spec.rb +6 -0
  101. data/spec/models/financial_connections_investment_security_exchange_spec.rb +6 -0
  102. data/spec/models/financial_connections_owner_addresses_inner_data_spec.rb +6 -0
  103. data/spec/models/{get_spend_power_customization_response_spec.rb → get_consumer_risk_report_customization_response_spec.rb} +7 -7
  104. data/spec/models/{get_spend_power_response_spec.rb → get_consumer_risk_report_response_spec.rb} +7 -7
  105. data/spec/models/transaction_spec.rb +1 -1
  106. data/spec/models/transaction_to_enrich_spec.rb +32 -4
  107. data/spec/models/{update_spend_power_customization_request_spec.rb → update_consumer_risk_report_customization_request_spec.rb} +6 -6
  108. data/spec/models/{update_spend_power_customization_response_spec.rb → update_consumer_risk_report_customization_response_spec.rb} +6 -6
  109. metadata +92 -76
  110. data/docs/CreateSpendPowerRequest.md +0 -22
  111. data/docs/EvalSpendPowerRequest.md +0 -22
  112. data/docs/SpendPowerApi.md +0 -165
  113. data/lib/fuse_client/models/get_spend_power_customization_response.rb +0 -239
@@ -22,14 +22,20 @@ module FuseClient
22
22
 
23
23
  attr_accessor :status
24
24
 
25
- # Use positive values to represent money going out and negative to represent money going in.
25
+ # Amount in cents associated with the transaction. Use positive values to represent money going out and negative to represent money going in.
26
26
  attr_accessor :amount
27
27
 
28
+ attr_accessor :country_code
29
+
28
30
  # The ISO-4217 currency code.
29
31
  attr_accessor :iso_currency_code
30
32
 
31
33
  attr_accessor :transaction_type
32
34
 
35
+ attr_accessor :transaction_description
36
+
37
+ attr_accessor :transaction_owner_type
38
+
33
39
  attr_accessor :merchant_name
34
40
 
35
41
  # Datetime of the transaction In ISO-8601 format
@@ -67,8 +73,11 @@ module FuseClient
67
73
  :'event_type' => :'event_type',
68
74
  :'status' => :'status',
69
75
  :'amount' => :'amount',
76
+ :'country_code' => :'country_code',
70
77
  :'iso_currency_code' => :'iso_currency_code',
71
78
  :'transaction_type' => :'transaction_type',
79
+ :'transaction_description' => :'transaction_description',
80
+ :'transaction_owner_type' => :'transaction_owner_type',
72
81
  :'merchant_name' => :'merchant_name',
73
82
  :'timestamp' => :'timestamp',
74
83
  :'balance' => :'balance'
@@ -87,8 +96,11 @@ module FuseClient
87
96
  :'event_type' => :'String',
88
97
  :'status' => :'ExternalTransactionEventStatus',
89
98
  :'amount' => :'Float',
99
+ :'country_code' => :'String',
90
100
  :'iso_currency_code' => :'String',
91
101
  :'transaction_type' => :'TransactionEventType',
102
+ :'transaction_description' => :'String',
103
+ :'transaction_owner_type' => :'String',
92
104
  :'merchant_name' => :'String',
93
105
  :'timestamp' => :'String',
94
106
  :'balance' => :'Float'
@@ -132,6 +144,12 @@ module FuseClient
132
144
  self.amount = attributes[:'amount']
133
145
  end
134
146
 
147
+ if attributes.key?(:'country_code')
148
+ self.country_code = attributes[:'country_code']
149
+ else
150
+ self.country_code = 'US'
151
+ end
152
+
135
153
  if attributes.key?(:'iso_currency_code')
136
154
  self.iso_currency_code = attributes[:'iso_currency_code']
137
155
  end
@@ -140,6 +158,16 @@ module FuseClient
140
158
  self.transaction_type = attributes[:'transaction_type']
141
159
  end
142
160
 
161
+ if attributes.key?(:'transaction_description')
162
+ self.transaction_description = attributes[:'transaction_description']
163
+ end
164
+
165
+ if attributes.key?(:'transaction_owner_type')
166
+ self.transaction_owner_type = attributes[:'transaction_owner_type']
167
+ else
168
+ self.transaction_owner_type = 'consumer'
169
+ end
170
+
143
171
  if attributes.key?(:'merchant_name')
144
172
  self.merchant_name = attributes[:'merchant_name']
145
173
  end
@@ -177,10 +205,6 @@ module FuseClient
177
205
  invalid_properties.push('invalid value for "iso_currency_code", iso_currency_code cannot be nil.')
178
206
  end
179
207
 
180
- if @transaction_type.nil?
181
- invalid_properties.push('invalid value for "transaction_type", transaction_type cannot be nil.')
182
- end
183
-
184
208
  if @merchant_name.nil?
185
209
  invalid_properties.push('invalid value for "merchant_name", merchant_name cannot be nil.')
186
210
  end
@@ -202,7 +226,8 @@ module FuseClient
202
226
  return false if @status.nil?
203
227
  return false if @amount.nil?
204
228
  return false if @iso_currency_code.nil?
205
- return false if @transaction_type.nil?
229
+ transaction_owner_type_validator = EnumAttributeValidator.new('String', ["consumer", "business"])
230
+ return false unless transaction_owner_type_validator.valid?(@transaction_owner_type)
206
231
  return false if @merchant_name.nil?
207
232
  return false if @timestamp.nil?
208
233
  true
@@ -218,6 +243,16 @@ module FuseClient
218
243
  @event_type = event_type
219
244
  end
220
245
 
246
+ # Custom attribute writer method checking allowed values (enum).
247
+ # @param [Object] transaction_owner_type Object to be assigned
248
+ def transaction_owner_type=(transaction_owner_type)
249
+ validator = EnumAttributeValidator.new('String', ["consumer", "business"])
250
+ unless validator.valid?(transaction_owner_type)
251
+ fail ArgumentError, "invalid value for \"transaction_owner_type\", must be one of #{validator.allowable_values}."
252
+ end
253
+ @transaction_owner_type = transaction_owner_type
254
+ end
255
+
221
256
  # Checks equality by comparing each attribute.
222
257
  # @param [Object] Object to be compared
223
258
  def ==(o)
@@ -227,8 +262,11 @@ module FuseClient
227
262
  event_type == o.event_type &&
228
263
  status == o.status &&
229
264
  amount == o.amount &&
265
+ country_code == o.country_code &&
230
266
  iso_currency_code == o.iso_currency_code &&
231
267
  transaction_type == o.transaction_type &&
268
+ transaction_description == o.transaction_description &&
269
+ transaction_owner_type == o.transaction_owner_type &&
232
270
  merchant_name == o.merchant_name &&
233
271
  timestamp == o.timestamp &&
234
272
  balance == o.balance
@@ -243,7 +281,7 @@ module FuseClient
243
281
  # Calculates hash code according to all attributes.
244
282
  # @return [Integer] Hash code
245
283
  def hash
246
- [id, event_type, status, amount, iso_currency_code, transaction_type, merchant_name, timestamp, balance].hash
284
+ [id, event_type, status, amount, country_code, iso_currency_code, transaction_type, transaction_description, transaction_owner_type, merchant_name, timestamp, balance].hash
247
285
  end
248
286
 
249
287
  # Builds the object from hash
@@ -45,6 +45,10 @@ module FuseClient
45
45
 
46
46
  attr_accessor :finverse
47
47
 
48
+ attr_accessor :basiq
49
+
50
+ attr_accessor :belvo
51
+
48
52
  class EnumAttributeValidator
49
53
  attr_reader :datatype
50
54
  attr_reader :allowable_values
@@ -82,7 +86,9 @@ module FuseClient
82
86
  :'flinks' => :'flinks',
83
87
  :'mono' => :'mono',
84
88
  :'truelayer' => :'truelayer',
85
- :'finverse' => :'finverse'
89
+ :'finverse' => :'finverse',
90
+ :'basiq' => :'basiq',
91
+ :'belvo' => :'belvo'
86
92
  }
87
93
  end
88
94
 
@@ -106,7 +112,9 @@ module FuseClient
106
112
  :'flinks' => :'FinancialConnectionDetailsFlinks',
107
113
  :'mono' => :'FinancialConnectionDetailsMono',
108
114
  :'truelayer' => :'FinancialConnectionDetailsTruelayer',
109
- :'finverse' => :'FinancialConnectionDetailsFinverse'
115
+ :'finverse' => :'FinancialConnectionDetailsFinverse',
116
+ :'basiq' => :'FinancialConnectionDetailsBasiq',
117
+ :'belvo' => :'FinancialConnectionDetailsBelvo'
110
118
  }
111
119
  end
112
120
 
@@ -182,6 +190,14 @@ module FuseClient
182
190
  if attributes.key?(:'finverse')
183
191
  self.finverse = attributes[:'finverse']
184
192
  end
193
+
194
+ if attributes.key?(:'basiq')
195
+ self.basiq = attributes[:'basiq']
196
+ end
197
+
198
+ if attributes.key?(:'belvo')
199
+ self.belvo = attributes[:'belvo']
200
+ end
185
201
  end
186
202
 
187
203
  # Show invalid properties with the reasons. Usually used together with valid?
@@ -251,7 +267,9 @@ module FuseClient
251
267
  flinks == o.flinks &&
252
268
  mono == o.mono &&
253
269
  truelayer == o.truelayer &&
254
- finverse == o.finverse
270
+ finverse == o.finverse &&
271
+ basiq == o.basiq &&
272
+ belvo == o.belvo
255
273
  end
256
274
 
257
275
  # @see the `==` method
@@ -263,7 +281,7 @@ module FuseClient
263
281
  # Calculates hash code according to all attributes.
264
282
  # @return [Integer] Hash code
265
283
  def hash
266
- [id, connection_status, connection_status_updated_at, is_oauth, aggregator, plaid, teller, mx, snaptrade, flinks, mono, truelayer, finverse].hash
284
+ [id, connection_status, connection_status_updated_at, is_oauth, aggregator, plaid, teller, mx, snaptrade, flinks, mono, truelayer, finverse, basiq, belvo].hash
267
285
  end
268
286
 
269
287
  # Builds the object from hash
@@ -0,0 +1,241 @@
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.6.0
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module FuseClient
17
+ # Data needed to query data from Basiq
18
+ class FinancialConnectionDetailsBasiq
19
+ # The identifier of the user for Basiq.
20
+ attr_accessor :user_id
21
+
22
+ # The identifier of the connection for Basiq.
23
+ attr_accessor :connection_id
24
+
25
+ # Attribute mapping from ruby-style variable name to JSON key.
26
+ def self.attribute_map
27
+ {
28
+ :'user_id' => :'user_id',
29
+ :'connection_id' => :'connection_id'
30
+ }
31
+ end
32
+
33
+ # Returns all the JSON keys this model knows about
34
+ def self.acceptable_attributes
35
+ attribute_map.values
36
+ end
37
+
38
+ # Attribute type mapping.
39
+ def self.openapi_types
40
+ {
41
+ :'user_id' => :'String',
42
+ :'connection_id' => :'String'
43
+ }
44
+ end
45
+
46
+ # List of attributes with nullable: true
47
+ def self.openapi_nullable
48
+ Set.new([
49
+ ])
50
+ end
51
+
52
+ # Initializes the object
53
+ # @param [Hash] attributes Model attributes in the form of hash
54
+ def initialize(attributes = {})
55
+ if (!attributes.is_a?(Hash))
56
+ fail ArgumentError, "The input argument (attributes) must be a hash in `FuseClient::FinancialConnectionDetailsBasiq` initialize method"
57
+ end
58
+
59
+ # check to see if the attribute exists and convert string to symbol for hash key
60
+ attributes = attributes.each_with_object({}) { |(k, v), h|
61
+ if (!self.class.attribute_map.key?(k.to_sym))
62
+ fail ArgumentError, "`#{k}` is not a valid attribute in `FuseClient::FinancialConnectionDetailsBasiq`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
63
+ end
64
+ h[k.to_sym] = v
65
+ }
66
+
67
+ if attributes.key?(:'user_id')
68
+ self.user_id = attributes[:'user_id']
69
+ end
70
+
71
+ if attributes.key?(:'connection_id')
72
+ self.connection_id = attributes[:'connection_id']
73
+ end
74
+ end
75
+
76
+ # Show invalid properties with the reasons. Usually used together with valid?
77
+ # @return Array for valid properties with the reasons
78
+ def list_invalid_properties
79
+ invalid_properties = Array.new
80
+ if @user_id.nil?
81
+ invalid_properties.push('invalid value for "user_id", user_id cannot be nil.')
82
+ end
83
+
84
+ if @connection_id.nil?
85
+ invalid_properties.push('invalid value for "connection_id", connection_id cannot be nil.')
86
+ end
87
+
88
+ invalid_properties
89
+ end
90
+
91
+ # Check to see if the all the properties in the model are valid
92
+ # @return true if the model is valid
93
+ def valid?
94
+ return false if @user_id.nil?
95
+ return false if @connection_id.nil?
96
+ true
97
+ end
98
+
99
+ # Checks equality by comparing each attribute.
100
+ # @param [Object] Object to be compared
101
+ def ==(o)
102
+ return true if self.equal?(o)
103
+ self.class == o.class &&
104
+ user_id == o.user_id &&
105
+ connection_id == o.connection_id
106
+ end
107
+
108
+ # @see the `==` method
109
+ # @param [Object] Object to be compared
110
+ def eql?(o)
111
+ self == o
112
+ end
113
+
114
+ # Calculates hash code according to all attributes.
115
+ # @return [Integer] Hash code
116
+ def hash
117
+ [user_id, connection_id].hash
118
+ end
119
+
120
+ # Builds the object from hash
121
+ # @param [Hash] attributes Model attributes in the form of hash
122
+ # @return [Object] Returns the model itself
123
+ def self.build_from_hash(attributes)
124
+ new.build_from_hash(attributes)
125
+ end
126
+
127
+ # Builds the object from hash
128
+ # @param [Hash] attributes Model attributes in the form of hash
129
+ # @return [Object] Returns the model itself
130
+ def build_from_hash(attributes)
131
+ return nil unless attributes.is_a?(Hash)
132
+ attributes = attributes.transform_keys(&:to_sym)
133
+ self.class.openapi_types.each_pair do |key, type|
134
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
135
+ self.send("#{key}=", nil)
136
+ elsif type =~ /\AArray<(.*)>/i
137
+ # check to ensure the input is an array given that the attribute
138
+ # is documented as an array but the input is not
139
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
140
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
141
+ end
142
+ elsif !attributes[self.class.attribute_map[key]].nil?
143
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
144
+ end
145
+ end
146
+
147
+ self
148
+ end
149
+
150
+ # Deserializes the data based on type
151
+ # @param string type Data type
152
+ # @param string value Value to be deserialized
153
+ # @return [Object] Deserialized data
154
+ def _deserialize(type, value)
155
+ case type.to_sym
156
+ when :Time
157
+ Time.parse(value)
158
+ when :Date
159
+ Date.parse(value)
160
+ when :String
161
+ value.to_s
162
+ when :Integer
163
+ value.to_i
164
+ when :Float
165
+ value.to_f
166
+ when :Boolean
167
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
168
+ true
169
+ else
170
+ false
171
+ end
172
+ when :Object
173
+ # generic object (usually a Hash), return directly
174
+ value
175
+ when /\AArray<(?<inner_type>.+)>\z/
176
+ inner_type = Regexp.last_match[:inner_type]
177
+ value.map { |v| _deserialize(inner_type, v) }
178
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
179
+ k_type = Regexp.last_match[:k_type]
180
+ v_type = Regexp.last_match[:v_type]
181
+ {}.tap do |hash|
182
+ value.each do |k, v|
183
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
184
+ end
185
+ end
186
+ else # model
187
+ # models (e.g. Pet) or oneOf
188
+ klass = FuseClient.const_get(type)
189
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
190
+ end
191
+ end
192
+
193
+ # Returns the string representation of the object
194
+ # @return [String] String presentation of the object
195
+ def to_s
196
+ to_hash.to_s
197
+ end
198
+
199
+ # to_body is an alias to to_hash (backward compatibility)
200
+ # @return [Hash] Returns the object in the form of hash
201
+ def to_body
202
+ to_hash
203
+ end
204
+
205
+ # Returns the object in the form of hash
206
+ # @return [Hash] Returns the object in the form of hash
207
+ def to_hash
208
+ hash = {}
209
+ self.class.attribute_map.each_pair do |attr, param|
210
+ value = self.send(attr)
211
+ if value.nil?
212
+ is_nullable = self.class.openapi_nullable.include?(attr)
213
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
214
+ end
215
+
216
+ hash[param] = _to_hash(value)
217
+ end
218
+ hash
219
+ end
220
+
221
+ # Outputs non-array value in the form of hash
222
+ # For object, use to_hash. Otherwise, just return the value
223
+ # @param [Object] value Any valid value
224
+ # @return [Hash] Returns the value in the form of hash
225
+ def _to_hash(value)
226
+ if value.is_a?(Array)
227
+ value.compact.map { |v| _to_hash(v) }
228
+ elsif value.is_a?(Hash)
229
+ {}.tap do |hash|
230
+ value.each { |k, v| hash[k] = _to_hash(v) }
231
+ end
232
+ elsif value.respond_to? :to_hash
233
+ value.to_hash
234
+ else
235
+ value
236
+ end
237
+ end
238
+
239
+ end
240
+
241
+ end
@@ -0,0 +1,236 @@
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.6.0
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module FuseClient
17
+ # Data needed to query data from Belvo
18
+ class FinancialConnectionDetailsBelvo
19
+ # The identifier of the link for Belvo.
20
+ attr_accessor :link_id
21
+
22
+ # The identifier of the institution for Belvo.
23
+ attr_accessor :institution
24
+
25
+ # Attribute mapping from ruby-style variable name to JSON key.
26
+ def self.attribute_map
27
+ {
28
+ :'link_id' => :'link_id',
29
+ :'institution' => :'institution'
30
+ }
31
+ end
32
+
33
+ # Returns all the JSON keys this model knows about
34
+ def self.acceptable_attributes
35
+ attribute_map.values
36
+ end
37
+
38
+ # Attribute type mapping.
39
+ def self.openapi_types
40
+ {
41
+ :'link_id' => :'String',
42
+ :'institution' => :'String'
43
+ }
44
+ end
45
+
46
+ # List of attributes with nullable: true
47
+ def self.openapi_nullable
48
+ Set.new([
49
+ ])
50
+ end
51
+
52
+ # Initializes the object
53
+ # @param [Hash] attributes Model attributes in the form of hash
54
+ def initialize(attributes = {})
55
+ if (!attributes.is_a?(Hash))
56
+ fail ArgumentError, "The input argument (attributes) must be a hash in `FuseClient::FinancialConnectionDetailsBelvo` initialize method"
57
+ end
58
+
59
+ # check to see if the attribute exists and convert string to symbol for hash key
60
+ attributes = attributes.each_with_object({}) { |(k, v), h|
61
+ if (!self.class.attribute_map.key?(k.to_sym))
62
+ fail ArgumentError, "`#{k}` is not a valid attribute in `FuseClient::FinancialConnectionDetailsBelvo`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
63
+ end
64
+ h[k.to_sym] = v
65
+ }
66
+
67
+ if attributes.key?(:'link_id')
68
+ self.link_id = attributes[:'link_id']
69
+ end
70
+
71
+ if attributes.key?(:'institution')
72
+ self.institution = attributes[:'institution']
73
+ end
74
+ end
75
+
76
+ # Show invalid properties with the reasons. Usually used together with valid?
77
+ # @return Array for valid properties with the reasons
78
+ def list_invalid_properties
79
+ invalid_properties = Array.new
80
+ if @link_id.nil?
81
+ invalid_properties.push('invalid value for "link_id", link_id cannot be nil.')
82
+ end
83
+
84
+ invalid_properties
85
+ end
86
+
87
+ # Check to see if the all the properties in the model are valid
88
+ # @return true if the model is valid
89
+ def valid?
90
+ return false if @link_id.nil?
91
+ true
92
+ end
93
+
94
+ # Checks equality by comparing each attribute.
95
+ # @param [Object] Object to be compared
96
+ def ==(o)
97
+ return true if self.equal?(o)
98
+ self.class == o.class &&
99
+ link_id == o.link_id &&
100
+ institution == o.institution
101
+ end
102
+
103
+ # @see the `==` method
104
+ # @param [Object] Object to be compared
105
+ def eql?(o)
106
+ self == o
107
+ end
108
+
109
+ # Calculates hash code according to all attributes.
110
+ # @return [Integer] Hash code
111
+ def hash
112
+ [link_id, institution].hash
113
+ end
114
+
115
+ # Builds the object from hash
116
+ # @param [Hash] attributes Model attributes in the form of hash
117
+ # @return [Object] Returns the model itself
118
+ def self.build_from_hash(attributes)
119
+ new.build_from_hash(attributes)
120
+ end
121
+
122
+ # Builds the object from hash
123
+ # @param [Hash] attributes Model attributes in the form of hash
124
+ # @return [Object] Returns the model itself
125
+ def build_from_hash(attributes)
126
+ return nil unless attributes.is_a?(Hash)
127
+ attributes = attributes.transform_keys(&:to_sym)
128
+ self.class.openapi_types.each_pair do |key, type|
129
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
130
+ self.send("#{key}=", nil)
131
+ elsif type =~ /\AArray<(.*)>/i
132
+ # check to ensure the input is an array given that the attribute
133
+ # is documented as an array but the input is not
134
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
135
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
136
+ end
137
+ elsif !attributes[self.class.attribute_map[key]].nil?
138
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
139
+ end
140
+ end
141
+
142
+ self
143
+ end
144
+
145
+ # Deserializes the data based on type
146
+ # @param string type Data type
147
+ # @param string value Value to be deserialized
148
+ # @return [Object] Deserialized data
149
+ def _deserialize(type, value)
150
+ case type.to_sym
151
+ when :Time
152
+ Time.parse(value)
153
+ when :Date
154
+ Date.parse(value)
155
+ when :String
156
+ value.to_s
157
+ when :Integer
158
+ value.to_i
159
+ when :Float
160
+ value.to_f
161
+ when :Boolean
162
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
163
+ true
164
+ else
165
+ false
166
+ end
167
+ when :Object
168
+ # generic object (usually a Hash), return directly
169
+ value
170
+ when /\AArray<(?<inner_type>.+)>\z/
171
+ inner_type = Regexp.last_match[:inner_type]
172
+ value.map { |v| _deserialize(inner_type, v) }
173
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
174
+ k_type = Regexp.last_match[:k_type]
175
+ v_type = Regexp.last_match[:v_type]
176
+ {}.tap do |hash|
177
+ value.each do |k, v|
178
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
179
+ end
180
+ end
181
+ else # model
182
+ # models (e.g. Pet) or oneOf
183
+ klass = FuseClient.const_get(type)
184
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
185
+ end
186
+ end
187
+
188
+ # Returns the string representation of the object
189
+ # @return [String] String presentation of the object
190
+ def to_s
191
+ to_hash.to_s
192
+ end
193
+
194
+ # to_body is an alias to to_hash (backward compatibility)
195
+ # @return [Hash] Returns the object in the form of hash
196
+ def to_body
197
+ to_hash
198
+ end
199
+
200
+ # Returns the object in the form of hash
201
+ # @return [Hash] Returns the object in the form of hash
202
+ def to_hash
203
+ hash = {}
204
+ self.class.attribute_map.each_pair do |attr, param|
205
+ value = self.send(attr)
206
+ if value.nil?
207
+ is_nullable = self.class.openapi_nullable.include?(attr)
208
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
209
+ end
210
+
211
+ hash[param] = _to_hash(value)
212
+ end
213
+ hash
214
+ end
215
+
216
+ # Outputs non-array value in the form of hash
217
+ # For object, use to_hash. Otherwise, just return the value
218
+ # @param [Object] value Any valid value
219
+ # @return [Hash] Returns the value in the form of hash
220
+ def _to_hash(value)
221
+ if value.is_a?(Array)
222
+ value.compact.map { |v| _to_hash(v) }
223
+ elsif value.is_a?(Hash)
224
+ {}.tap do |hash|
225
+ value.each { |k, v| hash[k] = _to_hash(v) }
226
+ end
227
+ elsif value.respond_to? :to_hash
228
+ value.to_hash
229
+ else
230
+ value
231
+ end
232
+ end
233
+
234
+ end
235
+
236
+ end