ynab 1.29.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 +6 -6
- 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 +79 -42
- data/lib/ynab/api/budgets_api.rb +69 -37
- data/lib/ynab/api/categories_api.rb +109 -61
- data/lib/ynab/api/deprecated_api.rb +33 -18
- data/lib/ynab/api/months_api.rb +50 -29
- data/lib/ynab/api/payee_locations_api.rb +74 -42
- data/lib/ynab/api/payees_api.rb +50 -29
- data/lib/ynab/api/scheduled_transactions_api.rb +50 -29
- data/lib/ynab/api/transactions_api.rb +269 -141
- data/lib/ynab/api/user_api.rb +23 -13
- data/lib/ynab/api_client.rb +98 -96
- data/lib/ynab/configuration.rb +103 -16
- data/lib/ynab/models/account.rb +118 -56
- data/lib/ynab/models/account_response.rb +54 -19
- data/lib/ynab/models/account_response_data.rb +54 -19
- data/lib/ynab/models/account_type.rb +31 -21
- data/lib/ynab/models/accounts_response.rb +54 -19
- data/lib/ynab/models/accounts_response_data.rb +55 -20
- data/lib/ynab/models/budget_detail.rb +81 -36
- data/lib/ynab/models/budget_detail_all_of.rb +320 -0
- data/lib/ynab/models/budget_detail_response.rb +54 -19
- data/lib/ynab/models/budget_detail_response_data.rb +55 -20
- data/lib/ynab/models/budget_settings.rb +57 -30
- data/lib/ynab/models/budget_settings_response.rb +54 -19
- data/lib/ynab/models/budget_settings_response_data.rb +54 -19
- data/lib/ynab/models/budget_summary.rb +64 -27
- data/lib/ynab/models/budget_summary_response.rb +54 -19
- data/lib/ynab/models/budget_summary_response_data.rb +55 -21
- data/lib/ynab/models/bulk_response.rb +54 -19
- data/lib/ynab/models/bulk_response_data.rb +54 -19
- data/lib/ynab/models/bulk_response_data_bulk.rb +55 -20
- data/lib/ynab/models/bulk_transactions.rb +54 -19
- data/lib/ynab/models/categories_response.rb +54 -19
- data/lib/ynab/models/categories_response_data.rb +55 -20
- data/lib/ynab/models/category.rb +111 -49
- data/lib/ynab/models/category_group.rb +59 -24
- data/lib/ynab/models/category_group_with_categories.rb +68 -25
- 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 +54 -19
- data/lib/ynab/models/category_response_data.rb +54 -19
- data/lib/ynab/models/currency_format.rb +63 -28
- data/lib/ynab/models/date_format.rb +54 -19
- data/lib/ynab/models/error_detail.rb +56 -21
- data/lib/ynab/models/error_response.rb +54 -19
- data/lib/ynab/models/hybrid_transaction.rb +120 -47
- data/lib/ynab/models/hybrid_transaction_all_of.rb +304 -0
- data/lib/ynab/models/hybrid_transactions_response.rb +54 -19
- data/lib/ynab/models/hybrid_transactions_response_data.rb +55 -20
- data/lib/ynab/models/month_detail.rb +73 -28
- data/lib/ynab/models/{update_transactions_wrapper.rb → month_detail_all_of.rb} +66 -30
- data/lib/ynab/models/month_detail_response.rb +54 -19
- data/lib/ynab/models/month_detail_response_data.rb +54 -19
- data/lib/ynab/models/month_summaries_response.rb +54 -19
- data/lib/ynab/models/month_summaries_response_data.rb +55 -20
- data/lib/ynab/models/month_summary.rb +64 -27
- data/lib/ynab/models/patch_month_category_wrapper.rb +54 -19
- data/lib/ynab/models/patch_transactions_wrapper.rb +54 -19
- data/lib/ynab/models/payee.rb +59 -23
- data/lib/ynab/models/payee_location.rb +59 -24
- data/lib/ynab/models/payee_location_response.rb +54 -19
- data/lib/ynab/models/payee_location_response_data.rb +54 -19
- data/lib/ynab/models/payee_locations_response.rb +54 -19
- data/lib/ynab/models/payee_locations_response_data.rb +54 -19
- data/lib/ynab/models/payee_response.rb +54 -19
- data/lib/ynab/models/payee_response_data.rb +54 -19
- data/lib/ynab/models/payees_response.rb +54 -19
- data/lib/ynab/models/payees_response_data.rb +55 -20
- data/lib/ynab/models/post_account_wrapper.rb +54 -19
- data/lib/ynab/models/post_transactions_wrapper.rb +55 -20
- data/lib/ynab/models/put_transaction_wrapper.rb +54 -19
- data/lib/ynab/models/save_account.rb +78 -21
- data/lib/ynab/models/save_category_response.rb +54 -19
- data/lib/ynab/models/save_category_response_data.rb +55 -20
- data/lib/ynab/models/save_month_category.rb +54 -19
- data/lib/ynab/models/save_sub_transaction.rb +62 -23
- data/lib/ynab/models/save_transaction.rb +89 -34
- data/lib/ynab/models/save_transaction_with_id.rb +103 -47
- 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 +82 -34
- data/lib/ynab/models/save_transactions_response.rb +54 -19
- data/lib/ynab/models/save_transactions_response_data.rb +58 -24
- data/lib/ynab/models/scheduled_sub_transaction.rb +67 -28
- data/lib/ynab/models/scheduled_transaction_detail.rb +96 -37
- data/lib/ynab/models/scheduled_transaction_detail_all_of.rb +262 -0
- data/lib/ynab/models/scheduled_transaction_response.rb +54 -19
- data/lib/ynab/models/scheduled_transaction_response_data.rb +54 -19
- data/lib/ynab/models/scheduled_transaction_summary.rb +81 -33
- data/lib/ynab/models/scheduled_transactions_response.rb +54 -19
- data/lib/ynab/models/scheduled_transactions_response_data.rb +55 -20
- data/lib/ynab/models/sub_transaction.rb +72 -30
- data/lib/ynab/models/transaction_detail.rb +114 -45
- data/lib/ynab/models/{save_transaction_wrapper.rb → transaction_detail_all_of.rb} +102 -29
- data/lib/ynab/models/transaction_response.rb +54 -19
- data/lib/ynab/models/transaction_response_data.rb +54 -19
- data/lib/ynab/models/transaction_summary.rb +99 -41
- data/lib/ynab/models/transactions_import_response.rb +54 -19
- data/lib/ynab/models/transactions_import_response_data.rb +54 -19
- data/lib/ynab/models/transactions_response.rb +54 -19
- data/lib/ynab/models/transactions_response_data.rb +55 -20
- data/lib/ynab/models/user.rb +54 -19
- data/lib/ynab/models/user_response.rb +54 -19
- data/lib/ynab/models/user_response_data.rb +54 -19
- data/lib/ynab/version.rb +1 -1
- data/lib/ynab.rb +21 -16
- 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 +197 -90
- 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/category.rb
CHANGED
@@ -1,16 +1,17 @@
|
|
1
1
|
=begin
|
2
2
|
#YNAB API Endpoints
|
3
3
|
|
4
|
-
#Our API uses a REST based design, leverages the JSON data format, and relies upon HTTPS for transport. We respond with meaningful HTTP response codes and if an error occurs, we include error details in the response body. API Documentation is at https://api.
|
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 Category
|
@@ -18,12 +19,14 @@ module YNAB
|
|
18
19
|
|
19
20
|
attr_accessor :category_group_id
|
20
21
|
|
22
|
+
attr_accessor :category_group_name
|
23
|
+
|
21
24
|
attr_accessor :name
|
22
25
|
|
23
26
|
# Whether or not the category is hidden
|
24
27
|
attr_accessor :hidden
|
25
28
|
|
26
|
-
#
|
29
|
+
# DEPRECATED: No longer used. Value will always be null.
|
27
30
|
attr_accessor :original_category_group_id
|
28
31
|
|
29
32
|
attr_accessor :note
|
@@ -40,13 +43,13 @@ module YNAB
|
|
40
43
|
# The type of goal, if the category has a goal (TB='Target Category Balance', TBD='Target Category Balance by Date', MF='Monthly Funding', NEED='Plan Your Spending')
|
41
44
|
attr_accessor :goal_type
|
42
45
|
|
43
|
-
#
|
46
|
+
# A day offset modifier for the goal's due date. When goal_cadence is 2 (Weekly), this value specifies which day of the week the goal is due (0 = Sunday, 6 = Saturday). Otherwise, this value specifies which day of the month the goal is due (1 = 1st, 31 = 31st, null = Last day of Month).
|
44
47
|
attr_accessor :goal_day
|
45
48
|
|
46
|
-
# The goal cadence
|
49
|
+
# The goal cadence. Value in range 0-14. There are two subsets of these values which behave differently. For values 0, 1, 2, and 13, the goal's due date repeats every goal_cadence * goal_cadence_frequency, where 0 = None, 1 = Monthly, 2 = Weekly, and 13 = Yearly. For example, goal_cadence 1 with goal_cadence_frequency 2 means the goal is due every other month. For values 3-12 and 14, goal_cadence_frequency is ignored and the goal's due date repeats every goal_cadence, where 3 = Every 2 Months, 4 = Every 3 Months, ..., 12 = Every 11 Months, and 14 = Every 2 Years.
|
47
50
|
attr_accessor :goal_cadence
|
48
51
|
|
49
|
-
# The goal cadence frequency
|
52
|
+
# The goal cadence frequency. When goal_cadence is 0, 1, 2, or 13, a goal's due date repeats every goal_cadence * goal_cadence_frequency. For example, goal_cadence 1 with goal_cadence_frequency 2 means the goal is due every other month. When goal_cadence is 3-12 or 14, goal_cadence_frequency is ignored.
|
50
53
|
attr_accessor :goal_cadence_frequency
|
51
54
|
|
52
55
|
# The month a goal was created
|
@@ -64,7 +67,7 @@ module YNAB
|
|
64
67
|
# The number of months, including the current month, left in the current goal period.
|
65
68
|
attr_accessor :goal_months_to_budget
|
66
69
|
|
67
|
-
# The amount of funding still needed in the current month to stay on track towards completing the goal within the current goal period.
|
70
|
+
# The amount of funding still needed in the current month to stay on track towards completing the goal within the current goal period. This amount will generally correspond to the 'Underfunded' amount in the web and mobile clients except when viewing a category with a Needed for Spending Goal in a future month. The web and mobile clients will ignore any funding from a prior goal period when viewing category with a Needed for Spending Goal in a future month.
|
68
71
|
attr_accessor :goal_under_funded
|
69
72
|
|
70
73
|
# The total amount funded towards the goal within the current goal period.
|
@@ -103,6 +106,7 @@ module YNAB
|
|
103
106
|
{
|
104
107
|
:'id' => :'id',
|
105
108
|
:'category_group_id' => :'category_group_id',
|
109
|
+
:'category_group_name' => :'category_group_name',
|
106
110
|
:'name' => :'name',
|
107
111
|
:'hidden' => :'hidden',
|
108
112
|
:'original_category_group_id' => :'original_category_group_id',
|
@@ -126,13 +130,19 @@ module YNAB
|
|
126
130
|
}
|
127
131
|
end
|
128
132
|
|
133
|
+
# Returns all the JSON keys this model knows about
|
134
|
+
def self.acceptable_attributes
|
135
|
+
attribute_map.values
|
136
|
+
end
|
137
|
+
|
129
138
|
# Attribute type mapping.
|
130
|
-
def self.
|
139
|
+
def self.openapi_types
|
131
140
|
{
|
132
141
|
:'id' => :'String',
|
133
142
|
:'category_group_id' => :'String',
|
143
|
+
:'category_group_name' => :'String',
|
134
144
|
:'name' => :'String',
|
135
|
-
:'hidden' => :'
|
145
|
+
:'hidden' => :'Boolean',
|
136
146
|
:'original_category_group_id' => :'String',
|
137
147
|
:'note' => :'String',
|
138
148
|
:'budgeted' => :'Integer',
|
@@ -150,103 +160,134 @@ module YNAB
|
|
150
160
|
:'goal_under_funded' => :'Integer',
|
151
161
|
:'goal_overall_funded' => :'Integer',
|
152
162
|
:'goal_overall_left' => :'Integer',
|
153
|
-
:'deleted' => :'
|
163
|
+
:'deleted' => :'Boolean'
|
154
164
|
}
|
155
165
|
end
|
156
166
|
|
167
|
+
# List of attributes with nullable: true
|
168
|
+
def self.openapi_nullable
|
169
|
+
Set.new([
|
170
|
+
:'original_category_group_id',
|
171
|
+
:'note',
|
172
|
+
:'goal_type',
|
173
|
+
:'goal_day',
|
174
|
+
:'goal_cadence',
|
175
|
+
:'goal_cadence_frequency',
|
176
|
+
:'goal_creation_month',
|
177
|
+
:'goal_target',
|
178
|
+
:'goal_target_month',
|
179
|
+
:'goal_percentage_complete',
|
180
|
+
:'goal_months_to_budget',
|
181
|
+
:'goal_under_funded',
|
182
|
+
:'goal_overall_funded',
|
183
|
+
:'goal_overall_left',
|
184
|
+
])
|
185
|
+
end
|
186
|
+
|
157
187
|
# Initializes the object
|
158
188
|
# @param [Hash] attributes Model attributes in the form of hash
|
159
189
|
def initialize(attributes = {})
|
160
|
-
|
190
|
+
if (!attributes.is_a?(Hash))
|
191
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `YNAB::Category` initialize method"
|
192
|
+
end
|
161
193
|
|
162
|
-
# convert string to symbol for hash key
|
163
|
-
attributes = attributes.each_with_object({}) { |(k, v), h|
|
194
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
195
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
196
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
197
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `YNAB::Category`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
198
|
+
end
|
199
|
+
h[k.to_sym] = v
|
200
|
+
}
|
164
201
|
|
165
|
-
if attributes.
|
202
|
+
if attributes.key?(:'id')
|
166
203
|
self.id = attributes[:'id']
|
167
204
|
end
|
168
205
|
|
169
|
-
if attributes.
|
206
|
+
if attributes.key?(:'category_group_id')
|
170
207
|
self.category_group_id = attributes[:'category_group_id']
|
171
208
|
end
|
172
209
|
|
173
|
-
if attributes.
|
210
|
+
if attributes.key?(:'category_group_name')
|
211
|
+
self.category_group_name = attributes[:'category_group_name']
|
212
|
+
end
|
213
|
+
|
214
|
+
if attributes.key?(:'name')
|
174
215
|
self.name = attributes[:'name']
|
175
216
|
end
|
176
217
|
|
177
|
-
if attributes.
|
218
|
+
if attributes.key?(:'hidden')
|
178
219
|
self.hidden = attributes[:'hidden']
|
179
220
|
end
|
180
221
|
|
181
|
-
if attributes.
|
222
|
+
if attributes.key?(:'original_category_group_id')
|
182
223
|
self.original_category_group_id = attributes[:'original_category_group_id']
|
183
224
|
end
|
184
225
|
|
185
|
-
if attributes.
|
226
|
+
if attributes.key?(:'note')
|
186
227
|
self.note = attributes[:'note']
|
187
228
|
end
|
188
229
|
|
189
|
-
if attributes.
|
230
|
+
if attributes.key?(:'budgeted')
|
190
231
|
self.budgeted = attributes[:'budgeted']
|
191
232
|
end
|
192
233
|
|
193
|
-
if attributes.
|
234
|
+
if attributes.key?(:'activity')
|
194
235
|
self.activity = attributes[:'activity']
|
195
236
|
end
|
196
237
|
|
197
|
-
if attributes.
|
238
|
+
if attributes.key?(:'balance')
|
198
239
|
self.balance = attributes[:'balance']
|
199
240
|
end
|
200
241
|
|
201
|
-
if attributes.
|
242
|
+
if attributes.key?(:'goal_type')
|
202
243
|
self.goal_type = attributes[:'goal_type']
|
203
244
|
end
|
204
245
|
|
205
|
-
if attributes.
|
246
|
+
if attributes.key?(:'goal_day')
|
206
247
|
self.goal_day = attributes[:'goal_day']
|
207
248
|
end
|
208
249
|
|
209
|
-
if attributes.
|
250
|
+
if attributes.key?(:'goal_cadence')
|
210
251
|
self.goal_cadence = attributes[:'goal_cadence']
|
211
252
|
end
|
212
253
|
|
213
|
-
if attributes.
|
254
|
+
if attributes.key?(:'goal_cadence_frequency')
|
214
255
|
self.goal_cadence_frequency = attributes[:'goal_cadence_frequency']
|
215
256
|
end
|
216
257
|
|
217
|
-
if attributes.
|
258
|
+
if attributes.key?(:'goal_creation_month')
|
218
259
|
self.goal_creation_month = attributes[:'goal_creation_month']
|
219
260
|
end
|
220
261
|
|
221
|
-
if attributes.
|
262
|
+
if attributes.key?(:'goal_target')
|
222
263
|
self.goal_target = attributes[:'goal_target']
|
223
264
|
end
|
224
265
|
|
225
|
-
if attributes.
|
266
|
+
if attributes.key?(:'goal_target_month')
|
226
267
|
self.goal_target_month = attributes[:'goal_target_month']
|
227
268
|
end
|
228
269
|
|
229
|
-
if attributes.
|
270
|
+
if attributes.key?(:'goal_percentage_complete')
|
230
271
|
self.goal_percentage_complete = attributes[:'goal_percentage_complete']
|
231
272
|
end
|
232
273
|
|
233
|
-
if attributes.
|
274
|
+
if attributes.key?(:'goal_months_to_budget')
|
234
275
|
self.goal_months_to_budget = attributes[:'goal_months_to_budget']
|
235
276
|
end
|
236
277
|
|
237
|
-
if attributes.
|
278
|
+
if attributes.key?(:'goal_under_funded')
|
238
279
|
self.goal_under_funded = attributes[:'goal_under_funded']
|
239
280
|
end
|
240
281
|
|
241
|
-
if attributes.
|
282
|
+
if attributes.key?(:'goal_overall_funded')
|
242
283
|
self.goal_overall_funded = attributes[:'goal_overall_funded']
|
243
284
|
end
|
244
285
|
|
245
|
-
if attributes.
|
286
|
+
if attributes.key?(:'goal_overall_left')
|
246
287
|
self.goal_overall_left = attributes[:'goal_overall_left']
|
247
288
|
end
|
248
289
|
|
249
|
-
if attributes.
|
290
|
+
if attributes.key?(:'deleted')
|
250
291
|
self.deleted = attributes[:'deleted']
|
251
292
|
end
|
252
293
|
end
|
@@ -300,7 +341,7 @@ module YNAB
|
|
300
341
|
return false if @budgeted.nil?
|
301
342
|
return false if @activity.nil?
|
302
343
|
return false if @balance.nil?
|
303
|
-
goal_type_validator = EnumAttributeValidator.new('String', [
|
344
|
+
goal_type_validator = EnumAttributeValidator.new('String', ["TB", "TBD", "MF", "NEED", "DEBT", "null"])
|
304
345
|
return false unless goal_type_validator.valid?(@goal_type)
|
305
346
|
return false if @deleted.nil?
|
306
347
|
true
|
@@ -309,6 +350,10 @@ module YNAB
|
|
309
350
|
# Custom attribute writer method checking allowed values (enum).
|
310
351
|
# @param [Object] goal_type Object to be assigned
|
311
352
|
def goal_type=(goal_type)
|
353
|
+
validator = EnumAttributeValidator.new('String', ["TB", "TBD", "MF", "NEED", "DEBT", "null"])
|
354
|
+
unless validator.valid?(goal_type)
|
355
|
+
fail ArgumentError, "invalid value for \"goal_type\", must be one of #{validator.allowable_values}."
|
356
|
+
end
|
312
357
|
@goal_type = goal_type
|
313
358
|
end
|
314
359
|
|
@@ -319,6 +364,7 @@ module YNAB
|
|
319
364
|
self.class == o.class &&
|
320
365
|
id == o.id &&
|
321
366
|
category_group_id == o.category_group_id &&
|
367
|
+
category_group_name == o.category_group_name &&
|
322
368
|
name == o.name &&
|
323
369
|
hidden == o.hidden &&
|
324
370
|
original_category_group_id == o.original_category_group_id &&
|
@@ -348,17 +394,28 @@ module YNAB
|
|
348
394
|
end
|
349
395
|
|
350
396
|
# Calculates hash code according to all attributes.
|
351
|
-
# @return [
|
397
|
+
# @return [Integer] Hash code
|
352
398
|
def hash
|
353
|
-
[id, category_group_id, name, hidden, original_category_group_id, note, budgeted, activity, balance, goal_type, goal_day, goal_cadence, goal_cadence_frequency, goal_creation_month, goal_target, goal_target_month, goal_percentage_complete, goal_months_to_budget, goal_under_funded, goal_overall_funded, goal_overall_left, deleted].hash
|
399
|
+
[id, category_group_id, category_group_name, name, hidden, original_category_group_id, note, budgeted, activity, balance, goal_type, goal_day, goal_cadence, goal_cadence_frequency, goal_creation_month, goal_target, goal_target_month, goal_percentage_complete, goal_months_to_budget, goal_under_funded, goal_overall_funded, goal_overall_left, deleted].hash
|
400
|
+
end
|
401
|
+
|
402
|
+
# Builds the object from hash
|
403
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
404
|
+
# @return [Object] Returns the model itself
|
405
|
+
def self.build_from_hash(attributes)
|
406
|
+
new.build_from_hash(attributes)
|
354
407
|
end
|
408
|
+
|
355
409
|
# Builds the object from hash
|
356
410
|
# @param [Hash] attributes Model attributes in the form of hash
|
357
411
|
# @return [Object] Returns the model itself
|
358
412
|
def build_from_hash(attributes)
|
359
413
|
return nil unless attributes.is_a?(Hash)
|
360
|
-
|
361
|
-
|
414
|
+
attributes = attributes.transform_keys(&:to_sym)
|
415
|
+
self.class.openapi_types.each_pair do |key, type|
|
416
|
+
if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
|
417
|
+
self.send("#{key}=", nil)
|
418
|
+
elsif type =~ /\AArray<(.*)>/i
|
362
419
|
# check to ensure the input is an array given that the attribute
|
363
420
|
# is documented as an array but the input is not
|
364
421
|
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
@@ -366,7 +423,7 @@ module YNAB
|
|
366
423
|
end
|
367
424
|
elsif !attributes[self.class.attribute_map[key]].nil?
|
368
425
|
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
369
|
-
end
|
426
|
+
end
|
370
427
|
end
|
371
428
|
|
372
429
|
self
|
@@ -378,8 +435,8 @@ module YNAB
|
|
378
435
|
# @return [Object] Deserialized data
|
379
436
|
def _deserialize(type, value)
|
380
437
|
case type.to_sym
|
381
|
-
when :
|
382
|
-
|
438
|
+
when :Time
|
439
|
+
Time.parse(value)
|
383
440
|
when :Date
|
384
441
|
Date.parse(value)
|
385
442
|
when :String
|
@@ -388,7 +445,7 @@ module YNAB
|
|
388
445
|
value.to_i
|
389
446
|
when :Float
|
390
447
|
value.to_f
|
391
|
-
when :
|
448
|
+
when :Boolean
|
392
449
|
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
393
450
|
true
|
394
451
|
else
|
@@ -409,8 +466,9 @@ module YNAB
|
|
409
466
|
end
|
410
467
|
end
|
411
468
|
else # model
|
412
|
-
|
413
|
-
|
469
|
+
# models (e.g. Pet) or oneOf
|
470
|
+
klass = YNAB.const_get(type)
|
471
|
+
klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
414
472
|
end
|
415
473
|
end
|
416
474
|
|
@@ -432,7 +490,11 @@ module YNAB
|
|
432
490
|
hash = {}
|
433
491
|
self.class.attribute_map.each_pair do |attr, param|
|
434
492
|
value = self.send(attr)
|
435
|
-
|
493
|
+
if value.nil?
|
494
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
495
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
496
|
+
end
|
497
|
+
|
436
498
|
hash[param] = _to_hash(value)
|
437
499
|
end
|
438
500
|
hash
|
@@ -1,16 +1,17 @@
|
|
1
1
|
=begin
|
2
2
|
#YNAB API Endpoints
|
3
3
|
|
4
|
-
#Our API uses a REST based design, leverages the JSON data format, and relies upon HTTPS for transport. We respond with meaningful HTTP response codes and if an error occurs, we include error details in the response body. API Documentation is at https://api.
|
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 CategoryGroup
|
@@ -34,37 +35,55 @@ module YNAB
|
|
34
35
|
}
|
35
36
|
end
|
36
37
|
|
38
|
+
# Returns all the JSON keys this model knows about
|
39
|
+
def self.acceptable_attributes
|
40
|
+
attribute_map.values
|
41
|
+
end
|
42
|
+
|
37
43
|
# Attribute type mapping.
|
38
|
-
def self.
|
44
|
+
def self.openapi_types
|
39
45
|
{
|
40
46
|
:'id' => :'String',
|
41
47
|
:'name' => :'String',
|
42
|
-
:'hidden' => :'
|
43
|
-
:'deleted' => :'
|
48
|
+
:'hidden' => :'Boolean',
|
49
|
+
:'deleted' => :'Boolean'
|
44
50
|
}
|
45
51
|
end
|
46
52
|
|
53
|
+
# List of attributes with nullable: true
|
54
|
+
def self.openapi_nullable
|
55
|
+
Set.new([
|
56
|
+
])
|
57
|
+
end
|
58
|
+
|
47
59
|
# Initializes the object
|
48
60
|
# @param [Hash] attributes Model attributes in the form of hash
|
49
61
|
def initialize(attributes = {})
|
50
|
-
|
62
|
+
if (!attributes.is_a?(Hash))
|
63
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `YNAB::CategoryGroup` initialize method"
|
64
|
+
end
|
51
65
|
|
52
|
-
# convert string to symbol for hash key
|
53
|
-
attributes = attributes.each_with_object({}) { |(k, v), h|
|
66
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
67
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
68
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
69
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `YNAB::CategoryGroup`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
70
|
+
end
|
71
|
+
h[k.to_sym] = v
|
72
|
+
}
|
54
73
|
|
55
|
-
if attributes.
|
74
|
+
if attributes.key?(:'id')
|
56
75
|
self.id = attributes[:'id']
|
57
76
|
end
|
58
77
|
|
59
|
-
if attributes.
|
78
|
+
if attributes.key?(:'name')
|
60
79
|
self.name = attributes[:'name']
|
61
80
|
end
|
62
81
|
|
63
|
-
if attributes.
|
82
|
+
if attributes.key?(:'hidden')
|
64
83
|
self.hidden = attributes[:'hidden']
|
65
84
|
end
|
66
85
|
|
67
|
-
if attributes.
|
86
|
+
if attributes.key?(:'deleted')
|
68
87
|
self.deleted = attributes[:'deleted']
|
69
88
|
end
|
70
89
|
end
|
@@ -120,17 +139,28 @@ module YNAB
|
|
120
139
|
end
|
121
140
|
|
122
141
|
# Calculates hash code according to all attributes.
|
123
|
-
# @return [
|
142
|
+
# @return [Integer] Hash code
|
124
143
|
def hash
|
125
144
|
[id, name, hidden, deleted].hash
|
126
145
|
end
|
146
|
+
|
147
|
+
# Builds the object from hash
|
148
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
149
|
+
# @return [Object] Returns the model itself
|
150
|
+
def self.build_from_hash(attributes)
|
151
|
+
new.build_from_hash(attributes)
|
152
|
+
end
|
153
|
+
|
127
154
|
# Builds the object from hash
|
128
155
|
# @param [Hash] attributes Model attributes in the form of hash
|
129
156
|
# @return [Object] Returns the model itself
|
130
157
|
def build_from_hash(attributes)
|
131
158
|
return nil unless attributes.is_a?(Hash)
|
132
|
-
|
133
|
-
|
159
|
+
attributes = attributes.transform_keys(&:to_sym)
|
160
|
+
self.class.openapi_types.each_pair do |key, type|
|
161
|
+
if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
|
162
|
+
self.send("#{key}=", nil)
|
163
|
+
elsif type =~ /\AArray<(.*)>/i
|
134
164
|
# check to ensure the input is an array given that the attribute
|
135
165
|
# is documented as an array but the input is not
|
136
166
|
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
@@ -138,7 +168,7 @@ module YNAB
|
|
138
168
|
end
|
139
169
|
elsif !attributes[self.class.attribute_map[key]].nil?
|
140
170
|
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
141
|
-
end
|
171
|
+
end
|
142
172
|
end
|
143
173
|
|
144
174
|
self
|
@@ -150,8 +180,8 @@ module YNAB
|
|
150
180
|
# @return [Object] Deserialized data
|
151
181
|
def _deserialize(type, value)
|
152
182
|
case type.to_sym
|
153
|
-
when :
|
154
|
-
|
183
|
+
when :Time
|
184
|
+
Time.parse(value)
|
155
185
|
when :Date
|
156
186
|
Date.parse(value)
|
157
187
|
when :String
|
@@ -160,7 +190,7 @@ module YNAB
|
|
160
190
|
value.to_i
|
161
191
|
when :Float
|
162
192
|
value.to_f
|
163
|
-
when :
|
193
|
+
when :Boolean
|
164
194
|
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
165
195
|
true
|
166
196
|
else
|
@@ -181,8 +211,9 @@ module YNAB
|
|
181
211
|
end
|
182
212
|
end
|
183
213
|
else # model
|
184
|
-
|
185
|
-
|
214
|
+
# models (e.g. Pet) or oneOf
|
215
|
+
klass = YNAB.const_get(type)
|
216
|
+
klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
186
217
|
end
|
187
218
|
end
|
188
219
|
|
@@ -204,7 +235,11 @@ module YNAB
|
|
204
235
|
hash = {}
|
205
236
|
self.class.attribute_map.each_pair do |attr, param|
|
206
237
|
value = self.send(attr)
|
207
|
-
|
238
|
+
if value.nil?
|
239
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
240
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
241
|
+
end
|
242
|
+
|
208
243
|
hash[param] = _to_hash(value)
|
209
244
|
end
|
210
245
|
hash
|