fuse_client 0.3.2 → 0.3.4

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 (75) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile.lock +70 -0
  3. data/LICENSE +21 -0
  4. data/README.md +1 -258
  5. data/docs/Aggregator.md +15 -0
  6. data/docs/CreateAssetReportRequest.md +3 -1
  7. data/docs/CreateEntityRequest.md +24 -0
  8. data/docs/CreateEntityResponse.md +24 -0
  9. data/docs/CreateLinkTokenRequest.md +5 -5
  10. data/docs/CreateLinkTokenRequestMx.md +1 -1
  11. data/docs/CreateLinkTokenRequestPlaid.md +1 -1
  12. data/docs/CreateSessionRequest.md +3 -5
  13. data/docs/FinancialConnectionsAccountDetails.md +1 -3
  14. data/docs/FinancialConnectionsHolding.md +2 -0
  15. data/docs/FuseApi.md +307 -1
  16. data/docs/GetEntityResponse.md +24 -0
  17. data/docs/GetInvestmentHoldingsRequest.md +3 -1
  18. data/docs/GetInvestmentHoldingsResponse.md +1 -3
  19. data/docs/GetInvestmentTransactionsResponse.md +1 -3
  20. data/docs/GetLiabilitiesResponse.md +1 -3
  21. data/docs/GetTransactionsResponseDataInner.md +1 -3
  22. data/docs/Product.md +15 -0
  23. data/docs/RefreshAssetReportRequest.md +22 -0
  24. data/docs/UpdateEntityRequest.md +22 -0
  25. data/docs/UpdateEntityResponse.md +24 -0
  26. data/lib/fuse_client/api/fuse_api.rb +261 -0
  27. data/lib/fuse_client/configuration.rb +2 -2
  28. data/lib/fuse_client/models/aggregator.rb +42 -0
  29. data/lib/fuse_client/models/create_asset_report_request.rb +16 -4
  30. data/lib/fuse_client/models/{create_session_request_mx.rb → create_entity_request.rb} +50 -29
  31. data/lib/fuse_client/models/create_entity_response.rb +268 -0
  32. data/lib/fuse_client/models/create_link_token_request.rb +21 -20
  33. data/lib/fuse_client/models/create_link_token_request_mx.rb +1 -1
  34. data/lib/fuse_client/models/create_link_token_request_plaid.rb +3 -2
  35. data/lib/fuse_client/models/create_session_request.rb +36 -39
  36. data/lib/fuse_client/models/financial_connections_account_details.rb +4 -14
  37. data/lib/fuse_client/models/financial_connections_holding.rb +11 -1
  38. data/lib/fuse_client/models/{create_link_token_request_plaid_config.rb → get_entity_response.rb} +57 -14
  39. data/lib/fuse_client/models/get_investment_holdings_request.rb +14 -4
  40. data/lib/fuse_client/models/get_investment_holdings_response.rb +4 -14
  41. data/lib/fuse_client/models/get_investment_transactions_response.rb +4 -14
  42. data/lib/fuse_client/models/get_liabilities_response.rb +4 -14
  43. data/lib/fuse_client/models/get_transactions_response_data_inner.rb +4 -14
  44. data/lib/fuse_client/models/product.rb +44 -0
  45. data/lib/fuse_client/models/refresh_asset_report_request.rb +275 -0
  46. data/lib/fuse_client/models/{create_session_request_plaid.rb → update_entity_request.rb} +41 -21
  47. data/lib/fuse_client/models/update_entity_response.rb +268 -0
  48. data/lib/fuse_client/version.rb +1 -1
  49. data/lib/fuse_client.rb +8 -3
  50. data/spec/api/fuse_api_spec.rb +45 -0
  51. data/spec/configuration_spec.rb +3 -3
  52. data/spec/models/aggregator_spec.rb +28 -0
  53. data/spec/models/create_asset_report_request_spec.rb +6 -0
  54. data/spec/models/{create_session_request_mx_spec.rb → create_entity_request_spec.rb} +10 -10
  55. data/spec/models/create_entity_response_spec.rb +52 -0
  56. data/spec/models/create_link_token_request_spec.rb +5 -5
  57. data/spec/models/create_session_request_spec.rb +1 -11
  58. data/spec/models/financial_connections_account_details_spec.rb +0 -6
  59. data/spec/models/financial_connections_holding_spec.rb +6 -0
  60. data/spec/models/get_entity_response_spec.rb +52 -0
  61. data/spec/models/get_investment_holdings_request_spec.rb +6 -0
  62. data/spec/models/get_investment_holdings_response_spec.rb +0 -6
  63. data/spec/models/get_investment_transactions_response_spec.rb +0 -6
  64. data/spec/models/get_liabilities_response_spec.rb +0 -6
  65. data/spec/models/get_transactions_response_data_inner_spec.rb +0 -6
  66. data/spec/models/product_spec.rb +28 -0
  67. data/spec/models/refresh_asset_report_request_spec.rb +46 -0
  68. data/spec/models/update_entity_request_spec.rb +46 -0
  69. data/spec/models/update_entity_response_spec.rb +52 -0
  70. metadata +36 -14
  71. data/docs/CreateLinkTokenRequestPlaidConfig.md +0 -18
  72. data/docs/CreateSessionRequestMx.md +0 -24
  73. data/docs/CreateSessionRequestPlaid.md +0 -18
  74. data/spec/models/create_link_token_request_plaid_config_spec.rb +0 -34
  75. data/spec/models/create_session_request_plaid_spec.rb +0 -34
