ynab 2.1.0 → 3.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (136) hide show
  1. checksums.yaml +4 -4
  2. data/DEVELOPMENT.md +6 -2
  3. data/Gemfile.lock +1 -1
  4. data/README.md +3 -1
  5. data/docs/BulkTransactions.md +1 -1
  6. data/docs/CategoriesApi.md +22 -0
  7. data/docs/ExistingTransaction.md +18 -0
  8. data/docs/HybridTransaction.md +3 -2
  9. data/docs/NewTransaction.md +19 -0
  10. data/docs/PatchCategoryWrapper.md +8 -0
  11. data/docs/PatchPayeeWrapper.md +8 -0
  12. data/docs/PatchTransactionsWrapper.md +1 -1
  13. data/docs/PayeesApi.md +22 -0
  14. data/docs/PostTransactionsWrapper.md +2 -2
  15. data/docs/PutTransactionWrapper.md +1 -1
  16. data/docs/SaveCategory.md +10 -0
  17. data/docs/SavePayee.md +8 -0
  18. data/docs/SavePayeeResponse.md +8 -0
  19. data/docs/SavePayeeResponseData.md +9 -0
  20. data/docs/SaveTransactionWithIdOrImportId.md +20 -0
  21. data/docs/SaveTransactionWithOptionalFields.md +2 -3
  22. data/docs/ScheduledTransactionDetail.md +2 -1
  23. data/docs/ScheduledTransactionSummary.md +2 -1
  24. data/docs/TransactionClearedStatus.md +7 -0
  25. data/docs/TransactionDetail.md +3 -2
  26. data/docs/TransactionFlagColor.md +7 -0
  27. data/docs/TransactionSummary.md +3 -2
  28. data/docs/TransactionsApi.md +7 -7
  29. data/lib/ynab/api/accounts_api.rb +2 -2
  30. data/lib/ynab/api/budgets_api.rb +2 -2
  31. data/lib/ynab/api/categories_api.rb +82 -2
  32. data/lib/ynab/api/months_api.rb +2 -2
  33. data/lib/ynab/api/payee_locations_api.rb +2 -2
  34. data/lib/ynab/api/payees_api.rb +82 -2
  35. data/lib/ynab/api/scheduled_transactions_api.rb +2 -2
  36. data/lib/ynab/api/transactions_api.rb +12 -12
  37. data/lib/ynab/api/user_api.rb +2 -2
  38. data/lib/ynab/api_client.rb +2 -2
  39. data/lib/ynab/configuration.rb +14 -11
  40. data/lib/ynab/models/account.rb +13 -20
  41. data/lib/ynab/models/account_response.rb +13 -20
  42. data/lib/ynab/models/account_response_data.rb +13 -20
  43. data/lib/ynab/models/account_type.rb +2 -2
  44. data/lib/ynab/models/accounts_response.rb +13 -20
  45. data/lib/ynab/models/accounts_response_data.rb +13 -20
  46. data/lib/ynab/models/budget_detail.rb +13 -21
  47. data/lib/ynab/models/budget_detail_response.rb +13 -20
  48. data/lib/ynab/models/budget_detail_response_data.rb +13 -20
  49. data/lib/ynab/models/budget_settings.rb +13 -20
  50. data/lib/ynab/models/budget_settings_response.rb +13 -20
  51. data/lib/ynab/models/budget_settings_response_data.rb +13 -20
  52. data/lib/ynab/models/budget_summary.rb +13 -20
  53. data/lib/ynab/models/budget_summary_response.rb +13 -20
  54. data/lib/ynab/models/budget_summary_response_data.rb +13 -20
  55. data/lib/ynab/models/bulk_response.rb +13 -20
  56. data/lib/ynab/models/bulk_response_data.rb +13 -20
  57. data/lib/ynab/models/bulk_response_data_bulk.rb +13 -20
  58. data/lib/ynab/models/bulk_transactions.rb +14 -21
  59. data/lib/ynab/models/categories_response.rb +13 -20
  60. data/lib/ynab/models/categories_response_data.rb +13 -20
  61. data/lib/ynab/models/category.rb +13 -20
  62. data/lib/ynab/models/category_group.rb +13 -20
  63. data/lib/ynab/models/category_group_with_categories.rb +14 -22
  64. data/lib/ynab/models/category_response.rb +13 -20
  65. data/lib/ynab/models/category_response_data.rb +13 -20
  66. data/lib/ynab/models/currency_format.rb +13 -20
  67. data/lib/ynab/models/date_format.rb +13 -20
  68. data/lib/ynab/models/error_detail.rb +13 -20
  69. data/lib/ynab/models/error_response.rb +13 -20
  70. data/lib/ynab/models/existing_transaction.rb +359 -0
  71. data/lib/ynab/models/hybrid_transaction.rb +28 -43
  72. data/lib/ynab/models/hybrid_transactions_response.rb +13 -20
  73. data/lib/ynab/models/hybrid_transactions_response_data.rb +13 -20
  74. data/lib/ynab/models/month_detail.rb +13 -21
  75. data/lib/ynab/models/month_detail_response.rb +13 -20
  76. data/lib/ynab/models/month_detail_response_data.rb +13 -20
  77. data/lib/ynab/models/month_summaries_response.rb +13 -20
  78. data/lib/ynab/models/month_summaries_response_data.rb +13 -20
  79. data/lib/ynab/models/month_summary.rb +13 -20
  80. data/lib/ynab/models/new_transaction.rb +377 -0
  81. data/lib/ynab/models/patch_category_wrapper.rb +213 -0
  82. data/lib/ynab/models/patch_month_category_wrapper.rb +13 -20
  83. data/lib/ynab/models/patch_payee_wrapper.rb +213 -0
  84. data/lib/ynab/models/patch_transactions_wrapper.rb +14 -21
  85. data/lib/ynab/models/payee.rb +13 -20
  86. data/lib/ynab/models/payee_location.rb +13 -20
  87. data/lib/ynab/models/payee_location_response.rb +13 -20
  88. data/lib/ynab/models/payee_location_response_data.rb +13 -20
  89. data/lib/ynab/models/payee_locations_response.rb +13 -20
  90. data/lib/ynab/models/payee_locations_response_data.rb +13 -20
  91. data/lib/ynab/models/payee_response.rb +13 -20
  92. data/lib/ynab/models/payee_response_data.rb +13 -20
  93. data/lib/ynab/models/payees_response.rb +13 -20
  94. data/lib/ynab/models/payees_response_data.rb +13 -20
  95. data/lib/ynab/models/post_account_wrapper.rb +13 -20
  96. data/lib/ynab/models/post_transactions_wrapper.rb +15 -22
  97. data/lib/ynab/models/put_transaction_wrapper.rb +14 -21
  98. data/lib/ynab/models/save_account.rb +13 -20
  99. data/lib/ynab/models/save_category.rb +232 -0
  100. data/lib/ynab/models/save_category_response.rb +13 -20
  101. data/lib/ynab/models/save_category_response_data.rb +13 -20
  102. data/lib/ynab/models/save_month_category.rb +13 -20
  103. data/lib/ynab/models/save_payee.rb +220 -0
  104. data/lib/ynab/models/save_payee_response.rb +213 -0
  105. data/lib/ynab/models/save_payee_response_data.rb +224 -0
  106. data/lib/ynab/models/save_sub_transaction.rb +13 -20
  107. data/lib/ynab/models/save_transaction_with_id_or_import_id.rb +388 -0
  108. data/lib/ynab/models/save_transaction_with_optional_fields.rb +17 -59
  109. data/lib/ynab/models/save_transactions_response.rb +13 -20
  110. data/lib/ynab/models/save_transactions_response_data.rb +13 -20
  111. data/lib/ynab/models/scheduled_sub_transaction.rb +13 -20
  112. data/lib/ynab/models/scheduled_transaction_detail.rb +26 -32
  113. data/lib/ynab/models/scheduled_transaction_response.rb +13 -20
  114. data/lib/ynab/models/scheduled_transaction_response_data.rb +13 -20
  115. data/lib/ynab/models/scheduled_transaction_summary.rb +26 -31
  116. data/lib/ynab/models/scheduled_transactions_response.rb +13 -20
  117. data/lib/ynab/models/scheduled_transactions_response_data.rb +13 -20
  118. data/lib/ynab/models/sub_transaction.rb +13 -20
  119. data/lib/ynab/models/transaction_cleared_status.rb +41 -0
  120. data/lib/ynab/models/transaction_detail.rb +28 -43
  121. data/lib/ynab/models/transaction_flag_color.rb +45 -0
  122. data/lib/ynab/models/transaction_response.rb +13 -20
  123. data/lib/ynab/models/transaction_response_data.rb +13 -20
  124. data/lib/ynab/models/transaction_summary.rb +28 -42
  125. data/lib/ynab/models/transactions_import_response.rb +13 -20
  126. data/lib/ynab/models/transactions_import_response_data.rb +13 -20
  127. data/lib/ynab/models/transactions_response.rb +13 -20
  128. data/lib/ynab/models/transactions_response_data.rb +13 -20
  129. data/lib/ynab/models/user.rb +13 -20
  130. data/lib/ynab/models/user_response.rb +13 -20
  131. data/lib/ynab/models/user_response_data.rb +13 -20
  132. data/lib/ynab/version.rb +1 -1
  133. data/lib/ynab.rb +13 -12
  134. data/open_api_spec.yaml +455 -343
  135. data/ynab.gemspec +4 -3
  136. metadata +29 -7
