ynab 2.0.0 → 3.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (145) hide show
  1. checksums.yaml +4 -4
  2. data/DEVELOPMENT.md +6 -2
  3. data/Gemfile.lock +1 -1
  4. data/README.md +4 -2
  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 -28
  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 -56
  41. data/lib/ynab/models/account_response.rb +13 -24
  42. data/lib/ynab/models/account_response_data.rb +13 -24
  43. data/lib/ynab/models/account_type.rb +2 -2
  44. data/lib/ynab/models/accounts_response.rb +13 -24
  45. data/lib/ynab/models/accounts_response_data.rb +13 -28
  46. data/lib/ynab/models/budget_detail.rb +13 -29
  47. data/lib/ynab/models/budget_detail_response.rb +13 -24
  48. data/lib/ynab/models/budget_detail_response_data.rb +13 -28
  49. data/lib/ynab/models/budget_settings.rb +13 -20
  50. data/lib/ynab/models/budget_settings_response.rb +13 -24
  51. data/lib/ynab/models/budget_settings_response_data.rb +13 -24
  52. data/lib/ynab/models/budget_summary.rb +13 -28
  53. data/lib/ynab/models/budget_summary_response.rb +13 -24
  54. data/lib/ynab/models/budget_summary_response_data.rb +13 -24
  55. data/lib/ynab/models/bulk_response.rb +13 -24
  56. data/lib/ynab/models/bulk_response_data.rb +13 -24
  57. data/lib/ynab/models/bulk_response_data_bulk.rb +13 -28
  58. data/lib/ynab/models/bulk_transactions.rb +14 -25
  59. data/lib/ynab/models/categories_response.rb +13 -24
  60. data/lib/ynab/models/categories_response_data.rb +13 -28
  61. data/lib/ynab/models/category.rb +13 -56
  62. data/lib/ynab/models/category_group.rb +13 -36
  63. data/lib/ynab/models/category_group_with_categories.rb +14 -42
  64. data/lib/ynab/models/category_group_with_categories_all_of.rb +0 -4
  65. data/lib/ynab/models/category_response.rb +13 -24
  66. data/lib/ynab/models/category_response_data.rb +13 -24
  67. data/lib/ynab/models/currency_format.rb +13 -52
  68. data/lib/ynab/models/date_format.rb +13 -24
  69. data/lib/ynab/models/error_detail.rb +13 -32
  70. data/lib/ynab/models/error_response.rb +13 -24
  71. data/lib/ynab/models/existing_transaction.rb +359 -0
  72. data/lib/ynab/models/hybrid_transaction.rb +28 -95
  73. data/lib/ynab/models/hybrid_transaction_all_of.rb +0 -12
  74. data/lib/ynab/models/hybrid_transactions_response.rb +13 -24
  75. data/lib/ynab/models/hybrid_transactions_response_data.rb +13 -24
  76. data/lib/ynab/models/month_detail.rb +13 -49
  77. data/lib/ynab/models/month_detail_all_of.rb +0 -4
  78. data/lib/ynab/models/month_detail_response.rb +13 -24
  79. data/lib/ynab/models/month_detail_response_data.rb +13 -24
  80. data/lib/ynab/models/month_summaries_response.rb +13 -24
  81. data/lib/ynab/models/month_summaries_response_data.rb +13 -28
  82. data/lib/ynab/models/month_summary.rb +13 -44
  83. data/lib/ynab/models/new_transaction.rb +377 -0
  84. data/lib/ynab/models/patch_category_wrapper.rb +213 -0
  85. data/lib/ynab/models/patch_month_category_wrapper.rb +13 -24
  86. data/lib/ynab/models/patch_payee_wrapper.rb +213 -0
  87. data/lib/ynab/models/patch_transactions_wrapper.rb +14 -25
  88. data/lib/ynab/models/payee.rb +13 -32
  89. data/lib/ynab/models/payee_location.rb +13 -40
  90. data/lib/ynab/models/payee_location_response.rb +13 -24
  91. data/lib/ynab/models/payee_location_response_data.rb +13 -24
  92. data/lib/ynab/models/payee_locations_response.rb +13 -24
  93. data/lib/ynab/models/payee_locations_response_data.rb +13 -24
  94. data/lib/ynab/models/payee_response.rb +13 -24
  95. data/lib/ynab/models/payee_response_data.rb +13 -24
  96. data/lib/ynab/models/payees_response.rb +13 -24
  97. data/lib/ynab/models/payees_response_data.rb +13 -28
  98. data/lib/ynab/models/post_account_wrapper.rb +13 -24
  99. data/lib/ynab/models/post_transactions_wrapper.rb +15 -22
  100. data/lib/ynab/models/put_transaction_wrapper.rb +14 -25
  101. data/lib/ynab/models/save_account.rb +13 -32
  102. data/lib/ynab/models/save_category.rb +232 -0
  103. data/lib/ynab/models/save_category_response.rb +13 -24
  104. data/lib/ynab/models/save_category_response_data.rb +13 -28
  105. data/lib/ynab/models/save_month_category.rb +13 -24
  106. data/lib/ynab/models/save_payee.rb +220 -0
  107. data/lib/ynab/models/save_payee_response.rb +213 -0
  108. data/lib/ynab/models/save_payee_response_data.rb +224 -0
  109. data/lib/ynab/models/save_sub_transaction.rb +13 -40
  110. data/lib/ynab/models/save_transaction.rb +0 -32
  111. data/lib/ynab/models/save_transaction_with_id.rb +0 -32
  112. data/lib/ynab/models/save_transaction_with_id_or_import_id.rb +388 -0
  113. data/lib/ynab/models/save_transaction_with_optional_fields.rb +17 -91
  114. data/lib/ynab/models/save_transactions_response.rb +13 -24
  115. data/lib/ynab/models/save_transactions_response_data.rb +13 -28
  116. data/lib/ynab/models/scheduled_sub_transaction.rb +13 -36
  117. data/lib/ynab/models/scheduled_transaction_detail.rb +26 -76
  118. data/lib/ynab/models/scheduled_transaction_detail_all_of.rb +0 -8
  119. data/lib/ynab/models/scheduled_transaction_response.rb +13 -24
  120. data/lib/ynab/models/scheduled_transaction_response_data.rb +13 -24
  121. data/lib/ynab/models/scheduled_transaction_summary.rb +26 -67
  122. data/lib/ynab/models/scheduled_transactions_response.rb +13 -24
  123. data/lib/ynab/models/scheduled_transactions_response_data.rb +13 -28
  124. data/lib/ynab/models/sub_transaction.rb +13 -36
  125. data/lib/ynab/models/transaction_cleared_status.rb +41 -0
  126. data/lib/ynab/models/transaction_detail.rb +28 -91
  127. data/lib/ynab/models/transaction_detail_all_of.rb +0 -8
  128. data/lib/ynab/models/transaction_flag_color.rb +45 -0
  129. data/lib/ynab/models/transaction_response.rb +13 -24
  130. data/lib/ynab/models/transaction_response_data.rb +13 -24
  131. data/lib/ynab/models/transaction_summary.rb +28 -82
  132. data/lib/ynab/models/transactions_import_response.rb +13 -24
  133. data/lib/ynab/models/transactions_import_response_data.rb +13 -24
  134. data/lib/ynab/models/transactions_response.rb +13 -24
  135. data/lib/ynab/models/transactions_response_data.rb +13 -28
  136. data/lib/ynab/models/user.rb +13 -24
  137. data/lib/ynab/models/user_response.rb +13 -24
  138. data/lib/ynab/models/user_response_data.rb +13 -24
  139. data/lib/ynab/version.rb +1 -1
  140. data/lib/ynab.rb +13 -12
  141. data/open_api_spec.yaml +455 -343
  142. data/templates/api.mustache +213 -0
  143. data/templates/partial_model_generic.mustache +305 -0
  144. data/ynab.gemspec +4 -3
  145. metadata +31 -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
 