@@ -0,0 +1,275 @@
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.2.1
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module FuseClient
17
+ class RefreshAssetReportRequest
18
+ # The asset_report_token returned by the original call to /asset_report/create
19
+ attr_accessor :access_token
20
+
21
+ # The maximum integer number of days of history to include in the Asset Report
22
+ attr_accessor :days_requested
23
+
24
+ # Indicates whether to include identity data in the Asset Report
25
+ attr_accessor :include_identity
26
+
27
+ # Attribute mapping from ruby-style variable name to JSON key.
28
+ def self.attribute_map
29
+ {
30
+ :'access_token' => :'access_token',
31
+ :'days_requested' => :'days_requested',
32
+ :'include_identity' => :'include_identity'
33
+ }
34
+ end
35
+
36
+ # Returns all the JSON keys this model knows about
37
+ def self.acceptable_attributes
38
+ attribute_map.values
39
+ end
40
+
41
+ # Attribute type mapping.
42
+ def self.openapi_types
43
+ {
44
+ :'access_token' => :'String',
45
+ :'days_requested' => :'Float',
46
+ :'include_identity' => :'Boolean'
47
+ }
48
+ end
49
+
50
+ # List of attributes with nullable: true
51
+ def self.openapi_nullable
52
+ Set.new([
53
+ ])
54
+ end
55
+
56
+ # Initializes the object
57
+ # @param [Hash] attributes Model attributes in the form of hash
58
+ def initialize(attributes = {})
59
+ if (!attributes.is_a?(Hash))
60
+ fail ArgumentError, "The input argument (attributes) must be a hash in `FuseClient::RefreshAssetReportRequest` initialize method"
61
+ end
62
+
63
+ # check to see if the attribute exists and convert string to symbol for hash key
64
+ attributes = attributes.each_with_object({}) { |(k, v), h|
65
+ if (!self.class.attribute_map.key?(k.to_sym))
66
+ fail ArgumentError, "`#{k}` is not a valid attribute in `FuseClient::RefreshAssetReportRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
67
+ end
68
+ h[k.to_sym] = v
69
+ }
70
+
71
+ if attributes.key?(:'access_token')
72
+ self.access_token = attributes[:'access_token']
73
+ end
74
+
75
+ if attributes.key?(:'days_requested')
76
+ self.days_requested = attributes[:'days_requested']
77
+ end
78
+
79
+ if attributes.key?(:'include_identity')
80
+ self.include_identity = attributes[:'include_identity']
81
+ else
82
+ self.include_identity = true
83
+ end
84
+ end
85
+
86
+ # Show invalid properties with the reasons. Usually used together with valid?
87
+ # @return Array for valid properties with the reasons
88
+ def list_invalid_properties
89
+ invalid_properties = Array.new
90
+ if @days_requested.nil?
91
+ invalid_properties.push('invalid value for "days_requested", days_requested cannot be nil.')
92
+ end
93
+
94
+ if @days_requested > 365
95
+ invalid_properties.push('invalid value for "days_requested", must be smaller than or equal to 365.')
96
+ end
97
+
98
+ if @days_requested < 1
99
+ invalid_properties.push('invalid value for "days_requested", must be greater than or equal to 1.')
100
+ end
101
+
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
+ return false if @days_requested.nil?
109
+ return false if @days_requested > 365
110
+ return false if @days_requested < 1
111
+ true
112
+ end
113
+
114
+ # Custom attribute writer method with validation
115
+ # @param [Object] days_requested Value to be assigned
116
+ def days_requested=(days_requested)
117
+ if days_requested.nil?
118
+ fail ArgumentError, 'days_requested cannot be nil'
119
+ end
120
+
121
+ if days_requested > 365
122
+ fail ArgumentError, 'invalid value for "days_requested", must be smaller than or equal to 365.'
123
+ end
124
+
125
+ if days_requested < 1
126
+ fail ArgumentError, 'invalid value for "days_requested", must be greater than or equal to 1.'
127
+ end
128
+
129
+ @days_requested = days_requested
130
+ end
131
+
132
+ # Checks equality by comparing each attribute.
133
+ # @param [Object] Object to be compared
134
+ def ==(o)
135
+ return true if self.equal?(o)
136
+ self.class == o.class &&
137
+ access_token == o.access_token &&
138
+ days_requested == o.days_requested &&
139
+ include_identity == o.include_identity
140
+ end
141
+
142
+ # @see the `==` method
143
+ # @param [Object] Object to be compared
144
+ def eql?(o)
145
+ self == o
146
+ end
147
+
148
+ # Calculates hash code according to all attributes.
149
+ # @return [Integer] Hash code
150
+ def hash
151
+ [access_token, days_requested, include_identity].hash
152
+ end
153
+
154
+ # Builds the object from hash
155
+ # @param [Hash] attributes Model attributes in the form of hash
156
+ # @return [Object] Returns the model itself
157
+ def self.build_from_hash(attributes)
158
+ new.build_from_hash(attributes)
159
+ end
160
+
161
+ # Builds the object from hash
162
+ # @param [Hash] attributes Model attributes in the form of hash
163
+ # @return [Object] Returns the model itself
164
+ def build_from_hash(attributes)
165
+ return nil unless attributes.is_a?(Hash)
166
+ attributes = attributes.transform_keys(&:to_sym)
167
+ self.class.openapi_types.each_pair do |key, type|
168
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
169
+ self.send("#{key}=", nil)
170
+ elsif type =~ /\AArray<(.*)>/i
171
+ # check to ensure the input is an array given that the attribute
172
+ # is documented as an array but the input is not
173
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
174
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
175
+ end
176
+ elsif !attributes[self.class.attribute_map[key]].nil?
177
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
178
+ end
179
+ end
180
+
181
+ self
182
+ end
183
+
184
+ # Deserializes the data based on type
185
+ # @param string type Data type
186
+ # @param string value Value to be deserialized
187
+ # @return [Object] Deserialized data
188
+ def _deserialize(type, value)
189
+ case type.to_sym
190
+ when :Time
191
+ Time.parse(value)
192
+ when :Date
193
+ Date.parse(value)
194
+ when :String
195
+ value.to_s
196
+ when :Integer
197
+ value.to_i
198
+ when :Float
199
+ value.to_f
200
+ when :Boolean
201
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
202
+ true
203
+ else
204
+ false
205
+ end
206
+ when :Object
207
+ # generic object (usually a Hash), return directly
208
+ value
209
+ when /\AArray<(?<inner_type>.+)>\z/
210
+ inner_type = Regexp.last_match[:inner_type]
211
+ value.map { |v| _deserialize(inner_type, v) }
212
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
213
+ k_type = Regexp.last_match[:k_type]
214
+ v_type = Regexp.last_match[:v_type]
215
+ {}.tap do |hash|
216
+ value.each do |k, v|
217
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
218
+ end
219
+ end
220
+ else # model
221
+ # models (e.g. Pet) or oneOf
222
+ klass = FuseClient.const_get(type)
223
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
224
+ end
225
+ end
226
+
227
+ # Returns the string representation of the object
228
+ # @return [String] String presentation of the object
229
+ def to_s
230
+ to_hash.to_s
231
+ end
232
+
233
+ # to_body is an alias to to_hash (backward compatibility)
234
+ # @return [Hash] Returns the object in the form of hash
235
+ def to_body
236
+ to_hash
237
+ end
238
+
239
+ # Returns the object in the form of hash
240
+ # @return [Hash] Returns the object in the form of hash
241
+ def to_hash
242
+ hash = {}
243
+ self.class.attribute_map.each_pair do |attr, param|
244
+ value = self.send(attr)
245
+ if value.nil?
246
+ is_nullable = self.class.openapi_nullable.include?(attr)
247
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
248
+ end
249
+
250
+ hash[param] = _to_hash(value)
251
+ end
252
+ hash
253
+ end
254
+
255
+ # Outputs non-array value in the form of hash
256
+ # For object, use to_hash. Otherwise, just return the value
257
+ # @param [Object] value Any valid value
258
+ # @return [Hash] Returns the value in the form of hash
259
+ def _to_hash(value)
260
+ if value.is_a?(Array)
261
+ value.compact.map { |v| _to_hash(v) }
262
+ elsif value.is_a?(Hash)
263
+ {}.tap do |hash|
264
+ value.each { |k, v| hash[k] = _to_hash(v) }
265
+ end
266
+ elsif value.respond_to? :to_hash
267
+ value.to_hash
268
+ else
269
+ value
270
+ end
271
+ end
272
+
273
+ end
274
+
275
+ end
@@ -14,15 +14,21 @@ require 'date'
14
14
  require 'time'