@@ -3,10 +3,10 @@
3
3
 
4
4
  #Our API uses a REST based design, leverages the JSON data format, and relies upon HTTPS for transport. We respond with meaningful HTTP response codes and if an error occurs, we include error details in the response body. API Documentation is at https://api.ynab.com
5
5
 
6
- The version of the OpenAPI document: 1.0.0
6
+ The version of the OpenAPI document: 1.69.0
7
7
 
8
8
  Generated by: https://openapi-generator.tech
9
- OpenAPI Generator version: 6.6.0
9
+ Generator version: 7.6.0
10
10
 
11
11
  =end
12
12
 
@@ -147,37 +147,30 @@ module YNAB
147
147
  # @param [Hash] attributes Model attributes in the form of hash
148
148
  # @return [Object] Returns the model itself
149
149
  def self.build_from_hash(attributes)
150
- new.build_from_hash(attributes)
151
- end
152
-
153
- # Builds the object from hash
154
- # @param [Hash] attributes Model attributes in the form of hash
155
- # @return [Object] Returns the model itself
156
- def build_from_hash(attributes)
157
150
  return nil unless attributes.is_a?(Hash)
158
151
  attributes = attributes.transform_keys(&:to_sym)
159
- self.class.openapi_types.each_pair do |key, type|
160
- if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
161
- self.send("#{key}=", nil)
152
+ transformed_hash = {}
153
+ openapi_types.each_pair do |key, type|
154
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
155
+ transformed_hash["#{key}"] = nil
162
156
  elsif type =~ /\AArray<(.*)>/i
