ynab 2.0.0 → 3.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/DEVELOPMENT.md +6 -2
- data/Gemfile.lock +1 -1
- data/README.md +4 -2
- data/docs/BulkTransactions.md +1 -1
- data/docs/CategoriesApi.md +22 -0
- data/docs/ExistingTransaction.md +18 -0
- data/docs/HybridTransaction.md +3 -2
- data/docs/NewTransaction.md +19 -0
- data/docs/PatchCategoryWrapper.md +8 -0
- data/docs/PatchPayeeWrapper.md +8 -0
- data/docs/PatchTransactionsWrapper.md +1 -1
- data/docs/PayeesApi.md +22 -0
- data/docs/PostTransactionsWrapper.md +2 -2
- data/docs/PutTransactionWrapper.md +1 -1
- data/docs/SaveCategory.md +10 -0
- data/docs/SavePayee.md +8 -0
- data/docs/SavePayeeResponse.md +8 -0
- data/docs/SavePayeeResponseData.md +9 -0
- data/docs/SaveTransactionWithIdOrImportId.md +20 -0
- data/docs/SaveTransactionWithOptionalFields.md +2 -3
- data/docs/ScheduledTransactionDetail.md +2 -1
- data/docs/ScheduledTransactionSummary.md +2 -1
- data/docs/TransactionClearedStatus.md +7 -0
- data/docs/TransactionDetail.md +3 -2
- data/docs/TransactionFlagColor.md +7 -0
- data/docs/TransactionSummary.md +3 -2
- data/docs/TransactionsApi.md +7 -7
- data/lib/ynab/api/accounts_api.rb +2 -2
- data/lib/ynab/api/budgets_api.rb +2 -2
- data/lib/ynab/api/categories_api.rb +82 -2
- data/lib/ynab/api/months_api.rb +2 -2
- data/lib/ynab/api/payee_locations_api.rb +2 -2
- data/lib/ynab/api/payees_api.rb +82 -2
- data/lib/ynab/api/scheduled_transactions_api.rb +2 -2
- data/lib/ynab/api/transactions_api.rb +12 -28
- data/lib/ynab/api/user_api.rb +2 -2
- data/lib/ynab/api_client.rb +2 -2
- data/lib/ynab/configuration.rb +14 -11
- data/lib/ynab/models/account.rb +13 -56
- data/lib/ynab/models/account_response.rb +13 -24
- data/lib/ynab/models/account_response_data.rb +13 -24
- data/lib/ynab/models/account_type.rb +2 -2
- data/lib/ynab/models/accounts_response.rb +13 -24
- data/lib/ynab/models/accounts_response_data.rb +13 -28
- data/lib/ynab/models/budget_detail.rb +13 -29
- data/lib/ynab/models/budget_detail_response.rb +13 -24
- data/lib/ynab/models/budget_detail_response_data.rb +13 -28
- data/lib/ynab/models/budget_settings.rb +13 -20
- data/lib/ynab/models/budget_settings_response.rb +13 -24
- data/lib/ynab/models/budget_settings_response_data.rb +13 -24
- data/lib/ynab/models/budget_summary.rb +13 -28
- data/lib/ynab/models/budget_summary_response.rb +13 -24
- data/lib/ynab/models/budget_summary_response_data.rb +13 -24
- data/lib/ynab/models/bulk_response.rb +13 -24
- data/lib/ynab/models/bulk_response_data.rb +13 -24
- data/lib/ynab/models/bulk_response_data_bulk.rb +13 -28
- data/lib/ynab/models/bulk_transactions.rb +14 -25
- data/lib/ynab/models/categories_response.rb +13 -24
- data/lib/ynab/models/categories_response_data.rb +13 -28
- data/lib/ynab/models/category.rb +13 -56
- data/lib/ynab/models/category_group.rb +13 -36
- data/lib/ynab/models/category_group_with_categories.rb +14 -42
- data/lib/ynab/models/category_group_with_categories_all_of.rb +0 -4
- data/lib/ynab/models/category_response.rb +13 -24
- data/lib/ynab/models/category_response_data.rb +13 -24
- data/lib/ynab/models/currency_format.rb +13 -52
- data/lib/ynab/models/date_format.rb +13 -24
- data/lib/ynab/models/error_detail.rb +13 -32
- data/lib/ynab/models/error_response.rb +13 -24
- data/lib/ynab/models/existing_transaction.rb +359 -0
- data/lib/ynab/models/hybrid_transaction.rb +28 -95
- data/lib/ynab/models/hybrid_transaction_all_of.rb +0 -12
- data/lib/ynab/models/hybrid_transactions_response.rb +13 -24
- data/lib/ynab/models/hybrid_transactions_response_data.rb +13 -24
- data/lib/ynab/models/month_detail.rb +13 -49
- data/lib/ynab/models/month_detail_all_of.rb +0 -4
- data/lib/ynab/models/month_detail_response.rb +13 -24
- data/lib/ynab/models/month_detail_response_data.rb +13 -24
- data/lib/ynab/models/month_summaries_response.rb +13 -24
- data/lib/ynab/models/month_summaries_response_data.rb +13 -28
- data/lib/ynab/models/month_summary.rb +13 -44
- data/lib/ynab/models/new_transaction.rb +377 -0
- data/lib/ynab/models/patch_category_wrapper.rb +213 -0
- data/lib/ynab/models/patch_month_category_wrapper.rb +13 -24
- data/lib/ynab/models/patch_payee_wrapper.rb +213 -0
- data/lib/ynab/models/patch_transactions_wrapper.rb +14 -25
- data/lib/ynab/models/payee.rb +13 -32
- data/lib/ynab/models/payee_location.rb +13 -40
- data/lib/ynab/models/payee_location_response.rb +13 -24
- data/lib/ynab/models/payee_location_response_data.rb +13 -24
- data/lib/ynab/models/payee_locations_response.rb +13 -24
- data/lib/ynab/models/payee_locations_response_data.rb +13 -24
- data/lib/ynab/models/payee_response.rb +13 -24
- data/lib/ynab/models/payee_response_data.rb +13 -24
- data/lib/ynab/models/payees_response.rb +13 -24
- data/lib/ynab/models/payees_response_data.rb +13 -28
- data/lib/ynab/models/post_account_wrapper.rb +13 -24
- data/lib/ynab/models/post_transactions_wrapper.rb +15 -22
- data/lib/ynab/models/put_transaction_wrapper.rb +14 -25
- data/lib/ynab/models/save_account.rb +13 -32
- data/lib/ynab/models/save_category.rb +232 -0
- data/lib/ynab/models/save_category_response.rb +13 -24
- data/lib/ynab/models/save_category_response_data.rb +13 -28
- data/lib/ynab/models/save_month_category.rb +13 -24
- data/lib/ynab/models/save_payee.rb +220 -0
- data/lib/ynab/models/save_payee_response.rb +213 -0
- data/lib/ynab/models/save_payee_response_data.rb +224 -0
- data/lib/ynab/models/save_sub_transaction.rb +13 -40
- data/lib/ynab/models/save_transaction.rb +0 -32
- data/lib/ynab/models/save_transaction_with_id.rb +0 -32
- data/lib/ynab/models/save_transaction_with_id_or_import_id.rb +388 -0
- data/lib/ynab/models/save_transaction_with_optional_fields.rb +17 -91
- data/lib/ynab/models/save_transactions_response.rb +13 -24
- data/lib/ynab/models/save_transactions_response_data.rb +13 -28
- data/lib/ynab/models/scheduled_sub_transaction.rb +13 -36
- data/lib/ynab/models/scheduled_transaction_detail.rb +26 -76
- data/lib/ynab/models/scheduled_transaction_detail_all_of.rb +0 -8
- data/lib/ynab/models/scheduled_transaction_response.rb +13 -24
- data/lib/ynab/models/scheduled_transaction_response_data.rb +13 -24
- data/lib/ynab/models/scheduled_transaction_summary.rb +26 -67
- data/lib/ynab/models/scheduled_transactions_response.rb +13 -24
- data/lib/ynab/models/scheduled_transactions_response_data.rb +13 -28
- data/lib/ynab/models/sub_transaction.rb +13 -36
- data/lib/ynab/models/transaction_cleared_status.rb +41 -0
- data/lib/ynab/models/transaction_detail.rb +28 -91
- data/lib/ynab/models/transaction_detail_all_of.rb +0 -8
- data/lib/ynab/models/transaction_flag_color.rb +45 -0
- data/lib/ynab/models/transaction_response.rb +13 -24
- data/lib/ynab/models/transaction_response_data.rb +13 -24
- data/lib/ynab/models/transaction_summary.rb +28 -82
- data/lib/ynab/models/transactions_import_response.rb +13 -24
- data/lib/ynab/models/transactions_import_response_data.rb +13 -24
- data/lib/ynab/models/transactions_response.rb +13 -24
- data/lib/ynab/models/transactions_response_data.rb +13 -28
- data/lib/ynab/models/user.rb +13 -24
- data/lib/ynab/models/user_response.rb +13 -24
- data/lib/ynab/models/user_response_data.rb +13 -24
- data/lib/ynab/version.rb +1 -1
- data/lib/ynab.rb +13 -12
- data/open_api_spec.yaml +455 -343
- data/templates/api.mustache +213 -0
- data/templates/partial_model_generic.mustache +305 -0
- data/ynab.gemspec +4 -3
- 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.
|
6
|
+
The version of the OpenAPI document: 1.69.0
|
7
7
|
|
8
8
|
Generated by: https://openapi-generator.tech
|
9
|
-
|
9
|
+
Generator version: 7.6.0
|
10
10
|
|
11
11
|
=end
|
12
12
|
|
@@ -25,15 +25,16 @@ module YNAB
|
|
25
25
|
|
26
26
|
attr_accessor :memo
|
27
27
|
|
28
|
-
# The cleared status of the transaction
|
29
28
|
attr_accessor :cleared
|
30
29
|
|
31
30
|
# Whether or not the transaction is approved
|
32
31
|
attr_accessor :approved
|
33
32
|
|
34
|
-
# The transaction flag
|
35
33
|
attr_accessor :flag_color
|
36
34
|
|
35
|
+
# The customized name of a transaction flag
|
36
|
+
attr_accessor :flag_name
|
37
|
+
|
37
38
|
attr_accessor :account_id
|
38
39
|
|
39
40
|
attr_accessor :payee_id
|
@@ -96,6 +97,7 @@ module YNAB
|
|
96
97
|
:'cleared' => :'cleared',
|
97
98
|
:'approved' => :'approved',
|
98
99
|
:'flag_color' => :'flag_color',
|
100
|
+
:'flag_name' => :'flag_name',
|
99
101
|
:'account_id' => :'account_id',
|
100
102
|
:'payee_id' => :'payee_id',
|
101
103
|
:'category_id' => :'category_id',
|
@@ -122,9 +124,10 @@ module YNAB
|
|
122
124
|
:'date' => :'Date',
|
123
125
|
:'amount' => :'Integer',
|
124
126
|
:'memo' => :'String',
|
125
|
-
:'cleared' => :'
|
127
|
+
:'cleared' => :'TransactionClearedStatus',
|
126
128
|
:'approved' => :'Boolean',
|
127
|
-
:'flag_color' => :'
|
129
|
+
:'flag_color' => :'TransactionFlagColor',
|
130
|
+
:'flag_name' => :'String',
|
128
131
|
:'account_id' => :'String',
|
129
132
|
:'payee_id' => :'String',
|
130
133
|
:'category_id' => :'String',
|
@@ -144,6 +147,7 @@ module YNAB
|
|
144
147
|
Set.new([
|
145
148
|
:'memo',
|
146
149
|
:'flag_color',
|
150
|
+
:'flag_name',
|
147
151
|
:'payee_id',
|
148
152
|
:'category_id',
|
149
153
|
:'transfer_account_id',
|
@@ -199,6 +203,10 @@ module YNAB
|
|
199
203
|
self.flag_color = attributes[:'flag_color']
|
200
204
|
end
|
201
205
|
|
206
|
+
if attributes.key?(:'flag_name')
|
207
|
+
self.flag_name = attributes[:'flag_name']
|
208
|
+
end
|
209
|
+
|
202
210
|
if attributes.key?(:'account_id')
|
203
211
|
self.account_id = attributes[:'account_id']
|
204
212
|
end
|
@@ -248,34 +256,6 @@ module YNAB
|
|
248
256
|
# @return Array for valid properties with the reasons
|
249
257
|
def list_invalid_properties
|
250
258
|
invalid_properties = Array.new
|
251
|
-
if @id.nil?
|
252
|
-
invalid_properties.push('invalid value for "id", id cannot be nil.')
|
253
|
-
end
|
254
|
-
|
255
|
-
if @date.nil?
|
256
|
-
invalid_properties.push('invalid value for "date", date cannot be nil.')
|
257
|
-
end
|
258
|
-
|
259
|
-
if @amount.nil?
|
260
|
-
invalid_properties.push('invalid value for "amount", amount cannot be nil.')
|
261
|
-
end
|
262
|
-
|
263
|
-
if @cleared.nil?
|
264
|
-
invalid_properties.push('invalid value for "cleared", cleared cannot be nil.')
|
265
|
-
end
|
266
|
-
|
267
|
-
if @approved.nil?
|
268
|
-
invalid_properties.push('invalid value for "approved", approved cannot be nil.')
|
269
|
-
end
|
270
|
-
|
271
|
-
if @account_id.nil?
|
272
|
-
invalid_properties.push('invalid value for "account_id", account_id cannot be nil.')
|
273
|
-
end
|
274
|
-
|
275
|
-
if @deleted.nil?
|
276
|
-
invalid_properties.push('invalid value for "deleted", deleted cannot be nil.')
|
277
|
-
end
|
278
|
-
|
279
259
|
invalid_properties
|
280
260
|
end
|
281
261
|
|
@@ -286,45 +266,17 @@ module YNAB
|
|
286
266
|
return false if @date.nil?
|
287
267
|
return false if @amount.nil?
|
288
268
|
return false if @cleared.nil?
|
289
|
-
cleared_validator = EnumAttributeValidator.new('String', ["cleared", "uncleared", "reconciled"])
|
290
|
-
return false unless cleared_validator.valid?(@cleared)
|
291
269
|
return false if @approved.nil?
|
292
|
-
flag_color_validator = EnumAttributeValidator.new('String', ["red", "orange", "yellow", "green", "blue", "purple", "null"])
|
293
|
-
return false unless flag_color_validator.valid?(@flag_color)
|
294
270
|
return false if @account_id.nil?
|
295
|
-
debt_transaction_type_validator = EnumAttributeValidator.new('String', ["payment", "refund", "fee", "interest", "escrow", "
|
271
|
+
debt_transaction_type_validator = EnumAttributeValidator.new('String', ["payment", "refund", "fee", "interest", "escrow", "balanceAdjustment", "credit", "charge", "null"])
|
296
272
|
return false unless debt_transaction_type_validator.valid?(@debt_transaction_type)
|
297
273
|
return false if @deleted.nil?
|
298
274
|
true
|
299
275
|
end
|
300
276
|
|
301
|
-
# Custom attribute writer method checking allowed values (enum).
|
302
|
-
# @param [Object] cleared Object to be assigned
|
303
|
-
def cleared=(cleared)
|
304
|
-
validator = EnumAttributeValidator.new('String', ["cleared", "uncleared", "reconciled"])
|
305
|
-
unless validator.valid?(cleared)
|
306
|
-
fail ArgumentError, "invalid value for \"cleared\", must be one of #{validator.allowable_values}."
|
307
|
-
end
|
308
|
-
@cleared = cleared
|
309
|
-
end
|
310
|
-
|
311
|
-
# Custom attribute writer method checking allowed values (enum).
|
312
|
-
# @param [Object] flag_color Object to be assigned
|
313
|
-
def flag_color=(flag_color)
|
314
|
-
validator = EnumAttributeValidator.new('String', ["red", "orange", "yellow", "green", "blue", "purple", "null"])
|
315
|
-
unless validator.valid?(flag_color)
|
316
|
-
fail ArgumentError, "invalid value for \"flag_color\", must be one of #{validator.allowable_values}."
|
317
|
-
end
|
318
|
-
@flag_color = flag_color
|
319
|
-
end
|
320
|
-
|
321
277
|
# Custom attribute writer method checking allowed values (enum).
|
322
278
|
# @param [Object] debt_transaction_type Object to be assigned
|
323
279
|
def debt_transaction_type=(debt_transaction_type)
|
324
|
-
validator = EnumAttributeValidator.new('String', ["payment", "refund", "fee", "interest", "escrow", "balancedAdjustment", "credit", "charge", "null"])
|
325
|
-
unless validator.valid?(debt_transaction_type)
|
326
|
-
fail ArgumentError, "invalid value for \"debt_transaction_type\", must be one of #{validator.allowable_values}."
|
327
|
-
end
|
328
280
|
@debt_transaction_type = debt_transaction_type
|
329
281
|
end
|
330
282
|
|
@@ -340,6 +292,7 @@ module YNAB
|
|
340
292
|
cleared == o.cleared &&
|
341
293
|
approved == o.approved &&
|
342
294
|
flag_color == o.flag_color &&
|
295
|
+
flag_name == o.flag_name &&
|
343
296
|
account_id == o.account_id &&
|
344
297
|
payee_id == o.payee_id &&
|
345
298
|
category_id == o.category_id &&
|
@@ -362,44 +315,37 @@ module YNAB
|
|
362
315
|
# Calculates hash code according to all attributes.
|
363
316
|
# @return [Integer] Hash code
|
364
317
|
def hash
|
365
|
-
[id, date, amount, memo, cleared, approved, flag_color, account_id, payee_id, category_id, transfer_account_id, transfer_transaction_id, matched_transaction_id, import_id, import_payee_name, import_payee_name_original, debt_transaction_type, deleted].hash
|
318
|
+
[id, date, amount, memo, cleared, approved, flag_color, flag_name, account_id, payee_id, category_id, transfer_account_id, transfer_transaction_id, matched_transaction_id, import_id, import_payee_name, import_payee_name_original, debt_transaction_type, deleted].hash
|
366
319
|
end
|
367
320
|
|
368
321
|
# Builds the object from hash
|
369
322
|
# @param [Hash] attributes Model attributes in the form of hash
|
370
323
|
# @return [Object] Returns the model itself
|
371
324
|
def self.build_from_hash(attributes)
|
372
|
-
new.build_from_hash(attributes)
|
373
|
-
end
|
374
|
-
|
375
|
-
# Builds the object from hash
|
376
|
-
# @param [Hash] attributes Model attributes in the form of hash
|
377
|
-
# @return [Object] Returns the model itself
|
378
|
-
def build_from_hash(attributes)
|
379
325
|
return nil unless attributes.is_a?(Hash)
|
380
326
|
attributes = attributes.transform_keys(&:to_sym)
|
381
|
-
|
382
|
-
|
383
|
-
|
327
|
+
transformed_hash = {}
|
328
|
+
openapi_types.each_pair do |key, type|
|
329
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
330
|
+
transformed_hash["#{key}"] = nil
|
384
331
|
elsif type =~ /\AArray<(.*)>/i
|
385
332
|
# check to ensure the input is an array given that the attribute
|
386
333
|
# is documented as an array but the input is not
|
387
|
-
if attributes[
|
388
|
-
|
334
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
335
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
389
336
|
end
|
390
|
-
elsif !attributes[
|
391
|
-
|
337
|
+
elsif !attributes[attribute_map[key]].nil?
|
338
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
392
339
|
end
|
393
340
|
end
|
394
|
-
|
395
|
-
self
|
341
|
+
new(transformed_hash)
|
396
342
|
end
|
397
343
|
|
398
344
|
# Deserializes the data based on type
|
399
345
|
# @param string type Data type
|
400
346
|
# @param string value Value to be deserialized
|
401
347
|
# @return [Object] Deserialized data
|
402
|
-
def _deserialize(type, value)
|
348
|
+
def self._deserialize(type, value)
|
403
349
|
case type.to_sym
|
404
350
|
when :Time
|
405
351
|
Time.parse(value)
|
@@ -434,7 +380,7 @@ module YNAB
|
|
434
380
|
else # model
|
435
381
|
# models (e.g. Pet) or oneOf
|
436
382
|
klass = YNAB.const_get(type)
|
437
|
-
klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
383
|
+
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
438
384
|
end
|
439
385
|
end
|
440
386
|
|
@@ -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.
|
6
|
+
The version of the OpenAPI document: 1.69.0
|
7
7
|
|
8
8
|
Generated by: https://openapi-generator.tech
|
9
|
-
|
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
|
-
|
117
|
-
|
118
|
-
|
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[
|
123
|
-
|
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[
|
126
|
-
|
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.
|
6
|
+
The version of the OpenAPI document: 1.69.0
|
7
7
|
|
8
8
|
Generated by: https://openapi-generator.tech
|
9
|
-
|
9
|
+
Generator version: 7.6.0
|
10
10
|
|
11
11
|
=end
|
12
12
|
|
@@ -69,10 +69,6 @@ module YNAB
|
|
69
69
|
# @return Array for valid properties with the reasons
|
70
70
|
def list_invalid_properties
|
71
71
|
invalid_properties = Array.new
|
72
|
-
if @transaction_ids.nil?
|
73
|
-
invalid_properties.push('invalid value for "transaction_ids", transaction_ids cannot be nil.')
|
74
|
-
end
|
75
|
-
|
76
72
|
invalid_properties
|
77
73
|
end
|
78
74
|
|
@@ -107,37 +103,30 @@ module YNAB
|
|
107
103
|
# @param [Hash] attributes Model attributes in the form of hash
|
108
104
|
# @return [Object] Returns the model itself
|
109
105
|
def self.build_from_hash(attributes)
|
110
|
-
new.build_from_hash(attributes)
|
111
|
-
end
|
112
|
-
|
113
|
-
# Builds the object from hash
|
114
|
-
# @param [Hash] attributes Model attributes in the form of hash
|
115
|
-
# @return [Object] Returns the model itself
|
116
|
-
def build_from_hash(attributes)
|
117
106
|
return nil unless attributes.is_a?(Hash)
|
118
107
|
attributes = attributes.transform_keys(&:to_sym)
|
119
|
-
|
120
|
-
|
121
|
-
|
108
|
+
transformed_hash = {}
|
109
|
+
openapi_types.each_pair do |key, type|
|
110
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
111
|
+
transformed_hash["#{key}"] = nil
|
122
112
|
elsif type =~ /\AArray<(.*)>/i
|
123
113
|
# check to ensure the input is an array given that the attribute
|
124
114
|
# is documented as an array but the input is not
|
125
|
-
if attributes[
|
126
|
-
|
115
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
116
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
127
117
|
end
|
128
|
-
elsif !attributes[
|
129
|
-
|
118
|
+
elsif !attributes[attribute_map[key]].nil?
|
119
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
130
120
|
end
|
131
121
|
end
|
132
|
-
|
133
|
-
self
|
122
|
+
new(transformed_hash)
|
134
123
|
end
|
135
124
|
|
136
125
|
# Deserializes the data based on type
|
137
126
|
# @param string type Data type
|
138
127
|
# @param string value Value to be deserialized
|
139
128
|
# @return [Object] Deserialized data
|
140
|
-
def _deserialize(type, value)
|
129
|
+
def self._deserialize(type, value)
|
141
130
|
case type.to_sym
|
142
131
|
when :Time
|
143
132
|
Time.parse(value)
|
@@ -172,7 +161,7 @@ module YNAB
|
|
172
161
|
else # model
|
173
162
|
# models (e.g. Pet) or oneOf
|
174
163
|
klass = YNAB.const_get(type)
|
175
|
-
klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
164
|
+
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
176
165
|
end
|
177
166
|
end
|
178
167
|
|
@@ -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.
|
6
|
+
The version of the OpenAPI document: 1.69.0
|
7
7
|
|
8
8
|
Generated by: https://openapi-generator.tech
|
9
|
-
|
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
|
-
|
117
|
-
|
118
|
-
|
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[
|
123
|
-
|
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[
|
126
|
-
|
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.
|
6
|
+
The version of the OpenAPI document: 1.69.0
|
7
7
|
|
8
8
|
Generated by: https://openapi-generator.tech
|
9
|
-
|
9
|
+
Generator version: 7.6.0
|
10
10
|
|
11
11
|
=end
|
12
12
|
|
@@ -77,14 +77,6 @@ module YNAB
|
|
77
77
|
# @return Array for valid properties with the reasons
|
78
78
|
def list_invalid_properties
|
79
79
|
invalid_properties = Array.new
|
80
|
-
if @transactions.nil?
|
81
|
-
invalid_properties.push('invalid value for "transactions", transactions cannot be nil.')
|
82
|
-
end
|
83
|
-
|
84
|
-
if @server_knowledge.nil?
|
85
|
-
invalid_properties.push('invalid value for "server_knowledge", server_knowledge cannot be nil.')
|
86
|
-
end
|
87
|
-
|
88
80
|
invalid_properties
|
89
81
|
end
|
90
82
|
|
@@ -121,37 +113,30 @@ module YNAB
|
|
121
113
|
# @param [Hash] attributes Model attributes in the form of hash
|
122
114
|
# @return [Object] Returns the model itself
|
123
115
|
def self.build_from_hash(attributes)
|
124
|
-
new.build_from_hash(attributes)
|
125
|
-
end
|
126
|
-
|
127
|
-
# Builds the object from hash
|
128
|
-
# @param [Hash] attributes Model attributes in the form of hash
|
129
|
-
# @return [Object] Returns the model itself
|
130
|
-
def build_from_hash(attributes)
|
131
116
|
return nil unless attributes.is_a?(Hash)
|
132
117
|
attributes = attributes.transform_keys(&:to_sym)
|
133
|
-
|
134
|
-
|
135
|
-
|
118
|
+
transformed_hash = {}
|
119
|
+
openapi_types.each_pair do |key, type|
|
120
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
121
|
+
transformed_hash["#{key}"] = nil
|
136
122
|
elsif type =~ /\AArray<(.*)>/i
|
137
123
|
# check to ensure the input is an array given that the attribute
|
138
124
|
# is documented as an array but the input is not
|
139
|
-
if attributes[
|
140
|
-
|
125
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
126
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
141
127
|
end
|
142
|
-
elsif !attributes[
|
143
|
-
|
128
|
+
elsif !attributes[attribute_map[key]].nil?
|
129
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
144
130
|
end
|
145
131
|
end
|
146
|
-
|
147
|
-
self
|
132
|
+
new(transformed_hash)
|
148
133
|
end
|
149
134
|
|
150
135
|
# Deserializes the data based on type
|
151
136
|
# @param string type Data type
|
152
137
|
# @param string value Value to be deserialized
|
153
138
|
# @return [Object] Deserialized data
|
154
|
-
def _deserialize(type, value)
|
139
|
+
def self._deserialize(type, value)
|
155
140
|
case type.to_sym
|
156
141
|
when :Time
|
157
142
|
Time.parse(value)
|
@@ -186,7 +171,7 @@ module YNAB
|
|
186
171
|
else # model
|
187
172
|
# models (e.g. Pet) or oneOf
|
188
173
|
klass = YNAB.const_get(type)
|
189
|
-
klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
174
|
+
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
190
175
|
end
|
191
176
|
end
|
192
177
|
|
data/lib/ynab/models/user.rb
CHANGED
@@ -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.
|
6
|
+
The version of the OpenAPI document: 1.69.0
|
7
7
|
|
8
8
|
Generated by: https://openapi-generator.tech
|
9
|
-
|
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 @id.nil?
|
70
|
-
invalid_properties.push('invalid value for "id", id 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
|
-
|
117
|
-
|
118
|
-
|
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[
|
123
|
-
|
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[
|
126
|
-
|
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
|
|