15
15
 
16
16
  module FuseClient
17
- # This field is REQUIRED if PLAID is in the list of supported_financial_institution_aggregators. An object specifying information about the Plaid configuration to use for deciding which Plaid supported financial institutions to display.
18
- class CreateSessionRequestPlaid
19
- # For a comprehensive list of supported plaid products, see https://plaid.com/docs/api/tokens/#link-token-create-request-products
20
- attr_accessor :products
17
+ class UpdateEntityRequest
18
+ # Email of the entity
19
+ attr_accessor :email
20
+
21
+ # These will force the user to connect through all of these aggregators
22
+ attr_accessor :aggregators
23
+
24
+ attr_accessor :institution_ids
21
25
 
22
26
  # Attribute mapping from ruby-style variable name to JSON key.
23
27
  def self.attribute_map
24
28
  {
25
- :'products' => :'products'
29
+ :'email' => :'email',
30
+ :'aggregators' => :'aggregators',
31
+ :'institution_ids' => :'institution_ids'
26
32
  }
27
33
  end
28
34
 
@@ -34,7 +40,9 @@ module FuseClient
34
40
  # Attribute type mapping.
35
41
  def self.openapi_types
36
42
  {
37
- :'products' => :'Array<String>'
43
+ :'email' => :'String',
44
+ :'aggregators' => :'Array<Aggregator>',
45
+ :'institution_ids' => :'Array<String>'
38
46
  }
