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
@@ -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 CategoryGroupWithCategories
|
@@ -38,42 +39,68 @@ module YNAB
|
|
38
39
|
}
|
39
40
|
end
|
40
41
|
|
42
|
+
# Returns all the JSON keys this model knows about
|
43
|
+
def self.acceptable_attributes
|
44
|
+
attribute_map.values
|
45
|
+
end
|
46
|
+
|
41
47
|
# Attribute type mapping.
|
42
|
-
def self.
|
48
|
+
def self.openapi_types
|
43
49
|
{
|
44
50
|
:'id' => :'String',
|
45
51
|
:'name' => :'String',
|
46
|
-
:'hidden' => :'
|
47
|
-
:'deleted' => :'
|
52
|
+
:'hidden' => :'Boolean',
|
53
|
+
:'deleted' => :'Boolean',
|
48
54
|
:'categories' => :'Array<Category>'
|
49
55
|
}
|
50
56
|
end
|
51
57
|
|
58
|
+
# List of attributes with nullable: true
|
59
|
+
def self.openapi_nullable
|
60
|
+
Set.new([
|
61
|
+
])
|
62
|
+
end
|
63
|
+
|
64
|
+
# List of class defined in allOf (OpenAPI v3)
|
65
|
+
def self.openapi_all_of
|
66
|
+
[
|
67
|
+
:'CategoryGroup',
|
68
|
+
:'CategoryGroupWithCategoriesAllOf'
|
69
|
+
]
|
70
|
+
end
|
71
|
+
|
52
72
|
# Initializes the object
|
53
73
|
# @param [Hash] attributes Model attributes in the form of hash
|
54
74
|
def initialize(attributes = {})
|
55
|
-
|
75
|
+
if (!attributes.is_a?(Hash))
|
76
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `YNAB::CategoryGroupWithCategories` initialize method"
|
77
|
+
end
|
56
78
|
|
57
|
-
# convert string to symbol for hash key
|
58
|
-
attributes = attributes.each_with_object({}) { |(k, v), h|
|
79
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
80
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
81
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
82
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `YNAB::CategoryGroupWithCategories`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
83
|
+
end
|
84
|
+
h[k.to_sym] = v
|
85
|
+
}
|
59
86
|
|
60
|
-
if attributes.
|
87
|
+
if attributes.key?(:'id')
|
61
88
|
self.id = attributes[:'id']
|
62
89
|
end
|
63
90
|
|
64
|
-
if attributes.
|
91
|
+
if attributes.key?(:'name')
|
65
92
|
self.name = attributes[:'name']
|
66
93
|
end
|
67
94
|
|
68
|
-
if attributes.
|
95
|
+
if attributes.key?(:'hidden')
|
69
96
|
self.hidden = attributes[:'hidden']
|
70
97
|
end
|
71
98
|
|
72
|
-
if attributes.
|
99
|
+
if attributes.key?(:'deleted')
|
73
100
|
self.deleted = attributes[:'deleted']
|
74
101
|
end
|
75
102
|
|
76
|
-
if attributes.
|
103
|
+
if attributes.key?(:'categories')
|
77
104
|
if (value = attributes[:'categories']).is_a?(Array)
|
78
105
|
self.categories = value
|
79
106
|
end
|
@@ -137,17 +164,28 @@ module YNAB
|
|
137
164
|
end
|
138
165
|
|
139
166
|
# Calculates hash code according to all attributes.
|
140
|
-
# @return [
|
167
|
+
# @return [Integer] Hash code
|
141
168
|
def hash
|
142
169
|
[id, name, hidden, deleted, categories].hash
|
143
170
|
end
|
171
|
+
|
172
|
+
# Builds the object from hash
|
173
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
174
|
+
# @return [Object] Returns the model itself
|
175
|
+
def self.build_from_hash(attributes)
|
176
|
+
new.build_from_hash(attributes)
|
177
|
+
end
|
178
|
+
|
144
179
|
# Builds the object from hash
|
145
180
|
# @param [Hash] attributes Model attributes in the form of hash
|
146
181
|
# @return [Object] Returns the model itself
|
147
182
|
def build_from_hash(attributes)
|
148
183
|
return nil unless attributes.is_a?(Hash)
|
149
|
-
|
150
|
-
|
184
|
+
attributes = attributes.transform_keys(&:to_sym)
|
185
|
+
self.class.openapi_types.each_pair do |key, type|
|
186
|
+
if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
|
187
|
+
self.send("#{key}=", nil)
|
188
|
+
elsif type =~ /\AArray<(.*)>/i
|
151
189
|
# check to ensure the input is an array given that the attribute
|
152
190
|
# is documented as an array but the input is not
|
153
191
|
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
@@ -155,7 +193,7 @@ module YNAB
|
|
155
193
|
end
|
156
194
|
elsif !attributes[self.class.attribute_map[key]].nil?
|
157
195
|
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
158
|
-
end
|
196
|
+
end
|
159
197
|
end
|
160
198
|
|
161
199
|
self
|
@@ -167,8 +205,8 @@ module YNAB
|
|
167
205
|
# @return [Object] Deserialized data
|
168
206
|
def _deserialize(type, value)
|
169
207
|
case type.to_sym
|
170
|
-
when :
|
171
|
-
|
208
|
+
when :Time
|
209
|
+
Time.parse(value)
|
172
210
|
when :Date
|
173
211
|
Date.parse(value)
|
174
212
|
when :String
|
@@ -177,7 +215,7 @@ module YNAB
|
|
177
215
|
value.to_i
|
178
216
|
when :Float
|
179
217
|
value.to_f
|
180
|
-
when :
|
218
|
+
when :Boolean
|
181
219
|
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
182
220
|
true
|
183
221
|
else
|
@@ -198,8 +236,9 @@ module YNAB
|
|
198
236
|
end
|
199
237
|
end
|
200
238
|
else # model
|
201
|
-
|
202
|
-
|
239
|
+
# models (e.g. Pet) or oneOf
|
240
|
+
klass = YNAB.const_get(type)
|
241
|
+
klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
203
242
|
end
|
204
243
|
end
|
205
244
|
|
@@ -221,7 +260,11 @@ module YNAB
|
|
221
260
|
hash = {}
|
222
261
|
self.class.attribute_map.each_pair do |attr, param|
|
223
262
|
value = self.send(attr)
|
224
|
-
|
263
|
+
if value.nil?
|
264
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
265
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
266
|
+
end
|
267
|
+
|
225
268
|
hash[param] = _to_hash(value)
|
226
269
|
end
|
227
270
|
hash
|
data/lib/ynab/models/{save_month_category_wrapper.rb → category_group_with_categories_all_of.rb}
RENAMED
@@ -1,45 +1,67 @@
|
|
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
|
-
class
|
17
|
-
|
17
|
+
class CategoryGroupWithCategoriesAllOf
|
18
|
+
# Category group categories. Amounts (budgeted, activity, balance, etc.) are specific to the current budget month (UTC).
|
19
|
+
attr_accessor :categories
|
18
20
|
|
19
21
|
# Attribute mapping from ruby-style variable name to JSON key.
|
20
22
|
def self.attribute_map
|
21
23
|
{
|
22
|
-
:'
|
24
|
+
:'categories' => :'categories'
|
23
25
|
}
|
24
26
|
end
|
25
27
|
|
28
|
+
# Returns all the JSON keys this model knows about
|
29
|
+
def self.acceptable_attributes
|
30
|
+
attribute_map.values
|
31
|
+
end
|
32
|
+
|
26
33
|
# Attribute type mapping.
|
27
|
-
def self.
|
34
|
+
def self.openapi_types
|
28
35
|
{
|
29
|
-
:'
|
36
|
+
:'categories' => :'Array<Category>'
|
30
37
|
}
|
31
38
|
end
|
32
39
|
|
40
|
+
# List of attributes with nullable: true
|
41
|
+
def self.openapi_nullable
|
42
|
+
Set.new([
|
43
|
+
])
|
44
|
+
end
|
45
|
+
|
33
46
|
# Initializes the object
|
34
47
|
# @param [Hash] attributes Model attributes in the form of hash
|
35
48
|
def initialize(attributes = {})
|
36
|
-
|
49
|
+
if (!attributes.is_a?(Hash))
|
50
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `YNAB::CategoryGroupWithCategoriesAllOf` initialize method"
|
51
|
+
end
|
37
52
|
|
38
|
-
# convert string to symbol for hash key
|
39
|
-
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::CategoryGroupWithCategoriesAllOf`. 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
|
+
}
|
40
60
|
|
41
|
-
if attributes.
|
42
|
-
|
61
|
+
if attributes.key?(:'categories')
|
62
|
+
if (value = attributes[:'categories']).is_a?(Array)
|
63
|
+
self.categories = value
|
64
|
+
end
|
43
65
|
end
|
44
66
|
end
|
45
67
|
|
@@ -47,8 +69,8 @@ module YNAB
|
|
47
69
|
# @return Array for valid properties with the reasons
|
48
70
|
def list_invalid_properties
|
49
71
|
invalid_properties = Array.new
|
50
|
-
if @
|
51
|
-
invalid_properties.push('invalid value for "
|
72
|
+
if @categories.nil?
|
73
|
+
invalid_properties.push('invalid value for "categories", categories cannot be nil.')
|
52
74
|
end
|
53
75
|
|
54
76
|
invalid_properties
|
@@ -57,7 +79,7 @@ module YNAB
|
|
57
79
|
# Check to see if the all the properties in the model are valid
|
58
80
|
# @return true if the model is valid
|
59
81
|
def valid?
|
60
|
-
return false if @
|
82
|
+
return false if @categories.nil?
|
61
83
|
true
|
62
84
|
end
|
63
85
|
|
@@ -66,7 +88,7 @@ module YNAB
|
|
66
88
|
def ==(o)
|
67
89
|
return true if self.equal?(o)
|
68
90
|
self.class == o.class &&
|
69
|
-
|
91
|
+
categories == o.categories
|
70
92
|
end
|
71
93
|
|
72
94
|
# @see the `==` method
|
@@ -76,17 +98,28 @@ module YNAB
|
|
76
98
|
end
|
77
99
|
|
78
100
|
# Calculates hash code according to all attributes.
|
79
|
-
# @return [
|
101
|
+
# @return [Integer] Hash code
|
80
102
|
def hash
|
81
|
-
[
|
103
|
+
[categories].hash
|
82
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
|
+
|
83
113
|
# Builds the object from hash
|
84
114
|
# @param [Hash] attributes Model attributes in the form of hash
|
85
115
|
# @return [Object] Returns the model itself
|
86
116
|
def build_from_hash(attributes)
|
87
117
|
return nil unless attributes.is_a?(Hash)
|
88
|
-
|
89
|
-
|
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
|
90
123
|
# check to ensure the input is an array given that the attribute
|
91
124
|
# is documented as an array but the input is not
|
92
125
|
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
@@ -94,7 +127,7 @@ module YNAB
|
|
94
127
|
end
|
95
128
|
elsif !attributes[self.class.attribute_map[key]].nil?
|
96
129
|
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
97
|
-
end
|
130
|
+
end
|
98
131
|
end
|
99
132
|
|
100
133
|
self
|
@@ -106,8 +139,8 @@ module YNAB
|
|
106
139
|
# @return [Object] Deserialized data
|
107
140
|
def _deserialize(type, value)
|
108
141
|
case type.to_sym
|
109
|
-
when :
|
110
|
-
|
142
|
+
when :Time
|
143
|
+
Time.parse(value)
|
111
144
|
when :Date
|
112
145
|
Date.parse(value)
|
113
146
|
when :String
|
@@ -116,7 +149,7 @@ module YNAB
|
|
116
149
|
value.to_i
|
117
150
|
when :Float
|
118
151
|
value.to_f
|
119
|
-
when :
|
152
|
+
when :Boolean
|
120
153
|
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
121
154
|
true
|
122
155
|
else
|
@@ -137,8 +170,9 @@ module YNAB
|
|
137
170
|
end
|
138
171
|
end
|
139
172
|
else # model
|
140
|
-
|
141
|
-
|
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)
|
142
176
|
end
|
143
177
|
end
|
144
178
|
|
@@ -160,7 +194,11 @@ module YNAB
|
|
160
194
|
hash = {}
|
161
195
|
self.class.attribute_map.each_pair do |attr, param|
|
162
196
|
value = self.send(attr)
|
163
|
-
|
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
|
+
|
164
202
|
hash[param] = _to_hash(value)
|
165
203
|
end
|
166
204
|
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 CategoryResponse
|
@@ -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' => :'CategoryResponseData'
|
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::CategoryResponse` 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::CategoryResponse`. 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 CategoryResponseData
|
@@ -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
|
:'category' => :'Category'
|
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::CategoryResponseData` 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::CategoryResponseData`. 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?(:'category')
|
42
61
|
self.category = attributes[:'category']
|
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
|
[category].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
|