@@ -108,14 +108,6 @@ module YNAB
108
108
  # @return Array for valid properties with the reasons
109
109
  def list_invalid_properties
110
110
  invalid_properties = Array.new
111
- if @transaction_ids.nil?
112
- invalid_properties.push('invalid value for "transaction_ids", transaction_ids cannot be nil.')
113
- end
114
-
115
- if @server_knowledge.nil?
116
- invalid_properties.push('invalid value for "server_knowledge", server_knowledge cannot be nil.')
117
- end
118
-
119
111
  invalid_properties
120
112
  end
121
113
 
@@ -155,37 +147,30 @@ module YNAB
155
147
  # @param [Hash] attributes Model attributes in the form of hash
156
148
  # @return [Object] Returns the model itself
157
149
  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
150
  return nil unless attributes.is_a?(Hash)
166
151
  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)
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
170
156
  elsif type =~ /\AArray<(.*)>/i
171
157
  # check to ensure the input is an array given that the attribute
172
158
  # 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) })
159
+ if attributes[attribute_map[key]].is_a?(Array)
160
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
175
161
  end
176
- elsif !attributes[self.class.attribute_map[key]].nil?
177
- 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]])
178
164
  end
179
165
  end
180
-
181
- self
166
+ new(transformed_hash)
182
167
  end
