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
|
|
@@ -130,14 +130,6 @@ module YNAB
|
|
130
130
|
# @return Array for valid properties with the reasons
|
131
131
|
def list_invalid_properties
|
132
132
|
invalid_properties = Array.new
|
133
|
-
if @id.nil?
|
134
|
-
invalid_properties.push('invalid value for "id", id cannot be nil.')
|
135
|
-
end
|
136
|
-
|
137
|
-
if @name.nil?
|
138
|
-
invalid_properties.push('invalid value for "name", name cannot be nil.')
|
139
|
-
end
|
140
|
-
|
141
133
|
invalid_properties
|
142
134
|
end
|
143
135
|
|
@@ -180,37 +172,30 @@ module YNAB
|
|
180
172
|
# @param [Hash] attributes Model attributes in the form of hash
|
181
173
|
# @return [Object] Returns the model itself
|
182
174
|
def self.build_from_hash(attributes)
|
183
|
-
new.build_from_hash(attributes)
|
184
|
-
end
|
185
|
-
|
186
|
-
# Builds the object from hash
|
187
|
-
# @param [Hash] attributes Model attributes in the form of hash
|
188
|
-
# @return [Object] Returns the model itself
|
189
|
-
def build_from_hash(attributes)
|
190
175
|
return nil unless attributes.is_a?(Hash)
|
191
176
|
attributes = attributes.transform_keys(&:to_sym)
|
192
|
-
|
193
|
-
|
194
|
-
|
177
|
+
transformed_hash = {}
|
178
|
+
openapi_types.each_pair do |key, type|
|
179
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
180
|
+
transformed_hash["#{key}"] = nil
|
195
181
|
elsif type =~ /\AArray<(.*)>/i
|
196
182
|
# check to ensure the input is an array given that the attribute
|
197
183
|
# is documented as an array but the input is not
|
198
|
-
if attributes[
|
199
|
-
|
184
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
185
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
200
186
|
end
|
201
|
-
elsif !attributes[
|
202
|
-
|
187
|
+
elsif !attributes[attribute_map[key]].nil?
|
188
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
203
189
|
end
|
204
190
|
end
|
205
|
-
|
206
|
-
self
|
191
|
+
new(transformed_hash)
|
207
192
|
end
|
208
193
|
|
209
194
|
# Deserializes the data based on type
|
210
195
|
# @param string type Data type
|
211
196
|
# @param string value Value to be deserialized
|
212
197
|
# @return [Object] Deserialized data
|
213
|
-
def _deserialize(type, value)
|
198
|
+
def self._deserialize(type, value)
|
214
199
|
case type.to_sym
|
215
200
|
when :Time
|
216
201
|
Time.parse(value)
|
@@ -245,7 +230,7 @@ module YNAB
|
|
245
230
|
else # model
|
246
231
|
# models (e.g. Pet) or oneOf
|
247
232
|
klass = YNAB.const_get(type)
|
248
|
-
klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
233
|
+
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
249
234
|
end
|
250
235
|
end
|
251
236
|
|
@@ -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
|
|
@@ -76,10 +76,6 @@ module YNAB
|
|
76
76
|
# @return Array for valid properties with the reasons
|
77
77
|
def list_invalid_properties
|
78
78
|
invalid_properties = Array.new
|
79
|
-
if @budgets.nil?
|
80
|
-
invalid_properties.push('invalid value for "budgets", budgets cannot be nil.')
|
81
|
-
end
|
82
|
-
|
83
79
|
invalid_properties
|
84
80
|
end
|
85
81
|
|
@@ -115,37 +111,30 @@ module YNAB
|
|
115
111
|
# @param [Hash] attributes Model attributes in the form of hash
|
116
112
|
# @return [Object] Returns the model itself
|
117
113
|
def self.build_from_hash(attributes)
|
118
|
-
new.build_from_hash(attributes)
|
119
|
-
end
|
120
|
-
|
121
|
-
# Builds the object from hash
|
122
|
-
# @param [Hash] attributes Model attributes in the form of hash
|
123
|
-
# @return [Object] Returns the model itself
|
124
|
-
def build_from_hash(attributes)
|
125
114
|
return nil unless attributes.is_a?(Hash)
|
126
115
|
attributes = attributes.transform_keys(&:to_sym)
|
127
|
-
|
128
|
-
|
129
|
-
|
116
|
+
transformed_hash = {}
|
117
|
+
openapi_types.each_pair do |key, type|
|
118
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
119
|
+
transformed_hash["#{key}"] = nil
|
130
120
|
elsif type =~ /\AArray<(.*)>/i
|
131
121
|
# check to ensure the input is an array given that the attribute
|
132
122
|
# is documented as an array but the input is not
|
133
|
-
if attributes[
|
134
|
-
|
123
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
124
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
135
125
|
end
|
136
|
-
elsif !attributes[
|
137
|
-
|
126
|
+
elsif !attributes[attribute_map[key]].nil?
|
127
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
138
128
|
end
|
139
129
|
end
|
140
|
-
|
141
|
-
self
|
130
|
+
new(transformed_hash)
|
142
131
|
end
|
143
132
|
|
144
133
|
# Deserializes the data based on type
|
145
134
|
# @param string type Data type
|
146
135
|
# @param string value Value to be deserialized
|
147
136
|
# @return [Object] Deserialized data
|
148
|
-
def _deserialize(type, value)
|
137
|
+
def self._deserialize(type, value)
|
149
138
|
case type.to_sym
|
150
139
|
when :Time
|
151
140
|
Time.parse(value)
|
@@ -180,7 +169,7 @@ module YNAB
|
|
180
169
|
else # model
|
181
170
|
# models (e.g. Pet) or oneOf
|
182
171
|
klass = YNAB.const_get(type)
|
183
|
-
klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
172
|
+
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
184
173
|
end
|
185
174
|
end
|
186
175
|
|
@@ -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 @bulk.nil?
|
70
|
-
invalid_properties.push('invalid value for "bulk", bulk 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
|
|
@@ -80,14 +80,6 @@ module YNAB
|
|
80
80
|
# @return Array for valid properties with the reasons
|
81
81
|
def list_invalid_properties
|
82
82
|
invalid_properties = Array.new
|
83
|
-
if @transaction_ids.nil?
|
84
|
-
invalid_properties.push('invalid value for "transaction_ids", transaction_ids cannot be nil.')
|
85
|
-
end
|
86
|
-
|
87
|
-
if @duplicate_import_ids.nil?
|
88
|
-
invalid_properties.push('invalid value for "duplicate_import_ids", duplicate_import_ids cannot be nil.')
|
89
|
-
end
|
90
|
-
|
91
83
|
invalid_properties
|
92
84
|
end
|
93
85
|
|
@@ -124,37 +116,30 @@ module YNAB
|
|
124
116
|
# @param [Hash] attributes Model attributes in the form of hash
|
125
117
|
# @return [Object] Returns the model itself
|
126
118
|
def self.build_from_hash(attributes)
|
127
|
-
new.build_from_hash(attributes)
|
128
|
-
end
|
129
|
-
|
130
|
-
# Builds the object from hash
|
131
|
-
# @param [Hash] attributes Model attributes in the form of hash
|
132
|
-
# @return [Object] Returns the model itself
|
133
|
-
def build_from_hash(attributes)
|
134
119
|
return nil unless attributes.is_a?(Hash)
|
135
120
|
attributes = attributes.transform_keys(&:to_sym)
|
136
|
-
|
137
|
-
|
138
|
-
|
121
|
+
transformed_hash = {}
|
122
|
+
openapi_types.each_pair do |key, type|
|
123
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
124
|
+
transformed_hash["#{key}"] = nil
|
139
125
|
elsif type =~ /\AArray<(.*)>/i
|
140
126
|
# check to ensure the input is an array given that the attribute
|
141
127
|
# is documented as an array but the input is not
|
142
|
-
if attributes[
|
143
|
-
|
128
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
129
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
144
130
|
end
|
145
|
-
elsif !attributes[
|
146
|
-
|
131
|
+
elsif !attributes[attribute_map[key]].nil?
|
132
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
147
133
|
end
|
148
134
|
end
|
149
|
-
|
150
|
-
self
|
135
|
+
new(transformed_hash)
|
151
136
|
end
|
152
137
|
|
153
138
|
# Deserializes the data based on type
|
154
139
|
# @param string type Data type
|
155
140
|
# @param string value Value to be deserialized
|
156
141
|
# @return [Object] Deserialized data
|
157
|
-
def _deserialize(type, value)
|
142
|
+
def self._deserialize(type, value)
|
158
143
|
case type.to_sym
|
159
144
|
when :Time
|
160
145
|
Time.parse(value)
|
@@ -189,7 +174,7 @@ module YNAB
|
|
189
174
|
else # model
|
190
175
|
# models (e.g. Pet) or oneOf
|
191
176
|
klass = YNAB.const_get(type)
|
192
|
-
klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
177
|
+
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
193
178
|
end
|
194
179
|
end
|
195
180
|
|
@@ -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
|
|
@@ -32,7 +32,7 @@ module YNAB
|
|
32
32
|
# Attribute type mapping.
|
33
33
|
def self.openapi_types
|
34
34
|
{
|
35
|
-
:'transactions' => :'Array<
|
35
|
+
:'transactions' => :'Array<SaveTransactionWithOptionalFields>'
|
36
36
|
}
|
37
37
|
end
|
38
38
|
|
@@ -68,10 +68,6 @@ module YNAB
|
|
68
68
|
# @return Array for valid properties with the reasons
|
69
69
|
def list_invalid_properties
|
70
70
|
invalid_properties = Array.new
|
71
|
-
if @transactions.nil?
|
72
|
-
invalid_properties.push('invalid value for "transactions", transactions cannot be nil.')
|
73
|
-
end
|
74
|
-
|
75
71
|
invalid_properties
|
76
72
|
end
|
77
73
|
|
@@ -106,37 +102,30 @@ module YNAB
|
|
106
102
|
# @param [Hash] attributes Model attributes in the form of hash
|
107
103
|
# @return [Object] Returns the model itself
|
108
104
|
def self.build_from_hash(attributes)
|
109
|
-
new.build_from_hash(attributes)
|
110
|
-
end
|
111
|
-
|
112
|
-
# Builds the object from hash
|
113
|
-
# @param [Hash] attributes Model attributes in the form of hash
|
114
|
-
# @return [Object] Returns the model itself
|
115
|
-
def build_from_hash(attributes)
|
116
105
|
return nil unless attributes.is_a?(Hash)
|
117
106
|
attributes = attributes.transform_keys(&:to_sym)
|
118
|
-
|
119
|
-
|
120
|
-
|
107
|
+
transformed_hash = {}
|
108
|
+
openapi_types.each_pair do |key, type|
|
109
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
110
|
+
transformed_hash["#{key}"] = nil
|
121
111
|
elsif type =~ /\AArray<(.*)>/i
|
122
112
|
# check to ensure the input is an array given that the attribute
|
123
113
|
# is documented as an array but the input is not
|
124
|
-
if attributes[
|
125
|
-
|
114
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
115
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
126
116
|
end
|
127
|
-
elsif !attributes[
|
128
|
-
|
117
|
+
elsif !attributes[attribute_map[key]].nil?
|
118
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
129
119
|
end
|
130
120
|
end
|
131
|
-
|
132
|
-
self
|
121
|
+
new(transformed_hash)
|
133
122
|
end
|
134
123
|
|
135
124
|
# Deserializes the data based on type
|
136
125
|
# @param string type Data type
|
137
126
|
# @param string value Value to be deserialized
|
138
127
|
# @return [Object] Deserialized data
|
139
|
-
def _deserialize(type, value)
|
128
|
+
def self._deserialize(type, value)
|
140
129
|
case type.to_sym
|
141
130
|
when :Time
|
142
131
|
Time.parse(value)
|
@@ -171,7 +160,7 @@ module YNAB
|
|
171
160
|
else # model
|
172
161
|
# models (e.g. Pet) or oneOf
|
173
162
|
klass = YNAB.const_get(type)
|
174
|
-
klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
163
|
+
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
175
164
|
end
|
176
165
|
end
|
177
166
|
|
@@ -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
|
|