ynab 5.2.0 → 5.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/DEVELOPMENT.md +6 -3
- data/Gemfile.lock +21 -19
- data/Rakefile +9 -8
- data/docs/ExistingCategory.md +4 -3
- data/docs/ExistingTransaction.md +1 -1
- data/docs/NewCategory.md +4 -3
- data/docs/NewTransaction.md +1 -1
- data/docs/SaveCategory.md +4 -3
- data/docs/SaveTransactionWithIdOrImportId.md +1 -1
- data/docs/SaveTransactionWithOptionalFields.md +1 -1
- data/docs/TransactionsApi.md +1 -1
- data/lib/ynab/api/accounts_api.rb +1 -1
- data/lib/ynab/api/categories_api.rb +1 -1
- data/lib/ynab/api/money_movements_api.rb +1 -1
- data/lib/ynab/api/months_api.rb +1 -1
- data/lib/ynab/api/payee_locations_api.rb +1 -1
- data/lib/ynab/api/payees_api.rb +1 -1
- data/lib/ynab/api/plans_api.rb +1 -1
- data/lib/ynab/api/scheduled_transactions_api.rb +1 -1
- data/lib/ynab/api/transactions_api.rb +3 -3
- data/lib/ynab/api/user_api.rb +1 -1
- data/lib/ynab/api_client.rb +1 -1
- data/lib/ynab/api_model_base.rb +1 -1
- data/lib/ynab/configuration.rb +1 -1
- data/lib/ynab/models/account.rb +38 -13
- data/lib/ynab/models/account_base.rb +34 -12
- data/lib/ynab/models/account_response.rb +31 -12
- data/lib/ynab/models/account_response_data.rb +31 -12
- data/lib/ynab/models/account_type.rb +1 -1
- data/lib/ynab/models/accounts_response.rb +31 -12
- data/lib/ynab/models/accounts_response_data.rb +31 -12
- data/lib/ynab/models/bulk_response.rb +31 -12
- data/lib/ynab/models/bulk_response_data.rb +31 -12
- data/lib/ynab/models/bulk_response_data_bulk.rb +31 -12
- data/lib/ynab/models/bulk_transactions.rb +31 -12
- data/lib/ynab/models/categories_response.rb +31 -12
- data/lib/ynab/models/categories_response_data.rb +31 -12
- data/lib/ynab/models/category.rb +47 -12
- data/lib/ynab/models/category_base.rb +31 -12
- data/lib/ynab/models/category_group.rb +31 -12
- data/lib/ynab/models/category_group_with_categories.rb +31 -12
- data/lib/ynab/models/category_response.rb +31 -12
- data/lib/ynab/models/category_response_data.rb +31 -12
- data/lib/ynab/models/currency_format.rb +31 -12
- data/lib/ynab/models/date_format.rb +31 -12
- data/lib/ynab/models/error_detail.rb +31 -12
- data/lib/ynab/models/error_response.rb +31 -12
- data/lib/ynab/models/existing_category.rb +83 -19
- data/lib/ynab/models/existing_transaction.rb +36 -13
- data/lib/ynab/models/hybrid_transaction.rb +41 -12
- data/lib/ynab/models/hybrid_transactions_response.rb +31 -12
- data/lib/ynab/models/hybrid_transactions_response_data.rb +31 -12
- data/lib/ynab/models/money_movement.rb +38 -12
- data/lib/ynab/models/money_movement_base.rb +31 -12
- data/lib/ynab/models/money_movement_group.rb +31 -12
- data/lib/ynab/models/money_movement_groups_response.rb +31 -12
- data/lib/ynab/models/money_movement_groups_response_data.rb +31 -12
- data/lib/ynab/models/money_movements_response.rb +31 -12
- data/lib/ynab/models/money_movements_response_data.rb +31 -12
- data/lib/ynab/models/month_detail.rb +33 -12
- data/lib/ynab/models/month_detail_base.rb +33 -12
- data/lib/ynab/models/month_detail_response.rb +31 -12
- data/lib/ynab/models/month_detail_response_data.rb +31 -12
- data/lib/ynab/models/month_summaries_response.rb +31 -12
- data/lib/ynab/models/month_summaries_response_data.rb +31 -12
- data/lib/ynab/models/month_summary.rb +33 -12
- data/lib/ynab/models/month_summary_base.rb +31 -12
- data/lib/ynab/models/new_category.rb +83 -19
- data/lib/ynab/models/new_transaction.rb +36 -13
- data/lib/ynab/models/patch_category_group_wrapper.rb +31 -12
- data/lib/ynab/models/patch_category_wrapper.rb +31 -12
- data/lib/ynab/models/patch_month_category_wrapper.rb +31 -12
- data/lib/ynab/models/patch_payee_wrapper.rb +31 -12
- data/lib/ynab/models/patch_transactions_wrapper.rb +31 -12
- data/lib/ynab/models/payee.rb +31 -12
- data/lib/ynab/models/payee_location.rb +31 -12
- data/lib/ynab/models/payee_location_response.rb +31 -12
- data/lib/ynab/models/payee_location_response_data.rb +31 -12
- data/lib/ynab/models/payee_locations_response.rb +31 -12
- data/lib/ynab/models/payee_locations_response_data.rb +31 -12
- data/lib/ynab/models/payee_response.rb +31 -12
- data/lib/ynab/models/payee_response_data.rb +31 -12
- data/lib/ynab/models/payees_response.rb +31 -12
- data/lib/ynab/models/payees_response_data.rb +31 -12
- data/lib/ynab/models/plan_detail.rb +33 -12
- data/lib/ynab/models/plan_detail_response.rb +31 -12
- data/lib/ynab/models/plan_detail_response_data.rb +31 -12
- data/lib/ynab/models/plan_settings.rb +33 -14
- data/lib/ynab/models/plan_settings_response.rb +31 -12
- data/lib/ynab/models/plan_settings_response_data.rb +31 -12
- data/lib/ynab/models/plan_summary.rb +33 -12
- data/lib/ynab/models/plan_summary_response.rb +31 -12
- data/lib/ynab/models/plan_summary_response_data.rb +31 -12
- data/lib/ynab/models/post_account_wrapper.rb +31 -12
- data/lib/ynab/models/post_category_group_wrapper.rb +31 -12
- data/lib/ynab/models/post_category_wrapper.rb +31 -12
- data/lib/ynab/models/post_payee.rb +31 -12
- data/lib/ynab/models/post_payee_wrapper.rb +31 -12
- data/lib/ynab/models/post_scheduled_transaction_wrapper.rb +31 -12
- data/lib/ynab/models/post_transactions_wrapper.rb +31 -12
- data/lib/ynab/models/put_scheduled_transaction_wrapper.rb +31 -12
- data/lib/ynab/models/put_transaction_wrapper.rb +31 -12
- data/lib/ynab/models/save_account.rb +31 -12
- data/lib/ynab/models/save_account_type.rb +1 -1
- data/lib/ynab/models/save_category.rb +79 -20
- data/lib/ynab/models/save_category_group.rb +31 -12
- data/lib/ynab/models/save_category_group_response.rb +31 -12
- data/lib/ynab/models/save_category_group_response_data.rb +31 -12
- data/lib/ynab/models/save_category_response.rb +31 -12
- data/lib/ynab/models/save_category_response_data.rb +31 -12
- data/lib/ynab/models/save_month_category.rb +31 -12
- data/lib/ynab/models/save_payee.rb +31 -12
- data/lib/ynab/models/save_payee_response.rb +31 -12
- data/lib/ynab/models/save_payee_response_data.rb +31 -12
- data/lib/ynab/models/save_scheduled_transaction.rb +31 -12
- data/lib/ynab/models/save_sub_transaction.rb +31 -12
- data/lib/ynab/models/save_transaction_with_id_or_import_id.rb +36 -13
- data/lib/ynab/models/save_transaction_with_optional_fields.rb +32 -13
- data/lib/ynab/models/save_transactions_response.rb +31 -12
- data/lib/ynab/models/save_transactions_response_data.rb +31 -12
- data/lib/ynab/models/scheduled_sub_transaction.rb +37 -12
- data/lib/ynab/models/scheduled_sub_transaction_base.rb +31 -12
- data/lib/ynab/models/scheduled_transaction_detail.rb +36 -12
- data/lib/ynab/models/scheduled_transaction_frequency.rb +1 -1
- data/lib/ynab/models/scheduled_transaction_response.rb +31 -12
- data/lib/ynab/models/scheduled_transaction_response_data.rb +31 -12
- data/lib/ynab/models/scheduled_transaction_summary.rb +36 -12
- data/lib/ynab/models/scheduled_transaction_summary_base.rb +31 -12
- data/lib/ynab/models/scheduled_transactions_response.rb +31 -12
- data/lib/ynab/models/scheduled_transactions_response_data.rb +31 -12
- data/lib/ynab/models/sub_transaction.rb +38 -12
- data/lib/ynab/models/sub_transaction_base.rb +31 -12
- data/lib/ynab/models/transaction_cleared_status.rb +1 -1
- data/lib/ynab/models/transaction_detail.rb +41 -12
- data/lib/ynab/models/transaction_flag_color.rb +1 -1
- data/lib/ynab/models/transaction_response.rb +31 -12
- data/lib/ynab/models/transaction_response_data.rb +31 -12
- data/lib/ynab/models/transaction_summary.rb +41 -12
- data/lib/ynab/models/transaction_summary_base.rb +31 -12
- data/lib/ynab/models/transactions_import_response.rb +31 -12
- data/lib/ynab/models/transactions_import_response_data.rb +31 -12
- data/lib/ynab/models/transactions_response.rb +31 -12
- data/lib/ynab/models/transactions_response_data.rb +31 -12
- data/lib/ynab/models/user.rb +31 -12
- data/lib/ynab/models/user_response.rb +31 -12
- data/lib/ynab/models/user_response_data.rb +31 -12
- data/lib/ynab/version.rb +1 -1
- data/lib/ynab.rb +1 -1
- data/open_api_spec.yaml +61 -30
- data/templates/partial_model_generic.mustache +37 -11
- data/ynab.gemspec +2 -2
- metadata +3 -3
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
=begin
|
|
2
2
|
#YNAB API Endpoints
|
|
3
3
|
|
|
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
|
|
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. Read the [API Documentation](https://api.ynab.com) for more information about the API, including how to obtain an access token and how to use it to make requests.
|
|
5
5
|
|
|
6
6
|
Generated by: OpenAPI Generator (https://openapi-generator.tech)
|
|
7
7
|
|
|
@@ -131,9 +131,14 @@ module YNAB
|
|
|
131
131
|
}
|
|
132
132
|
end
|
|
133
133
|
|
|
134
|
+
# Returns attribute mapping this model knows about
|
|
135
|
+
def self.acceptable_attribute_map
|
|
136
|
+
attribute_map
|
|
137
|
+
end
|
|
138
|
+
|
|
134
139
|
# Returns all the JSON keys this model knows about
|
|
135
140
|
def self.acceptable_attributes
|
|
136
|
-
|
|
141
|
+
acceptable_attribute_map.values
|
|
137
142
|
end
|
|
138
143
|
|
|
139
144
|
# Attribute type mapping.
|
|
@@ -170,13 +175,33 @@ module YNAB
|
|
|
170
175
|
# List of attributes with nullable: true
|
|
171
176
|
def self.openapi_nullable
|
|
172
177
|
Set.new([
|
|
178
|
+
:'memo',
|
|
173
179
|
:'flag_color',
|
|
180
|
+
:'flag_name',
|
|
181
|
+
:'payee_id',
|
|
182
|
+
:'category_id',
|
|
183
|
+
:'transfer_account_id',
|
|
184
|
+
:'transfer_transaction_id',
|
|
185
|
+
:'matched_transaction_id',
|
|
186
|
+
:'import_id',
|
|
187
|
+
:'import_payee_name',
|
|
188
|
+
:'import_payee_name_original',
|
|
174
189
|
:'debt_transaction_type',
|
|
175
190
|
:'payee_name',
|
|
176
191
|
:'category_name',
|
|
177
192
|
])
|
|
178
193
|
end
|
|
179
194
|
|
|
195
|
+
# Returns attribute type mapping
|
|
196
|
+
def self.acceptable_openapi_types
|
|
197
|
+
openapi_types
|
|
198
|
+
end
|
|
199
|
+
|
|
200
|
+
# Returns the nullable attributes
|
|
201
|
+
def self.acceptable_openapi_nullable
|
|
202
|
+
openapi_nullable
|
|
203
|
+
end
|
|
204
|
+
|
|
180
205
|
# List of class defined in allOf (OpenAPI v3)
|
|
181
206
|
def self.openapi_all_of
|
|
182
207
|
[
|
|
@@ -192,9 +217,10 @@ module YNAB
|
|
|
192
217
|
end
|
|
193
218
|
|
|
194
219
|
# check to see if the attribute exists and convert string to symbol for hash key
|
|
220
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
195
221
|
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
196
|
-
if (!
|
|
197
|
-
fail ArgumentError, "`#{k}` is not a valid attribute in `YNAB::TransactionDetail`. Please check the name to make sure it's valid. List of attributes: " +
|
|
222
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
223
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `YNAB::TransactionDetail`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
198
224
|
end
|
|
199
225
|
h[k.to_sym] = v
|
|
200
226
|
}
|
|
@@ -382,18 +408,20 @@ module YNAB
|
|
|
382
408
|
def self.build_from_hash(attributes)
|
|
383
409
|
return nil unless attributes.is_a?(Hash)
|
|
384
410
|
attributes = attributes.transform_keys(&:to_sym)
|
|
411
|
+
# include attributes inherited from allOf parents (the nearest declaration wins)
|
|
412
|
+
map = acceptable_attribute_map
|
|
385
413
|
transformed_hash = {}
|
|
386
|
-
|
|
387
|
-
if attributes.key?(
|
|
414
|
+
acceptable_openapi_types.each_pair do |key, type|
|
|
415
|
+
if attributes.key?(map[key]) && attributes[map[key]].nil?
|
|
388
416
|
transformed_hash["#{key}"] = nil
|
|
389
417
|
elsif type =~ /\AArray<(.*)>/i
|
|
390
418
|
# check to ensure the input is an array given that the attribute
|
|
391
419
|
# is documented as an array but the input is not
|
|
392
|
-
if attributes[
|
|
393
|
-
transformed_hash["#{key}"] = attributes[
|
|
420
|
+
if attributes[map[key]].is_a?(Array)
|
|
421
|
+
transformed_hash["#{key}"] = attributes[map[key]].map { |v| _deserialize($1, v) }
|
|
394
422
|
end
|
|
395
|
-
elsif !attributes[
|
|
396
|
-
transformed_hash["#{key}"] = _deserialize(type, attributes[
|
|
423
|
+
elsif !attributes[map[key]].nil?
|
|
424
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[map[key]])
|
|
397
425
|
end
|
|
398
426
|
end
|
|
399
427
|
new(transformed_hash)
|
|
@@ -403,10 +431,11 @@ module YNAB
|
|
|
403
431
|
# @return [Hash] Returns the object in the form of hash
|
|
404
432
|
def to_hash
|
|
405
433
|
hash = {}
|
|
406
|
-
|
|
434
|
+
# include attributes inherited from allOf parents (the nearest declaration wins)
|
|
435
|
+
self.class.acceptable_attribute_map.each_pair do |attr, param|
|
|
407
436
|
value = self.send(attr)
|
|
408
437
|
if value.nil?
|
|
409
|
-
is_nullable = self.class.
|
|
438
|
+
is_nullable = self.class.acceptable_openapi_nullable.include?(attr)
|
|
410
439
|
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
411
440
|
end
|
|
412
441
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
=begin
|
|
2
2
|
#YNAB API Endpoints
|
|
3
3
|
|
|
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
|
|
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. Read the [API Documentation](https://api.ynab.com) for more information about the API, including how to obtain an access token and how to use it to make requests.
|
|
5
5
|
|
|
6
6
|
Generated by: OpenAPI Generator (https://openapi-generator.tech)
|
|
7
7
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
=begin
|
|
2
2
|
#YNAB API Endpoints
|
|
3
3
|
|
|
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
|
|
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. Read the [API Documentation](https://api.ynab.com) for more information about the API, including how to obtain an access token and how to use it to make requests.
|
|
5
5
|
|
|
6
6
|
Generated by: OpenAPI Generator (https://openapi-generator.tech)
|
|
7
7
|
|
|
@@ -21,9 +21,14 @@ module YNAB
|
|
|
21
21
|
}
|
|
22
22
|
end
|
|
23
23
|
|
|
24
|
+
# Returns attribute mapping this model knows about
|
|
25
|
+
def self.acceptable_attribute_map
|
|
26
|
+
attribute_map
|
|
27
|
+
end
|
|
28
|
+
|
|
24
29
|
# Returns all the JSON keys this model knows about
|
|
25
30
|
def self.acceptable_attributes
|
|
26
|
-
|
|
31
|
+
acceptable_attribute_map.values
|
|
27
32
|
end
|
|
28
33
|
|
|
29
34
|
# Attribute type mapping.
|
|
@@ -39,6 +44,16 @@ module YNAB
|
|
|
39
44
|
])
|
|
40
45
|
end
|
|
41
46
|
|
|
47
|
+
# Returns attribute type mapping
|
|
48
|
+
def self.acceptable_openapi_types
|
|
49
|
+
openapi_types
|
|
50
|
+
end
|
|
51
|
+
|
|
52
|
+
# Returns the nullable attributes
|
|
53
|
+
def self.acceptable_openapi_nullable
|
|
54
|
+
openapi_nullable
|
|
55
|
+
end
|
|
56
|
+
|
|
42
57
|
# Initializes the object
|
|
43
58
|
# @param [Hash] attributes Model attributes in the form of hash
|
|
44
59
|
def initialize(attributes = {})
|
|
@@ -47,9 +62,10 @@ module YNAB
|
|
|
47
62
|
end
|
|
48
63
|
|
|
49
64
|
# check to see if the attribute exists and convert string to symbol for hash key
|
|
65
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
50
66
|
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
51
|
-
if (!
|
|
52
|
-
fail ArgumentError, "`#{k}` is not a valid attribute in `YNAB::TransactionResponse`. Please check the name to make sure it's valid. List of attributes: " +
|
|
67
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
68
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `YNAB::TransactionResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
53
69
|
end
|
|
54
70
|
h[k.to_sym] = v
|
|
55
71
|
}
|
|
@@ -99,18 +115,20 @@ module YNAB
|
|
|
99
115
|
def self.build_from_hash(attributes)
|
|
100
116
|
return nil unless attributes.is_a?(Hash)
|
|
101
117
|
attributes = attributes.transform_keys(&:to_sym)
|
|
118
|
+
# include attributes inherited from allOf parents (the nearest declaration wins)
|
|
119
|
+
map = acceptable_attribute_map
|
|
102
120
|
transformed_hash = {}
|
|
103
|
-
|
|
104
|
-
if attributes.key?(
|
|
121
|
+
acceptable_openapi_types.each_pair do |key, type|
|
|
122
|
+
if attributes.key?(map[key]) && attributes[map[key]].nil?
|
|
105
123
|
transformed_hash["#{key}"] = nil
|
|
106
124
|
elsif type =~ /\AArray<(.*)>/i
|
|
107
125
|
# check to ensure the input is an array given that the attribute
|
|
108
126
|
# is documented as an array but the input is not
|
|
109
|
-
if attributes[
|
|
110
|
-
transformed_hash["#{key}"] = attributes[
|
|
127
|
+
if attributes[map[key]].is_a?(Array)
|
|
128
|
+
transformed_hash["#{key}"] = attributes[map[key]].map { |v| _deserialize($1, v) }
|
|
111
129
|
end
|
|
112
|
-
elsif !attributes[
|
|
113
|
-
transformed_hash["#{key}"] = _deserialize(type, attributes[
|
|
130
|
+
elsif !attributes[map[key]].nil?
|
|
131
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[map[key]])
|
|
114
132
|
end
|
|
115
133
|
end
|
|
116
134
|
new(transformed_hash)
|
|
@@ -120,10 +138,11 @@ module YNAB
|
|
|
120
138
|
# @return [Hash] Returns the object in the form of hash
|
|
121
139
|
def to_hash
|
|
122
140
|
hash = {}
|
|
123
|
-
|
|
141
|
+
# include attributes inherited from allOf parents (the nearest declaration wins)
|
|
142
|
+
self.class.acceptable_attribute_map.each_pair do |attr, param|
|
|
124
143
|
value = self.send(attr)
|
|
125
144
|
if value.nil?
|
|
126
|
-
is_nullable = self.class.
|
|
145
|
+
is_nullable = self.class.acceptable_openapi_nullable.include?(attr)
|
|
127
146
|
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
128
147
|
end
|
|
129
148
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
=begin
|
|
2
2
|
#YNAB API Endpoints
|
|
3
3
|
|
|
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
|
|
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. Read the [API Documentation](https://api.ynab.com) for more information about the API, including how to obtain an access token and how to use it to make requests.
|
|
5
5
|
|
|
6
6
|
Generated by: OpenAPI Generator (https://openapi-generator.tech)
|
|
7
7
|
|
|
@@ -25,9 +25,14 @@ module YNAB
|
|
|
25
25
|
}
|
|
26
26
|
end
|
|
27
27
|
|
|
28
|
+
# Returns attribute mapping this model knows about
|
|
29
|
+
def self.acceptable_attribute_map
|
|
30
|
+
attribute_map
|
|
31
|
+
end
|
|
32
|
+
|
|
28
33
|
# Returns all the JSON keys this model knows about
|
|
29
34
|
def self.acceptable_attributes
|
|
30
|
-
|
|
35
|
+
acceptable_attribute_map.values
|
|
31
36
|
end
|
|
32
37
|
|
|
33
38
|
# Attribute type mapping.
|
|
@@ -44,6 +49,16 @@ module YNAB
|
|
|
44
49
|
])
|
|
45
50
|
end
|
|
46
51
|
|
|
52
|
+
# Returns attribute type mapping
|
|
53
|
+
def self.acceptable_openapi_types
|
|
54
|
+
openapi_types
|
|
55
|
+
end
|
|
56
|
+
|
|
57
|
+
# Returns the nullable attributes
|
|
58
|
+
def self.acceptable_openapi_nullable
|
|
59
|
+
openapi_nullable
|
|
60
|
+
end
|
|
61
|
+
|
|
47
62
|
# Initializes the object
|
|
48
63
|
# @param [Hash] attributes Model attributes in the form of hash
|
|
49
64
|
def initialize(attributes = {})
|
|
@@ -52,9 +67,10 @@ module YNAB
|
|
|
52
67
|
end
|
|
53
68
|
|
|
54
69
|
# check to see if the attribute exists and convert string to symbol for hash key
|
|
70
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
55
71
|
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
56
|
-
if (!
|
|
57
|
-
fail ArgumentError, "`#{k}` is not a valid attribute in `YNAB::TransactionResponseData`. Please check the name to make sure it's valid. List of attributes: " +
|
|
72
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
73
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `YNAB::TransactionResponseData`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
58
74
|
end
|
|
59
75
|
h[k.to_sym] = v
|
|
60
76
|
}
|
|
@@ -110,18 +126,20 @@ module YNAB
|
|
|
110
126
|
def self.build_from_hash(attributes)
|
|
111
127
|
return nil unless attributes.is_a?(Hash)
|
|
112
128
|
attributes = attributes.transform_keys(&:to_sym)
|
|
129
|
+
# include attributes inherited from allOf parents (the nearest declaration wins)
|
|
130
|
+
map = acceptable_attribute_map
|
|
113
131
|
transformed_hash = {}
|
|
114
|
-
|
|
115
|
-
if attributes.key?(
|
|
132
|
+
acceptable_openapi_types.each_pair do |key, type|
|
|
133
|
+
if attributes.key?(map[key]) && attributes[map[key]].nil?
|
|
116
134
|
transformed_hash["#{key}"] = nil
|
|
117
135
|
elsif type =~ /\AArray<(.*)>/i
|
|
118
136
|
# check to ensure the input is an array given that the attribute
|
|
119
137
|
# is documented as an array but the input is not
|
|
120
|
-
if attributes[
|
|
121
|
-
transformed_hash["#{key}"] = attributes[
|
|
138
|
+
if attributes[map[key]].is_a?(Array)
|
|
139
|
+
transformed_hash["#{key}"] = attributes[map[key]].map { |v| _deserialize($1, v) }
|
|
122
140
|
end
|
|
123
|
-
elsif !attributes[
|
|
124
|
-
transformed_hash["#{key}"] = _deserialize(type, attributes[
|
|
141
|
+
elsif !attributes[map[key]].nil?
|
|
142
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[map[key]])
|
|
125
143
|
end
|
|
126
144
|
end
|
|
127
145
|
new(transformed_hash)
|
|
@@ -131,10 +149,11 @@ module YNAB
|
|
|
131
149
|
# @return [Hash] Returns the object in the form of hash
|
|
132
150
|
def to_hash
|
|
133
151
|
hash = {}
|
|
134
|
-
|
|
152
|
+
# include attributes inherited from allOf parents (the nearest declaration wins)
|
|
153
|
+
self.class.acceptable_attribute_map.each_pair do |attr, param|
|
|
135
154
|
value = self.send(attr)
|
|
136
155
|
if value.nil?
|
|
137
|
-
is_nullable = self.class.
|
|
156
|
+
is_nullable = self.class.acceptable_openapi_nullable.include?(attr)
|
|
138
157
|
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
139
158
|
end
|
|
140
159
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
=begin
|
|
2
2
|
#YNAB API Endpoints
|
|
3
3
|
|
|
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
|
|
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. Read the [API Documentation](https://api.ynab.com) for more information about the API, including how to obtain an access token and how to use it to make requests.
|
|
5
5
|
|
|
6
6
|
Generated by: OpenAPI Generator (https://openapi-generator.tech)
|
|
7
7
|
|
|
@@ -117,9 +117,14 @@ module YNAB
|
|
|
117
117
|
}
|
|
118
118
|
end
|
|
119
119
|
|
|
120
|
+
# Returns attribute mapping this model knows about
|
|
121
|
+
def self.acceptable_attribute_map
|
|
122
|
+
attribute_map
|
|
123
|
+
end
|
|
124
|
+
|
|
120
125
|
# Returns all the JSON keys this model knows about
|
|
121
126
|
def self.acceptable_attributes
|
|
122
|
-
|
|
127
|
+
acceptable_attribute_map.values
|
|
123
128
|
end
|
|
124
129
|
|
|
125
130
|
# Attribute type mapping.
|
|
@@ -152,11 +157,31 @@ module YNAB
|
|
|
152
157
|
# List of attributes with nullable: true
|
|
153
158
|
def self.openapi_nullable
|
|
154
159
|
Set.new([
|
|
160
|
+
:'memo',
|
|
155
161
|
:'flag_color',
|
|
162
|
+
:'flag_name',
|
|
163
|
+
:'payee_id',
|
|
164
|
+
:'category_id',
|
|
165
|
+
:'transfer_account_id',
|
|
166
|
+
:'transfer_transaction_id',
|
|
167
|
+
:'matched_transaction_id',
|
|
168
|
+
:'import_id',
|
|
169
|
+
:'import_payee_name',
|
|
170
|
+
:'import_payee_name_original',
|
|
156
171
|
:'debt_transaction_type',
|
|
157
172
|
])
|
|
158
173
|
end
|
|
159
174
|
|
|
175
|
+
# Returns attribute type mapping
|
|
176
|
+
def self.acceptable_openapi_types
|
|
177
|
+
openapi_types
|
|
178
|
+
end
|
|
179
|
+
|
|
180
|
+
# Returns the nullable attributes
|
|
181
|
+
def self.acceptable_openapi_nullable
|
|
182
|
+
openapi_nullable
|
|
183
|
+
end
|
|
184
|
+
|
|
160
185
|
# List of class defined in allOf (OpenAPI v3)
|
|
161
186
|
def self.openapi_all_of
|
|
162
187
|
[
|
|
@@ -172,9 +197,10 @@ module YNAB
|
|
|
172
197
|
end
|
|
173
198
|
|
|
174
199
|
# check to see if the attribute exists and convert string to symbol for hash key
|
|
200
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
175
201
|
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
176
|
-
if (!
|
|
177
|
-
fail ArgumentError, "`#{k}` is not a valid attribute in `YNAB::TransactionSummary`. Please check the name to make sure it's valid. List of attributes: " +
|
|
202
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
203
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `YNAB::TransactionSummary`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
178
204
|
end
|
|
179
205
|
h[k.to_sym] = v
|
|
180
206
|
}
|
|
@@ -338,18 +364,20 @@ module YNAB
|
|
|
338
364
|
def self.build_from_hash(attributes)
|
|
339
365
|
return nil unless attributes.is_a?(Hash)
|
|
340
366
|
attributes = attributes.transform_keys(&:to_sym)
|
|
367
|
+
# include attributes inherited from allOf parents (the nearest declaration wins)
|
|
368
|
+
map = acceptable_attribute_map
|
|
341
369
|
transformed_hash = {}
|
|
342
|
-
|
|
343
|
-
if attributes.key?(
|
|
370
|
+
acceptable_openapi_types.each_pair do |key, type|
|
|
371
|
+
if attributes.key?(map[key]) && attributes[map[key]].nil?
|
|
344
372
|
transformed_hash["#{key}"] = nil
|
|
345
373
|
elsif type =~ /\AArray<(.*)>/i
|
|
346
374
|
# check to ensure the input is an array given that the attribute
|
|
347
375
|
# is documented as an array but the input is not
|
|
348
|
-
if attributes[
|
|
349
|
-
transformed_hash["#{key}"] = attributes[
|
|
376
|
+
if attributes[map[key]].is_a?(Array)
|
|
377
|
+
transformed_hash["#{key}"] = attributes[map[key]].map { |v| _deserialize($1, v) }
|
|
350
378
|
end
|
|
351
|
-
elsif !attributes[
|
|
352
|
-
transformed_hash["#{key}"] = _deserialize(type, attributes[
|
|
379
|
+
elsif !attributes[map[key]].nil?
|
|
380
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[map[key]])
|
|
353
381
|
end
|
|
354
382
|
end
|
|
355
383
|
new(transformed_hash)
|
|
@@ -359,10 +387,11 @@ module YNAB
|
|
|
359
387
|
# @return [Hash] Returns the object in the form of hash
|
|
360
388
|
def to_hash
|
|
361
389
|
hash = {}
|
|
362
|
-
|
|
390
|
+
# include attributes inherited from allOf parents (the nearest declaration wins)
|
|
391
|
+
self.class.acceptable_attribute_map.each_pair do |attr, param|
|
|
363
392
|
value = self.send(attr)
|
|
364
393
|
if value.nil?
|
|
365
|
-
is_nullable = self.class.
|
|
394
|
+
is_nullable = self.class.acceptable_openapi_nullable.include?(attr)
|
|
366
395
|
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
367
396
|
end
|
|
368
397
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
=begin
|
|
2
2
|
#YNAB API Endpoints
|
|
3
3
|
|
|
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
|
|
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. Read the [API Documentation](https://api.ynab.com) for more information about the API, including how to obtain an access token and how to use it to make requests.
|
|
5
5
|
|
|
6
6
|
Generated by: OpenAPI Generator (https://openapi-generator.tech)
|
|
7
7
|
|
|
@@ -109,9 +109,14 @@ module YNAB
|
|
|
109
109
|
}
|
|
110
110
|
end
|
|
111
111
|
|
|
112
|
+
# Returns attribute mapping this model knows about
|
|
113
|
+
def self.acceptable_attribute_map
|
|
114
|
+
attribute_map
|
|
115
|
+
end
|
|
116
|
+
|
|
112
117
|
# Returns all the JSON keys this model knows about
|
|
113
118
|
def self.acceptable_attributes
|
|
114
|
-
|
|
119
|
+
acceptable_attribute_map.values
|
|
115
120
|
end
|
|
116
121
|
|
|
117
122
|
# Attribute type mapping.
|
|
@@ -157,6 +162,16 @@ module YNAB
|
|
|
157
162
|
])
|
|
158
163
|
end
|
|
159
164
|
|
|
165
|
+
# Returns attribute type mapping
|
|
166
|
+
def self.acceptable_openapi_types
|
|
167
|
+
openapi_types
|
|
168
|
+
end
|
|
169
|
+
|
|
170
|
+
# Returns the nullable attributes
|
|
171
|
+
def self.acceptable_openapi_nullable
|
|
172
|
+
openapi_nullable
|
|
173
|
+
end
|
|
174
|
+
|
|
160
175
|
# Initializes the object
|
|
161
176
|
# @param [Hash] attributes Model attributes in the form of hash
|
|
162
177
|
def initialize(attributes = {})
|
|
@@ -165,9 +180,10 @@ module YNAB
|
|
|
165
180
|
end
|
|
166
181
|
|
|
167
182
|
# check to see if the attribute exists and convert string to symbol for hash key
|
|
183
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
168
184
|
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
169
|
-
if (!
|
|
170
|
-
fail ArgumentError, "`#{k}` is not a valid attribute in `YNAB::TransactionSummaryBase`. Please check the name to make sure it's valid. List of attributes: " +
|
|
185
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
186
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `YNAB::TransactionSummaryBase`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
171
187
|
end
|
|
172
188
|
h[k.to_sym] = v
|
|
173
189
|
}
|
|
@@ -321,18 +337,20 @@ module YNAB
|
|
|
321
337
|
def self.build_from_hash(attributes)
|
|
322
338
|
return nil unless attributes.is_a?(Hash)
|
|
323
339
|
attributes = attributes.transform_keys(&:to_sym)
|
|
340
|
+
# include attributes inherited from allOf parents (the nearest declaration wins)
|
|
341
|
+
map = acceptable_attribute_map
|
|
324
342
|
transformed_hash = {}
|
|
325
|
-
|
|
326
|
-
if attributes.key?(
|
|
343
|
+
acceptable_openapi_types.each_pair do |key, type|
|
|
344
|
+
if attributes.key?(map[key]) && attributes[map[key]].nil?
|
|
327
345
|
transformed_hash["#{key}"] = nil
|
|
328
346
|
elsif type =~ /\AArray<(.*)>/i
|
|
329
347
|
# check to ensure the input is an array given that the attribute
|
|
330
348
|
# is documented as an array but the input is not
|
|
331
|
-
if attributes[
|
|
332
|
-
transformed_hash["#{key}"] = attributes[
|
|
349
|
+
if attributes[map[key]].is_a?(Array)
|
|
350
|
+
transformed_hash["#{key}"] = attributes[map[key]].map { |v| _deserialize($1, v) }
|
|
333
351
|
end
|
|
334
|
-
elsif !attributes[
|
|
335
|
-
transformed_hash["#{key}"] = _deserialize(type, attributes[
|
|
352
|
+
elsif !attributes[map[key]].nil?
|
|
353
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[map[key]])
|
|
336
354
|
end
|
|
337
355
|
end
|
|
338
356
|
new(transformed_hash)
|
|
@@ -342,10 +360,11 @@ module YNAB
|
|
|
342
360
|
# @return [Hash] Returns the object in the form of hash
|
|
343
361
|
def to_hash
|
|
344
362
|
hash = {}
|
|
345
|
-
|
|
363
|
+
# include attributes inherited from allOf parents (the nearest declaration wins)
|
|
364
|
+
self.class.acceptable_attribute_map.each_pair do |attr, param|
|
|
346
365
|
value = self.send(attr)
|
|
347
366
|
if value.nil?
|
|
348
|
-
is_nullable = self.class.
|
|
367
|
+
is_nullable = self.class.acceptable_openapi_nullable.include?(attr)
|
|
349
368
|
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
350
369
|
end
|
|
351
370
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
=begin
|
|
2
2
|
#YNAB API Endpoints
|
|
3
3
|
|
|
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
|
|
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. Read the [API Documentation](https://api.ynab.com) for more information about the API, including how to obtain an access token and how to use it to make requests.
|
|
5
5
|
|
|
6
6
|
Generated by: OpenAPI Generator (https://openapi-generator.tech)
|
|
7
7
|
|
|
@@ -21,9 +21,14 @@ module YNAB
|
|
|
21
21
|
}
|
|
22
22
|
end
|
|
23
23
|
|
|
24
|
+
# Returns attribute mapping this model knows about
|
|
25
|
+
def self.acceptable_attribute_map
|
|
26
|
+
attribute_map
|
|
27
|
+
end
|
|
28
|
+
|
|
24
29
|
# Returns all the JSON keys this model knows about
|
|
25
30
|
def self.acceptable_attributes
|
|
26
|
-
|
|
31
|
+
acceptable_attribute_map.values
|
|
27
32
|
end
|
|
28
33
|
|
|
29
34
|
# Attribute type mapping.
|
|
@@ -39,6 +44,16 @@ module YNAB
|
|
|
39
44
|
])
|
|
40
45
|
end
|
|
41
46
|
|
|
47
|
+
# Returns attribute type mapping
|
|
48
|
+
def self.acceptable_openapi_types
|
|
49
|
+
openapi_types
|
|
50
|
+
end
|
|
51
|
+
|
|
52
|
+
# Returns the nullable attributes
|
|
53
|
+
def self.acceptable_openapi_nullable
|
|
54
|
+
openapi_nullable
|
|
55
|
+
end
|
|
56
|
+
|
|
42
57
|
# Initializes the object
|
|
43
58
|
# @param [Hash] attributes Model attributes in the form of hash
|
|
44
59
|
def initialize(attributes = {})
|
|
@@ -47,9 +62,10 @@ module YNAB
|
|
|
47
62
|
end
|
|
48
63
|
|
|
49
64
|
# check to see if the attribute exists and convert string to symbol for hash key
|
|
65
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
50
66
|
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
51
|
-
if (!
|
|
52
|
-
fail ArgumentError, "`#{k}` is not a valid attribute in `YNAB::TransactionsImportResponse`. Please check the name to make sure it's valid. List of attributes: " +
|
|
67
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
68
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `YNAB::TransactionsImportResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
53
69
|
end
|
|
54
70
|
h[k.to_sym] = v
|
|
55
71
|
}
|
|
@@ -99,18 +115,20 @@ module YNAB
|
|
|
99
115
|
def self.build_from_hash(attributes)
|
|
100
116
|
return nil unless attributes.is_a?(Hash)
|
|
101
117
|
attributes = attributes.transform_keys(&:to_sym)
|
|
118
|
+
# include attributes inherited from allOf parents (the nearest declaration wins)
|
|
119
|
+
map = acceptable_attribute_map
|
|
102
120
|
transformed_hash = {}
|
|
103
|
-
|
|
104
|
-
if attributes.key?(
|
|
121
|
+
acceptable_openapi_types.each_pair do |key, type|
|
|
122
|
+
if attributes.key?(map[key]) && attributes[map[key]].nil?
|
|
105
123
|
transformed_hash["#{key}"] = nil
|
|
106
124
|
elsif type =~ /\AArray<(.*)>/i
|
|
107
125
|
# check to ensure the input is an array given that the attribute
|
|
108
126
|
# is documented as an array but the input is not
|
|
109
|
-
if attributes[
|
|
110
|
-
transformed_hash["#{key}"] = attributes[
|
|
127
|
+
if attributes[map[key]].is_a?(Array)
|
|
128
|
+
transformed_hash["#{key}"] = attributes[map[key]].map { |v| _deserialize($1, v) }
|
|
111
129
|
end
|
|
112
|
-
elsif !attributes[
|
|
113
|
-
transformed_hash["#{key}"] = _deserialize(type, attributes[
|
|
130
|
+
elsif !attributes[map[key]].nil?
|
|
131
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[map[key]])
|
|
114
132
|
end
|
|
115
133
|
end
|
|
116
134
|
new(transformed_hash)
|
|
@@ -120,10 +138,11 @@ module YNAB
|
|
|
120
138
|
# @return [Hash] Returns the object in the form of hash
|
|
121
139
|
def to_hash
|
|
122
140
|
hash = {}
|
|
123
|
-
|
|
141
|
+
# include attributes inherited from allOf parents (the nearest declaration wins)
|
|
142
|
+
self.class.acceptable_attribute_map.each_pair do |attr, param|
|
|
124
143
|
value = self.send(attr)
|
|
125
144
|
if value.nil?
|
|
126
|
-
is_nullable = self.class.
|
|
145
|
+
is_nullable = self.class.acceptable_openapi_nullable.include?(attr)
|
|
127
146
|
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
128
147
|
end
|
|
129
148
|
|