fuse_client 1.0.33 → 1.0.34

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 (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
@@ -21,19 +21,19 @@ module FuseClient
21
21
  # The customization id of the spend power.
22
22
  attr_accessor :customization_id
23
23
 
24
- # The amount, in cents, of the users spend limit.
24
+ # The total limit for the current timeframe, in cents.
25
25
  attr_accessor :spend_limit
26
26
 
27
- # The amount, in cents, that the user has already spent.
27
+ # The total current spend in the current timeframe, in cents, without factoring in pending payments.
28
28
  attr_accessor :current_spend
29
29
 
30
- # The accumulative amount, in cents, of all the combined pending payments.
30
+ # The total unpaid amount, in cents, from all timeframes.
31
31
  attr_accessor :pending_payments_amount
32
32
 
33
- # The currency.
34
- attr_accessor :currency
33
+ # The ISO-4217 currency code of the transaction
34
+ attr_accessor :iso_currency_code
35
35
 
36
- # The datetime of when the spend power was most recently updated.
36
+ # The datetime of when the spend power was most recently updated, in ISO-8601 format.
37
37
  attr_accessor :last_updated
38
38
 
39
39
  # Attribute mapping from ruby-style variable name to JSON key.
@@ -44,7 +44,7 @@ module FuseClient
44
44
  :'spend_limit' => :'spend_limit',
45
45
  :'current_spend' => :'current_spend',
46
46
  :'pending_payments_amount' => :'pending_payments_amount',
47
- :'currency' => :'currency',
47
+ :'iso_currency_code' => :'iso_currency_code',
48
48
  :'last_updated' => :'last_updated'
49
49
  }
50
50
  end
@@ -59,10 +59,10 @@ module FuseClient
59
59
  {
60
60
  :'id' => :'String',
61
61
  :'customization_id' => :'String',
62
- :'spend_limit' => :'String',
63
- :'current_spend' => :'String',
64
- :'pending_payments_amount' => :'String',
65
- :'currency' => :'String',
62
+ :'spend_limit' => :'Float',
63
+ :'current_spend' => :'Float',
64
+ :'pending_payments_amount' => :'Float',
65
+ :'iso_currency_code' => :'String',
66
66
  :'last_updated' => :'String'
67
67
  }
68
68
  end
@@ -108,8 +108,8 @@ module FuseClient
108
108
  self.pending_payments_amount = attributes[:'pending_payments_amount']
109
109
  end
110
110
 
111
- if attributes.key?(:'currency')
112
- self.currency = attributes[:'currency']
111
+ if attributes.key?(:'iso_currency_code')
112
+ self.iso_currency_code = attributes[:'iso_currency_code']
113
113
  end
114
114
 
115
115
  if attributes.key?(:'last_updated')
@@ -141,8 +141,8 @@ module FuseClient
141
141
  invalid_properties.push('invalid value for "pending_payments_amount", pending_payments_amount cannot be nil.')
142
142
  end
143
143
 
144
- if @currency.nil?
145
- invalid_properties.push('invalid value for "currency", currency cannot be nil.')
144
+ if @iso_currency_code.nil?
145
+ invalid_properties.push('invalid value for "iso_currency_code", iso_currency_code cannot be nil.')
146
146
  end
147
147
 
148
148
  if @last_updated.nil?
@@ -160,7 +160,7 @@ module FuseClient
160
160
  return false if @spend_limit.nil?
161
161
  return false if @current_spend.nil?
162
162
  return false if @pending_payments_amount.nil?
163
- return false if @currency.nil?
163
+ return false if @iso_currency_code.nil?
164
164
  return false if @last_updated.nil?
165
165
  true
166
166
  end
@@ -175,7 +175,7 @@ module FuseClient
175
175
  spend_limit == o.spend_limit &&
176
176
  current_spend == o.current_spend &&
177
177
  pending_payments_amount == o.pending_payments_amount &&
178
- currency == o.currency &&
178
+ iso_currency_code == o.iso_currency_code &&
179
179
  last_updated == o.last_updated
180
180
  end
181
181
 
@@ -188,7 +188,7 @@ module FuseClient
188
188
  # Calculates hash code according to all attributes.
