fuse_client 1.0.36 → 1.0.38

Sign up to get free protection for your applications and to get access to all the features.
Files changed (110) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile.lock +5 -3
  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/{CreateSpendPowerRequest.md → CreateConsumerRiskReportRequest.md} +4 -4
  9. data/docs/{DeleteSpendPowerResponse.md → CreateConsumerRiskReportResponse.md} +3 -3
  10. data/docs/{CreateSpendPowerResponse.md → DeleteConsumerRiskReportResponse.md} +3 -3
  11. data/docs/Entity.md +5 -3
  12. data/docs/EvalConsumerRiskReportRequest.md +22 -0
  13. data/docs/{EvalSpendPowerRequestEventsInner.md → EvalConsumerRiskReportRequestEventsInner.md} +2 -2
  14. data/docs/{EvalSpendPowerResponse.md → EvalConsumerRiskReportResponse.md} +2 -2
  15. data/docs/ExternalTransactionEvent.md +2 -2
  16. data/docs/FinancialConnectionDetails.md +9 -1
  17. data/docs/FinancialConnectionDetailsBasiq.md +20 -0
  18. data/docs/FinancialConnectionDetailsBelvo.md +20 -0
  19. data/docs/FinancialConnectionDetailsFinverse.md +20 -0
  20. data/docs/FinancialConnectionDetailsTruelayer.md +18 -0
  21. data/docs/FinancialConnectionsAccountDetails.md +2 -0
  22. data/docs/FinancialConnectionsAccountDetailsAccountNumber.md +28 -0
  23. data/docs/FinancialConnectionsInvestmentSecurityExchange.md +3 -1
  24. data/docs/FinancialConnectionsOwnerAddressesInnerData.md +2 -0
  25. data/docs/FuseApi.md +152 -148
  26. data/docs/{GetSpendPowerCustomizationResponse.md → GetConsumerRiskReportCustomizationResponse.md} +4 -4
  27. data/docs/{GetSpendPowerResponse.md → GetConsumerRiskReportResponse.md} +4 -4
  28. data/docs/GetFinancialConnectionsOwnersResponse.md +3 -1
  29. data/docs/GetFinancialConnectionsOwnersResponseAccountsInner.md +1 -3
  30. data/docs/InAppTransactionEvent.md +1 -1
  31. data/docs/RiskReportApi.md +165 -0
  32. data/docs/Transaction.md +1 -1
  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/fuse_client-1.0.37.gem +0 -0
  37. data/lib/fuse_client/api/fuse_api.rb +142 -139
  38. data/lib/fuse_client/api/{spend_power_api.rb → risk_report_api.rb} +39 -39
  39. data/lib/fuse_client/configuration.rb +42 -0
  40. data/lib/fuse_client/models/account_subtype.rb +13 -1
  41. data/lib/fuse_client/models/aggregator.rb +5 -1
  42. data/lib/fuse_client/models/{spend_power.rb → consumer_risk_report.rb} +4 -6
  43. data/lib/fuse_client/models/{spend_power_customization.rb → consumer_risk_report_customization.rb} +6 -7
  44. data/lib/fuse_client/models/{spend_power_time_frame.rb → consumer_risk_report_time_frame.rb} +3 -3
  45. data/lib/fuse_client/models/country_code.rb +82 -4
  46. data/lib/fuse_client/models/{create_spend_power_customization_request.rb → create_consumer_risk_report_customization_request.rb} +6 -6
  47. data/lib/fuse_client/models/{create_spend_power_customization_response.rb → create_consumer_risk_report_customization_response.rb} +3 -3
  48. data/lib/fuse_client/models/{create_spend_power_request.rb → create_consumer_risk_report_request.rb} +5 -5
  49. data/lib/fuse_client/models/{delete_spend_power_response.rb → create_consumer_risk_report_response.rb} +3 -4
  50. data/lib/fuse_client/models/{create_spend_power_response.rb → delete_consumer_risk_report_response.rb} +3 -4
  51. data/lib/fuse_client/models/entity.rb +16 -6
  52. data/lib/fuse_client/models/{eval_spend_power_request.rb → eval_consumer_risk_report_request.rb} +5 -5
  53. data/lib/fuse_client/models/{eval_spend_power_request_events_inner.rb → eval_consumer_risk_report_request_events_inner.rb} +3 -3
  54. data/lib/fuse_client/models/{eval_spend_power_response.rb → eval_consumer_risk_report_response.rb} +3 -3
  55. data/lib/fuse_client/models/external_transaction_event.rb +1 -6
  56. data/lib/fuse_client/models/financial_connection_details.rb +40 -4
  57. data/lib/fuse_client/models/financial_connection_details_basiq.rb +241 -0
  58. data/lib/fuse_client/models/financial_connection_details_belvo.rb +236 -0
  59. data/lib/fuse_client/models/financial_connection_details_finverse.rb +236 -0
  60. data/lib/fuse_client/models/financial_connection_details_truelayer.rb +226 -0
  61. data/lib/fuse_client/models/financial_connections_account_details.rb +10 -1
  62. data/lib/fuse_client/models/financial_connections_account_details_account_number.rb +270 -0
  63. data/lib/fuse_client/models/financial_connections_investment_security_exchange.rb +14 -4
  64. data/lib/fuse_client/models/financial_connections_owner_addresses_inner_data.rb +11 -1
  65. data/lib/fuse_client/models/fuse_api_error_code.rb +12 -3
  66. data/lib/fuse_client/models/get_consumer_risk_report_customization_response.rb +239 -0
  67. data/lib/fuse_client/models/{get_spend_power_response.rb → get_consumer_risk_report_response.rb} +13 -13
  68. data/lib/fuse_client/models/get_financial_connections_owners_response.rb +19 -4
  69. data/lib/fuse_client/models/get_financial_connections_owners_response_accounts_inner.rb +4 -19
  70. data/lib/fuse_client/models/in_app_transaction_event.rb +0 -5
  71. data/lib/fuse_client/models/transaction.rb +1 -1
  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/models/webhook_source.rb +3 -1
  76. data/lib/fuse_client/version.rb +1 -1
  77. data/lib/fuse_client.rb +21 -16
  78. data/spec/api/fuse_api_spec.rb +37 -36
  79. data/spec/api/{spend_power_api_spec.rb → risk_report_api_spec.rb} +16 -16
  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} +6 -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_spend_power_response_spec.rb → delete_consumer_risk_report_response_spec.rb} +6 -6
  88. data/spec/models/entity_spec.rb +6 -0
  89. data/spec/models/{eval_spend_power_request_events_inner_spec.rb → eval_consumer_risk_report_request_events_inner_spec.rb} +6 -6
  90. data/spec/models/{eval_spend_power_request_spec.rb → eval_consumer_risk_report_request_spec.rb} +6 -6
  91. data/spec/models/{eval_spend_power_response_spec.rb → eval_consumer_risk_report_response_spec.rb} +6 -6
  92. data/spec/models/financial_connection_details_basiq_spec.rb +40 -0
  93. data/spec/models/financial_connection_details_belvo_spec.rb +40 -0
  94. data/spec/models/{get_spend_power_customization_response_spec.rb → financial_connection_details_finverse_spec.rb} +8 -8
  95. data/spec/models/financial_connection_details_spec.rb +24 -0
  96. data/spec/models/financial_connection_details_truelayer_spec.rb +34 -0
  97. data/spec/models/financial_connections_account_details_account_number_spec.rb +64 -0
  98. data/spec/models/financial_connections_account_details_spec.rb +6 -0
  99. data/spec/models/financial_connections_investment_security_exchange_spec.rb +6 -0
  100. data/spec/models/financial_connections_owner_addresses_inner_data_spec.rb +6 -0
  101. data/spec/models/get_consumer_risk_report_customization_response_spec.rb +40 -0
  102. data/spec/models/{get_spend_power_response_spec.rb → get_consumer_risk_report_response_spec.rb} +7 -7
  103. data/spec/models/get_financial_connections_owners_response_accounts_inner_spec.rb +0 -6
  104. data/spec/models/get_financial_connections_owners_response_spec.rb +6 -0
  105. data/spec/models/{update_spend_power_customization_request_spec.rb → update_consumer_risk_report_customization_request_spec.rb} +6 -6
  106. data/spec/models/{update_spend_power_customization_response_spec.rb → update_consumer_risk_report_customization_response_spec.rb} +6 -6
  107. metadata +97 -76
  108. data/docs/EvalSpendPowerRequest.md +0 -22
  109. data/docs/SpendPowerApi.md +0 -165
  110. data/lib/fuse_client/models/get_spend_power_customization_response.rb +0 -239