183
168
 
184
169
  # Deserializes the data based on type
185
170
  # @param string type Data type
186
171
  # @param string value Value to be deserialized
187
172
  # @return [Object] Deserialized data
188
- def _deserialize(type, value)
173
+ def self._deserialize(type, value)
189
174
  case type.to_sym
190
175
  when :Time
191
176
  Time.parse(value)
@@ -220,7 +205,7 @@ module YNAB
220
205
  else # model
221
206
  # models (e.g. Pet) or oneOf
222
207
  klass = YNAB.const_get(type)
223
- 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)
224
209
  end
225
210
  end
226
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
 
@@ -129,22 +129,6 @@ module YNAB
129
129
  # @return Array for valid properties with the reasons
130
130
  def list_invalid_properties
131
131
  invalid_properties = Array.new
132
- if @id.nil?
133
- invalid_properties.push('invalid value for "id", id cannot be nil.')
134
- end
135
-
136
- if @scheduled_transaction_id.nil?
137
- invalid_properties.push('invalid value for "scheduled_transaction_id", scheduled_transaction_id cannot be nil.')
138
- end
139
-
140
- if @amount.nil?
141
- invalid_properties.push('invalid value for "amount", amount cannot be nil.')
142
- end
143
-
144
- if @deleted.nil?
145
- invalid_properties.push('invalid value for "deleted", deleted cannot be nil.')
146
- end
147
-
148
132
  invalid_properties
149
133
  end
150
134
 
@@ -189,37 +173,30 @@ module YNAB
189
173
  # @param [Hash] attributes Model attributes in the form of hash
190
174
  # @return [Object] Returns the model itself
191
175
  def self.build_from_hash(attributes)
192
- new.build_from_hash(attributes)
193
- end
194
-
195
- # Builds the object from hash
196
- # @param [Hash] attributes Model attributes in the form of hash
197
- # @return [Object] Returns the model itself
198
- def build_from_hash(attributes)
199
176
  return nil unless attributes.is_a?(Hash)
200
177
  attributes = attributes.transform_keys(&:to_sym)
201
- self.class.openapi_types.each_pair do |key, type|
202
- if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
203
- 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
204
182
  elsif type =~ /\AArray<(.*)>/i
205
183
  # check to ensure the input is an array given that the attribute
206
184
  # is documented as an array but the input is not
207
- if attributes[self.class.attribute_map[key]].is_a?(Array)
208
- 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) }
209
187
  end