163
157
  # check to ensure the input is an array given that the attribute
164
158
  # is documented as an array but the input is not
165
- if attributes[self.class.attribute_map[key]].is_a?(Array)
166
- self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
159
+ if attributes[attribute_map[key]].is_a?(Array)
160
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
167
161
  end
168
- elsif !attributes[self.class.attribute_map[key]].nil?
169
- self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
162
+ elsif !attributes[attribute_map[key]].nil?
163
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
170
164
  end
171
165
  end
172
-
173
- self
166
+ new(transformed_hash)
174
167
  end
175
168
 
176
169
  # Deserializes the data based on type
177
170
  # @param string type Data type
178
171
  # @param string value Value to be deserialized
179
172
  # @return [Object] Deserialized data
180
- def _deserialize(type, value)
173
+ def self._deserialize(type, value)
181
174
  case type.to_sym
182
175
  when :Time
183
176
  Time.parse(value)
@@ -212,7 +205,7 @@ module YNAB
212
205
  else # model
213
206
  # models (e.g. Pet) or oneOf
214
207
  klass = YNAB.const_get(type)
215
- klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
208
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
216
209
  end
217
210
  end
218
211
 
@@ -3,10 +3,10 @@
3
3
 
4
4
  #Our API uses a REST based design, leverages the JSON data format, and relies upon HTTPS for transport. We respond with meaningful HTTP response codes and if an error occurs, we include error details in the response body. API Documentation is at https://api.ynab.com
5
5
 
6
- The version of the OpenAPI document: 1.0.0
6
+ The version of the OpenAPI document: 1.69.0
7
7
 
8
8
  Generated by: https://openapi-generator.tech
9
- OpenAPI Generator version: 6.6.0
9
+ Generator version: 7.6.0
10
10
 
11
11
  =end
12
12
 
@@ -173,37 +173,30 @@ module YNAB
173
173
  # @param [Hash] attributes Model attributes in the form of hash
174
174
  # @return [Object] Returns the model itself
175
175
  def self.build_from_hash(attributes)
176
- new.build_from_hash(attributes)
177
- end
178
-
179
- # Builds the object from hash
180
- # @param [Hash] attributes Model attributes in the form of hash
181
- # @return [Object] Returns the model itself
182
- def build_from_hash(attributes)
183
176
  return nil unless attributes.is_a?(Hash)
184
177
  attributes = attributes.transform_keys(&:to_sym)
185
- self.class.openapi_types.each_pair do |key, type|
186
- if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
187
- self.send("#{key}=", nil)
178
+ transformed_hash = {}
179
+ openapi_types.each_pair do |key, type|
180
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
181
+ transformed_hash["#{key}"] = nil
188
182
  elsif type =~ /\AArray<(.*)>/i
189
183
  # check to ensure the input is an array given that the attribute