@@ -22,7 +22,7 @@ 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
28
  # The ISO-4217 currency code.
@@ -177,10 +177,6 @@ module FuseClient
177
177
  invalid_properties.push('invalid value for "iso_currency_code", iso_currency_code cannot be nil.')
178
178
  end
179
179
 
180
- if @transaction_type.nil?
181
- invalid_properties.push('invalid value for "transaction_type", transaction_type cannot be nil.')
182
- end
183
-
184
180
  if @merchant_name.nil?
185
181
  invalid_properties.push('invalid value for "merchant_name", merchant_name cannot be nil.')
186
182
  end
@@ -202,7 +198,6 @@ module FuseClient
202
198
  return false if @status.nil?
203
199
  return false if @amount.nil?
204
200
  return false if @iso_currency_code.nil?
205
- return false if @transaction_type.nil?
206
201
  return false if @merchant_name.nil?
207
202
  return false if @timestamp.nil?
208
203
  true
@@ -41,6 +41,14 @@ module FuseClient
41
41
 
42
42
  attr_accessor :mono
43
43
 
44
+ attr_accessor :truelayer
45
+
46
+ attr_accessor :finverse
47
+
48
+ attr_accessor :basiq
49
+
50
+ attr_accessor :belvo
51
+
44
52
  class EnumAttributeValidator