210
- elsif !attributes[self.class.attribute_map[key]].nil?
211
- 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]])
212
190
  end
213
191
  end
214
-
215
- self
192
+ new(transformed_hash)
216
193
  end
217
194
 
218
195
  # Deserializes the data based on type
219
196
  # @param string type Data type
220
197
  # @param string value Value to be deserialized
221
198
  # @return [Object] Deserialized data
222
- def _deserialize(type, value)
199
+ def self._deserialize(type, value)
223
200
  case type.to_sym
224
201
  when :Time
225
202
  Time.parse(value)
@@ -254,7 +231,7 @@ module YNAB
254
231
  else # model
255
232
  # models (e.g. Pet) or oneOf
256
233
  klass = YNAB.const_get(type)
257
- 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)
258
235
  end
259
236
  end
260
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
@@ -233,42 +241,6 @@ module YNAB
233
241
  # @return Array for valid properties with the reasons
234
242
  def list_invalid_properties
235
243
  invalid_properties = Array.new
236
- if @id.nil?
237
- invalid_properties.push('invalid value for "id", id cannot be nil.')
238
- end
239
-
240
- if @date_first.nil?
241
- invalid_properties.push('invalid value for "date_first", date_first cannot be nil.')
242
- end
243
-
244
- if @date_next.nil?
245
- invalid_properties.push('invalid value for "date_next", date_next cannot be nil.')
246
- end
247
-
248
- if @frequency.nil?
249
- invalid_properties.push('invalid value for "frequency", frequency cannot be nil.')
250
- end
251
-
252
- if @amount.nil?
253
- invalid_properties.push('invalid value for "amount", amount cannot be nil.')
254
- end
255
-
256
- if @account_id.nil?
257
- invalid_properties.push('invalid value for "account_id", account_id cannot be nil.')
258
- end
259
-
260
- if @deleted.nil?
261
- invalid_properties.push('invalid value for "deleted", deleted cannot be nil.')
262
- end
263
-
264
- if @account_name.nil?
265
- invalid_properties.push('invalid value for "account_name", account_name cannot be nil.')
266
- end
267
-
268
- if @subtransactions.nil?
269
- invalid_properties.push('invalid value for "subtransactions", subtransactions cannot be nil.')
270
- end
271
-
272
244
  invalid_properties
273
245
  end
274
246
 
@@ -282,8 +254,6 @@ module YNAB
282
254
  frequency_validator = EnumAttributeValidator.new('String', ["never", "daily", "weekly", "everyOtherWeek", "twiceAMonth", "every4Weeks", "monthly", "everyOtherMonth", "every3Months", "every4Months", "twiceAYear", "yearly", "everyOtherYear"])
283
255
  return false unless frequency_validator.valid?(@frequency)
284
256
  return false if @amount.nil?
285
- flag_color_validator = EnumAttributeValidator.new('String', ["red", "orange", "yellow", "green", "blue", "purple", "null"])
286
- return false unless flag_color_validator.valid?(@flag_color)
287
257
  return false if @account_id.nil?
288
258
  return false if @deleted.nil?
289
259
  return false if @account_name.nil?
@@ -294,23 +264,9 @@ module YNAB
294
264
  # Custom attribute writer method checking allowed values (enum).
295
265
  # @param [Object] frequency Object to be assigned
296
266
  def frequency=(frequency)
297
- validator = EnumAttributeValidator.new('String', ["never", "daily", "weekly", "everyOtherWeek", "twiceAMonth", "every4Weeks", "monthly", "everyOtherMonth", "every3Months", "every4Months", "twiceAYear", "yearly", "everyOtherYear"])
298
- unless validator.valid?(frequency)
299
- fail ArgumentError, "invalid value for \"frequency\", must be one of #{validator.allowable_values}."
300
- end
301
267
  @frequency = frequency
302
268
  end
303
269
 