39
47
  end
40
48
 
@@ -48,20 +56,30 @@ module FuseClient
48
56
  # @param [Hash] attributes Model attributes in the form of hash
49
57
  def initialize(attributes = {})
50
58
  if (!attributes.is_a?(Hash))
51
- fail ArgumentError, "The input argument (attributes) must be a hash in `FuseClient::CreateSessionRequestPlaid` initialize method"
59
+ fail ArgumentError, "The input argument (attributes) must be a hash in `FuseClient::UpdateEntityRequest` initialize method"
52
60
  end
53
61
 
54
62
  # check to see if the attribute exists and convert string to symbol for hash key
55
63
  attributes = attributes.each_with_object({}) { |(k, v), h|
56
64
  if (!self.class.attribute_map.key?(k.to_sym))
57
- fail ArgumentError, "`#{k}` is not a valid attribute in `FuseClient::CreateSessionRequestPlaid`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
65
+ fail ArgumentError, "`#{k}` is not a valid attribute in `FuseClient::UpdateEntityRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
58
66
  end
59
67
  h[k.to_sym] = v
60
68
  }
61
69
 
62
- if attributes.key?(:'products')
63
- if (value = attributes[:'products']).is_a?(Array)
64
- self.products = value
70
+ if attributes.key?(:'email')
71
+ self.email = attributes[:'email']
72
+ end
73
+
74
+ if attributes.key?(:'aggregators')
75
+ if (value = attributes[:'aggregators']).is_a?(Array)
76
+ self.aggregators = value
77
+ end
78
+ end
79
+
80
+ if attributes.key?(:'institution_ids')
81
+ if (value = attributes[:'institution_ids']).is_a?(Array)
82
+ self.institution_ids = value
65
83
  end
