ynab 1.31.0 → 2.0.0.rc1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/DEVELOPMENT.md +11 -0
- data/Gemfile +8 -0
- data/Gemfile.lock +42 -0
- data/README.md +3 -3
- data/Rakefile +58 -0
- data/config.json +9 -0
- data/docs/Account.md +25 -0
- data/docs/AccountResponse.md +8 -0
- data/docs/AccountResponseData.md +8 -0
- data/docs/AccountType.md +7 -0
- data/docs/AccountWrapper.md +8 -0
- data/docs/AccountsApi.md +70 -0
- data/docs/AccountsResponse.md +8 -0
- data/docs/AccountsResponseData.md +9 -0
- data/docs/AccountsWrapper.md +9 -0
- data/docs/BudgetDetail.md +24 -0
- data/docs/BudgetDetailAllOf.md +17 -0
- data/docs/BudgetDetailResponse.md +8 -0
- data/docs/BudgetDetailResponseData.md +9 -0
- data/docs/BudgetDetailWrapper.md +9 -0
- data/docs/BudgetSettings.md +9 -0
- data/docs/BudgetSettingsResponse.md +8 -0
- data/docs/BudgetSettingsResponseData.md +8 -0
- data/docs/BudgetSettingsWrapper.md +8 -0
- data/docs/BudgetSummary.md +15 -0
- data/docs/BudgetSummaryResponse.md +8 -0
- data/docs/BudgetSummaryResponseData.md +9 -0
- data/docs/BudgetSummaryWrapper.md +9 -0
- data/docs/BudgetsApi.md +68 -0
- data/docs/BulkIdWrapper.md +8 -0
- data/docs/BulkIds.md +9 -0
- data/docs/BulkResponse.md +8 -0
- data/docs/BulkResponseData.md +8 -0
- data/docs/BulkResponseDataBulk.md +9 -0
- data/docs/BulkTransactionCreateResponse.md +8 -0
- data/docs/BulkTransactionIds.md +8 -0
- data/docs/BulkTransactions.md +8 -0
- data/docs/CategoriesApi.md +94 -0
- data/docs/CategoriesResponse.md +8 -0
- data/docs/CategoriesResponseData.md +9 -0
- data/docs/Category.md +30 -0
- data/docs/CategoryGroup.md +11 -0
- data/docs/CategoryGroupWithCategories.md +12 -0
- data/docs/CategoryGroupWithCategoriesAllOf.md +8 -0
- data/docs/CategoryGroupsWrapper.md +9 -0
- data/docs/CategoryResponse.md +8 -0
- data/docs/CategoryResponseData.md +8 -0
- data/docs/CategoryWrapper.md +9 -0
- data/docs/CurrencyFormat.md +15 -0
- data/docs/DateFormat.md +8 -0
- data/docs/DeprecatedApi.md +28 -0
- data/docs/ErrorDetail.md +10 -0
- data/docs/ErrorResponse.md +8 -0
- data/docs/HybridTransaction.md +30 -0
- data/docs/HybridTransactionAllOf.md +12 -0
- data/docs/HybridTransactionsResponse.md +8 -0
- data/docs/HybridTransactionsResponseData.md +9 -0
- data/docs/HybridTransactionsWrapper.md +8 -0
- data/docs/LoanAccountPeriodicValue.md +7 -0
- data/docs/MonthDetail.md +16 -0
- data/docs/MonthDetailAllOf.md +8 -0
- data/docs/MonthDetailResponse.md +8 -0
- data/docs/MonthDetailResponseData.md +8 -0
- data/docs/MonthDetailWrapper.md +8 -0
- data/docs/MonthSummariesResponse.md +8 -0
- data/docs/MonthSummariesResponseData.md +9 -0
- data/docs/MonthSummariesWrapper.md +9 -0
- data/docs/MonthSummary.md +15 -0
- data/docs/MonthsApi.md +49 -0
- data/docs/PatchMonthCategoryWrapper.md +8 -0
- data/docs/PatchTransactionsWrapper.md +8 -0
- data/docs/Payee.md +11 -0
- data/docs/PayeeLocation.md +12 -0
- data/docs/PayeeLocationResponse.md +8 -0
- data/docs/PayeeLocationResponseData.md +8 -0
- data/docs/PayeeLocationWrapper.md +8 -0
- data/docs/PayeeLocationsApi.md +69 -0
- data/docs/PayeeLocationsResponse.md +8 -0
- data/docs/PayeeLocationsResponseData.md +8 -0
- data/docs/PayeeLocationsWrapper.md +8 -0
- data/docs/PayeeResponse.md +8 -0
- data/docs/PayeeResponseData.md +8 -0
- data/docs/PayeeWrapper.md +8 -0
- data/docs/PayeesApi.md +49 -0
- data/docs/PayeesResponse.md +8 -0
- data/docs/PayeesResponseData.md +9 -0
- data/docs/PayeesWrapper.md +9 -0
- data/docs/PostAccountWrapper.md +8 -0
- data/docs/PostTransactionsWrapper.md +9 -0
- data/docs/PutTransactionWrapper.md +8 -0
- data/docs/SaveAccount.md +10 -0
- data/docs/SaveAccountWrapper.md +8 -0
- data/docs/SaveCategoryResponse.md +8 -0
- data/docs/SaveCategoryResponseData.md +9 -0
- data/docs/SaveMonthCategory.md +8 -0
- data/docs/SaveMonthCategoryWrapper.md +8 -0
- data/docs/SaveSubTransaction.md +12 -0
- data/docs/SaveTransaction.md +19 -0
- data/docs/SaveTransactionWithId.md +20 -0
- data/docs/SaveTransactionWithIdAllOf.md +8 -0
- data/docs/SaveTransactionWithOptionalFields.md +19 -0
- data/docs/SaveTransactionWrapper.md +8 -0
- data/docs/SaveTransactionsResponse.md +8 -0
- data/docs/SaveTransactionsResponseData.md +12 -0
- data/docs/SaveTransactionsWrapper.md +9 -0
- data/docs/ScheduledSubTransaction.md +15 -0
- data/docs/ScheduledTransactionDetail.md +23 -0
- data/docs/ScheduledTransactionDetailAllOf.md +11 -0
- data/docs/ScheduledTransactionResponse.md +8 -0
- data/docs/ScheduledTransactionResponseData.md +8 -0
- data/docs/ScheduledTransactionSummary.md +19 -0
- data/docs/ScheduledTransactionWrapper.md +8 -0
- data/docs/ScheduledTransactionsApi.md +49 -0
- data/docs/ScheduledTransactionsResponse.md +8 -0
- data/docs/ScheduledTransactionsResponseData.md +9 -0
- data/docs/ScheduledTransactionsWrapper.md +8 -0
- data/docs/SubTransaction.md +18 -0
- data/docs/TransactionDetail.md +29 -0
- data/docs/TransactionDetailAllOf.md +11 -0
- data/docs/TransactionResponse.md +8 -0
- data/docs/TransactionResponseData.md +8 -0
- data/docs/TransactionSummary.md +25 -0
- data/docs/TransactionWrapper.md +8 -0
- data/docs/TransactionsApi.md +228 -0
- data/docs/TransactionsImportResponse.md +8 -0
- data/docs/TransactionsImportResponseData.md +8 -0
- data/docs/TransactionsResponse.md +8 -0
- data/docs/TransactionsResponseData.md +9 -0
- data/docs/TransactionsWrapper.md +9 -0
- data/docs/UpdateTransaction.md +20 -0
- data/docs/UpdateTransactionsWrapper.md +8 -0
- data/docs/User.md +8 -0
- data/docs/UserApi.md +25 -0
- data/docs/UserResponse.md +8 -0
- data/docs/UserResponseData.md +8 -0
- data/docs/UserWrapper.md +8 -0
- data/examples/budget-list.rb +21 -0
- data/examples/budget-month.rb +33 -0
- data/examples/category-balance.rb +23 -0
- data/examples/create-multiple-transactions.rb +42 -0
- data/examples/create-transaction.rb +30 -0
- data/examples/update-category-budgeted.rb +25 -0
- data/examples/update-multiple-transactions.rb +20 -0
- data/lib/ynab/api/accounts_api.rb +78 -41
- data/lib/ynab/api/budgets_api.rb +68 -36
- data/lib/ynab/api/categories_api.rb +108 -60
- data/lib/ynab/api/deprecated_api.rb +32 -17
- data/lib/ynab/api/months_api.rb +49 -28
- data/lib/ynab/api/payee_locations_api.rb +73 -41
- data/lib/ynab/api/payees_api.rb +49 -28
- data/lib/ynab/api/scheduled_transactions_api.rb +49 -28
- data/lib/ynab/api/transactions_api.rb +268 -140
- data/lib/ynab/api/user_api.rb +22 -12
- data/lib/ynab/api_client.rb +97 -95
- data/lib/ynab/configuration.rb +101 -14
- data/lib/ynab/models/account.rb +117 -55
- data/lib/ynab/models/account_response.rb +53 -18
- data/lib/ynab/models/account_response_data.rb +53 -18
- data/lib/ynab/models/account_type.rb +30 -20
- data/lib/ynab/models/accounts_response.rb +53 -18
- data/lib/ynab/models/accounts_response_data.rb +54 -19
- data/lib/ynab/models/budget_detail.rb +80 -35
- data/lib/ynab/models/budget_detail_all_of.rb +320 -0
- data/lib/ynab/models/budget_detail_response.rb +53 -18
- data/lib/ynab/models/budget_detail_response_data.rb +54 -19
- data/lib/ynab/models/budget_settings.rb +56 -29
- data/lib/ynab/models/budget_settings_response.rb +53 -18
- data/lib/ynab/models/budget_settings_response_data.rb +53 -18
- data/lib/ynab/models/budget_summary.rb +63 -26
- data/lib/ynab/models/budget_summary_response.rb +53 -18
- data/lib/ynab/models/budget_summary_response_data.rb +54 -20
- data/lib/ynab/models/bulk_response.rb +53 -18
- data/lib/ynab/models/bulk_response_data.rb +53 -18
- data/lib/ynab/models/bulk_response_data_bulk.rb +54 -19
- data/lib/ynab/models/bulk_transactions.rb +53 -18
- data/lib/ynab/models/categories_response.rb +53 -18
- data/lib/ynab/models/categories_response_data.rb +54 -19
- data/lib/ynab/models/category.rb +110 -48
- data/lib/ynab/models/category_group.rb +58 -23
- data/lib/ynab/models/category_group_with_categories.rb +67 -24
- data/lib/ynab/models/{save_month_category_wrapper.rb → category_group_with_categories_all_of.rb} +67 -29
- data/lib/ynab/models/category_response.rb +53 -18
- data/lib/ynab/models/category_response_data.rb +53 -18
- data/lib/ynab/models/currency_format.rb +62 -27
- data/lib/ynab/models/date_format.rb +53 -18
- data/lib/ynab/models/error_detail.rb +55 -20
- data/lib/ynab/models/error_response.rb +53 -18
- data/lib/ynab/models/hybrid_transaction.rb +118 -46
- data/lib/ynab/models/hybrid_transaction_all_of.rb +304 -0
- data/lib/ynab/models/hybrid_transactions_response.rb +53 -18
- data/lib/ynab/models/hybrid_transactions_response_data.rb +54 -19
- data/lib/ynab/models/month_detail.rb +72 -27
- data/lib/ynab/models/{update_transactions_wrapper.rb → month_detail_all_of.rb} +66 -30
- data/lib/ynab/models/month_detail_response.rb +53 -18
- data/lib/ynab/models/month_detail_response_data.rb +53 -18
- data/lib/ynab/models/month_summaries_response.rb +53 -18
- data/lib/ynab/models/month_summaries_response_data.rb +54 -19
- data/lib/ynab/models/month_summary.rb +63 -26
- data/lib/ynab/models/patch_month_category_wrapper.rb +53 -18
- data/lib/ynab/models/patch_transactions_wrapper.rb +53 -18
- data/lib/ynab/models/payee.rb +58 -22
- data/lib/ynab/models/payee_location.rb +58 -23
- data/lib/ynab/models/payee_location_response.rb +53 -18
- data/lib/ynab/models/payee_location_response_data.rb +53 -18
- data/lib/ynab/models/payee_locations_response.rb +53 -18
- data/lib/ynab/models/payee_locations_response_data.rb +53 -18
- data/lib/ynab/models/payee_response.rb +53 -18
- data/lib/ynab/models/payee_response_data.rb +53 -18
- data/lib/ynab/models/payees_response.rb +53 -18
- data/lib/ynab/models/payees_response_data.rb +54 -19
- data/lib/ynab/models/post_account_wrapper.rb +53 -18
- data/lib/ynab/models/post_transactions_wrapper.rb +54 -19
- data/lib/ynab/models/put_transaction_wrapper.rb +53 -18
- data/lib/ynab/models/save_account.rb +77 -20
- data/lib/ynab/models/save_category_response.rb +53 -18
- data/lib/ynab/models/save_category_response_data.rb +54 -19
- data/lib/ynab/models/save_month_category.rb +53 -18
- data/lib/ynab/models/save_sub_transaction.rb +61 -22
- data/lib/ynab/models/save_transaction.rb +88 -33
- data/lib/ynab/models/save_transaction_with_id.rb +102 -46
- data/lib/ynab/models/{save_transactions_wrapper.rb → save_transaction_with_id_all_of.rb} +60 -36
- data/lib/ynab/models/save_transaction_with_optional_fields.rb +81 -33
- data/lib/ynab/models/save_transactions_response.rb +53 -18
- data/lib/ynab/models/save_transactions_response_data.rb +57 -23
- data/lib/ynab/models/scheduled_sub_transaction.rb +66 -27
- data/lib/ynab/models/scheduled_transaction_detail.rb +94 -36
- data/lib/ynab/models/scheduled_transaction_detail_all_of.rb +262 -0
- data/lib/ynab/models/scheduled_transaction_response.rb +53 -18
- data/lib/ynab/models/scheduled_transaction_response_data.rb +53 -18
- data/lib/ynab/models/scheduled_transaction_summary.rb +80 -32
- data/lib/ynab/models/scheduled_transactions_response.rb +53 -18
- data/lib/ynab/models/scheduled_transactions_response_data.rb +54 -19
- data/lib/ynab/models/sub_transaction.rb +71 -29
- data/lib/ynab/models/transaction_detail.rb +112 -44
- data/lib/ynab/models/{save_transaction_wrapper.rb → transaction_detail_all_of.rb} +102 -29
- data/lib/ynab/models/transaction_response.rb +53 -18
- data/lib/ynab/models/transaction_response_data.rb +53 -18
- data/lib/ynab/models/transaction_summary.rb +98 -40
- data/lib/ynab/models/transactions_import_response.rb +53 -18
- data/lib/ynab/models/transactions_import_response_data.rb +53 -18
- data/lib/ynab/models/transactions_response.rb +53 -18
- data/lib/ynab/models/transactions_response_data.rb +54 -19
- data/lib/ynab/models/user.rb +53 -18
- data/lib/ynab/models/user_response.rb +53 -18
- data/lib/ynab/models/user_response_data.rb +53 -18
- data/lib/ynab/version.rb +1 -1
- data/lib/ynab.rb +19 -14
- data/open_api_spec.yaml +3012 -0
- data/templates/api_client.mustache +274 -0
- data/templates/api_client_typhoeus_partial.mustache +156 -0
- data/templates/api_doc.mustache +44 -0
- data/templates/gem.mustache +84 -0
- data/templates/partial_model_generic_doc.mustache +9 -0
- data/ynab.gemspec +38 -0
- metadata +194 -87
- data/lib/ynab/models/loan_account_periodic_value.rb +0 -175
- data/lib/ynab/models/save_account_wrapper.rb +0 -189
- data/lib/ynab/models/update_transaction.rb +0 -407
- data/spec/models/transaction_detail_spec.rb +0 -11
@@ -3,14 +3,15 @@
|
|
3
3
|
|
4
4
|
#Our API uses a REST based design, leverages the JSON data format, and relies upon HTTPS for transport. We respond with meaningful HTTP response codes and if an error occurs, we include error details in the response body. API Documentation is at https://api.ynab.com
|
5
5
|
|
6
|
-
OpenAPI
|
6
|
+
The version of the OpenAPI document: 1.0.0
|
7
7
|
|
8
|
-
Generated by: https://
|
9
|
-
|
8
|
+
Generated by: https://openapi-generator.tech
|
9
|
+
OpenAPI Generator version: 6.6.0
|
10
10
|
|
11
11
|
=end
|
12
12
|
|
13
13
|
require 'date'
|
14
|
+
require 'time'
|
14
15
|
|
15
16
|
module YNAB
|
16
17
|
# The currency format setting for the budget. In some cases the format will not be available and will be specified as null.
|
@@ -45,57 +46,75 @@ module YNAB
|
|
45
46
|
}
|
46
47
|
end
|
47
48
|
|
49
|
+
# Returns all the JSON keys this model knows about
|
50
|
+
def self.acceptable_attributes
|
51
|
+
attribute_map.values
|
52
|
+
end
|
53
|
+
|
48
54
|
# Attribute type mapping.
|
49
|
-
def self.
|
55
|
+
def self.openapi_types
|
50
56
|
{
|
51
57
|
:'iso_code' => :'String',
|
52
58
|
:'example_format' => :'String',
|
53
59
|
:'decimal_digits' => :'Integer',
|
54
60
|
:'decimal_separator' => :'String',
|
55
|
-
:'symbol_first' => :'
|
61
|
+
:'symbol_first' => :'Boolean',
|
56
62
|
:'group_separator' => :'String',
|
57
63
|
:'currency_symbol' => :'String',
|
58
|
-
:'display_symbol' => :'
|
64
|
+
:'display_symbol' => :'Boolean'
|
59
65
|
}
|
60
66
|
end
|
61
67
|
|
68
|
+
# List of attributes with nullable: true
|
69
|
+
def self.openapi_nullable
|
70
|
+
Set.new([
|
71
|
+
])
|
72
|
+
end
|
73
|
+
|
62
74
|
# Initializes the object
|
63
75
|
# @param [Hash] attributes Model attributes in the form of hash
|
64
76
|
def initialize(attributes = {})
|
65
|
-
|
77
|
+
if (!attributes.is_a?(Hash))
|
78
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `YNAB::CurrencyFormat` initialize method"
|
79
|
+
end
|
66
80
|
|
67
|
-
# convert string to symbol for hash key
|
68
|
-
attributes = attributes.each_with_object({}) { |(k, v), h|
|
81
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
82
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
83
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
84
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `YNAB::CurrencyFormat`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
85
|
+
end
|
86
|
+
h[k.to_sym] = v
|
87
|
+
}
|
69
88
|
|
70
|
-
if attributes.
|
89
|
+
if attributes.key?(:'iso_code')
|
71
90
|
self.iso_code = attributes[:'iso_code']
|
72
91
|
end
|
73
92
|
|
74
|
-
if attributes.
|
93
|
+
if attributes.key?(:'example_format')
|
75
94
|
self.example_format = attributes[:'example_format']
|
76
95
|
end
|
77
96
|
|
78
|
-
if attributes.
|
97
|
+
if attributes.key?(:'decimal_digits')
|
79
98
|
self.decimal_digits = attributes[:'decimal_digits']
|
80
99
|
end
|
81
100
|
|
82
|
-
if attributes.
|
101
|
+
if attributes.key?(:'decimal_separator')
|
83
102
|
self.decimal_separator = attributes[:'decimal_separator']
|
84
103
|
end
|
85
104
|
|
86
|
-
if attributes.
|
105
|
+
if attributes.key?(:'symbol_first')
|
87
106
|
self.symbol_first = attributes[:'symbol_first']
|
88
107
|
end
|
89
108
|
|
90
|
-
if attributes.
|
109
|
+
if attributes.key?(:'group_separator')
|
91
110
|
self.group_separator = attributes[:'group_separator']
|
92
111
|
end
|
93
112
|
|
94
|
-
if attributes.
|
113
|
+
if attributes.key?(:'currency_symbol')
|
95
114
|
self.currency_symbol = attributes[:'currency_symbol']
|
96
115
|
end
|
97
116
|
|
98
|
-
if attributes.
|
117
|
+
if attributes.key?(:'display_symbol')
|
99
118
|
self.display_symbol = attributes[:'display_symbol']
|
100
119
|
end
|
101
120
|
end
|
@@ -175,17 +194,28 @@ module YNAB
|
|
175
194
|
end
|
176
195
|
|
177
196
|
# Calculates hash code according to all attributes.
|
178
|
-
# @return [
|
197
|
+
# @return [Integer] Hash code
|
179
198
|
def hash
|
180
199
|
[iso_code, example_format, decimal_digits, decimal_separator, symbol_first, group_separator, currency_symbol, display_symbol].hash
|
181
200
|
end
|
201
|
+
|
202
|
+
# Builds the object from hash
|
203
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
204
|
+
# @return [Object] Returns the model itself
|
205
|
+
def self.build_from_hash(attributes)
|
206
|
+
new.build_from_hash(attributes)
|
207
|
+
end
|
208
|
+
|
182
209
|
# Builds the object from hash
|
183
210
|
# @param [Hash] attributes Model attributes in the form of hash
|
184
211
|
# @return [Object] Returns the model itself
|
185
212
|
def build_from_hash(attributes)
|
186
213
|
return nil unless attributes.is_a?(Hash)
|
187
|
-
|
188
|
-
|
214
|
+
attributes = attributes.transform_keys(&:to_sym)
|
215
|
+
self.class.openapi_types.each_pair do |key, type|
|
216
|
+
if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
|
217
|
+
self.send("#{key}=", nil)
|
218
|
+
elsif type =~ /\AArray<(.*)>/i
|
189
219
|
# check to ensure the input is an array given that the attribute
|
190
220
|
# is documented as an array but the input is not
|
191
221
|
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
@@ -193,7 +223,7 @@ module YNAB
|
|
193
223
|
end
|
194
224
|
elsif !attributes[self.class.attribute_map[key]].nil?
|
195
225
|
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
196
|
-
end
|
226
|
+
end
|
197
227
|
end
|
198
228
|
|
199
229
|
self
|
@@ -205,8 +235,8 @@ module YNAB
|
|
205
235
|
# @return [Object] Deserialized data
|
206
236
|
def _deserialize(type, value)
|
207
237
|
case type.to_sym
|
208
|
-
when :
|
209
|
-
|
238
|
+
when :Time
|
239
|
+
Time.parse(value)
|
210
240
|
when :Date
|
211
241
|
Date.parse(value)
|
212
242
|
when :String
|
@@ -215,7 +245,7 @@ module YNAB
|
|
215
245
|
value.to_i
|
216
246
|
when :Float
|
217
247
|
value.to_f
|
218
|
-
when :
|
248
|
+
when :Boolean
|
219
249
|
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
220
250
|
true
|
221
251
|
else
|
@@ -236,8 +266,9 @@ module YNAB
|
|
236
266
|
end
|
237
267
|
end
|
238
268
|
else # model
|
239
|
-
|
240
|
-
|
269
|
+
# models (e.g. Pet) or oneOf
|
270
|
+
klass = YNAB.const_get(type)
|
271
|
+
klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
241
272
|
end
|
242
273
|
end
|
243
274
|
|
@@ -259,7 +290,11 @@ module YNAB
|
|
259
290
|
hash = {}
|
260
291
|
self.class.attribute_map.each_pair do |attr, param|
|
261
292
|
value = self.send(attr)
|
262
|
-
|
293
|
+
if value.nil?
|
294
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
295
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
296
|
+
end
|
297
|
+
|
263
298
|
hash[param] = _to_hash(value)
|
264
299
|
end
|
265
300
|
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
|
# The date format setting for the budget. In some cases the format will not be available and will be specified as null.
|
@@ -24,22 +25,40 @@ module YNAB
|
|
24
25
|
}
|
25
26
|
end
|
26
27
|
|
28
|
+
# Returns all the JSON keys this model knows about
|
29
|
+
def self.acceptable_attributes
|
30
|
+
attribute_map.values
|
31
|
+
end
|
32
|
+
|
27
33
|
# Attribute type mapping.
|
28
|
-
def self.
|
34
|
+
def self.openapi_types
|
29
35
|
{
|
30
36
|
:'format' => :'String'
|
31
37
|
}
|
32
38
|
end
|
33
39
|
|
40
|
+
# List of attributes with nullable: true
|
41
|
+
def self.openapi_nullable
|
42
|
+
Set.new([
|
43
|
+
])
|
44
|
+
end
|
45
|
+
|
34
46
|
# Initializes the object
|
35
47
|
# @param [Hash] attributes Model attributes in the form of hash
|
36
48
|
def initialize(attributes = {})
|
37
|
-
|
49
|
+
if (!attributes.is_a?(Hash))
|
50
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `YNAB::DateFormat` initialize method"
|
51
|
+
end
|
38
52
|
|
39
|
-
# convert string to symbol for hash key
|
40
|
-
attributes = attributes.each_with_object({}) { |(k, v), h|
|
53
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
54
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
55
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
56
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `YNAB::DateFormat`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
57
|
+
end
|
58
|
+
h[k.to_sym] = v
|
59
|
+
}
|
41
60
|
|
42
|
-
if attributes.
|
61
|
+
if attributes.key?(:'format')
|
43
62
|
self.format = attributes[:'format']
|
44
63
|
end
|
45
64
|
end
|
@@ -77,17 +96,28 @@ module YNAB
|
|
77
96
|
end
|
78
97
|
|
79
98
|
# Calculates hash code according to all attributes.
|
80
|
-
# @return [
|
99
|
+
# @return [Integer] Hash code
|
81
100
|
def hash
|
82
101
|
[format].hash
|
83
102
|
end
|
103
|
+
|
104
|
+
# Builds the object from hash
|
105
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
106
|
+
# @return [Object] Returns the model itself
|
107
|
+
def self.build_from_hash(attributes)
|
108
|
+
new.build_from_hash(attributes)
|
109
|
+
end
|
110
|
+
|
84
111
|
# Builds the object from hash
|
85
112
|
# @param [Hash] attributes Model attributes in the form of hash
|
86
113
|
# @return [Object] Returns the model itself
|
87
114
|
def build_from_hash(attributes)
|
88
115
|
return nil unless attributes.is_a?(Hash)
|
89
|
-
|
90
|
-
|
116
|
+
attributes = attributes.transform_keys(&:to_sym)
|
117
|
+
self.class.openapi_types.each_pair do |key, type|
|
118
|
+
if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
|
119
|
+
self.send("#{key}=", nil)
|
120
|
+
elsif type =~ /\AArray<(.*)>/i
|
91
121
|
# check to ensure the input is an array given that the attribute
|
92
122
|
# is documented as an array but the input is not
|
93
123
|
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
@@ -95,7 +125,7 @@ module YNAB
|
|
95
125
|
end
|
96
126
|
elsif !attributes[self.class.attribute_map[key]].nil?
|
97
127
|
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
98
|
-
end
|
128
|
+
end
|
99
129
|
end
|
100
130
|
|
101
131
|
self
|
@@ -107,8 +137,8 @@ module YNAB
|
|
107
137
|
# @return [Object] Deserialized data
|
108
138
|
def _deserialize(type, value)
|
109
139
|
case type.to_sym
|
110
|
-
when :
|
111
|
-
|
140
|
+
when :Time
|
141
|
+
Time.parse(value)
|
112
142
|
when :Date
|
113
143
|
Date.parse(value)
|
114
144
|
when :String
|
@@ -117,7 +147,7 @@ module YNAB
|
|
117
147
|
value.to_i
|
118
148
|
when :Float
|
119
149
|
value.to_f
|
120
|
-
when :
|
150
|
+
when :Boolean
|
121
151
|
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
122
152
|
true
|
123
153
|
else
|
@@ -138,8 +168,9 @@ module YNAB
|
|
138
168
|
end
|
139
169
|
end
|
140
170
|
else # model
|
141
|
-
|
142
|
-
|
171
|
+
# models (e.g. Pet) or oneOf
|
172
|
+
klass = YNAB.const_get(type)
|
173
|
+
klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
143
174
|
end
|
144
175
|
end
|
145
176
|
|
@@ -161,7 +192,11 @@ module YNAB
|
|
161
192
|
hash = {}
|
162
193
|
self.class.attribute_map.each_pair do |attr, param|
|
163
194
|
value = self.send(attr)
|
164
|
-
|
195
|
+
if value.nil?
|
196
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
197
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
198
|
+
end
|
199
|
+
|
165
200
|
hash[param] = _to_hash(value)
|
166
201
|
end
|
167
202
|
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 ErrorDetail
|
@@ -29,8 +30,13 @@ module YNAB
|
|
29
30
|
}
|
30
31
|
end
|
31
32
|
|
33
|
+
# Returns all the JSON keys this model knows about
|
34
|
+
def self.acceptable_attributes
|
35
|
+
attribute_map.values
|
36
|
+
end
|
37
|
+
|
32
38
|
# Attribute type mapping.
|
33
|
-
def self.
|
39
|
+
def self.openapi_types
|
34
40
|
{
|
35
41
|
:'id' => :'String',
|
36
42
|
:'name' => :'String',
|
@@ -38,23 +44,36 @@ module YNAB
|
|
38
44
|
}
|
39
45
|
end
|
40
46
|
|
47
|
+
# List of attributes with nullable: true
|
48
|
+
def self.openapi_nullable
|
49
|
+
Set.new([
|
50
|
+
])
|
51
|
+
end
|
52
|
+
|
41
53
|
# Initializes the object
|
42
54
|
# @param [Hash] attributes Model attributes in the form of hash
|
43
55
|
def initialize(attributes = {})
|
44
|
-
|
56
|
+
if (!attributes.is_a?(Hash))
|
57
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `YNAB::ErrorDetail` initialize method"
|
58
|
+
end
|
45
59
|
|
46
|
-
# convert string to symbol for hash key
|
47
|
-
attributes = attributes.each_with_object({}) { |(k, v), h|
|
60
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
61
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
62
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
63
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `YNAB::ErrorDetail`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
64
|
+
end
|
65
|
+
h[k.to_sym] = v
|
66
|
+
}
|
48
67
|
|
49
|
-
if attributes.
|
68
|
+
if attributes.key?(:'id')
|
50
69
|
self.id = attributes[:'id']
|
51
70
|
end
|
52
71
|
|
53
|
-
if attributes.
|
72
|
+
if attributes.key?(:'name')
|
54
73
|
self.name = attributes[:'name']
|
55
74
|
end
|
56
75
|
|
57
|
-
if attributes.
|
76
|
+
if attributes.key?(:'detail')
|
58
77
|
self.detail = attributes[:'detail']
|
59
78
|
end
|
60
79
|
end
|
@@ -104,17 +123,28 @@ module YNAB
|
|
104
123
|
end
|
105
124
|
|
106
125
|
# Calculates hash code according to all attributes.
|
107
|
-
# @return [
|
126
|
+
# @return [Integer] Hash code
|
108
127
|
def hash
|
109
128
|
[id, name, detail].hash
|
110
129
|
end
|
130
|
+
|
131
|
+
# Builds the object from hash
|
132
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
133
|
+
# @return [Object] Returns the model itself
|
134
|
+
def self.build_from_hash(attributes)
|
135
|
+
new.build_from_hash(attributes)
|
136
|
+
end
|
137
|
+
|
111
138
|
# Builds the object from hash
|
112
139
|
# @param [Hash] attributes Model attributes in the form of hash
|
113
140
|
# @return [Object] Returns the model itself
|
114
141
|
def build_from_hash(attributes)
|
115
142
|
return nil unless attributes.is_a?(Hash)
|
116
|
-
|
117
|
-
|
143
|
+
attributes = attributes.transform_keys(&:to_sym)
|
144
|
+
self.class.openapi_types.each_pair do |key, type|
|
145
|
+
if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
|
146
|
+
self.send("#{key}=", nil)
|
147
|
+
elsif type =~ /\AArray<(.*)>/i
|
118
148
|
# check to ensure the input is an array given that the attribute
|
119
149
|
# is documented as an array but the input is not
|
120
150
|
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
@@ -122,7 +152,7 @@ module YNAB
|
|
122
152
|
end
|
123
153
|
elsif !attributes[self.class.attribute_map[key]].nil?
|
124
154
|
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
125
|
-
end
|
155
|
+
end
|
126
156
|
end
|
127
157
|
|
128
158
|
self
|
@@ -134,8 +164,8 @@ module YNAB
|
|
134
164
|
# @return [Object] Deserialized data
|
135
165
|
def _deserialize(type, value)
|
136
166
|
case type.to_sym
|
137
|
-
when :
|
138
|
-
|
167
|
+
when :Time
|
168
|
+
Time.parse(value)
|
139
169
|
when :Date
|
140
170
|
Date.parse(value)
|
141
171
|
when :String
|
@@ -144,7 +174,7 @@ module YNAB
|
|
144
174
|
value.to_i
|
145
175
|
when :Float
|
146
176
|
value.to_f
|
147
|
-
when :
|
177
|
+
when :Boolean
|
148
178
|
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
149
179
|
true
|
150
180
|
else
|
@@ -165,8 +195,9 @@ module YNAB
|
|
165
195
|
end
|
166
196
|
end
|
167
197
|
else # model
|
168
|
-
|
169
|
-
|
198
|
+
# models (e.g. Pet) or oneOf
|
199
|
+
klass = YNAB.const_get(type)
|
200
|
+
klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
170
201
|
end
|
171
202
|
end
|
172
203
|
|
@@ -188,7 +219,11 @@ module YNAB
|
|
188
219
|
hash = {}
|
189
220
|
self.class.attribute_map.each_pair do |attr, param|
|
190
221
|
value = self.send(attr)
|
191
|
-
|
222
|
+
if value.nil?
|
223
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
224
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
225
|
+
end
|
226
|
+
|
192
227
|
hash[param] = _to_hash(value)
|
193
228
|
end
|
194
229
|
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 ErrorResponse
|
@@ -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
|
:'error' => :'ErrorDetail'
|
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::ErrorResponse` 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::ErrorResponse`. 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?(:'error')
|
42
61
|
self.error = attributes[:'error']
|
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
|
[error].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
|