304
- # Custom attribute writer method checking allowed values (enum).
305
- # @param [Object] flag_color Object to be assigned
306
- def flag_color=(flag_color)
307
- validator = EnumAttributeValidator.new('String', ["red", "orange", "yellow", "green", "blue", "purple", "null"])
308
- unless validator.valid?(flag_color)
309
- fail ArgumentError, "invalid value for \"flag_color\", must be one of #{validator.allowable_values}."
310
- end
311
- @flag_color = flag_color
312
- end
313
-
314
270
  # Checks equality by comparing each attribute.
315
271
  # @param [Object] Object to be compared
316
272
  def ==(o)
@@ -323,6 +279,7 @@ module YNAB
323
279
  amount == o.amount &&
324
280
  memo == o.memo &&
325
281
  flag_color == o.flag_color &&
282
+ flag_name == o.flag_name &&
326
283
  account_id == o.account_id &&
327
284
  payee_id == o.payee_id &&
328
285
  category_id == o.category_id &&
@@ -343,44 +300,37 @@ module YNAB
343
300
  # Calculates hash code according to all attributes.
344
301
  # @return [Integer] Hash code
345
302
  def hash
346
- [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
347
304
  end
348
305
 
349
306
  # Builds the object from hash
350
307
  # @param [Hash] attributes Model attributes in the form of hash
351
308
  # @return [Object] Returns the model itself
352
309
  def self.build_from_hash(attributes)
353
- new.build_from_hash(attributes)
354
- end
355
-
356
- # Builds the object from hash
357
- # @param [Hash] attributes Model attributes in the form of hash
358
- # @return [Object] Returns the model itself
359
- def build_from_hash(attributes)
360
310
  return nil unless attributes.is_a?(Hash)
361
311
  attributes = attributes.transform_keys(&:to_sym)
362
- self.class.openapi_types.each_pair do |key, type|
363
- if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
364
- 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
365
316
  elsif type =~ /\AArray<(.*)>/i
366
317
  # check to ensure the input is an array given that the attribute
367
318
  # is documented as an array but the input is not
368
- if attributes[self.class.attribute_map[key]].is_a?(Array)
369
- 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) }
370
321
  end
371
- elsif !attributes[self.class.attribute_map[key]].nil?
372
- 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]])
373
324
  end
374
325
  end
375
-
376
- self
326
+ new(transformed_hash)
377
327
  end
378
328
 
379
329
  # Deserializes the data based on type
380
330
  # @param string type Data type
381
331
  # @param string value Value to be deserialized
382
332
  # @return [Object] Deserialized data
383
- def _deserialize(type, value)
333
+ def self._deserialize(type, value)
384
334
  case type.to_sym
385
335
  when :Time
386
336
  Time.parse(value)
@@ -415,7 +365,7 @@ module YNAB
415
365
  else # model
416
366
  # models (e.g. Pet) or oneOf
417
367
  klass = YNAB.const_get(type)
418
- 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)
419
369
  end
420
370
  end
421
371
 
@@ -96,14 +96,6 @@ module YNAB
96
96
  # @return Array for valid properties with the reasons
97
97
  def list_invalid_properties
98
98
  invalid_properties = Array.new
99
- if @account_name.nil?
100
- invalid_properties.push('invalid value for "account_name", account_name cannot be nil.')
101
- end
102
-
103
- if @subtransactions.nil?
104
- invalid_properties.push('invalid value for "subtransactions", subtransactions cannot be nil.')
105
- end
106
-
107
99
  invalid_properties
108
100
  end
109
101
 
@@ -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
 
@@ -66,10 +66,6 @@ module YNAB
66
66
  # @return Array for valid properties with the reasons
67
67
  def list_invalid_properties
68
68
  invalid_properties = Array.new
69
- if @data.nil?
70
- invalid_properties.push('invalid value for "data", data cannot be nil.')
71
- end
72
-
73
69
  invalid_properties
74
70
  end
75
71
 
@@ -104,37 +100,30 @@ module YNAB
104
100
  # @param [Hash] attributes Model attributes in the form of hash