66
84
  end
67
85
  end
@@ -70,8 +88,8 @@ module FuseClient
70
88
  # @return Array for valid properties with the reasons
71
89
  def list_invalid_properties
72
90
  invalid_properties = Array.new
73
- if !@products.nil? && @products.length < 1
74
- invalid_properties.push('invalid value for "products", number of items must be greater than or equal to 1.')
91
+ if !@aggregators.nil? && @aggregators.length < 1
92
+ invalid_properties.push('invalid value for "aggregators", number of items must be greater than or equal to 1.')
75
93
  end
76
94
 
77
95
  invalid_properties
@@ -80,18 +98,18 @@ module FuseClient
80
98
  # Check to see if the all the properties in the model are valid
81
99
  # @return true if the model is valid
82
100
  def valid?
83
- return false if !@products.nil? && @products.length < 1
101
+ return false if !@aggregators.nil? && @aggregators.length < 1
84
102
  true
85
103
  end
86
104
 
87
105
  # Custom attribute writer method with validation
88
- # @param [Object] products Value to be assigned
89
- def products=(products)
90
- if !products.nil? && products.length < 1
91
- fail ArgumentError, 'invalid value for "products", number of items must be greater than or equal to 1.'
106
+ # @param [Object] aggregators Value to be assigned
107
+ def aggregators=(aggregators)
108
+ if !aggregators.nil? && aggregators.length < 1
109
+ fail ArgumentError, 'invalid value for "aggregators", number of items must be greater than or equal to 1.'
92
110
  end
93
111
 
94
- @products = products
112
+ @aggregators = aggregators
95
113
  end
96
114
 
97
115
  # Checks equality by comparing each attribute.
@@ -99,7 +117,9 @@ module FuseClient
99
117
  def ==(o)
100
118
  return true if self.equal?(o)
101
119
  self.class == o.class &&
102
- products == o.products
120
+ email == o.email &&
121
+ aggregators == o.aggregators &&
122
+ institution_ids == o.institution_ids
103
123
  end
104
124
 
105
125
  # @see the `==` method
@@ -111,7 +131,7 @@ module FuseClient
111
131
  # Calculates hash code according to all attributes.
112
132
  # @return [Integer] Hash code
113
133
  def hash
114
- [products].hash
134
+ [email, aggregators, institution_ids].hash
115
135
  end
116
136
 
117
137
  # Builds the object from hash