189
189
  # @return [Integer] Hash code
190
190
  def hash
191
- [id, customization_id, spend_limit, current_spend, pending_payments_amount, currency, last_updated].hash
191
+ [id, customization_id, spend_limit, current_spend, pending_payments_amount, iso_currency_code, last_updated].hash
192
192
  end
193
193
 
194
194
  # Builds the object from hash
@@ -15,7 +15,9 @@ require 'time'
15
15
 
16
16
  module FuseClient
17
17
  class SpendPowerCustomization
18
- # The timeframe to base the spend power on.
18
+ # The id of the spend power customization
19
+ attr_accessor :id
20
+
19
21
  attr_accessor :timeframe
20
22
 
21
23
  # The minimum allowed limit for the spend power, in cents.
@@ -49,6 +51,7 @@ module FuseClient
49
51
  # Attribute mapping from ruby-style variable name to JSON key.
50
52
  def self.attribute_map
51
53
  {
54
+ :'id' => :'id',
52
55
  :'timeframe' => :'timeframe',
53
56
  :'min_limit' => :'min_limit',
54
57
  :'max_limit' => :'max_limit'
@@ -63,9 +66,10 @@ module FuseClient
63
66
  # Attribute type mapping.
64
67
  def self.openapi_types
65
68
  {
66
- :'timeframe' => :'String',
67
- :'min_limit' => :'String',
68
- :'max_limit' => :'String'
69
+ :'id' => :'String',
70
+ :'timeframe' => :'SpendPowerTimeFrame',
71
+ :'min_limit' => :'Float',
72
+ :'max_limit' => :'Float'
69
73
  }
70
74
  end
71
75
 
@@ -90,6 +94,10 @@ module FuseClient
90
94
  h[k.to_sym] = v
91
95
  }
92
96
 
97
+ if attributes.key?(:'id')
98
+ self.id = attributes[:'id']
99
+ end
100
+
93
101
  if attributes.key?(:'timeframe')
94
102
  self.timeframe = attributes[:'timeframe']
95
103
  end
@@ -107,6 +115,10 @@ module FuseClient
107
115
  # @return Array for valid properties with the reasons
108
116
  def list_invalid_properties
109
117
  invalid_properties = Array.new
118
+ if @id.nil?
119
+ invalid_properties.push('invalid value for "id", id cannot be nil.')
120
+ end
121
+
110
122
  if @timeframe.nil?
111
123
  invalid_properties.push('invalid value for "timeframe", timeframe cannot be nil.')
112
124
  end
@@ -115,32 +127,59 @@ module FuseClient
115
127
  invalid_properties.push('invalid value for "min_limit", min_limit cannot be nil.')
116
128
  end
117
129
 
130
+ if @min_limit < 0
131
+ invalid_properties.push('invalid value for "min_limit", must be greater than or equal to 0.')
132
+ end
133
+
118
134
  if @max_limit.nil?
119
135
  invalid_properties.push('invalid value for "max_limit", max_limit cannot be nil.')
120
136
  end
121
137
 
138
+ if @max_limit < 1
139
+ invalid_properties.push('invalid value for "max_limit", must be greater than or equal to 1.')
140
+ end
141
+
122
142
  invalid_properties
123
143
  end
124
144
 
125
145
  # Check to see if the all the properties in the model are valid
126
146
  # @return true if the model is valid
127
147
  def valid?
148
+ return false if @id.nil?
128
149
  return false if @timeframe.nil?
129
- timeframe_validator = EnumAttributeValidator.new('String', ["daily", "weekly", "monthly"])
130
- return false unless timeframe_validator.valid?(@timeframe)
131
150
  return false if @min_limit.nil?
151
+ return false if @min_limit < 0
132
152
  return false if @max_limit.nil?
153
+ return false if @max_limit < 1
133
154
  true
134
155
  end
135
156
 
