ynab 1.31.0 → 2.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 +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 +192 -85
- 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
data/lib/ynab/models/account.rb
CHANGED
@@ -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 Account
|
@@ -52,18 +53,37 @@ module YNAB
|
|
52
53
|
# The original debt/loan account balance, specified in milliunits format.
|
53
54
|
attr_accessor :debt_original_balance
|
54
55
|
|
55
|
-
# The debt/loan account interest rate(s), by effective date.
|
56
56
|
attr_accessor :debt_interest_rates
|
57
57
|
|
58
|
-
# The minimum payment amount(s) for the debt/loan account, by effective date. The amounts are specified in milliunits format.
|
59
58
|
attr_accessor :debt_minimum_payments
|
60
59
|
|
61
|
-
# The escrow value(s) for the debt/loan account, by effective date. The amounts are specified in milliunits format.
|
62
60
|
attr_accessor :debt_escrow_amounts
|
63
61
|
|
64
62
|
# Whether or not the account has been deleted. Deleted accounts will only be included in delta requests.
|
65
63
|
attr_accessor :deleted
|
66
64
|
|
65
|
+
class EnumAttributeValidator
|
66
|
+
attr_reader :datatype
|
67
|
+
attr_reader :allowable_values
|
68
|
+
|
69
|
+
def initialize(datatype, allowable_values)
|
70
|
+
@allowable_values = allowable_values.map do |value|
|
71
|
+
case datatype.to_s
|
72
|
+
when /Integer/i
|
73
|
+
value.to_i
|
74
|
+
when /Float/i
|
75
|
+
value.to_f
|
76
|
+
else
|
77
|
+
value
|
78
|
+
end
|
79
|
+
end
|
80
|
+
end
|
81
|
+
|
82
|
+
def valid?(value)
|
83
|
+
!value || allowable_values.include?(value)
|
84
|
+
end
|
85
|
+
end
|
86
|
+
|
67
87
|
# Attribute mapping from ruby-style variable name to JSON key.
|
68
88
|
def self.attribute_map
|
69
89
|
{
|
@@ -88,107 +108,138 @@ module YNAB
|
|
88
108
|
}
|
89
109
|
end
|
90
110
|
|
111
|
+
# Returns all the JSON keys this model knows about
|
112
|
+
def self.acceptable_attributes
|
113
|
+
attribute_map.values
|
114
|
+
end
|
115
|
+
|
91
116
|
# Attribute type mapping.
|
92
|
-
def self.
|
117
|
+
def self.openapi_types
|
93
118
|
{
|
94
119
|
:'id' => :'String',
|
95
120
|
:'name' => :'String',
|
96
121
|
:'type' => :'AccountType',
|
97
|
-
:'on_budget' => :'
|
98
|
-
:'closed' => :'
|
122
|
+
:'on_budget' => :'Boolean',
|
123
|
+
:'closed' => :'Boolean',
|
99
124
|
:'note' => :'String',
|
100
125
|
:'balance' => :'Integer',
|
101
126
|
:'cleared_balance' => :'Integer',
|
102
127
|
:'uncleared_balance' => :'Integer',
|
103
128
|
:'transfer_payee_id' => :'String',
|
104
|
-
:'direct_import_linked' => :'
|
105
|
-
:'direct_import_in_error' => :'
|
106
|
-
:'last_reconciled_at' => :'
|
129
|
+
:'direct_import_linked' => :'Boolean',
|
130
|
+
:'direct_import_in_error' => :'Boolean',
|
131
|
+
:'last_reconciled_at' => :'Time',
|
107
132
|
:'debt_original_balance' => :'Integer',
|
108
|
-
:'debt_interest_rates' => :'
|
109
|
-
:'debt_minimum_payments' => :'
|
110
|
-
:'debt_escrow_amounts' => :'
|
111
|
-
:'deleted' => :'
|
133
|
+
:'debt_interest_rates' => :'Hash<String, Integer>',
|
134
|
+
:'debt_minimum_payments' => :'Hash<String, Integer>',
|
135
|
+
:'debt_escrow_amounts' => :'Hash<String, Integer>',
|
136
|
+
:'deleted' => :'Boolean'
|
112
137
|
}
|
113
138
|
end
|
114
139
|
|
140
|
+
# List of attributes with nullable: true
|
141
|
+
def self.openapi_nullable
|
142
|
+
Set.new([
|
143
|
+
:'note',
|
144
|
+
:'transfer_payee_id',
|
145
|
+
:'last_reconciled_at',
|
146
|
+
:'debt_original_balance',
|
147
|
+
:'debt_interest_rates',
|
148
|
+
:'debt_minimum_payments',
|
149
|
+
:'debt_escrow_amounts',
|
150
|
+
])
|
151
|
+
end
|
152
|
+
|
115
153
|
# Initializes the object
|
116
154
|
# @param [Hash] attributes Model attributes in the form of hash
|
117
155
|
def initialize(attributes = {})
|
118
|
-
|
156
|
+
if (!attributes.is_a?(Hash))
|
157
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `YNAB::Account` initialize method"
|
158
|
+
end
|
119
159
|
|
120
|
-
# convert string to symbol for hash key
|
121
|
-
attributes = attributes.each_with_object({}) { |(k, v), h|
|
160
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
161
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
162
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
163
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `YNAB::Account`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
164
|
+
end
|
165
|
+
h[k.to_sym] = v
|
166
|
+
}
|
122
167
|
|
123
|
-
if attributes.
|
168
|
+
if attributes.key?(:'id')
|
124
169
|
self.id = attributes[:'id']
|
125
170
|
end
|
126
171
|
|
127
|
-
if attributes.
|
172
|
+
if attributes.key?(:'name')
|
128
173
|
self.name = attributes[:'name']
|
129
174
|
end
|
130
175
|
|
131
|
-
if attributes.
|
176
|
+
if attributes.key?(:'type')
|
132
177
|
self.type = attributes[:'type']
|
133
178
|
end
|
134
179
|
|
135
|
-
if attributes.
|
180
|
+
if attributes.key?(:'on_budget')
|
136
181
|
self.on_budget = attributes[:'on_budget']
|
137
182
|
end
|
138
183
|
|
139
|
-
if attributes.
|
184
|
+
if attributes.key?(:'closed')
|
140
185
|
self.closed = attributes[:'closed']
|
141
186
|
end
|
142
187
|
|
143
|
-
if attributes.
|
188
|
+
if attributes.key?(:'note')
|
144
189
|
self.note = attributes[:'note']
|
145
190
|
end
|
146
191
|
|
147
|
-
if attributes.
|
192
|
+
if attributes.key?(:'balance')
|
148
193
|
self.balance = attributes[:'balance']
|
149
194
|
end
|
150
195
|
|
151
|
-
if attributes.
|
196
|
+
if attributes.key?(:'cleared_balance')
|
152
197
|
self.cleared_balance = attributes[:'cleared_balance']
|
153
198
|
end
|
154
199
|
|
155
|
-
if attributes.
|
200
|
+
if attributes.key?(:'uncleared_balance')
|
156
201
|
self.uncleared_balance = attributes[:'uncleared_balance']
|
157
202
|
end
|
158
203
|
|
159
|
-
if attributes.
|
204
|
+
if attributes.key?(:'transfer_payee_id')
|
160
205
|
self.transfer_payee_id = attributes[:'transfer_payee_id']
|
161
206
|
end
|
162
207
|
|
163
|
-
if attributes.
|
208
|
+
if attributes.key?(:'direct_import_linked')
|
164
209
|
self.direct_import_linked = attributes[:'direct_import_linked']
|
165
210
|
end
|
166
211
|
|
167
|
-
if attributes.
|
212
|
+
if attributes.key?(:'direct_import_in_error')
|
168
213
|
self.direct_import_in_error = attributes[:'direct_import_in_error']
|
169
214
|
end
|
170
215
|
|
171
|
-
if attributes.
|
216
|
+
if attributes.key?(:'last_reconciled_at')
|
172
217
|
self.last_reconciled_at = attributes[:'last_reconciled_at']
|
173
218
|
end
|
174
219
|
|
175
|
-
if attributes.
|
220
|
+
if attributes.key?(:'debt_original_balance')
|
176
221
|
self.debt_original_balance = attributes[:'debt_original_balance']
|
177
222
|
end
|
178
223
|
|
179
|
-
if attributes.
|
180
|
-
|
224
|
+
if attributes.key?(:'debt_interest_rates')
|
225
|
+
if (value = attributes[:'debt_interest_rates']).is_a?(Hash)
|
226
|
+
self.debt_interest_rates = value
|
227
|
+
end
|
181
228
|
end
|
182
229
|
|
183
|
-
if attributes.
|
184
|
-
|
230
|
+
if attributes.key?(:'debt_minimum_payments')
|
231
|
+
if (value = attributes[:'debt_minimum_payments']).is_a?(Hash)
|
232
|
+
self.debt_minimum_payments = value
|
233
|
+
end
|
185
234
|
end
|
186
235
|
|
187
|
-
if attributes.
|
188
|
-
|
236
|
+
if attributes.key?(:'debt_escrow_amounts')
|
237
|
+
if (value = attributes[:'debt_escrow_amounts']).is_a?(Hash)
|
238
|
+
self.debt_escrow_amounts = value
|
239
|
+
end
|
189
240
|
end
|
190
241
|
|
191
|
-
if attributes.
|
242
|
+
if attributes.key?(:'deleted')
|
192
243
|
self.deleted = attributes[:'deleted']
|
193
244
|
end
|
194
245
|
end
|
@@ -229,10 +280,6 @@ module YNAB
|
|
229
280
|
invalid_properties.push('invalid value for "uncleared_balance", uncleared_balance cannot be nil.')
|
230
281
|
end
|
231
282
|
|
232
|
-
if @transfer_payee_id.nil?
|
233
|
-
invalid_properties.push('invalid value for "transfer_payee_id", transfer_payee_id cannot be nil.')
|
234
|
-
end
|
235
|
-
|
236
283
|
if @deleted.nil?
|
237
284
|
invalid_properties.push('invalid value for "deleted", deleted cannot be nil.')
|
238
285
|
end
|
@@ -251,7 +298,6 @@ module YNAB
|
|
251
298
|
return false if @balance.nil?
|
252
299
|
return false if @cleared_balance.nil?
|
253
300
|
return false if @uncleared_balance.nil?
|
254
|
-
return false if @transfer_payee_id.nil?
|
255
301
|
return false if @deleted.nil?
|
256
302
|
true
|
257
303
|
end
|
@@ -288,17 +334,28 @@ module YNAB
|
|
288
334
|
end
|
289
335
|
|
290
336
|
# Calculates hash code according to all attributes.
|
291
|
-
# @return [
|
337
|
+
# @return [Integer] Hash code
|
292
338
|
def hash
|
293
339
|
[id, name, type, on_budget, closed, note, balance, cleared_balance, uncleared_balance, transfer_payee_id, direct_import_linked, direct_import_in_error, last_reconciled_at, debt_original_balance, debt_interest_rates, debt_minimum_payments, debt_escrow_amounts, deleted].hash
|
294
340
|
end
|
341
|
+
|
342
|
+
# Builds the object from hash
|
343
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
344
|
+
# @return [Object] Returns the model itself
|
345
|
+
def self.build_from_hash(attributes)
|
346
|
+
new.build_from_hash(attributes)
|
347
|
+
end
|
348
|
+
|
295
349
|
# Builds the object from hash
|
296
350
|
# @param [Hash] attributes Model attributes in the form of hash
|
297
351
|
# @return [Object] Returns the model itself
|
298
352
|
def build_from_hash(attributes)
|
299
353
|
return nil unless attributes.is_a?(Hash)
|
300
|
-
|
301
|
-
|
354
|
+
attributes = attributes.transform_keys(&:to_sym)
|
355
|
+
self.class.openapi_types.each_pair do |key, type|
|
356
|
+
if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
|
357
|
+
self.send("#{key}=", nil)
|
358
|
+
elsif type =~ /\AArray<(.*)>/i
|
302
359
|
# check to ensure the input is an array given that the attribute
|
303
360
|
# is documented as an array but the input is not
|
304
361
|
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
@@ -306,7 +363,7 @@ module YNAB
|
|
306
363
|
end
|
307
364
|
elsif !attributes[self.class.attribute_map[key]].nil?
|
308
365
|
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
309
|
-
end
|
366
|
+
end
|
310
367
|
end
|
311
368
|
|
312
369
|
self
|
@@ -318,8 +375,8 @@ module YNAB
|
|
318
375
|
# @return [Object] Deserialized data
|
319
376
|
def _deserialize(type, value)
|
320
377
|
case type.to_sym
|
321
|
-
when :
|
322
|
-
|
378
|
+
when :Time
|
379
|
+
Time.parse(value)
|
323
380
|
when :Date
|
324
381
|
Date.parse(value)
|
325
382
|
when :String
|
@@ -328,7 +385,7 @@ module YNAB
|
|
328
385
|
value.to_i
|
329
386
|
when :Float
|
330
387
|
value.to_f
|
331
|
-
when :
|
388
|
+
when :Boolean
|
332
389
|
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
333
390
|
true
|
334
391
|
else
|
@@ -349,8 +406,9 @@ module YNAB
|
|
349
406
|
end
|
350
407
|
end
|
351
408
|
else # model
|
352
|
-
|
353
|
-
|
409
|
+
# models (e.g. Pet) or oneOf
|
410
|
+
klass = YNAB.const_get(type)
|
411
|
+
klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
354
412
|
end
|
355
413
|
end
|
356
414
|
|
@@ -372,7 +430,11 @@ module YNAB
|
|
372
430
|
hash = {}
|
373
431
|
self.class.attribute_map.each_pair do |attr, param|
|
374
432
|
value = self.send(attr)
|
375
|
-
|
433
|
+
if value.nil?
|
434
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
435
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
436
|
+
end
|
437
|
+
|
376
438
|
hash[param] = _to_hash(value)
|
377
439
|
end
|
378
440
|
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 AccountResponse
|
@@ -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' => :'AccountResponseData'
|
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::AccountResponse` 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::AccountResponse`. 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 AccountResponseData
|
@@ -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
|
:'account' => :'Account'
|
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::AccountResponseData` 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::AccountResponseData`. 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?(:'account')
|
42
61
|
self.account = attributes[:'account']
|
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
|
[account].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
|