@@ -0,0 +1,268 @@
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.2.1
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module FuseClient
17
+ class UpdateEntityResponse
18
+ # Id of the entity
19
+ attr_accessor :id
20
+
21
+ # Email of the entity
22
+ attr_accessor :email
23
+
24
+ # These will force the user to connect through all of these aggregators
25
+ attr_accessor :aggregators
26
+
27
+ attr_accessor :institution_ids
28
+
29
+ # Attribute mapping from ruby-style variable name to JSON key.
30
+ def self.attribute_map
31
+ {
32
+ :'id' => :'id',
33
+ :'email' => :'email',
34
+ :'aggregators' => :'aggregators',
35
+ :'institution_ids' => :'institution_ids'
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
+ :'id' => :'String',
48
+ :'email' => :'String',
49
+ :'aggregators' => :'Array<Aggregator>',
50
+ :'institution_ids' => :'Array<String>'
51
+ }
52
+ end
53
+
54
+ # List of attributes with nullable: true
55
+ def self.openapi_nullable
56
+ Set.new([
57
+ ])
58
+ end
59
+
60
+ # Initializes the object
61
+ # @param [Hash] attributes Model attributes in the form of hash
62
+ def initialize(attributes = {})
63
+ if (!attributes.is_a?(Hash))
64
+ fail ArgumentError, "The input argument (attributes) must be a hash in `FuseClient::UpdateEntityResponse` initialize method"
65
+ end
66
+
67
+ # check to see if the attribute exists and convert string to symbol for hash key
68
+ attributes = attributes.each_with_object({}) { |(k, v), h|
69
+ if (!self.class.attribute_map.key?(k.to_sym))
70
+ fail ArgumentError, "`#{k}` is not a valid attribute in `FuseClient::UpdateEntityResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
71
+ end
72
+ h[k.to_sym] = v
73
+ }
74
+
75
+ if attributes.key?(:'id')
76
+ self.id = attributes[:'id']
77
+ end
78
+
79
+ if attributes.key?(:'email')
80
+ self.email = attributes[:'email']
81
+ end
82
+
83
+ if attributes.key?(:'aggregators')
84
+ if (value = attributes[:'aggregators']).is_a?(Array)
85
+ self.aggregators = value
86
+ end
87
+ end
88
+
89
+ if attributes.key?(:'institution_ids')
90
+ if (value = attributes[:'institution_ids']).is_a?(Array)
91
+ self.institution_ids = value
92
+ end
93
+ end
94
+ end
95
+
96
+ # Show invalid properties with the reasons. Usually used together with valid?
97
+ # @return Array for valid properties with the reasons
98
+ def list_invalid_properties
99
+ invalid_properties = Array.new
100
+ if !@aggregators.nil? && @aggregators.length < 1
101
+ invalid_properties.push('invalid value for "aggregators", number of items must be greater than or equal to 1.')
102
+ end
103
+
104
+ invalid_properties
105
+ end
106
+
107
+ # Check to see if the all the properties in the model are valid
108
+ # @return true if the model is valid
109
+ def valid?
110
+ return false if !@aggregators.nil? && @aggregators.length < 1
111
+ true
112
+ end
113
+
114
+ # Custom attribute writer method with validation
115
+ # @param [Object] aggregators Value to be assigned
116
+ def aggregators=(aggregators)
117
+ if !aggregators.nil? && aggregators.length < 1
118
+ fail ArgumentError, 'invalid value for "aggregators", number of items must be greater than or equal to 1.'
119
+ end
120
+
121
+ @aggregators = aggregators
122
+ end
123
+
124
+ # Checks equality by comparing each attribute.
125
+ # @param [Object] Object to be compared
126
+ def ==(o)
127
+ return true if self.equal?(o)
128
+ self.class == o.class &&
129
+ id == o.id &&
130
+ email == o.email &&
131
+ aggregators == o.aggregators &&
132
+ institution_ids == o.institution_ids
133
+ end
134
+
135
+ # @see the `==` method
136
+ # @param [Object] Object to be compared
137
+ def eql?(o)
138
+ self == o
139
+ end
140
+
141
+ # Calculates hash code according to all attributes.
142
+ # @return [Integer] Hash code
143
+ def hash
144
+ [id, email, aggregators, institution_ids].hash
145
+ end
146
+
147
+ # Builds the object from hash
148
+ # @param [Hash] attributes Model attributes in the form of hash
149
+ # @return [Object] Returns the model itself
150
+ def self.build_from_hash(attributes)
151
+ new.build_from_hash(attributes)
152
+ end
153
+
154
+ # Builds the object from hash
155
+ # @param [Hash] attributes Model attributes in the form of hash
156
+ # @return [Object] Returns the model itself
157
+ def build_from_hash(attributes)
158
+ return nil unless attributes.is_a?(Hash)
159
+ attributes = attributes.transform_keys(&:to_sym)
160
+ self.class.openapi_types.each_pair do |key, type|
161
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
162
+ self.send("#{key}=", nil)
163
+ elsif type =~ /\AArray<(.*)>/i
164
+ # check to ensure the input is an array given that the attribute
165
+ # is documented as an array but the input is not
166
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
167
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
168
+ end
169
+ elsif !attributes[self.class.attribute_map[key]].nil?
170
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
171
+ end
172
+ end
173
+
174
+ self
175
+ end
176
+
177
+ # Deserializes the data based on type
178
+ # @param string type Data type
179
+ # @param string value Value to be deserialized
180
+ # @return [Object] Deserialized data
181
+ def _deserialize(type, value)
182
+ case type.to_sym
183
+ when :Time
184
+ Time.parse(value)
185
+ when :Date
186
+ Date.parse(value)
187
+ when :String
188
+ value.to_s
189
+ when :Integer
190
+ value.to_i
191
+ when :Float
192
+ value.to_f
193
+ when :Boolean
194
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
195
+ true
196
+ else
197
+ false
198
+ end
199
+ when :Object
200
+ # generic object (usually a Hash), return directly
201
+ value
202
+ when /\AArray<(?<inner_type>.+)>\z/
203
+ inner_type = Regexp.last_match[:inner_type]
204
+ value.map { |v| _deserialize(inner_type, v) }
205
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
206
+ k_type = Regexp.last_match[:k_type]
207
+ v_type = Regexp.last_match[:v_type]
208
+ {}.tap do |hash|
209
+ value.each do |k, v|
210
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
211
+ end
212
+ end
213
+ else # model
214
+ # models (e.g. Pet) or oneOf
215
+ klass = FuseClient.const_get(type)
216
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
217
+ end
218
+ end
219
+
220
+ # Returns the string representation of the object
221
+ # @return [String] String presentation of the object
222
+ def to_s
223
+ to_hash.to_s
224
+ end
225
+
226
+ # to_body is an alias to to_hash (backward compatibility)
227
+ # @return [Hash] Returns the object in the form of hash
228
+ def to_body
229
+ to_hash
230
+ end
231
+
232
+ # Returns the object in the form of hash
233
+ # @return [Hash] Returns the object in the form of hash
234
+ def to_hash
235
+ hash = {}
236
+ self.class.attribute_map.each_pair do |attr, param|
237
+ value = self.send(attr)
238
+ if value.nil?
239
+ is_nullable = self.class.openapi_nullable.include?(attr)
240
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
241
+ end
242
+
243
+ hash[param] = _to_hash(value)
244
+ end
245
+ hash
246
+ end
247
+
248
+ # Outputs non-array value in the form of hash
249
+ # For object, use to_hash. Otherwise, just return the value
250
+ # @param [Object] value Any valid value
251
+ # @return [Hash] Returns the value in the form of hash
252
+ def _to_hash(value)
253
+ if value.is_a?(Array)
254
+ value.compact.map { |v| _to_hash(v) }
255
+ elsif value.is_a?(Hash)
256
+ {}.tap do |hash|
257
+ value.each { |k, v| hash[k] = _to_hash(v) }
258
+ end
259
+ elsif value.respond_to? :to_hash
260
+ value.to_hash
261
+ else
262
+ value
263
+ end
264
+ end
265
+
266
+ end
267
+
268
+ end
@@ -11,5 +11,5 @@ OpenAPI Generator version: 6.2.1
11
11
  =end
12
12
 
13
13
  module FuseClient
14
- VERSION = '0.3.2'
14
+ VERSION = '0.3.4'
15
15
  end