190
184
  # is documented as an array but the input is not
191
- if attributes[self.class.attribute_map[key]].is_a?(Array)
192
- self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
185
+ if attributes[attribute_map[key]].is_a?(Array)
186
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
193
187
  end
194
- elsif !attributes[self.class.attribute_map[key]].nil?
195
- self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
188
+ elsif !attributes[attribute_map[key]].nil?
189
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
196
190
  end
197
191
  end
198
-
199
- self
192
+ new(transformed_hash)
200
193
  end
201
194
 
202
195
  # Deserializes the data based on type
203
196
  # @param string type Data type
204
197
  # @param string value Value to be deserialized
205
198
  # @return [Object] Deserialized data
206
- def _deserialize(type, value)
199
+ def self._deserialize(type, value)
207
200
  case type.to_sym
208
201
  when :Time
209
202
  Time.parse(value)
@@ -238,7 +231,7 @@ module YNAB
238
231
  else # model
239
232
  # models (e.g. Pet) or oneOf
240
233
  klass = YNAB.const_get(type)
241
- klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
234
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
242
235
  end
243
236
  end
244
237
 
@@ -3,10 +3,10 @@
3
3
 
4
4
  #Our API uses a REST based design, leverages the JSON data format, and relies upon HTTPS for transport. We respond with meaningful HTTP response codes and if an error occurs, we include error details in the response body. API Documentation is at https://api.ynab.com
5
5
 
6
- The version of the OpenAPI document: 1.0.0
6
+ The version of the OpenAPI document: 1.69.0
7
7
 
8
8
  Generated by: https://openapi-generator.tech
9
- OpenAPI Generator version: 6.6.0
9
+ Generator version: 7.6.0
10
10
 
11
11
  =end
12
12
 
@@ -30,9 +30,11 @@ module YNAB
30
30
 
31
31
  attr_accessor :memo
32
32
 
33
- # The scheduled transaction flag
34
33
  attr_accessor :flag_color
35
34
 
35
+ # The customized name of a transaction flag
36
+ attr_accessor :flag_name
37
+
36
38
  attr_accessor :account_id
37
39
 
38
40
  attr_accessor :payee_id
@@ -87,6 +89,7 @@ module YNAB
87
89
  :'amount' => :'amount',
88
90
  :'memo' => :'memo',
89
91
  :'flag_color' => :'flag_color',
92
+ :'flag_name' => :'flag_name',
90
93
  :'account_id' => :'account_id',
91
94
  :'payee_id' => :'payee_id',
92
95
  :'category_id' => :'category_id',
@@ -113,7 +116,8 @@ module YNAB
113
116
  :'frequency' => :'String',
114
117
  :'amount' => :'Integer',
115
118
  :'memo' => :'String',
116
- :'flag_color' => :'String',
119
+ :'flag_color' => :'TransactionFlagColor',
120
+ :'flag_name' => :'String',
117
121
  :'account_id' => :'String',
118
122
  :'payee_id' => :'String',
119
123
  :'category_id' => :'String',