45
53
  attr_reader :datatype
46
54
  attr_reader :allowable_values
@@ -76,7 +84,11 @@ module FuseClient
76
84
  :'mx' => :'mx',
77
85
  :'snaptrade' => :'snaptrade',
78
86
  :'flinks' => :'flinks',
79
- :'mono' => :'mono'
87
+ :'mono' => :'mono',
88
+ :'truelayer' => :'truelayer',
89
+ :'finverse' => :'finverse',
90
+ :'basiq' => :'basiq',
91
+ :'belvo' => :'belvo'
80
92
  }
81
93
  end
82
94
 
@@ -98,7 +110,11 @@ module FuseClient
98
110
  :'mx' => :'FinancialConnectionDetailsMx',
99
111
  :'snaptrade' => :'FinancialConnectionDetailsSnaptrade',
100
112
  :'flinks' => :'FinancialConnectionDetailsFlinks',
101
- :'mono' => :'FinancialConnectionDetailsMono'
113
+ :'mono' => :'FinancialConnectionDetailsMono',
114
+ :'truelayer' => :'FinancialConnectionDetailsTruelayer',
115
+ :'finverse' => :'FinancialConnectionDetailsFinverse',
116
+ :'basiq' => :'FinancialConnectionDetailsBasiq',
117
+ :'belvo' => :'FinancialConnectionDetailsBelvo'
102
118
  }
103
119
  end
104
120
 
@@ -166,6 +182,22 @@ module FuseClient
166
182
  if attributes.key?(:'mono')
167
183
  self.mono = attributes[:'mono']
168
184
  end
185
+
186
+ if attributes.key?(:'truelayer')
187
+ self.truelayer = attributes[:'truelayer']
188
+ end
189
+
190
+ if attributes.key?(:'finverse')
191
+ self.finverse = attributes[:'finverse']
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
169
201
  end
170
202
 
171
203
  # Show invalid properties with the reasons. Usually used together with valid?
@@ -233,7 +265,11 @@ module FuseClient
233
265
  mx == o.mx &&
234
266
  snaptrade == o.snaptrade &&
235
267
  flinks == o.flinks &&
236
- mono == o.mono
268
+ mono == o.mono &&
269
+ truelayer == o.truelayer &&
270
+ finverse == o.finverse &&
271
+ basiq == o.basiq &&
272
+ belvo == o.belvo
237
273
  end
238
274
 
239
275
  # @see the `==` method
@@ -245,7 +281,7 @@ module FuseClient
245
281
  # Calculates hash code according to all attributes.
246
282
  # @return [Integer] Hash code
247
283
  def hash
248
- [id, connection_status, connection_status_updated_at, is_oauth, aggregator, plaid, teller, mx, snaptrade, flinks, mono].hash
284
+ [id, connection_status, connection_status_updated_at, is_oauth, aggregator, plaid, teller, mx, snaptrade, flinks, mono, truelayer, finverse, basiq, belvo].hash
249
285
  end
250
286
 
251
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