ynab 1.31.0 → 2.0.0.rc1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/DEVELOPMENT.md +11 -0
- data/Gemfile +8 -0
- data/Gemfile.lock +42 -0
- data/README.md +3 -3
- data/Rakefile +58 -0
- data/config.json +9 -0
- data/docs/Account.md +25 -0
- data/docs/AccountResponse.md +8 -0
- data/docs/AccountResponseData.md +8 -0
- data/docs/AccountType.md +7 -0
- data/docs/AccountWrapper.md +8 -0
- data/docs/AccountsApi.md +70 -0
- data/docs/AccountsResponse.md +8 -0
- data/docs/AccountsResponseData.md +9 -0
- data/docs/AccountsWrapper.md +9 -0
- data/docs/BudgetDetail.md +24 -0
- data/docs/BudgetDetailAllOf.md +17 -0
- data/docs/BudgetDetailResponse.md +8 -0
- data/docs/BudgetDetailResponseData.md +9 -0
- data/docs/BudgetDetailWrapper.md +9 -0
- data/docs/BudgetSettings.md +9 -0
- data/docs/BudgetSettingsResponse.md +8 -0
- data/docs/BudgetSettingsResponseData.md +8 -0
- data/docs/BudgetSettingsWrapper.md +8 -0
- data/docs/BudgetSummary.md +15 -0
- data/docs/BudgetSummaryResponse.md +8 -0
- data/docs/BudgetSummaryResponseData.md +9 -0
- data/docs/BudgetSummaryWrapper.md +9 -0
- data/docs/BudgetsApi.md +68 -0
- data/docs/BulkIdWrapper.md +8 -0
- data/docs/BulkIds.md +9 -0
- data/docs/BulkResponse.md +8 -0
- data/docs/BulkResponseData.md +8 -0
- data/docs/BulkResponseDataBulk.md +9 -0
- data/docs/BulkTransactionCreateResponse.md +8 -0
- data/docs/BulkTransactionIds.md +8 -0
- data/docs/BulkTransactions.md +8 -0
- data/docs/CategoriesApi.md +94 -0
- data/docs/CategoriesResponse.md +8 -0
- data/docs/CategoriesResponseData.md +9 -0
- data/docs/Category.md +30 -0
- data/docs/CategoryGroup.md +11 -0
- data/docs/CategoryGroupWithCategories.md +12 -0
- data/docs/CategoryGroupWithCategoriesAllOf.md +8 -0
- data/docs/CategoryGroupsWrapper.md +9 -0
- data/docs/CategoryResponse.md +8 -0
- data/docs/CategoryResponseData.md +8 -0
- data/docs/CategoryWrapper.md +9 -0
- data/docs/CurrencyFormat.md +15 -0
- data/docs/DateFormat.md +8 -0
- data/docs/DeprecatedApi.md +28 -0
- data/docs/ErrorDetail.md +10 -0
- data/docs/ErrorResponse.md +8 -0
- data/docs/HybridTransaction.md +30 -0
- data/docs/HybridTransactionAllOf.md +12 -0
- data/docs/HybridTransactionsResponse.md +8 -0
- data/docs/HybridTransactionsResponseData.md +9 -0
- data/docs/HybridTransactionsWrapper.md +8 -0
- data/docs/LoanAccountPeriodicValue.md +7 -0
- data/docs/MonthDetail.md +16 -0
- data/docs/MonthDetailAllOf.md +8 -0
- data/docs/MonthDetailResponse.md +8 -0
- data/docs/MonthDetailResponseData.md +8 -0
- data/docs/MonthDetailWrapper.md +8 -0
- data/docs/MonthSummariesResponse.md +8 -0
- data/docs/MonthSummariesResponseData.md +9 -0
- data/docs/MonthSummariesWrapper.md +9 -0
- data/docs/MonthSummary.md +15 -0
- data/docs/MonthsApi.md +49 -0
- data/docs/PatchMonthCategoryWrapper.md +8 -0
- data/docs/PatchTransactionsWrapper.md +8 -0
- data/docs/Payee.md +11 -0
- data/docs/PayeeLocation.md +12 -0
- data/docs/PayeeLocationResponse.md +8 -0
- data/docs/PayeeLocationResponseData.md +8 -0
- data/docs/PayeeLocationWrapper.md +8 -0
- data/docs/PayeeLocationsApi.md +69 -0
- data/docs/PayeeLocationsResponse.md +8 -0
- data/docs/PayeeLocationsResponseData.md +8 -0
- data/docs/PayeeLocationsWrapper.md +8 -0
- data/docs/PayeeResponse.md +8 -0
- data/docs/PayeeResponseData.md +8 -0
- data/docs/PayeeWrapper.md +8 -0
- data/docs/PayeesApi.md +49 -0
- data/docs/PayeesResponse.md +8 -0
- data/docs/PayeesResponseData.md +9 -0
- data/docs/PayeesWrapper.md +9 -0
- data/docs/PostAccountWrapper.md +8 -0
- data/docs/PostTransactionsWrapper.md +9 -0
- data/docs/PutTransactionWrapper.md +8 -0
- data/docs/SaveAccount.md +10 -0
- data/docs/SaveAccountWrapper.md +8 -0
- data/docs/SaveCategoryResponse.md +8 -0
- data/docs/SaveCategoryResponseData.md +9 -0
- data/docs/SaveMonthCategory.md +8 -0
- data/docs/SaveMonthCategoryWrapper.md +8 -0
- data/docs/SaveSubTransaction.md +12 -0
- data/docs/SaveTransaction.md +19 -0
- data/docs/SaveTransactionWithId.md +20 -0
- data/docs/SaveTransactionWithIdAllOf.md +8 -0
- data/docs/SaveTransactionWithOptionalFields.md +19 -0
- data/docs/SaveTransactionWrapper.md +8 -0
- data/docs/SaveTransactionsResponse.md +8 -0
- data/docs/SaveTransactionsResponseData.md +12 -0
- data/docs/SaveTransactionsWrapper.md +9 -0
- data/docs/ScheduledSubTransaction.md +15 -0
- data/docs/ScheduledTransactionDetail.md +23 -0
- data/docs/ScheduledTransactionDetailAllOf.md +11 -0
- data/docs/ScheduledTransactionResponse.md +8 -0
- data/docs/ScheduledTransactionResponseData.md +8 -0
- data/docs/ScheduledTransactionSummary.md +19 -0
- data/docs/ScheduledTransactionWrapper.md +8 -0
- data/docs/ScheduledTransactionsApi.md +49 -0
- data/docs/ScheduledTransactionsResponse.md +8 -0
- data/docs/ScheduledTransactionsResponseData.md +9 -0
- data/docs/ScheduledTransactionsWrapper.md +8 -0
- data/docs/SubTransaction.md +18 -0
- data/docs/TransactionDetail.md +29 -0
- data/docs/TransactionDetailAllOf.md +11 -0
- data/docs/TransactionResponse.md +8 -0
- data/docs/TransactionResponseData.md +8 -0
- data/docs/TransactionSummary.md +25 -0
- data/docs/TransactionWrapper.md +8 -0
- data/docs/TransactionsApi.md +228 -0
- data/docs/TransactionsImportResponse.md +8 -0
- data/docs/TransactionsImportResponseData.md +8 -0
- data/docs/TransactionsResponse.md +8 -0
- data/docs/TransactionsResponseData.md +9 -0
- data/docs/TransactionsWrapper.md +9 -0
- data/docs/UpdateTransaction.md +20 -0
- data/docs/UpdateTransactionsWrapper.md +8 -0
- data/docs/User.md +8 -0
- data/docs/UserApi.md +25 -0
- data/docs/UserResponse.md +8 -0
- data/docs/UserResponseData.md +8 -0
- data/docs/UserWrapper.md +8 -0
- data/examples/budget-list.rb +21 -0
- data/examples/budget-month.rb +33 -0
- data/examples/category-balance.rb +23 -0
- data/examples/create-multiple-transactions.rb +42 -0
- data/examples/create-transaction.rb +30 -0
- data/examples/update-category-budgeted.rb +25 -0
- data/examples/update-multiple-transactions.rb +20 -0
- data/lib/ynab/api/accounts_api.rb +78 -41
- data/lib/ynab/api/budgets_api.rb +68 -36
- data/lib/ynab/api/categories_api.rb +108 -60
- data/lib/ynab/api/deprecated_api.rb +32 -17
- data/lib/ynab/api/months_api.rb +49 -28
- data/lib/ynab/api/payee_locations_api.rb +73 -41
- data/lib/ynab/api/payees_api.rb +49 -28
- data/lib/ynab/api/scheduled_transactions_api.rb +49 -28
- data/lib/ynab/api/transactions_api.rb +268 -140
- data/lib/ynab/api/user_api.rb +22 -12
- data/lib/ynab/api_client.rb +97 -95
- data/lib/ynab/configuration.rb +101 -14
- data/lib/ynab/models/account.rb +117 -55
- data/lib/ynab/models/account_response.rb +53 -18
- data/lib/ynab/models/account_response_data.rb +53 -18
- data/lib/ynab/models/account_type.rb +30 -20
- data/lib/ynab/models/accounts_response.rb +53 -18
- data/lib/ynab/models/accounts_response_data.rb +54 -19
- data/lib/ynab/models/budget_detail.rb +80 -35
- data/lib/ynab/models/budget_detail_all_of.rb +320 -0
- data/lib/ynab/models/budget_detail_response.rb +53 -18
- data/lib/ynab/models/budget_detail_response_data.rb +54 -19
- data/lib/ynab/models/budget_settings.rb +56 -29
- data/lib/ynab/models/budget_settings_response.rb +53 -18
- data/lib/ynab/models/budget_settings_response_data.rb +53 -18
- data/lib/ynab/models/budget_summary.rb +63 -26
- data/lib/ynab/models/budget_summary_response.rb +53 -18
- data/lib/ynab/models/budget_summary_response_data.rb +54 -20
- data/lib/ynab/models/bulk_response.rb +53 -18
- data/lib/ynab/models/bulk_response_data.rb +53 -18
- data/lib/ynab/models/bulk_response_data_bulk.rb +54 -19
- data/lib/ynab/models/bulk_transactions.rb +53 -18
- data/lib/ynab/models/categories_response.rb +53 -18
- data/lib/ynab/models/categories_response_data.rb +54 -19
- data/lib/ynab/models/category.rb +110 -48
- data/lib/ynab/models/category_group.rb +58 -23
- data/lib/ynab/models/category_group_with_categories.rb +67 -24
- data/lib/ynab/models/{save_month_category_wrapper.rb → category_group_with_categories_all_of.rb} +67 -29
- data/lib/ynab/models/category_response.rb +53 -18
- data/lib/ynab/models/category_response_data.rb +53 -18
- data/lib/ynab/models/currency_format.rb +62 -27
- data/lib/ynab/models/date_format.rb +53 -18
- data/lib/ynab/models/error_detail.rb +55 -20
- data/lib/ynab/models/error_response.rb +53 -18
- data/lib/ynab/models/hybrid_transaction.rb +118 -46
- data/lib/ynab/models/hybrid_transaction_all_of.rb +304 -0
- data/lib/ynab/models/hybrid_transactions_response.rb +53 -18
- data/lib/ynab/models/hybrid_transactions_response_data.rb +54 -19
- data/lib/ynab/models/month_detail.rb +72 -27
- data/lib/ynab/models/{update_transactions_wrapper.rb → month_detail_all_of.rb} +66 -30
- data/lib/ynab/models/month_detail_response.rb +53 -18
- data/lib/ynab/models/month_detail_response_data.rb +53 -18
- data/lib/ynab/models/month_summaries_response.rb +53 -18
- data/lib/ynab/models/month_summaries_response_data.rb +54 -19
- data/lib/ynab/models/month_summary.rb +63 -26
- data/lib/ynab/models/patch_month_category_wrapper.rb +53 -18
- data/lib/ynab/models/patch_transactions_wrapper.rb +53 -18
- data/lib/ynab/models/payee.rb +58 -22
- data/lib/ynab/models/payee_location.rb +58 -23
- data/lib/ynab/models/payee_location_response.rb +53 -18
- data/lib/ynab/models/payee_location_response_data.rb +53 -18
- data/lib/ynab/models/payee_locations_response.rb +53 -18
- data/lib/ynab/models/payee_locations_response_data.rb +53 -18
- data/lib/ynab/models/payee_response.rb +53 -18
- data/lib/ynab/models/payee_response_data.rb +53 -18
- data/lib/ynab/models/payees_response.rb +53 -18
- data/lib/ynab/models/payees_response_data.rb +54 -19
- data/lib/ynab/models/post_account_wrapper.rb +53 -18
- data/lib/ynab/models/post_transactions_wrapper.rb +54 -19
- data/lib/ynab/models/put_transaction_wrapper.rb +53 -18
- data/lib/ynab/models/save_account.rb +77 -20
- data/lib/ynab/models/save_category_response.rb +53 -18
- data/lib/ynab/models/save_category_response_data.rb +54 -19
- data/lib/ynab/models/save_month_category.rb +53 -18
- data/lib/ynab/models/save_sub_transaction.rb +61 -22
- data/lib/ynab/models/save_transaction.rb +88 -33
- data/lib/ynab/models/save_transaction_with_id.rb +102 -46
- data/lib/ynab/models/{save_transactions_wrapper.rb → save_transaction_with_id_all_of.rb} +60 -36
- data/lib/ynab/models/save_transaction_with_optional_fields.rb +81 -33
- data/lib/ynab/models/save_transactions_response.rb +53 -18
- data/lib/ynab/models/save_transactions_response_data.rb +57 -23
- data/lib/ynab/models/scheduled_sub_transaction.rb +66 -27
- data/lib/ynab/models/scheduled_transaction_detail.rb +94 -36
- data/lib/ynab/models/scheduled_transaction_detail_all_of.rb +262 -0
- data/lib/ynab/models/scheduled_transaction_response.rb +53 -18
- data/lib/ynab/models/scheduled_transaction_response_data.rb +53 -18
- data/lib/ynab/models/scheduled_transaction_summary.rb +80 -32
- data/lib/ynab/models/scheduled_transactions_response.rb +53 -18
- data/lib/ynab/models/scheduled_transactions_response_data.rb +54 -19
- data/lib/ynab/models/sub_transaction.rb +71 -29
- data/lib/ynab/models/transaction_detail.rb +112 -44
- data/lib/ynab/models/{save_transaction_wrapper.rb → transaction_detail_all_of.rb} +102 -29
- data/lib/ynab/models/transaction_response.rb +53 -18
- data/lib/ynab/models/transaction_response_data.rb +53 -18
- data/lib/ynab/models/transaction_summary.rb +98 -40
- data/lib/ynab/models/transactions_import_response.rb +53 -18
- data/lib/ynab/models/transactions_import_response_data.rb +53 -18
- data/lib/ynab/models/transactions_response.rb +53 -18
- data/lib/ynab/models/transactions_response_data.rb +54 -19
- data/lib/ynab/models/user.rb +53 -18
- data/lib/ynab/models/user_response.rb +53 -18
- data/lib/ynab/models/user_response_data.rb +53 -18
- data/lib/ynab/version.rb +1 -1
- data/lib/ynab.rb +19 -14
- data/open_api_spec.yaml +3012 -0
- data/templates/api_client.mustache +274 -0
- data/templates/api_client_typhoeus_partial.mustache +156 -0
- data/templates/api_doc.mustache +44 -0
- data/templates/gem.mustache +84 -0
- data/templates/partial_model_generic_doc.mustache +9 -0
- data/ynab.gemspec +38 -0
- metadata +194 -87
- data/lib/ynab/models/loan_account_periodic_value.rb +0 -175
- data/lib/ynab/models/save_account_wrapper.rb +0 -189
- data/lib/ynab/models/update_transaction.rb +0 -407
- data/spec/models/transaction_detail_spec.rb +0 -11
@@ -3,14 +3,15 @@
|
|
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
|
-
OpenAPI
|
6
|
+
The version of the OpenAPI document: 1.0.0
|
7
7
|
|
8
|
-
Generated by: https://
|
9
|
-
|
8
|
+
Generated by: https://openapi-generator.tech
|
9
|
+
OpenAPI Generator version: 6.6.0
|
10
10
|
|
11
11
|
=end
|
12
12
|
|
13
13
|
require 'date'
|
14
|
+
require 'time'
|
14
15
|
|
15
16
|
module YNAB
|
16
17
|
class TransactionSummary
|
@@ -109,15 +110,20 @@ module YNAB
|
|
109
110
|
}
|
110
111
|
end
|
111
112
|
|
113
|
+
# Returns all the JSON keys this model knows about
|
114
|
+
def self.acceptable_attributes
|
115
|
+
attribute_map.values
|
116
|
+
end
|
117
|
+
|
112
118
|
# Attribute type mapping.
|
113
|
-
def self.
|
119
|
+
def self.openapi_types
|
114
120
|
{
|
115
121
|
:'id' => :'String',
|
116
122
|
:'date' => :'Date',
|
117
123
|
:'amount' => :'Integer',
|
118
124
|
:'memo' => :'String',
|
119
125
|
:'cleared' => :'String',
|
120
|
-
:'approved' => :'
|
126
|
+
:'approved' => :'Boolean',
|
121
127
|
:'flag_color' => :'String',
|
122
128
|
:'account_id' => :'String',
|
123
129
|
:'payee_id' => :'String',
|
@@ -129,87 +135,111 @@ module YNAB
|
|
129
135
|
:'import_payee_name' => :'String',
|
130
136
|
:'import_payee_name_original' => :'String',
|
131
137
|
:'debt_transaction_type' => :'String',
|
132
|
-
:'deleted' => :'
|
138
|
+
:'deleted' => :'Boolean'
|
133
139
|
}
|
134
140
|
end
|
135
141
|
|
142
|
+
# List of attributes with nullable: true
|
143
|
+
def self.openapi_nullable
|
144
|
+
Set.new([
|
145
|
+
:'memo',
|
146
|
+
:'flag_color',
|
147
|
+
:'payee_id',
|
148
|
+
:'category_id',
|
149
|
+
:'transfer_account_id',
|
150
|
+
:'transfer_transaction_id',
|
151
|
+
:'matched_transaction_id',
|
152
|
+
:'import_id',
|
153
|
+
:'import_payee_name',
|
154
|
+
:'import_payee_name_original',
|
155
|
+
:'debt_transaction_type',
|
156
|
+
])
|
157
|
+
end
|
158
|
+
|
136
159
|
# Initializes the object
|
137
160
|
# @param [Hash] attributes Model attributes in the form of hash
|
138
161
|
def initialize(attributes = {})
|
139
|
-
|
162
|
+
if (!attributes.is_a?(Hash))
|
163
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `YNAB::TransactionSummary` initialize method"
|
164
|
+
end
|
140
165
|
|
141
|
-
# convert string to symbol for hash key
|
142
|
-
attributes = attributes.each_with_object({}) { |(k, v), h|
|
166
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
167
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
168
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
169
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `YNAB::TransactionSummary`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
170
|
+
end
|
171
|
+
h[k.to_sym] = v
|
172
|
+
}
|
143
173
|
|
144
|
-
if attributes.
|
174
|
+
if attributes.key?(:'id')
|
145
175
|
self.id = attributes[:'id']
|
146
176
|
end
|
147
177
|
|
148
|
-
if attributes.
|
178
|
+
if attributes.key?(:'date')
|
149
179
|
self.date = attributes[:'date']
|
150
180
|
end
|
151
181
|
|
152
|
-
if attributes.
|
182
|
+
if attributes.key?(:'amount')
|
153
183
|
self.amount = attributes[:'amount']
|
154
184
|
end
|
155
185
|
|
156
|
-
if attributes.
|
186
|
+
if attributes.key?(:'memo')
|
157
187
|
self.memo = attributes[:'memo']
|
158
188
|
end
|
159
189
|
|
160
|
-
if attributes.
|
190
|
+
if attributes.key?(:'cleared')
|
161
191
|
self.cleared = attributes[:'cleared']
|
162
192
|
end
|
163
193
|
|
164
|
-
if attributes.
|
194
|
+
if attributes.key?(:'approved')
|
165
195
|
self.approved = attributes[:'approved']
|
166
196
|
end
|
167
197
|
|
168
|
-
if attributes.
|
198
|
+
if attributes.key?(:'flag_color')
|
169
199
|
self.flag_color = attributes[:'flag_color']
|
170
200
|
end
|
171
201
|
|
172
|
-
if attributes.
|
202
|
+
if attributes.key?(:'account_id')
|
173
203
|
self.account_id = attributes[:'account_id']
|
174
204
|
end
|
175
205
|
|
176
|
-
if attributes.
|
206
|
+
if attributes.key?(:'payee_id')
|
177
207
|
self.payee_id = attributes[:'payee_id']
|
178
208
|
end
|
179
209
|
|
180
|
-
if attributes.
|
210
|
+
if attributes.key?(:'category_id')
|
181
211
|
self.category_id = attributes[:'category_id']
|
182
212
|
end
|
183
213
|
|
184
|
-
if attributes.
|
214
|
+
if attributes.key?(:'transfer_account_id')
|
185
215
|
self.transfer_account_id = attributes[:'transfer_account_id']
|
186
216
|
end
|
187
217
|
|
188
|
-
if attributes.
|
218
|
+
if attributes.key?(:'transfer_transaction_id')
|
189
219
|
self.transfer_transaction_id = attributes[:'transfer_transaction_id']
|
190
220
|
end
|
191
221
|
|
192
|
-
if attributes.
|
222
|
+
if attributes.key?(:'matched_transaction_id')
|
193
223
|
self.matched_transaction_id = attributes[:'matched_transaction_id']
|
194
224
|
end
|
195
225
|
|
196
|
-
if attributes.
|
226
|
+
if attributes.key?(:'import_id')
|
197
227
|
self.import_id = attributes[:'import_id']
|
198
228
|
end
|
199
229
|
|
200
|
-
if attributes.
|
230
|
+
if attributes.key?(:'import_payee_name')
|
201
231
|
self.import_payee_name = attributes[:'import_payee_name']
|
202
232
|
end
|
203
233
|
|
204
|
-
if attributes.
|
234
|
+
if attributes.key?(:'import_payee_name_original')
|
205
235
|
self.import_payee_name_original = attributes[:'import_payee_name_original']
|
206
236
|
end
|
207
237
|
|
208
|
-
if attributes.
|
238
|
+
if attributes.key?(:'debt_transaction_type')
|
209
239
|
self.debt_transaction_type = attributes[:'debt_transaction_type']
|
210
240
|
end
|
211
241
|
|
212
|
-
if attributes.
|
242
|
+
if attributes.key?(:'deleted')
|
213
243
|
self.deleted = attributes[:'deleted']
|
214
244
|
end
|
215
245
|
end
|
@@ -256,13 +286,13 @@ module YNAB
|
|
256
286
|
return false if @date.nil?
|
257
287
|
return false if @amount.nil?
|
258
288
|
return false if @cleared.nil?
|
259
|
-
cleared_validator = EnumAttributeValidator.new('String', [
|
289
|
+
cleared_validator = EnumAttributeValidator.new('String', ["cleared", "uncleared", "reconciled"])
|
260
290
|
return false unless cleared_validator.valid?(@cleared)
|
261
291
|
return false if @approved.nil?
|
262
|
-
flag_color_validator = EnumAttributeValidator.new('String', [
|
292
|
+
flag_color_validator = EnumAttributeValidator.new('String', ["red", "orange", "yellow", "green", "blue", "purple", "null"])
|
263
293
|
return false unless flag_color_validator.valid?(@flag_color)
|
264
294
|
return false if @account_id.nil?
|
265
|
-
debt_transaction_type_validator = EnumAttributeValidator.new('String', [
|
295
|
+
debt_transaction_type_validator = EnumAttributeValidator.new('String', ["payment", "refund", "fee", "interest", "escrow", "balancedAdjustment", "credit", "charge", "null"])
|
266
296
|
return false unless debt_transaction_type_validator.valid?(@debt_transaction_type)
|
267
297
|
return false if @deleted.nil?
|
268
298
|
true
|
@@ -271,18 +301,30 @@ module YNAB
|
|
271
301
|
# Custom attribute writer method checking allowed values (enum).
|
272
302
|
# @param [Object] cleared Object to be assigned
|
273
303
|
def cleared=(cleared)
|
304
|
+
validator = EnumAttributeValidator.new('String', ["cleared", "uncleared", "reconciled"])
|
305
|
+
unless validator.valid?(cleared)
|
306
|
+
fail ArgumentError, "invalid value for \"cleared\", must be one of #{validator.allowable_values}."
|
307
|
+
end
|
274
308
|
@cleared = cleared
|
275
309
|
end
|
276
310
|
|
277
311
|
# Custom attribute writer method checking allowed values (enum).
|
278
312
|
# @param [Object] flag_color Object to be assigned
|
279
313
|
def flag_color=(flag_color)
|
314
|
+
validator = EnumAttributeValidator.new('String', ["red", "orange", "yellow", "green", "blue", "purple", "null"])
|
315
|
+
unless validator.valid?(flag_color)
|
316
|
+
fail ArgumentError, "invalid value for \"flag_color\", must be one of #{validator.allowable_values}."
|
317
|
+
end
|
280
318
|
@flag_color = flag_color
|
281
319
|
end
|
282
320
|
|
283
321
|
# Custom attribute writer method checking allowed values (enum).
|
284
322
|
# @param [Object] debt_transaction_type Object to be assigned
|
285
323
|
def debt_transaction_type=(debt_transaction_type)
|
324
|
+
validator = EnumAttributeValidator.new('String', ["payment", "refund", "fee", "interest", "escrow", "balancedAdjustment", "credit", "charge", "null"])
|
325
|
+
unless validator.valid?(debt_transaction_type)
|
326
|
+
fail ArgumentError, "invalid value for \"debt_transaction_type\", must be one of #{validator.allowable_values}."
|
327
|
+
end
|
286
328
|
@debt_transaction_type = debt_transaction_type
|
287
329
|
end
|
288
330
|
|
@@ -318,17 +360,28 @@ module YNAB
|
|
318
360
|
end
|
319
361
|
|
320
362
|
# Calculates hash code according to all attributes.
|
321
|
-
# @return [
|
363
|
+
# @return [Integer] Hash code
|
322
364
|
def hash
|
323
365
|
[id, date, amount, memo, cleared, approved, flag_color, account_id, payee_id, category_id, transfer_account_id, transfer_transaction_id, matched_transaction_id, import_id, import_payee_name, import_payee_name_original, debt_transaction_type, deleted].hash
|
324
366
|
end
|
367
|
+
|
368
|
+
# Builds the object from hash
|
369
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
370
|
+
# @return [Object] Returns the model itself
|
371
|
+
def self.build_from_hash(attributes)
|
372
|
+
new.build_from_hash(attributes)
|
373
|
+
end
|
374
|
+
|
325
375
|
# Builds the object from hash
|
326
376
|
# @param [Hash] attributes Model attributes in the form of hash
|
327
377
|
# @return [Object] Returns the model itself
|
328
378
|
def build_from_hash(attributes)
|
329
379
|
return nil unless attributes.is_a?(Hash)
|
330
|
-
|
331
|
-
|
380
|
+
attributes = attributes.transform_keys(&:to_sym)
|
381
|
+
self.class.openapi_types.each_pair do |key, type|
|
382
|
+
if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
|
383
|
+
self.send("#{key}=", nil)
|
384
|
+
elsif type =~ /\AArray<(.*)>/i
|
332
385
|
# check to ensure the input is an array given that the attribute
|
333
386
|
# is documented as an array but the input is not
|
334
387
|
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
@@ -336,7 +389,7 @@ module YNAB
|
|
336
389
|
end
|
337
390
|
elsif !attributes[self.class.attribute_map[key]].nil?
|
338
391
|
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
339
|
-
end
|
392
|
+
end
|
340
393
|
end
|
341
394
|
|
342
395
|
self
|
@@ -348,8 +401,8 @@ module YNAB
|
|
348
401
|
# @return [Object] Deserialized data
|
349
402
|
def _deserialize(type, value)
|
350
403
|
case type.to_sym
|
351
|
-
when :
|
352
|
-
|
404
|
+
when :Time
|
405
|
+
Time.parse(value)
|
353
406
|
when :Date
|
354
407
|
Date.parse(value)
|
355
408
|
when :String
|
@@ -358,7 +411,7 @@ module YNAB
|
|
358
411
|
value.to_i
|
359
412
|
when :Float
|
360
413
|
value.to_f
|
361
|
-
when :
|
414
|
+
when :Boolean
|
362
415
|
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
363
416
|
true
|
364
417
|
else
|
@@ -379,8 +432,9 @@ module YNAB
|
|
379
432
|
end
|
380
433
|
end
|
381
434
|
else # model
|
382
|
-
|
383
|
-
|
435
|
+
# models (e.g. Pet) or oneOf
|
436
|
+
klass = YNAB.const_get(type)
|
437
|
+
klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
384
438
|
end
|
385
439
|
end
|
386
440
|
|
@@ -402,7 +456,11 @@ module YNAB
|
|
402
456
|
hash = {}
|
403
457
|
self.class.attribute_map.each_pair do |attr, param|
|
404
458
|
value = self.send(attr)
|
405
|
-
|
459
|
+
if value.nil?
|
460
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
461
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
462
|
+
end
|
463
|
+
|
406
464
|
hash[param] = _to_hash(value)
|
407
465
|
end
|
408
466
|
hash
|
@@ -3,14 +3,15 @@
|
|
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
|
-
OpenAPI
|
6
|
+
The version of the OpenAPI document: 1.0.0
|
7
7
|
|
8
|
-
Generated by: https://
|
9
|
-
|
8
|
+
Generated by: https://openapi-generator.tech
|
9
|
+
OpenAPI Generator version: 6.6.0
|
10
10
|
|
11
11
|
=end
|
12
12
|
|
13
13
|
require 'date'
|
14
|
+
require 'time'
|
14
15
|
|
15
16
|
module YNAB
|
16
17
|
class TransactionsImportResponse
|
@@ -23,22 +24,40 @@ module YNAB
|
|
23
24
|
}
|
24
25
|
end
|
25
26
|
|
27
|
+
# Returns all the JSON keys this model knows about
|
28
|
+
def self.acceptable_attributes
|
29
|
+
attribute_map.values
|
30
|
+
end
|
31
|
+
|
26
32
|
# Attribute type mapping.
|
27
|
-
def self.
|
33
|
+
def self.openapi_types
|
28
34
|
{
|
29
35
|
:'data' => :'TransactionsImportResponseData'
|
30
36
|
}
|
31
37
|
end
|
32
38
|
|
39
|
+
# List of attributes with nullable: true
|
40
|
+
def self.openapi_nullable
|
41
|
+
Set.new([
|
42
|
+
])
|
43
|
+
end
|
44
|
+
|
33
45
|
# Initializes the object
|
34
46
|
# @param [Hash] attributes Model attributes in the form of hash
|
35
47
|
def initialize(attributes = {})
|
36
|
-
|
48
|
+
if (!attributes.is_a?(Hash))
|
49
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `YNAB::TransactionsImportResponse` initialize method"
|
50
|
+
end
|
37
51
|
|
38
|
-
# convert string to symbol for hash key
|
39
|
-
attributes = attributes.each_with_object({}) { |(k, v), h|
|
52
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
53
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
54
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
55
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `YNAB::TransactionsImportResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
56
|
+
end
|
57
|
+
h[k.to_sym] = v
|
58
|
+
}
|
40
59
|
|
41
|
-
if attributes.
|
60
|
+
if attributes.key?(:'data')
|
42
61
|
self.data = attributes[:'data']
|
43
62
|
end
|
44
63
|
end
|
@@ -76,17 +95,28 @@ module YNAB
|
|
76
95
|
end
|
77
96
|
|
78
97
|
# Calculates hash code according to all attributes.
|
79
|
-
# @return [
|
98
|
+
# @return [Integer] Hash code
|
80
99
|
def hash
|
81
100
|
[data].hash
|
82
101
|
end
|
102
|
+
|
103
|
+
# Builds the object from hash
|
104
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
105
|
+
# @return [Object] Returns the model itself
|
106
|
+
def self.build_from_hash(attributes)
|
107
|
+
new.build_from_hash(attributes)
|
108
|
+
end
|
109
|
+
|
83
110
|
# Builds the object from hash
|
84
111
|
# @param [Hash] attributes Model attributes in the form of hash
|
85
112
|
# @return [Object] Returns the model itself
|
86
113
|
def build_from_hash(attributes)
|
87
114
|
return nil unless attributes.is_a?(Hash)
|
88
|
-
|
89
|
-
|
115
|
+
attributes = attributes.transform_keys(&:to_sym)
|
116
|
+
self.class.openapi_types.each_pair do |key, type|
|
117
|
+
if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
|
118
|
+
self.send("#{key}=", nil)
|
119
|
+
elsif type =~ /\AArray<(.*)>/i
|
90
120
|
# check to ensure the input is an array given that the attribute
|
91
121
|
# is documented as an array but the input is not
|
92
122
|
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
@@ -94,7 +124,7 @@ module YNAB
|
|
94
124
|
end
|
95
125
|
elsif !attributes[self.class.attribute_map[key]].nil?
|
96
126
|
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
97
|
-
end
|
127
|
+
end
|
98
128
|
end
|
99
129
|
|
100
130
|
self
|
@@ -106,8 +136,8 @@ module YNAB
|
|
106
136
|
# @return [Object] Deserialized data
|
107
137
|
def _deserialize(type, value)
|
108
138
|
case type.to_sym
|
109
|
-
when :
|
110
|
-
|
139
|
+
when :Time
|
140
|
+
Time.parse(value)
|
111
141
|
when :Date
|
112
142
|
Date.parse(value)
|
113
143
|
when :String
|
@@ -116,7 +146,7 @@ module YNAB
|
|
116
146
|
value.to_i
|
117
147
|
when :Float
|
118
148
|
value.to_f
|
119
|
-
when :
|
149
|
+
when :Boolean
|
120
150
|
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
121
151
|
true
|
122
152
|
else
|
@@ -137,8 +167,9 @@ module YNAB
|
|
137
167
|
end
|
138
168
|
end
|
139
169
|
else # model
|
140
|
-
|
141
|
-
|
170
|
+
# models (e.g. Pet) or oneOf
|
171
|
+
klass = YNAB.const_get(type)
|
172
|
+
klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
142
173
|
end
|
143
174
|
end
|
144
175
|
|
@@ -160,7 +191,11 @@ module YNAB
|
|
160
191
|
hash = {}
|
161
192
|
self.class.attribute_map.each_pair do |attr, param|
|
162
193
|
value = self.send(attr)
|
163
|
-
|
194
|
+
if value.nil?
|
195
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
196
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
197
|
+
end
|
198
|
+
|
164
199
|
hash[param] = _to_hash(value)
|
165
200
|
end
|
166
201
|
hash
|
@@ -3,14 +3,15 @@
|
|
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
|
-
OpenAPI
|
6
|
+
The version of the OpenAPI document: 1.0.0
|
7
7
|
|
8
|
-
Generated by: https://
|
9
|
-
|
8
|
+
Generated by: https://openapi-generator.tech
|
9
|
+
OpenAPI Generator version: 6.6.0
|
10
10
|
|
11
11
|
=end
|
12
12
|
|
13
13
|
require 'date'
|
14
|
+
require 'time'
|
14
15
|
|
15
16
|
module YNAB
|
16
17
|
class TransactionsImportResponseData
|
@@ -24,22 +25,40 @@ module YNAB
|
|
24
25
|
}
|
25
26
|
end
|
26
27
|
|
28
|
+
# Returns all the JSON keys this model knows about
|
29
|
+
def self.acceptable_attributes
|
30
|
+
attribute_map.values
|
31
|
+
end
|
32
|
+
|
27
33
|
# Attribute type mapping.
|
28
|
-
def self.
|
34
|
+
def self.openapi_types
|
29
35
|
{
|
30
36
|
:'transaction_ids' => :'Array<String>'
|
31
37
|
}
|
32
38
|
end
|
33
39
|
|
40
|
+
# List of attributes with nullable: true
|
41
|
+
def self.openapi_nullable
|
42
|
+
Set.new([
|
43
|
+
])
|
44
|
+
end
|
45
|
+
|
34
46
|
# Initializes the object
|
35
47
|
# @param [Hash] attributes Model attributes in the form of hash
|
36
48
|
def initialize(attributes = {})
|
37
|
-
|
49
|
+
if (!attributes.is_a?(Hash))
|
50
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `YNAB::TransactionsImportResponseData` initialize method"
|
51
|
+
end
|
38
52
|
|
39
|
-
# convert string to symbol for hash key
|
40
|
-
attributes = attributes.each_with_object({}) { |(k, v), h|
|
53
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
54
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
55
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
56
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `YNAB::TransactionsImportResponseData`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
57
|
+
end
|
58
|
+
h[k.to_sym] = v
|
59
|
+
}
|
41
60
|
|
42
|
-
if attributes.
|
61
|
+
if attributes.key?(:'transaction_ids')
|
43
62
|
if (value = attributes[:'transaction_ids']).is_a?(Array)
|
44
63
|
self.transaction_ids = value
|
45
64
|
end
|
@@ -79,17 +98,28 @@ module YNAB
|
|
79
98
|
end
|
80
99
|
|
81
100
|
# Calculates hash code according to all attributes.
|
82
|
-
# @return [
|
101
|
+
# @return [Integer] Hash code
|
83
102
|
def hash
|
84
103
|
[transaction_ids].hash
|
85
104
|
end
|
105
|
+
|
106
|
+
# Builds the object from hash
|
107
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
108
|
+
# @return [Object] Returns the model itself
|
109
|
+
def self.build_from_hash(attributes)
|
110
|
+
new.build_from_hash(attributes)
|
111
|
+
end
|
112
|
+
|
86
113
|
# Builds the object from hash
|
87
114
|
# @param [Hash] attributes Model attributes in the form of hash
|
88
115
|
# @return [Object] Returns the model itself
|
89
116
|
def build_from_hash(attributes)
|
90
117
|
return nil unless attributes.is_a?(Hash)
|
91
|
-
|
92
|
-
|
118
|
+
attributes = attributes.transform_keys(&:to_sym)
|
119
|
+
self.class.openapi_types.each_pair do |key, type|
|
120
|
+
if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
|
121
|
+
self.send("#{key}=", nil)
|
122
|
+
elsif type =~ /\AArray<(.*)>/i
|
93
123
|
# check to ensure the input is an array given that the attribute
|
94
124
|
# is documented as an array but the input is not
|
95
125
|
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
@@ -97,7 +127,7 @@ module YNAB
|
|
97
127
|
end
|
98
128
|
elsif !attributes[self.class.attribute_map[key]].nil?
|
99
129
|
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
100
|
-
end
|
130
|
+
end
|
101
131
|
end
|
102
132
|
|
103
133
|
self
|
@@ -109,8 +139,8 @@ module YNAB
|
|
109
139
|
# @return [Object] Deserialized data
|
110
140
|
def _deserialize(type, value)
|
111
141
|
case type.to_sym
|
112
|
-
when :
|
113
|
-
|
142
|
+
when :Time
|
143
|
+
Time.parse(value)
|
114
144
|
when :Date
|
115
145
|
Date.parse(value)
|
116
146
|
when :String
|
@@ -119,7 +149,7 @@ module YNAB
|
|
119
149
|
value.to_i
|
120
150
|
when :Float
|
121
151
|
value.to_f
|
122
|
-
when :
|
152
|
+
when :Boolean
|
123
153
|
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
124
154
|
true
|
125
155
|
else
|
@@ -140,8 +170,9 @@ module YNAB
|
|
140
170
|
end
|
141
171
|
end
|
142
172
|
else # model
|
143
|
-
|
144
|
-
|
173
|
+
# models (e.g. Pet) or oneOf
|
174
|
+
klass = YNAB.const_get(type)
|
175
|
+
klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
145
176
|
end
|
146
177
|
end
|
147
178
|
|
@@ -163,7 +194,11 @@ module YNAB
|
|
163
194
|
hash = {}
|
164
195
|
self.class.attribute_map.each_pair do |attr, param|
|
165
196
|
value = self.send(attr)
|
166
|
-
|
197
|
+
if value.nil?
|
198
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
199
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
200
|
+
end
|
201
|
+
|
167
202
|
hash[param] = _to_hash(value)
|
168
203
|
end
|
169
204
|
hash
|