@@ -131,6 +135,7 @@ module YNAB
131
135
  Set.new([
132
136
  :'memo',
133
137
  :'flag_color',
138
+ :'flag_name',
134
139
  :'payee_id',
135
140
  :'category_id',
136
141
  :'transfer_account_id',
@@ -142,7 +147,6 @@ module YNAB
142
147
  # List of class defined in allOf (OpenAPI v3)
143
148
  def self.openapi_all_of
144
149
  [
145
- :'ScheduledTransactionDetailAllOf',
146
150
  :'ScheduledTransactionSummary'
147
151
  ]
148
152
  end
@@ -190,6 +194,10 @@ module YNAB
190
194
  self.flag_color = attributes[:'flag_color']
191
195
  end
192
196
 
197
+ if attributes.key?(:'flag_name')
198
+ self.flag_name = attributes[:'flag_name']
199
+ end
200
+
193
201
  if attributes.key?(:'account_id')
194
202
  self.account_id = attributes[:'account_id']
195
203
  end
@@ -246,8 +254,6 @@ module YNAB
246
254
  frequency_validator = EnumAttributeValidator.new('String', ["never", "daily", "weekly", "everyOtherWeek", "twiceAMonth", "every4Weeks", "monthly", "everyOtherMonth", "every3Months", "every4Months", "twiceAYear", "yearly", "everyOtherYear"])
247
255
  return false unless frequency_validator.valid?(@frequency)
248
256
  return false if @amount.nil?
249
- flag_color_validator = EnumAttributeValidator.new('String', ["red", "orange", "yellow", "green", "blue", "purple", "null"])
250
- return false unless flag_color_validator.valid?(@flag_color)
251
257
  return false if @account_id.nil?
252
258
  return false if @deleted.nil?
253
259
  return false if @account_name.nil?
@@ -261,12 +267,6 @@ module YNAB
261
267
  @frequency = frequency
262
268
  end
263
269
 
264
- # Custom attribute writer method checking allowed values (enum).
265
- # @param [Object] flag_color Object to be assigned
266
- def flag_color=(flag_color)
267
- @flag_color = flag_color
268
- end
269
-
270
270
  # Checks equality by comparing each attribute.
271
271
  # @param [Object] Object to be compared
272
272
  def ==(o)
@@ -279,6 +279,7 @@ module YNAB
279
279
  amount == o.amount &&
280
280
  memo == o.memo &&
281
281
  flag_color == o.flag_color &&
282
+ flag_name == o.flag_name &&
282
283
  account_id == o.account_id &&
283
284
  payee_id == o.payee_id &&
284
285
  category_id == o.category_id &&
@@ -299,44 +300,37 @@ module YNAB
299
300
  # Calculates hash code according to all attributes.
300
301
  # @return [Integer] Hash code
301
302
  def hash
302
- [id, date_first, date_next, frequency, amount, memo, flag_color, account_id, payee_id, category_id, transfer_account_id, deleted, account_name, payee_name, category_name, subtransactions].hash
303
+ [id, date_first, date_next, frequency, amount, memo, flag_color, flag_name, account_id, payee_id, category_id, transfer_account_id, deleted, account_name, payee_name, category_name, subtransactions].hash
303
304
  end
304
305
 
305
306
  # Builds the object from hash
306
307
  # @param [Hash] attributes Model attributes in the form of hash
307
308
  # @return [Object] Returns the model itself
308
309
  def self.build_from_hash(attributes)
309
- new.build_from_hash(attributes)
310
- end
311
-
312
- # Builds the object from hash
313
- # @param [Hash] attributes Model attributes in the form of hash
314
- # @return [Object] Returns the model itself
315
- def build_from_hash(attributes)
316
310
  return nil unless attributes.is_a?(Hash)
317
311
  attributes = attributes.transform_keys(&:to_sym)
318
- self.class.openapi_types.each_pair do |key, type|
319
- if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
320
- self.send("#{key}=", nil)
312
+ transformed_hash = {}
313
+ openapi_types.each_pair do |key, type|
314
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
315
+ transformed_hash["#{key}"] = nil
321
316
  elsif type =~ /\AArray<(.*)>/i
322
317
  # check to ensure the input is an array given that the attribute
323
318
  # is documented as an array but the input is not
324
- if attributes[self.class.attribute_map[key]].is_a?(Array)
325
- self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
319
+ if attributes[attribute_map[key]].is_a?(Array)
320
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
326
321
  end
327
- elsif !attributes[self.class.attribute_map[key]].nil?
328
- self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
322
+ elsif !attributes[attribute_map[key]].nil?
323
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
329
324
  end
330
325
  end
331
-
332
- self
326
+ new(transformed_hash)
333
327
  end
334
328
 
335
329
  # Deserializes the data based on type
336
330
  # @param string type Data type
337
331
  # @param string value Value to be deserialized
338
332
  # @return [Object] Deserialized data
339
- def _deserialize(type, value)
333
+ def self._deserialize(type, value)
340
334
  case type.to_sym
341
335
  when :Time
342
336
  Time.parse(value)
@@ -371,7 +365,7 @@ module YNAB
371
365
  else # model
372
366
  # models (e.g. Pet) or oneOf
373
367
  klass = YNAB.const_get(type)
374
- klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
368
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
375
369
  end
376
370
  end
377
371
 
@@ -3,10 +3,10 @@
3
3
 
4
4
  #Our API uses a REST based design, leverages the JSON data format, and relies upon HTTPS for transport. We respond with meaningful HTTP response codes and if an error occurs, we include error details in the response body. API Documentation is at https://api.ynab.com
5
5
 
6
- The version of the OpenAPI document: 1.0.0
6
+ The version of the OpenAPI document: 1.69.0
7
7
 
8
8
  Generated by: https://openapi-generator.tech
9
- OpenAPI Generator version: 6.6.0
9
+ Generator version: 7.6.0
10
10
 
11
11
  =end
12
12
 
@@ -100,37 +100,30 @@ module YNAB
100
100
  # @param [Hash] attributes Model attributes in the form of hash
101
101
  # @return [Object] Returns the model itself
102
102
  def self.build_from_hash(attributes)
103
- new.build_from_hash(attributes)
104
- end
105
-
106
- # Builds the object from hash
107
- # @param [Hash] attributes Model attributes in the form of hash
108
- # @return [Object] Returns the model itself
109
- def build_from_hash(attributes)
110
103
  return nil unless attributes.is_a?(Hash)
111
104
  attributes = attributes.transform_keys(&:to_sym)
112
- self.class.openapi_types.each_pair do |key, type|
113
- if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
114
- self.send("#{key}=", nil)
105
+ transformed_hash = {}
106
+ openapi_types.each_pair do |key, type|
107
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
108
+ transformed_hash["#{key}"] = nil
115
109
  elsif type =~ /\AArray<(.*)>/i
116
110
  # check to ensure the input is an array given that the attribute
117
111
  # is documented as an array but the input is not
118
- if attributes[self.class.attribute_map[key]].is_a?(Array)
119
- self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
112
+ if attributes[attribute_map[key]].is_a?(Array)
113
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
120
114
  end
121
- elsif !attributes[self.class.attribute_map[key]].nil?
122
- self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
115
+ elsif !attributes[attribute_map[key]].nil?
116
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
123
117
  end
124
118
  end
125
-
126
- self
119
+ new(transformed_hash)
127
120
  end
128
121
 
129
122
  # Deserializes the data based on type
130
123
  # @param string type Data type
131
124
  # @param string value Value to be deserialized
132
125
  # @return [Object] Deserialized data
133
- def _deserialize(type, value)
126
+ def self._deserialize(type, value)
134
127
  case type.to_sym
135
128
  when :Time
136
129
  Time.parse(value)
@@ -165,7 +158,7 @@ module YNAB
165
158
  else # model
166
159
  # models (e.g. Pet) or oneOf
167
160
  klass = YNAB.const_get(type)
168
- klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
161
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
169
162
  end
170
163
  end
171
164
 
@@ -3,10 +3,10 @@
3
3
 
4
4
  #Our API uses a REST based design, leverages the JSON data format, and relies upon HTTPS for transport. We respond with meaningful HTTP response codes and if an error occurs, we include error details in the response body. API Documentation is at https://api.ynab.com
5
5
 
6
- The version of the OpenAPI document: 1.0.0
6
+ The version of the OpenAPI document: 1.69.0
7
7
 
8
8
  Generated by: https://openapi-generator.tech
9
- OpenAPI Generator version: 6.6.0
9
+ Generator version: 7.6.0
10
10
 
11
11
  =end
12
12
 
@@ -100,37 +100,30 @@ module YNAB
100
100
  # @param [Hash] attributes Model attributes in the form of hash
101
101
  # @return [Object] Returns the model itself
102
102
  def self.build_from_hash(attributes)
103
- new.build_from_hash(attributes)
104
- end
105
-
106
- # Builds the object from hash
107
- # @param [Hash] attributes Model attributes in the form of hash
108
- # @return [Object] Returns the model itself
109
- def build_from_hash(attributes)
110
103
  return nil unless attributes.is_a?(Hash)
111
104
  attributes = attributes.transform_keys(&:to_sym)
112
- self.class.openapi_types.each_pair do |key, type|
113
- if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
114
- self.send("#{key}=", nil)
105
+ transformed_hash = {}
106
+ openapi_types.each_pair do |key, type|
107
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
108
+ transformed_hash["#{key}"] = nil
115
109
  elsif type =~ /\AArray<(.*)>/i
116
110
  # check to ensure the input is an array given that the attribute
117
111
  # is documented as an array but the input is not
118
- if attributes[self.class.attribute_map[key]].is_a?(Array)
119
- self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
112
+ if attributes[attribute_map[key]].is_a?(Array)
113
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
120
114
  end
121
- elsif !attributes[self.class.attribute_map[key]].nil?
122
- self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
115
+ elsif !attributes[attribute_map[key]].nil?
116
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
123
117
  end
124
118
  end
125
-
126
- self
119
+ new(transformed_hash)
127
120
  end
128
121
 
129
122
  # Deserializes the data based on type
130
123
  # @param string type Data type
131
124
  # @param string value Value to be deserialized
132
125
  # @return [Object] Deserialized data
133
- def _deserialize(type, value)
126
+ def self._deserialize(type, value)
134
127
  case type.to_sym
135
128
  when :Time
136
129
  Time.parse(value)
@@ -165,7 +158,7 @@ module YNAB
165
158
  else # model
166
159
  # models (e.g. Pet) or oneOf
167
160
  klass = YNAB.const_get(type)
168
- klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
161
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
169
162
  end
170
163
  end
171
164
 
@@ -3,10 +3,10 @@
3
3
 
4
4
  #Our API uses a REST based design, leverages the JSON data format, and relies upon HTTPS for transport. We respond with meaningful HTTP response codes and if an error occurs, we include error details in the response body. API Documentation is at https://api.ynab.com
5
5
 
6
- The version of the OpenAPI document: 1.0.0
6
+ The version of the OpenAPI document: 1.69.0
7
7
 
8
8
  Generated by: https://openapi-generator.tech
9
- OpenAPI Generator version: 6.6.0
9
+ Generator version: 7.6.0
10
10
 
11
11
  =end
12
12
 
@@ -30,9 +30,11 @@ module YNAB
30
30
 
31
31
  attr_accessor :memo
32
32
 
33
- # The scheduled transaction flag
34
33
  attr_accessor :flag_color
35
34
 
35
+ # The customized name of a transaction flag
36
+ attr_accessor :flag_name
37
+
36
38
  attr_accessor :account_id
37
39
 
38
40
  attr_accessor :payee_id
@@ -77,6 +79,7 @@ module YNAB
77
79
  :'amount' => :'amount',
78
80
  :'memo' => :'memo',
79
81
  :'flag_color' => :'flag_color',
82
+ :'flag_name' => :'flag_name',
80
83
  :'account_id' => :'account_id',
81
84
  :'payee_id' => :'payee_id',
82
85
  :'category_id' => :'category_id',
@@ -99,7 +102,8 @@ module YNAB
99
102
  :'frequency' => :'String',
100
103
  :'amount' => :'Integer',
101
104
  :'memo' => :'String',
102
- :'flag_color' => :'String',
105
+ :'flag_color' => :'TransactionFlagColor',
106
+ :'flag_name' => :'String',
103
107
  :'account_id' => :'String',
104
108
  :'payee_id' => :'String',
105
109
  :'category_id' => :'String',
@@ -113,6 +117,7 @@ module YNAB
113
117
  Set.new([
114
118
  :'memo',
115
119
  :'flag_color',
120
+ :'flag_name',
116
121
  :'payee_id',
117
122
  :'category_id',
118
123
  :'transfer_account_id',
@@ -162,6 +167,10 @@ module YNAB
162
167
  self.flag_color = attributes[:'flag_color']
163
168
  end
164
169
 
170
+ if attributes.key?(:'flag_name')
171
+ self.flag_name = attributes[:'flag_name']
172
+ end
173
+
165
174
  if attributes.key?(:'account_id')
166
175
  self.account_id = attributes[:'account_id']
167
176
  end
@@ -200,8 +209,6 @@ module YNAB
200
209
  frequency_validator = EnumAttributeValidator.new('String', ["never", "daily", "weekly", "everyOtherWeek", "twiceAMonth", "every4Weeks", "monthly", "everyOtherMonth", "every3Months", "every4Months", "twiceAYear", "yearly", "everyOtherYear"])
201
210
  return false unless frequency_validator.valid?(@frequency)
202
211
  return false if @amount.nil?
203
- flag_color_validator = EnumAttributeValidator.new('String', ["red", "orange", "yellow", "green", "blue", "purple", "null"])
204
- return false unless flag_color_validator.valid?(@flag_color)
205
212
  return false if @account_id.nil?
206
213
  return false if @deleted.nil?
207
214
  true
@@ -213,12 +220,6 @@ module YNAB
213
220
  @frequency = frequency
214
221
  end
215
222
 
216
- # Custom attribute writer method checking allowed values (enum).
217
- # @param [Object] flag_color Object to be assigned
218
- def flag_color=(flag_color)
219
- @flag_color = flag_color
220
- end
221
-
222
223
  # Checks equality by comparing each attribute.
223
224
  # @param [Object] Object to be compared
224
225
  def ==(o)
@@ -231,6 +232,7 @@ module YNAB
231
232
  amount == o.amount &&
232
233
  memo == o.memo &&
233
234
  flag_color == o.flag_color &&
235
+ flag_name == o.flag_name &&
234
236
  account_id == o.account_id &&
235
237
  payee_id == o.payee_id &&
236
238
  category_id == o.category_id &&
@@ -247,44 +249,37 @@ module YNAB
247
249
  # Calculates hash code according to all attributes.
248
250
  # @return [Integer] Hash code
249
251
  def hash
250
- [id, date_first, date_next, frequency, amount, memo, flag_color, account_id, payee_id, category_id, transfer_account_id, deleted].hash
252
+ [id, date_first, date_next, frequency, amount, memo, flag_color, flag_name, account_id, payee_id, category_id, transfer_account_id, deleted].hash
251
253
  end
252
254
 
253
255
  # Builds the object from hash
254
256
  # @param [Hash] attributes Model attributes in the form of hash
255
257
  # @return [Object] Returns the model itself
256
258
  def self.build_from_hash(attributes)
257
- new.build_from_hash(attributes)
258
- end
259
-
260
- # Builds the object from hash
261
- # @param [Hash] attributes Model attributes in the form of hash
262
- # @return [Object] Returns the model itself
263
- def build_from_hash(attributes)
264
259
  return nil unless attributes.is_a?(Hash)
265
260
  attributes = attributes.transform_keys(&:to_sym)
266
- self.class.openapi_types.each_pair do |key, type|
267
- if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
268
- self.send("#{key}=", nil)
261
+ transformed_hash = {}
262
+ openapi_types.each_pair do |key, type|
263
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
264
+ transformed_hash["#{key}"] = nil
269
265
  elsif type =~ /\AArray<(.*)>/i
270
266
  # check to ensure the input is an array given that the attribute
271
267
  # is documented as an array but the input is not
272
- if attributes[self.class.attribute_map[key]].is_a?(Array)
273
- self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
268
+ if attributes[attribute_map[key]].is_a?(Array)
269
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
274
270
  end
275
- elsif !attributes[self.class.attribute_map[key]].nil?
276
- self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
271
+ elsif !attributes[attribute_map[key]].nil?
272
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
277
273
  end
278
274
  end
279
-
280
- self
275
+ new(transformed_hash)
281
276
  end
282
277
 
283
278
  # Deserializes the data based on type
284
279
  # @param string type Data type
285
280
  # @param string value Value to be deserialized
286
281
  # @return [Object] Deserialized data
287
- def _deserialize(type, value)
282
+ def self._deserialize(type, value)
288
283
  case type.to_sym
289
284
  when :Time
290
285
  Time.parse(value)
@@ -319,7 +314,7 @@ module YNAB
319
314
  else # model
320
315
  # models (e.g. Pet) or oneOf
321
316
  klass = YNAB.const_get(type)
322
- klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
317
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
323
318
  end
324
319
  end
325
320
 
@@ -3,10 +3,10 @@
3
3
 
4
4
  #Our API uses a REST based design, leverages the JSON data format, and relies upon HTTPS for transport. We respond with meaningful HTTP response codes and if an error occurs, we include error details in the response body. API Documentation is at https://api.ynab.com
5
5
 
6
- The version of the OpenAPI document: 1.0.0
6
+ The version of the OpenAPI document: 1.69.0
7
7
 
8
8
  Generated by: https://openapi-generator.tech
9
- OpenAPI Generator version: 6.6.0
9
+ Generator version: 7.6.0
10
10
 
11
11
  =end
12
12
 
@@ -100,37 +100,30 @@ module YNAB
100
100
  # @param [Hash] attributes Model attributes in the form of hash
101
101
  # @return [Object] Returns the model itself
102
102
  def self.build_from_hash(attributes)
103
- new.build_from_hash(attributes)
104
- end
105
-
106
- # Builds the object from hash
107
- # @param [Hash] attributes Model attributes in the form of hash
108
- # @return [Object] Returns the model itself
109
- def build_from_hash(attributes)
110
103
  return nil unless attributes.is_a?(Hash)
111
104
  attributes = attributes.transform_keys(&:to_sym)
112
- self.class.openapi_types.each_pair do |key, type|
113
- if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
114
- self.send("#{key}=", nil)
105
+ transformed_hash = {}
106
+ openapi_types.each_pair do |key, type|
107
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
108
+ transformed_hash["#{key}"] = nil
115
109
  elsif type =~ /\AArray<(.*)>/i
116
110
  # check to ensure the input is an array given that the attribute
117
111
  # is documented as an array but the input is not
118
- if attributes[self.class.attribute_map[key]].is_a?(Array)
119
- self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
112
+ if attributes[attribute_map[key]].is_a?(Array)
113
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
120
114
  end
121
- elsif !attributes[self.class.attribute_map[key]].nil?
122
- self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
115
+ elsif !attributes[attribute_map[key]].nil?
116
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
123
117
  end
124
118
  end
125
-
126
- self
119
+ new(transformed_hash)
127
120
  end
128
121
 
129
122
  # Deserializes the data based on type
130
123
  # @param string type Data type
131
124
  # @param string value Value to be deserialized
132
125
  # @return [Object] Deserialized data
133
- def _deserialize(type, value)
126
+ def self._deserialize(type, value)
134
127
  case type.to_sym
135
128
  when :Time
136
129
  Time.parse(value)
@@ -165,7 +158,7 @@ module YNAB
165
158
  else # model
166
159
  # models (e.g. Pet) or oneOf
167
160
  klass = YNAB.const_get(type)
168
- klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
161
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
169
162
  end
170
163
  end
171
164