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 BudgetSettings
|
@@ -26,27 +27,47 @@ module YNAB
|
|
26
27
|
}
|
27
28
|
end
|
28
29
|
|
30
|
+
# Returns all the JSON keys this model knows about
|
31
|
+
def self.acceptable_attributes
|
32
|
+
attribute_map.values
|
33
|
+
end
|
34
|
+
|
29
35
|
# Attribute type mapping.
|
30
|
-
def self.
|
36
|
+
def self.openapi_types
|
31
37
|
{
|
32
38
|
:'date_format' => :'DateFormat',
|
33
39
|
:'currency_format' => :'CurrencyFormat'
|
34
40
|
}
|
35
41
|
end
|
36
42
|
|
43
|
+
# List of attributes with nullable: true
|
44
|
+
def self.openapi_nullable
|
45
|
+
Set.new([
|
46
|
+
:'date_format',
|
47
|
+
:'currency_format'
|
48
|
+
])
|
49
|
+
end
|
50
|
+
|
37
51
|
# Initializes the object
|
38
52
|
# @param [Hash] attributes Model attributes in the form of hash
|
39
53
|
def initialize(attributes = {})
|
40
|
-
|
54
|
+
if (!attributes.is_a?(Hash))
|
55
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `YNAB::BudgetSettings` initialize method"
|
56
|
+
end
|
41
57
|
|
42
|
-
# convert string to symbol for hash key
|
43
|
-
attributes = attributes.each_with_object({}) { |(k, v), h|
|
58
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
59
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
60
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
61
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `YNAB::BudgetSettings`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
62
|
+
end
|
63
|
+
h[k.to_sym] = v
|
64
|
+
}
|
44
65
|
|
45
|
-
if attributes.
|
66
|
+
if attributes.key?(:'date_format')
|
46
67
|
self.date_format = attributes[:'date_format']
|
47
68
|
end
|
48
69
|
|
49
|
-
if attributes.
|
70
|
+
if attributes.key?(:'currency_format')
|
50
71
|
self.currency_format = attributes[:'currency_format']
|
51
72
|
end
|
52
73
|
end
|
@@ -55,22 +76,12 @@ module YNAB
|
|
55
76
|
# @return Array for valid properties with the reasons
|
56
77
|
def list_invalid_properties
|
57
78
|
invalid_properties = Array.new
|
58
|
-
if @date_format.nil?
|
59
|
-
invalid_properties.push('invalid value for "date_format", date_format cannot be nil.')
|
60
|
-
end
|
61
|
-
|
62
|
-
if @currency_format.nil?
|
63
|
-
invalid_properties.push('invalid value for "currency_format", currency_format cannot be nil.')
|
64
|
-
end
|
65
|
-
|
66
79
|
invalid_properties
|
67
80
|
end
|
68
81
|
|
69
82
|
# Check to see if the all the properties in the model are valid
|
70
83
|
# @return true if the model is valid
|
71
84
|
def valid?
|
72
|
-
return false if @date_format.nil?
|
73
|
-
return false if @currency_format.nil?
|
74
85
|
true
|
75
86
|
end
|
76
87
|
|
@@ -90,17 +101,28 @@ module YNAB
|
|
90
101
|
end
|
91
102
|
|
92
103
|
# Calculates hash code according to all attributes.
|
93
|
-
# @return [
|
104
|
+
# @return [Integer] Hash code
|
94
105
|
def hash
|
95
106
|
[date_format, currency_format].hash
|
96
107
|
end
|
108
|
+
|
109
|
+
# Builds the object from hash
|
110
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
111
|
+
# @return [Object] Returns the model itself
|
112
|
+
def self.build_from_hash(attributes)
|
113
|
+
new.build_from_hash(attributes)
|
114
|
+
end
|
115
|
+
|
97
116
|
# Builds the object from hash
|
98
117
|
# @param [Hash] attributes Model attributes in the form of hash
|
99
118
|
# @return [Object] Returns the model itself
|
100
119
|
def build_from_hash(attributes)
|
101
120
|
return nil unless attributes.is_a?(Hash)
|
102
|
-
|
103
|
-
|
121
|
+
attributes = attributes.transform_keys(&:to_sym)
|
122
|
+
self.class.openapi_types.each_pair do |key, type|
|
123
|
+
if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
|
124
|
+
self.send("#{key}=", nil)
|
125
|
+
elsif type =~ /\AArray<(.*)>/i
|
104
126
|
# check to ensure the input is an array given that the attribute
|
105
127
|
# is documented as an array but the input is not
|
106
128
|
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
@@ -108,7 +130,7 @@ module YNAB
|
|
108
130
|
end
|
109
131
|
elsif !attributes[self.class.attribute_map[key]].nil?
|
110
132
|
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
111
|
-
end
|
133
|
+
end
|
112
134
|
end
|
113
135
|
|
114
136
|
self
|
@@ -120,8 +142,8 @@ module YNAB
|
|
120
142
|
# @return [Object] Deserialized data
|
121
143
|
def _deserialize(type, value)
|
122
144
|
case type.to_sym
|
123
|
-
when :
|
124
|
-
|
145
|
+
when :Time
|
146
|
+
Time.parse(value)
|
125
147
|
when :Date
|
126
148
|
Date.parse(value)
|
127
149
|
when :String
|
@@ -130,7 +152,7 @@ module YNAB
|
|
130
152
|
value.to_i
|
131
153
|
when :Float
|
132
154
|
value.to_f
|
133
|
-
when :
|
155
|
+
when :Boolean
|
134
156
|
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
135
157
|
true
|
136
158
|
else
|
@@ -151,8 +173,9 @@ module YNAB
|
|
151
173
|
end
|
152
174
|
end
|
153
175
|
else # model
|
154
|
-
|
155
|
-
|
176
|
+
# models (e.g. Pet) or oneOf
|
177
|
+
klass = YNAB.const_get(type)
|
178
|
+
klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
156
179
|
end
|
157
180
|
end
|
158
181
|
|
@@ -174,7 +197,11 @@ module YNAB
|
|
174
197
|
hash = {}
|
175
198
|
self.class.attribute_map.each_pair do |attr, param|
|
176
199
|
value = self.send(attr)
|
177
|
-
|
200
|
+
if value.nil?
|
201
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
202
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
203
|
+
end
|
204
|
+
|
178
205
|
hash[param] = _to_hash(value)
|
179
206
|
end
|
180
207
|
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 BudgetSettingsResponse
|
@@ -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' => :'BudgetSettingsResponseData'
|
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::BudgetSettingsResponse` 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::BudgetSettingsResponse`. 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 BudgetSettingsResponseData
|
@@ -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
|
:'settings' => :'BudgetSettings'
|
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::BudgetSettingsResponseData` 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::BudgetSettingsResponseData`. 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?(:'settings')
|
42
61
|
self.settings = attributes[:'settings']
|
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
|
[settings].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 BudgetSummary
|
@@ -48,12 +49,17 @@ module YNAB
|
|
48
49
|
}
|
49
50
|
end
|
50
51
|
|
52
|
+
# Returns all the JSON keys this model knows about
|
53
|
+
def self.acceptable_attributes
|
54
|
+
attribute_map.values
|
55
|
+
end
|
56
|
+
|
51
57
|
# Attribute type mapping.
|
52
|
-
def self.
|
58
|
+
def self.openapi_types
|
53
59
|
{
|
54
60
|
:'id' => :'String',
|
55
61
|
:'name' => :'String',
|
56
|
-
:'last_modified_on' => :'
|
62
|
+
:'last_modified_on' => :'Time',
|
57
63
|
:'first_month' => :'Date',
|
58
64
|
:'last_month' => :'Date',
|
59
65
|
:'date_format' => :'DateFormat',
|
@@ -62,43 +68,58 @@ module YNAB
|
|
62
68
|
}
|
63
69
|
end
|
64
70
|
|
71
|
+
# List of attributes with nullable: true
|
72
|
+
def self.openapi_nullable
|
73
|
+
Set.new([
|
74
|
+
:'date_format',
|
75
|
+
:'currency_format',
|
76
|
+
])
|
77
|
+
end
|
78
|
+
|
65
79
|
# Initializes the object
|
66
80
|
# @param [Hash] attributes Model attributes in the form of hash
|
67
81
|
def initialize(attributes = {})
|
68
|
-
|
82
|
+
if (!attributes.is_a?(Hash))
|
83
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `YNAB::BudgetSummary` initialize method"
|
84
|
+
end
|
69
85
|
|
70
|
-
# convert string to symbol for hash key
|
71
|
-
attributes = attributes.each_with_object({}) { |(k, v), h|
|
86
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
87
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
88
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
89
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `YNAB::BudgetSummary`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
90
|
+
end
|
91
|
+
h[k.to_sym] = v
|
92
|
+
}
|
72
93
|
|
73
|
-
if attributes.
|
94
|
+
if attributes.key?(:'id')
|
74
95
|
self.id = attributes[:'id']
|
75
96
|
end
|
76
97
|
|
77
|
-
if attributes.
|
98
|
+
if attributes.key?(:'name')
|
78
99
|
self.name = attributes[:'name']
|
79
100
|
end
|
80
101
|
|
81
|
-
if attributes.
|
102
|
+
if attributes.key?(:'last_modified_on')
|
82
103
|
self.last_modified_on = attributes[:'last_modified_on']
|
83
104
|
end
|
84
105
|
|
85
|
-
if attributes.
|
106
|
+
if attributes.key?(:'first_month')
|
86
107
|
self.first_month = attributes[:'first_month']
|
87
108
|
end
|
88
109
|
|
89
|
-
if attributes.
|
110
|
+
if attributes.key?(:'last_month')
|
90
111
|
self.last_month = attributes[:'last_month']
|
91
112
|
end
|
92
113
|
|
93
|
-
if attributes.
|
114
|
+
if attributes.key?(:'date_format')
|
94
115
|
self.date_format = attributes[:'date_format']
|
95
116
|
end
|
96
117
|
|
97
|
-
if attributes.
|
118
|
+
if attributes.key?(:'currency_format')
|
98
119
|
self.currency_format = attributes[:'currency_format']
|
99
120
|
end
|
100
121
|
|
101
|
-
if attributes.
|
122
|
+
if attributes.key?(:'accounts')
|
102
123
|
if (value = attributes[:'accounts']).is_a?(Array)
|
103
124
|
self.accounts = value
|
104
125
|
end
|
@@ -150,17 +171,28 @@ module YNAB
|
|
150
171
|
end
|
151
172
|
|
152
173
|
# Calculates hash code according to all attributes.
|
153
|
-
# @return [
|
174
|
+
# @return [Integer] Hash code
|
154
175
|
def hash
|
155
176
|
[id, name, last_modified_on, first_month, last_month, date_format, currency_format, accounts].hash
|
156
177
|
end
|
178
|
+
|
179
|
+
# Builds the object from hash
|
180
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
181
|
+
# @return [Object] Returns the model itself
|
182
|
+
def self.build_from_hash(attributes)
|
183
|
+
new.build_from_hash(attributes)
|
184
|
+
end
|
185
|
+
|
157
186
|
# Builds the object from hash
|
158
187
|
# @param [Hash] attributes Model attributes in the form of hash
|
159
188
|
# @return [Object] Returns the model itself
|
160
189
|
def build_from_hash(attributes)
|
161
190
|
return nil unless attributes.is_a?(Hash)
|
162
|
-
|
163
|
-
|
191
|
+
attributes = attributes.transform_keys(&:to_sym)
|
192
|
+
self.class.openapi_types.each_pair do |key, type|
|
193
|
+
if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
|
194
|
+
self.send("#{key}=", nil)
|
195
|
+
elsif type =~ /\AArray<(.*)>/i
|
164
196
|
# check to ensure the input is an array given that the attribute
|
165
197
|
# is documented as an array but the input is not
|
166
198
|
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
@@ -168,7 +200,7 @@ module YNAB
|
|
168
200
|
end
|
169
201
|
elsif !attributes[self.class.attribute_map[key]].nil?
|
170
202
|
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
171
|
-
end
|
203
|
+
end
|
172
204
|
end
|
173
205
|
|
174
206
|
self
|
@@ -180,8 +212,8 @@ module YNAB
|
|
180
212
|
# @return [Object] Deserialized data
|
181
213
|
def _deserialize(type, value)
|
182
214
|
case type.to_sym
|
183
|
-
when :
|
184
|
-
|
215
|
+
when :Time
|
216
|
+
Time.parse(value)
|
185
217
|
when :Date
|
186
218
|
Date.parse(value)
|
187
219
|
when :String
|
@@ -190,7 +222,7 @@ module YNAB
|
|
190
222
|
value.to_i
|
191
223
|
when :Float
|
192
224
|
value.to_f
|
193
|
-
when :
|
225
|
+
when :Boolean
|
194
226
|
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
195
227
|
true
|
196
228
|
else
|
@@ -211,8 +243,9 @@ module YNAB
|
|
211
243
|
end
|
212
244
|
end
|
213
245
|
else # model
|
214
|
-
|
215
|
-
|
246
|
+
# models (e.g. Pet) or oneOf
|
247
|
+
klass = YNAB.const_get(type)
|
248
|
+
klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
216
249
|
end
|
217
250
|
end
|
218
251
|
|
@@ -234,7 +267,11 @@ module YNAB
|
|
234
267
|
hash = {}
|
235
268
|
self.class.attribute_map.each_pair do |attr, param|
|
236
269
|
value = self.send(attr)
|
237
|
-
|
270
|
+
if value.nil?
|
271
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
272
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
273
|
+
end
|
274
|
+
|
238
275
|
hash[param] = _to_hash(value)
|
239
276
|
end
|
240
277
|
hash
|