105
101
  # @return [Object] Returns the model itself
106
102
  def self.build_from_hash(attributes)
107
- new.build_from_hash(attributes)
108
- end
109
-
110
- # Builds the object from hash
111
- # @param [Hash] attributes Model attributes in the form of hash
112
- # @return [Object] Returns the model itself
113
- def build_from_hash(attributes)
114
103
  return nil unless attributes.is_a?(Hash)
115
104
  attributes = attributes.transform_keys(&:to_sym)
116
- self.class.openapi_types.each_pair do |key, type|
117
- if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
118
- 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
119
109
  elsif type =~ /\AArray<(.*)>/i
120
110
  # check to ensure the input is an array given that the attribute
121
111
  # is documented as an array but the input is not
122
- if attributes[self.class.attribute_map[key]].is_a?(Array)
123
- 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) }
124
114
  end
125
- elsif !attributes[self.class.attribute_map[key]].nil?
126
- 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]])
127
117
  end
128
118
  end
129
-
130
- self
119
+ new(transformed_hash)
131
120
  end
132
121
 
133
122
  # Deserializes the data based on type
134
123
  # @param string type Data type
135
124
  # @param string value Value to be deserialized
136
125
  # @return [Object] Deserialized data
137
- def _deserialize(type, value)
126
+ def self._deserialize(type, value)
138
127
  case type.to_sym
139
128
  when :Time
140
129
  Time.parse(value)
@@ -169,7 +158,7 @@ module YNAB
169
158
  else # model
170
159
  # models (e.g. Pet) or oneOf
171
160
  klass = YNAB.const_get(type)
172
- 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)
173
162
  end
174
163
  end
175
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
 
@@ -66,10 +66,6 @@ module YNAB
66
66
  # @return Array for valid properties with the reasons
67
67
  def list_invalid_properties
68
68
  invalid_properties = Array.new
69
- if @scheduled_transaction.nil?
70
- invalid_properties.push('invalid value for "scheduled_transaction", scheduled_transaction cannot be nil.')
71
- end
72
-
73
69
  invalid_properties
74
70
  end
75
71
 
@@ -104,37 +100,30 @@ module YNAB
104
100
  # @param [Hash] attributes Model attributes in the form of hash
105
101
  # @return [Object] Returns the model itself
106
102
  def self.build_from_hash(attributes)
107
- new.build_from_hash(attributes)
108
- end
109
-
110
- # Builds the object from hash
111
- # @param [Hash] attributes Model attributes in the form of hash
112
- # @return [Object] Returns the model itself
113
- def build_from_hash(attributes)
114
103
  return nil unless attributes.is_a?(Hash)
115
104
  attributes = attributes.transform_keys(&:to_sym)
116
- self.class.openapi_types.each_pair do |key, type|
117
- if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
118
- 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
119
109
  elsif type =~ /\AArray<(.*)>/i
120
110
  # check to ensure the input is an array given that the attribute
121
111
  # is documented as an array but the input is not
122
- if attributes[self.class.attribute_map[key]].is_a?(Array)
123
- 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) }
124
114
  end
125
- elsif !attributes[self.class.attribute_map[key]].nil?
126
- 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]])
127
117
  end
128
118
  end
129
-
130
- self
119
+ new(transformed_hash)
131
120
  end
132
121
 
133
122
  # Deserializes the data based on type
134
123
  # @param string type Data type
135
124
  # @param string value Value to be deserialized
136
125
  # @return [Object] Deserialized data
137
- def _deserialize(type, value)
126
+ def self._deserialize(type, value)
138
127
  case type.to_sym
139
128
  when :Time
140
129
  Time.parse(value)
@@ -169,7 +158,7 @@ module YNAB
169
158
  else # model
170
159
  # models (e.g. Pet) or oneOf
171
160
  klass = YNAB.const_get(type)
172
- 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)
173
162
  end
174
163
  end
175
164