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
|
|
@@ -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 @category_groups.nil?
|
81
|
-
invalid_properties.push('invalid value for "category_groups", category_groups 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/category.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
|
|
@@ -296,38 +296,6 @@ module YNAB
|
|
296
296
|
# @return Array for valid properties with the reasons
|
297
297
|
def list_invalid_properties
|
298
298
|
invalid_properties = Array.new
|
299
|
-
if @id.nil?
|
300
|
-
invalid_properties.push('invalid value for "id", id cannot be nil.')
|
301
|
-
end
|
302
|
-
|
303
|
-
if @category_group_id.nil?
|
304
|
-
invalid_properties.push('invalid value for "category_group_id", category_group_id cannot be nil.')
|
305
|
-
end
|
306
|
-
|
307
|
-
if @name.nil?
|
308
|
-
invalid_properties.push('invalid value for "name", name cannot be nil.')
|
309
|
-
end
|
310
|
-
|
311
|
-
if @hidden.nil?
|
312
|
-
invalid_properties.push('invalid value for "hidden", hidden cannot be nil.')
|
313
|
-
end
|
314
|
-
|
315
|
-
if @budgeted.nil?
|
316
|
-
invalid_properties.push('invalid value for "budgeted", budgeted cannot be nil.')
|
317
|
-
end
|
318
|
-
|
319
|
-
if @activity.nil?
|
320
|
-
invalid_properties.push('invalid value for "activity", activity cannot be nil.')
|
321
|
-
end
|
322
|
-
|
323
|
-
if @balance.nil?
|
324
|
-
invalid_properties.push('invalid value for "balance", balance cannot be nil.')
|
325
|
-
end
|
326
|
-
|
327
|
-
if @deleted.nil?
|
328
|
-
invalid_properties.push('invalid value for "deleted", deleted cannot be nil.')
|
329
|
-
end
|
330
|
-
|
331
299
|
invalid_properties
|
332
300
|
end
|
333
301
|
|
@@ -350,10 +318,6 @@ module YNAB
|
|
350
318
|
# Custom attribute writer method checking allowed values (enum).
|
351
319
|
# @param [Object] goal_type Object to be assigned
|
352
320
|
def goal_type=(goal_type)
|
353
|
-
validator = EnumAttributeValidator.new('String', ["TB", "TBD", "MF", "NEED", "DEBT", "null"])
|
354
|
-
unless validator.valid?(goal_type)
|
355
|
-
fail ArgumentError, "invalid value for \"goal_type\", must be one of #{validator.allowable_values}."
|
356
|
-
end
|
357
321
|
@goal_type = goal_type
|
358
322
|
end
|
359
323
|
|
@@ -403,37 +367,30 @@ module YNAB
|
|
403
367
|
# @param [Hash] attributes Model attributes in the form of hash
|
404
368
|
# @return [Object] Returns the model itself
|
405
369
|
def self.build_from_hash(attributes)
|
406
|
-
new.build_from_hash(attributes)
|
407
|
-
end
|
408
|
-
|
409
|
-
# Builds the object from hash
|
410
|
-
# @param [Hash] attributes Model attributes in the form of hash
|
411
|
-
# @return [Object] Returns the model itself
|
412
|
-
def build_from_hash(attributes)
|
413
370
|
return nil unless attributes.is_a?(Hash)
|
414
371
|
attributes = attributes.transform_keys(&:to_sym)
|
415
|
-
|
416
|
-
|
417
|
-
|
372
|
+
transformed_hash = {}
|
373
|
+
openapi_types.each_pair do |key, type|
|
374
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
375
|
+
transformed_hash["#{key}"] = nil
|
418
376
|
elsif type =~ /\AArray<(.*)>/i
|
419
377
|
# check to ensure the input is an array given that the attribute
|
420
378
|
# is documented as an array but the input is not
|
421
|
-
if attributes[
|
422
|
-
|
379
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
380
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
423
381
|
end
|
424
|
-
elsif !attributes[
|
425
|
-
|
382
|
+
elsif !attributes[attribute_map[key]].nil?
|
383
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
426
384
|
end
|
427
385
|
end
|
428
|
-
|
429
|
-
self
|
386
|
+
new(transformed_hash)
|
430
387
|
end
|
431
388
|
|
432
389
|
# Deserializes the data based on type
|
433
390
|
# @param string type Data type
|
434
391
|
# @param string value Value to be deserialized
|
435
392
|
# @return [Object] Deserialized data
|
436
|
-
def _deserialize(type, value)
|
393
|
+
def self._deserialize(type, value)
|
437
394
|
case type.to_sym
|
438
395
|
when :Time
|
439
396
|
Time.parse(value)
|
@@ -468,7 +425,7 @@ module YNAB
|
|
468
425
|
else # model
|
469
426
|
# models (e.g. Pet) or oneOf
|
470
427
|
klass = YNAB.const_get(type)
|
471
|
-
klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
428
|
+
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
472
429
|
end
|
473
430
|
end
|
474
431
|
|
@@ -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
|
|
@@ -92,22 +92,6 @@ module YNAB
|
|
92
92
|
# @return Array for valid properties with the reasons
|
93
93
|
def list_invalid_properties
|
94
94
|
invalid_properties = Array.new
|
95
|
-
if @id.nil?
|
96
|
-
invalid_properties.push('invalid value for "id", id cannot be nil.')
|
97
|
-
end
|
98
|
-
|
99
|
-
if @name.nil?
|
100
|
-
invalid_properties.push('invalid value for "name", name cannot be nil.')
|
101
|
-
end
|
102
|
-
|
103
|
-
if @hidden.nil?
|
104
|
-
invalid_properties.push('invalid value for "hidden", hidden cannot be nil.')
|
105
|
-
end
|
106
|
-
|
107
|
-
if @deleted.nil?
|
108
|
-
invalid_properties.push('invalid value for "deleted", deleted cannot be nil.')
|
109
|
-
end
|
110
|
-
|
111
95
|
invalid_properties
|
112
96
|
end
|
113
97
|
|
@@ -148,37 +132,30 @@ module YNAB
|
|
148
132
|
# @param [Hash] attributes Model attributes in the form of hash
|
149
133
|
# @return [Object] Returns the model itself
|
150
134
|
def self.build_from_hash(attributes)
|
151
|
-
new.build_from_hash(attributes)
|
152
|
-
end
|
153
|
-
|
154
|
-
# Builds the object from hash
|
155
|
-
# @param [Hash] attributes Model attributes in the form of hash
|
156
|
-
# @return [Object] Returns the model itself
|
157
|
-
def build_from_hash(attributes)
|
158
135
|
return nil unless attributes.is_a?(Hash)
|
159
136
|
attributes = attributes.transform_keys(&:to_sym)
|
160
|
-
|
161
|
-
|
162
|
-
|
137
|
+
transformed_hash = {}
|
138
|
+
openapi_types.each_pair do |key, type|
|
139
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
140
|
+
transformed_hash["#{key}"] = nil
|
163
141
|
elsif type =~ /\AArray<(.*)>/i
|
164
142
|
# check to ensure the input is an array given that the attribute
|
165
143
|
# is documented as an array but the input is not
|
166
|
-
if attributes[
|
167
|
-
|
144
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
145
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
168
146
|
end
|
169
|
-
elsif !attributes[
|
170
|
-
|
147
|
+
elsif !attributes[attribute_map[key]].nil?
|
148
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
171
149
|
end
|
172
150
|
end
|
173
|
-
|
174
|
-
self
|
151
|
+
new(transformed_hash)
|
175
152
|
end
|
176
153
|
|
177
154
|
# Deserializes the data based on type
|
178
155
|
# @param string type Data type
|
179
156
|
# @param string value Value to be deserialized
|
180
157
|
# @return [Object] Deserialized data
|
181
|
-
def _deserialize(type, value)
|
158
|
+
def self._deserialize(type, value)
|
182
159
|
case type.to_sym
|
183
160
|
when :Time
|
184
161
|
Time.parse(value)
|
@@ -213,7 +190,7 @@ module YNAB
|
|
213
190
|
else # model
|
214
191
|
# models (e.g. Pet) or oneOf
|
215
192
|
klass = YNAB.const_get(type)
|
216
|
-
klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
193
|
+
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
217
194
|
end
|
218
195
|
end
|
219
196
|
|
@@ -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
|
|
@@ -64,8 +64,7 @@ module YNAB
|
|
64
64
|
# List of class defined in allOf (OpenAPI v3)
|
65
65
|
def self.openapi_all_of
|
66
66
|
[
|
67
|
-
:'CategoryGroup'
|
68
|
-
:'CategoryGroupWithCategoriesAllOf'
|
67
|
+
:'CategoryGroup'
|
69
68
|
]
|
70
69
|
end
|
71
70
|
|
@@ -111,26 +110,6 @@ module YNAB
|
|
111
110
|
# @return Array for valid properties with the reasons
|
112
111
|
def list_invalid_properties
|
113
112
|
invalid_properties = Array.new
|
114
|
-
if @id.nil?
|
115
|
-
invalid_properties.push('invalid value for "id", id cannot be nil.')
|
116
|
-
end
|
117
|
-
|
118
|
-
if @name.nil?
|
119
|
-
invalid_properties.push('invalid value for "name", name cannot be nil.')
|
120
|
-
end
|
121
|
-
|
122
|
-
if @hidden.nil?
|
123
|
-
invalid_properties.push('invalid value for "hidden", hidden cannot be nil.')
|
124
|
-
end
|
125
|
-
|
126
|
-
if @deleted.nil?
|
127
|
-
invalid_properties.push('invalid value for "deleted", deleted cannot be nil.')
|
128
|
-
end
|
129
|
-
|
130
|
-
if @categories.nil?
|
131
|
-
invalid_properties.push('invalid value for "categories", categories cannot be nil.')
|
132
|
-
end
|
133
|
-
|
134
113
|
invalid_properties
|
135
114
|
end
|
136
115
|
|
@@ -173,37 +152,30 @@ module YNAB
|
|
173
152
|
# @param [Hash] attributes Model attributes in the form of hash
|
174
153
|
# @return [Object] Returns the model itself
|
175
154
|
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
155
|
return nil unless attributes.is_a?(Hash)
|
184
156
|
attributes = attributes.transform_keys(&:to_sym)
|
185
|
-
|
186
|
-
|
187
|
-
|
157
|
+
transformed_hash = {}
|
158
|
+
openapi_types.each_pair do |key, type|
|
159
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
160
|
+
transformed_hash["#{key}"] = nil
|
188
161
|
elsif type =~ /\AArray<(.*)>/i
|
189
162
|
# check to ensure the input is an array given that the attribute
|
190
163
|
# is documented as an array but the input is not
|
191
|
-
if attributes[
|
192
|
-
|
164
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
165
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
193
166
|
end
|
194
|
-
elsif !attributes[
|
195
|
-
|
167
|
+
elsif !attributes[attribute_map[key]].nil?
|
168
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
196
169
|
end
|
197
170
|
end
|
198
|
-
|
199
|
-
self
|
171
|
+
new(transformed_hash)
|
200
172
|
end
|
201
173
|
|
202
174
|
# Deserializes the data based on type
|
203
175
|
# @param string type Data type
|
204
176
|
# @param string value Value to be deserialized
|
205
177
|
# @return [Object] Deserialized data
|
206
|
-
def _deserialize(type, value)
|
178
|
+
def self._deserialize(type, value)
|
207
179
|
case type.to_sym
|
208
180
|
when :Time
|
209
181
|
Time.parse(value)
|
@@ -238,7 +210,7 @@ module YNAB
|
|
238
210
|
else # model
|
239
211
|
# models (e.g. Pet) or oneOf
|
240
212
|
klass = YNAB.const_get(type)
|
241
|
-
klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
213
|
+
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
242
214
|
end
|
243
215
|
end
|
244
216
|
|
@@ -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 @categories.nil?
|
73
|
-
invalid_properties.push('invalid value for "categories", categories cannot be nil.')
|
74
|
-
end
|
75
|
-
|
76
72
|
invalid_properties
|
77
73
|
end
|
78
74
|
|
@@ -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
|
|
@@ -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 @category.nil?
|
70
|
-
invalid_properties.push('invalid value for "category", category 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
|
|