136
- # Custom attribute writer method checking allowed values (enum).
137
- # @param [Object] timeframe Object to be assigned
138
- def timeframe=(timeframe)
139
- validator = EnumAttributeValidator.new('String', ["daily", "weekly", "monthly"])
140
- unless validator.valid?(timeframe)
141
- fail ArgumentError, "invalid value for \"timeframe\", must be one of #{validator.allowable_values}."
157
+ # Custom attribute writer method with validation
158
+ # @param [Object] min_limit Value to be assigned
159
+ def min_limit=(min_limit)
160
+ if min_limit.nil?
161
+ fail ArgumentError, 'min_limit cannot be nil'
142
162
  end
143
- @timeframe = timeframe
163
+
164
+ if min_limit < 0
165
+ fail ArgumentError, 'invalid value for "min_limit", must be greater than or equal to 0.'
166
+ end
167
+
168
+ @min_limit = min_limit
169
+ end
170
+
171
+ # Custom attribute writer method with validation
172
+ # @param [Object] max_limit Value to be assigned
173
+ def max_limit=(max_limit)
174
+ if max_limit.nil?
175
+ fail ArgumentError, 'max_limit cannot be nil'
176
+ end
177
+
178
+ if max_limit < 1
179
+ fail ArgumentError, 'invalid value for "max_limit", must be greater than or equal to 1.'
180
+ end
181
+
182
+ @max_limit = max_limit
144
183
  end
145
184
 
146
185
  # Checks equality by comparing each attribute.
@@ -148,6 +187,7 @@ module FuseClient
148
187
  def ==(o)
149
188
  return true if self.equal?(o)
150
189
  self.class == o.class &&
190
+ id == o.id &&
151
191
  timeframe == o.timeframe &&
152
192
  min_limit == o.min_limit &&
153
193
  max_limit == o.max_limit
@@ -162,7 +202,7 @@ module FuseClient
162
202
  # Calculates hash code according to all attributes.
163
203
  # @return [Integer] Hash code
164
204
  def hash
165
- [timeframe, min_limit, max_limit].hash
205
+ [id, timeframe, min_limit, max_limit].hash
166
206
  end
167
207
 
168
208
  # Builds the object from hash
@@ -0,0 +1,41 @@
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 SpendPowerTimeFrame
18
+ DAILY = "daily".freeze
19
+ WEEKLY = "weekly".freeze
20
+ MONTHLY = "monthly".freeze
21
+
22
+ def self.all_vars
23
+ @all_vars ||= [DAILY, WEEKLY, MONTHLY].freeze
24
+ end
25
+
26
+ # Builds the enum from string
27
+ # @param [String] The enum value in the form of the string
28
+ # @return [String] The enum value
29
+ def self.build_from_hash(value)
30
+ new.build_from_hash(value)
31
+ end
32
+
33
+ # Builds the enum from string
34
+ # @param [String] The enum value in the form of the string
35
+ # @return [String] The enum value
36
+ def build_from_hash(value)
37
+ return value if SpendPowerTimeFrame.all_vars.include?(value)
38
+ raise "Invalid ENUM value #{value} for class #SpendPowerTimeFrame"
39
+ end
40
+ end
41
+ end
@@ -21,7 +21,7 @@ module FuseClient
21
21
  # Remote Account Id of the transaction, ie Plaid Account Id
22
22
  attr_accessor :remote_account_id
23
23
 
24
- # Amount in cents associated with the transaction. Positive values when money moves out of the account; negative values when money moves in. For example, debit card purchases are positive; credit card payments, direct deposits, and refunds are negative.
24
+ # Amount in cents associated with the transaction. The format of this value is a double. Positive values when money moves out of the account; negative values when money moves in. For example, debit card purchases are positive; credit card payments, direct deposits, and refunds are negative.
25
25
  attr_accessor :amount
26
26
 
27
27
  # Date of the transaction (YYYY-MM-DD)
@@ -0,0 +1,260 @@
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 TransactionCategory
18
+ attr_accessor :primary
19
+
20
+ attr_accessor :detailed
21
+
22
+ class EnumAttributeValidator
23
+ attr_reader :datatype
24
+ attr_reader :allowable_values
25
+
26
+ def initialize(datatype, allowable_values)
27
+ @allowable_values = allowable_values.map do |value|
28
+ case datatype.to_s
29
+ when /Integer/i
30
+ value.to_i
31
+ when /Float/i
32
+ value.to_f
33
+ else
34
+ value
35
+ end
36
+ end
37
+ end
38
+
39
+ def valid?(value)
40
+ !value || allowable_values.include?(value)
41
+ end
42
+ end
43
+
44
+ # Attribute mapping from ruby-style variable name to JSON key.
45
+ def self.attribute_map
46
+ {
47
+ :'primary' => :'primary',
48
+ :'detailed' => :'detailed'
49
+ }
50
+ end
51
+
52
+ # Returns all the JSON keys this model knows about
53
+ def self.acceptable_attributes
54
+ attribute_map.values
55
+ end
56
+
57
+ # Attribute type mapping.
58
+ def self.openapi_types
59
+ {
60
+ :'primary' => :'TransactionCategoryPrimary',
61
+ :'detailed' => :'TransactionCategoryDetailed'
62
+ }
63
+ end
64
+
65
+ # List of attributes with nullable: true
66
+ def self.openapi_nullable
67
+ Set.new([
68
+ ])
69
+ end
70
+
71
+ # Initializes the object
72
+ # @param [Hash] attributes Model attributes in the form of hash
73
+ def initialize(attributes = {})
74
+ if (!attributes.is_a?(Hash))
75
+ fail ArgumentError, "The input argument (attributes) must be a hash in `FuseClient::TransactionCategory` initialize method"
76
+ end
77
+
78
+ # check to see if the attribute exists and convert string to symbol for hash key
79
+ attributes = attributes.each_with_object({}) { |(k, v), h|
80
+ if (!self.class.attribute_map.key?(k.to_sym))
81
+ fail ArgumentError, "`#{k}` is not a valid attribute in `FuseClient::TransactionCategory`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
82
+ end
83
+ h[k.to_sym] = v
84
+ }
85
+
86
+ if attributes.key?(:'primary')
87
+ self.primary = attributes[:'primary']
88
+ end
89
+
90
+ if attributes.key?(:'detailed')
91
+ self.detailed = attributes[:'detailed']
92
+ end
93
+ end
94
+
95
+ # Show invalid properties with the reasons. Usually used together with valid?
96
+ # @return Array for valid properties with the reasons
97
+ def list_invalid_properties
98
+ invalid_properties = Array.new
99
+ if @primary.nil?
100
+ invalid_properties.push('invalid value for "primary", primary cannot be nil.')
101
+ end
102
+
103
+ if @detailed.nil?
104
+ invalid_properties.push('invalid value for "detailed", detailed cannot be nil.')
105
+ end
106
+
107
+ invalid_properties
108
+ end
109
+
110
+ # Check to see if the all the properties in the model are valid
111
+ # @return true if the model is valid
112
+ def valid?
113
+ return false if @primary.nil?
114
+ return false if @detailed.nil?
115
+ true
116
+ end
117
+
118
+ # Checks equality by comparing each attribute.
119
+ # @param [Object] Object to be compared
120
+ def ==(o)
121
+ return true if self.equal?(o)
122
+ self.class == o.class &&
123
+ primary == o.primary &&
124
+ detailed == o.detailed
125
+ end
126
+
127
+ # @see the `==` method
128
+ # @param [Object] Object to be compared
129
+ def eql?(o)
130
+ self == o
131
+ end
132
+
133
+ # Calculates hash code according to all attributes.
134
+ # @return [Integer] Hash code
135
+ def hash
136
+ [primary, detailed].hash
137
+ end
138
+
139
+ # Builds the object from hash
140
+ # @param [Hash] attributes Model attributes in the form of hash
141
+ # @return [Object] Returns the model itself
142
+ def self.build_from_hash(attributes)
143
+ new.build_from_hash(attributes)
144
+ end
145
+
146
+ # Builds the object from hash
147
+ # @param [Hash] attributes Model attributes in the form of hash
148
+ # @return [Object] Returns the model itself
149
+ def build_from_hash(attributes)
150
+ return nil unless attributes.is_a?(Hash)
151
+ attributes = attributes.transform_keys(&:to_sym)
152
+ self.class.openapi_types.each_pair do |key, type|
153
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
154
+ self.send("#{key}=", nil)
155
+ elsif type =~ /\AArray<(.*)>/i
156
+ # check to ensure the input is an array given that the attribute
157
+ # is documented as an array but the input is not
158
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
159
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
160
+ end
161
+ elsif !attributes[self.class.attribute_map[key]].nil?
162
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
163
+ end
164
+ end
165
+
166
+ self
167
+ end
168
+
169
+ # Deserializes the data based on type
170
+ # @param string type Data type
171
+ # @param string value Value to be deserialized
172
+ # @return [Object] Deserialized data
173
+ def _deserialize(type, value)
174
+ case type.to_sym
175
+ when :Time
176
+ Time.parse(value)
177
+ when :Date
178
+ Date.parse(value)
179
+ when :String
180
+ value.to_s
181
+ when :Integer
182
+ value.to_i
183
+ when :Float
184
+ value.to_f
185
+ when :Boolean
186
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
187
+ true
188
+ else
189
+ false
190
+ end
191
+ when :Object
192
+ # generic object (usually a Hash), return directly
193
+ value
194
+ when /\AArray<(?<inner_type>.+)>\z/
195
+ inner_type = Regexp.last_match[:inner_type]
196
+ value.map { |v| _deserialize(inner_type, v) }
197
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
198
+ k_type = Regexp.last_match[:k_type]
199
+ v_type = Regexp.last_match[:v_type]
200
+ {}.tap do |hash|
201
+ value.each do |k, v|
202
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
203
+ end
204
+ end
205
+ else # model
206
+ # models (e.g. Pet) or oneOf
207
+ klass = FuseClient.const_get(type)
208
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
209
+ end
210
+ end
211
+
212
+ # Returns the string representation of the object
213
+ # @return [String] String presentation of the object
214
+ def to_s
215
+ to_hash.to_s
216
+ end
217
+
218
+ # to_body is an alias to to_hash (backward compatibility)
219
+ # @return [Hash] Returns the object in the form of hash
220
+ def to_body
221
+ to_hash
222
+ end
223
+
224
+ # Returns the object in the form of hash
225
+ # @return [Hash] Returns the object in the form of hash
226
+ def to_hash
227
+ hash = {}
228
+ self.class.attribute_map.each_pair do |attr, param|
229
+ value = self.send(attr)
230
+ if value.nil?
231
+ is_nullable = self.class.openapi_nullable.include?(attr)
232
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
233
+ end
234
+
235
+ hash[param] = _to_hash(value)
236
+ end
237
+ hash
238
+ end
239
+
240
+ # Outputs non-array value in the form of hash
241
+ # For object, use to_hash. Otherwise, just return the value
242
+ # @param [Object] value Any valid value
243
+ # @return [Hash] Returns the value in the form of hash
244
+ def _to_hash(value)
245
+ if value.is_a?(Array)
246
+ value.compact.map { |v| _to_hash(v) }
247
+ elsif value.is_a?(Hash)
248
+ {}.tap do |hash|
249
+ value.each { |k, v| hash[k] = _to_hash(v) }
250
+ end
251
+ elsif value.respond_to? :to_hash
252
+ value.to_hash
253
+ else
254
+ value
255
+ end
256
+ end
257
+
258
+ end
259
+
260
+ end
@@ -0,0 +1,135 @@
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 TransactionCategoryDetailed
18
+ AUTO_INSURANCE = "auto_insurance".freeze
19
+ AUTO_PAYMENT = "auto_payment".freeze
20
+ GAS = "gas".freeze
21
+ PARKING = "parking".freeze
22
+ PUBLIC_TRANSPORTATION = "public_transportation".freeze
23
+ SERVICE_AND_PARTS = "service_and_parts".freeze
24
+ DOMAIN_NAMES = "domain_names".freeze
25
+ FRAUD_PROTECTION = "fraud_protection".freeze
26
+ HOME_PHONE = "home_phone".freeze
27
+ HOSTING = "hosting".freeze
28
+ INTERNET = "internet".freeze
29
+ MOBILE_PHONE = "mobile_phone".freeze
30
+ TELEVISION = "television".freeze
31
+ UTILITIES = "utilities".freeze
32
+ ADVERTISING = "advertising".freeze
33
+ LEGAL = "legal".freeze
34
+ OFFICE_SUPPLIES = "office_supplies".freeze
35
+ PRINTING = "printing".freeze
36
+ SHIPPING = "shipping".freeze
37
+ BOOKS_AND_SUPPLIES = "books_and_supplies".freeze
38
+ STUDENT_LOAN = "student_loan".freeze
39
+ TUITION = "tuition".freeze
40
+ AMUSEMENT = "amusement".freeze
41
+ ARTS = "arts".freeze
42
+ MOVIES_AND_DVDS = "movies_and_dvds".freeze
43
+ MUSIC = "music".freeze
44
+ NEWSPAPERS_AND_MAGAZINES = "newspapers_and_magazines".freeze
45
+ ATM_FEE = "atm_fee".freeze
46
+ BANKING_FEE = "banking_fee".freeze
47
+ FINANCE_CHARGE = "finance_charge".freeze
48
+ LATE_FEE = "late_fee".freeze
49
+ SERVICE_FEE = "service_fee".freeze
50
+ TRADE_COMMISSIONS = "trade_commissions".freeze
51
+ FINANCIAL_ADVISOR = "financial_advisor".freeze
52
+ LIFE_INSURANCE = "life_insurance".freeze
53
+ ALCOHOL_AND_BARS = "alcohol_and_bars".freeze
54
+ COFFEE_SHOPS = "coffee_shops".freeze
55
+ FAST_FOOD = "fast_food".freeze
56
+ GROCERIES = "groceries".freeze
57
+ RESTAURANTS = "restaurants".freeze
58
+ CHARITY = "charity".freeze
59
+ GIFT = "gift".freeze
60
+ DENTIST = "dentist".freeze
61
+ DOCTOR = "doctor".freeze
62
+ EYECARE = "eyecare".freeze
63
+ GYM = "gym".freeze
64
+ HEALTH_INSURANCE = "health_insurance".freeze
65
+ PHARMACY = "pharmacy".freeze
66
+ SPORTS = "sports".freeze
67
+ FURNISHINGS = "furnishings".freeze
68
+ HOME_IMPROVEMENT = "home_improvement".freeze
69
+ HOME_INSURANCE = "home_insurance".freeze
70
+ HOME_SERVICES = "home_services".freeze
71
+ HOME_SUPPLIES = "home_supplies".freeze
72
+ LAWN_AND_GARDEN = "lawn_and_garden".freeze
73
+ MORTGAGE_AND_RENT = "mortgage_and_rent".freeze
74
+ BONUS = "bonus".freeze
75
+ INTEREST_INCOME = "interest_income".freeze
76
+ PAYCHECK = "paycheck".freeze
77
+ REIMBURSEMENT = "reimbursement".freeze
78
+ RENTAL_INCOME = "rental_income".freeze
79
+ RETURNED_PURCHASE = "returned_purchase".freeze
80
+ BUY = "buy".freeze
81
+ DEPOSIT = "deposit".freeze
82
+ DIVIDEND_AND_CAP_GAINS = "dividend_and_cap_gains".freeze
83
+ SELL = "sell".freeze
84
+ WITHDRAWAL = "withdrawal".freeze
85
+ ALLOWANCE = "allowance".freeze
86
+ BABY_SUPPLIES = "baby_supplies".freeze
87
+ BABYSITTER_AND_DAYCARE = "babysitter_and_daycare".freeze
88
+ CHILD_SUPPORT = "child_support".freeze
89
+ KIDS_ACTIVITIES = "kids_activities".freeze
90
+ TOYS = "toys".freeze
91
+ HAIR = "hair".freeze
92
+ LAUNDRY = "laundry".freeze
93
+ SPA_AND_MASSAGE = "spa_and_massage".freeze
94
+ PET_FOOD_AND_SUPPLIES = "pet_food_and_supplies".freeze
95
+ PET_GROOMING = "pet_grooming".freeze
96
+ VETERINARY = "veterinary".freeze
97
+ BOOKS = "books".freeze
98
+ CLOTHING = "clothing".freeze
99
+ HOBBIES = "hobbies".freeze
100
+ SPORTING_GOODS = "sporting_goods".freeze
101
+ FEDERAL_TAX = "federal_tax".freeze
102
+ LOCAL_TAX = "local_tax".freeze
103
+ PROPERTY_TAX = "property_tax".freeze
104
+ SALES_TAX = "sales_tax".freeze
105
+ STATE_TAX = "state_tax".freeze
106
+ CREDIT_CARD_PAYMENT = "credit_card_payment".freeze
107
+ TRANSFER_FOR_CASH_SPENDING = "transfer_for_cash_spending".freeze
108
+ MORTGAGE_PAYMENT = "mortgage_payment".freeze
109
+ AIR_TRAVEL = "air_travel".freeze
110
+ HOTEL = "hotel".freeze
111
+ RENTAL_CAR_AND_TAXI = "rental_car_and_taxi".freeze
112
+ VACATION = "vacation".freeze
113
+ CASH = "cash".freeze
114
+ CHECK = "check".freeze
115
+
116
+ def self.all_vars
117
+ @all_vars ||= [AUTO_INSURANCE, AUTO_PAYMENT, GAS, PARKING, PUBLIC_TRANSPORTATION, SERVICE_AND_PARTS, DOMAIN_NAMES, FRAUD_PROTECTION, HOME_PHONE, HOSTING, INTERNET, MOBILE_PHONE, TELEVISION, UTILITIES, ADVERTISING, LEGAL, OFFICE_SUPPLIES, PRINTING, SHIPPING, BOOKS_AND_SUPPLIES, STUDENT_LOAN, TUITION, AMUSEMENT, ARTS, MOVIES_AND_DVDS, MUSIC, NEWSPAPERS_AND_MAGAZINES, ATM_FEE, BANKING_FEE, FINANCE_CHARGE, LATE_FEE, SERVICE_FEE, TRADE_COMMISSIONS, FINANCIAL_ADVISOR, LIFE_INSURANCE, ALCOHOL_AND_BARS, COFFEE_SHOPS, FAST_FOOD, GROCERIES, RESTAURANTS, CHARITY, GIFT, DENTIST, DOCTOR, EYECARE, GYM, HEALTH_INSURANCE, PHARMACY, SPORTS, FURNISHINGS, HOME_IMPROVEMENT, HOME_INSURANCE, HOME_SERVICES, HOME_SUPPLIES, LAWN_AND_GARDEN, MORTGAGE_AND_RENT, BONUS, INTEREST_INCOME, PAYCHECK, REIMBURSEMENT, RENTAL_INCOME, RETURNED_PURCHASE, BUY, DEPOSIT, DIVIDEND_AND_CAP_GAINS, SELL, WITHDRAWAL, ALLOWANCE, BABY_SUPPLIES, BABYSITTER_AND_DAYCARE, CHILD_SUPPORT, KIDS_ACTIVITIES, TOYS, HAIR, LAUNDRY, SPA_AND_MASSAGE, PET_FOOD_AND_SUPPLIES, PET_GROOMING, VETERINARY, BOOKS, CLOTHING, HOBBIES, SPORTING_GOODS, FEDERAL_TAX, LOCAL_TAX, PROPERTY_TAX, SALES_TAX, STATE_TAX, CREDIT_CARD_PAYMENT, TRANSFER_FOR_CASH_SPENDING, MORTGAGE_PAYMENT, AIR_TRAVEL, HOTEL, RENTAL_CAR_AND_TAXI, VACATION, CASH, CHECK].freeze
118
+ end
119
+
120
+ # Builds the enum from string
121
+ # @param [String] The enum value in the form of the string
122
+ # @return [String] The enum value
123
+ def self.build_from_hash(value)
124
+ new.build_from_hash(value)
125
+ end
126
+
127
+ # Builds the enum from string
128
+ # @param [String] The enum value in the form of the string
129
+ # @return [String] The enum value
130
+ def build_from_hash(value)
131
+ return value if TransactionCategoryDetailed.all_vars.include?(value)
132
+ raise "Invalid ENUM value #{value} for class #TransactionCategoryDetailed"
133
+ end
134
+ end
135
+ end