ynab 2.1.0 → 3.2.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 +6 -2
- data/Gemfile.lock +1 -1
- data/README.md +3 -1
- data/Rakefile +3 -1
- data/docs/BulkTransactions.md +1 -1
- data/docs/CategoriesApi.md +22 -0
- data/docs/Category.md +1 -0
- data/docs/ExistingTransaction.md +18 -0
- data/docs/HybridTransaction.md +3 -2
- data/docs/NewTransaction.md +19 -0
- data/docs/PatchCategoryWrapper.md +8 -0
- data/docs/PatchPayeeWrapper.md +8 -0
- data/docs/PatchTransactionsWrapper.md +1 -1
- data/docs/PayeesApi.md +22 -0
- data/docs/PostTransactionsWrapper.md +2 -2
- data/docs/PutTransactionWrapper.md +1 -1
- data/docs/SaveCategory.md +10 -0
- data/docs/SavePayee.md +8 -0
- data/docs/SavePayeeResponse.md +8 -0
- data/docs/SavePayeeResponseData.md +9 -0
- data/docs/SaveTransactionWithIdOrImportId.md +20 -0
- data/docs/SaveTransactionWithOptionalFields.md +2 -3
- data/docs/ScheduledTransactionDetail.md +2 -1
- data/docs/ScheduledTransactionSummary.md +2 -1
- data/docs/TransactionClearedStatus.md +7 -0
- data/docs/TransactionDetail.md +3 -2
- data/docs/TransactionFlagColor.md +7 -0
- data/docs/TransactionSummary.md +3 -2
- data/docs/TransactionsApi.md +7 -7
- data/lib/ynab/api/accounts_api.rb +2 -2
- data/lib/ynab/api/budgets_api.rb +2 -2
- data/lib/ynab/api/categories_api.rb +82 -2
- data/lib/ynab/api/months_api.rb +2 -2
- data/lib/ynab/api/payee_locations_api.rb +2 -2
- data/lib/ynab/api/payees_api.rb +82 -2
- data/lib/ynab/api/scheduled_transactions_api.rb +2 -2
- data/lib/ynab/api/transactions_api.rb +12 -12
- data/lib/ynab/api/user_api.rb +2 -2
- data/lib/ynab/api_client.rb +2 -2
- data/lib/ynab/configuration.rb +14 -11
- data/lib/ynab/models/account.rb +13 -20
- data/lib/ynab/models/account_response.rb +13 -20
- data/lib/ynab/models/account_response_data.rb +13 -20
- data/lib/ynab/models/account_type.rb +2 -2
- data/lib/ynab/models/accounts_response.rb +13 -20
- data/lib/ynab/models/accounts_response_data.rb +13 -20
- data/lib/ynab/models/budget_detail.rb +13 -21
- data/lib/ynab/models/budget_detail_response.rb +13 -20
- data/lib/ynab/models/budget_detail_response_data.rb +13 -20
- data/lib/ynab/models/budget_settings.rb +13 -20
- data/lib/ynab/models/budget_settings_response.rb +13 -20
- data/lib/ynab/models/budget_settings_response_data.rb +13 -20
- data/lib/ynab/models/budget_summary.rb +13 -20
- data/lib/ynab/models/budget_summary_response.rb +13 -20
- data/lib/ynab/models/budget_summary_response_data.rb +13 -20
- data/lib/ynab/models/bulk_response.rb +13 -20
- data/lib/ynab/models/bulk_response_data.rb +13 -20
- data/lib/ynab/models/bulk_response_data_bulk.rb +13 -20
- data/lib/ynab/models/bulk_transactions.rb +14 -21
- data/lib/ynab/models/categories_response.rb +13 -20
- data/lib/ynab/models/categories_response_data.rb +13 -20
- data/lib/ynab/models/category.rb +25 -21
- data/lib/ynab/models/category_group.rb +13 -20
- data/lib/ynab/models/category_group_with_categories.rb +14 -22
- data/lib/ynab/models/category_response.rb +13 -20
- data/lib/ynab/models/category_response_data.rb +13 -20
- data/lib/ynab/models/currency_format.rb +13 -20
- data/lib/ynab/models/date_format.rb +13 -20
- data/lib/ynab/models/error_detail.rb +13 -20
- data/lib/ynab/models/error_response.rb +13 -20
- data/lib/ynab/models/existing_transaction.rb +359 -0
- data/lib/ynab/models/hybrid_transaction.rb +28 -43
- data/lib/ynab/models/hybrid_transactions_response.rb +13 -20
- data/lib/ynab/models/hybrid_transactions_response_data.rb +13 -20
- data/lib/ynab/models/month_detail.rb +13 -21
- data/lib/ynab/models/month_detail_response.rb +13 -20
- data/lib/ynab/models/month_detail_response_data.rb +13 -20
- data/lib/ynab/models/month_summaries_response.rb +13 -20
- data/lib/ynab/models/month_summaries_response_data.rb +13 -20
- data/lib/ynab/models/month_summary.rb +13 -20
- data/lib/ynab/models/new_transaction.rb +377 -0
- data/lib/ynab/models/patch_category_wrapper.rb +213 -0
- data/lib/ynab/models/patch_month_category_wrapper.rb +13 -20
- data/lib/ynab/models/patch_payee_wrapper.rb +213 -0
- data/lib/ynab/models/patch_transactions_wrapper.rb +14 -21
- data/lib/ynab/models/payee.rb +13 -20
- data/lib/ynab/models/payee_location.rb +13 -20
- data/lib/ynab/models/payee_location_response.rb +13 -20
- data/lib/ynab/models/payee_location_response_data.rb +13 -20
- data/lib/ynab/models/payee_locations_response.rb +13 -20
- data/lib/ynab/models/payee_locations_response_data.rb +13 -20
- data/lib/ynab/models/payee_response.rb +13 -20
- data/lib/ynab/models/payee_response_data.rb +13 -20
- data/lib/ynab/models/payees_response.rb +13 -20
- data/lib/ynab/models/payees_response_data.rb +13 -20
- data/lib/ynab/models/post_account_wrapper.rb +13 -20
- data/lib/ynab/models/post_transactions_wrapper.rb +15 -22
- data/lib/ynab/models/put_transaction_wrapper.rb +14 -21
- data/lib/ynab/models/save_account.rb +13 -20
- data/lib/ynab/models/save_category.rb +232 -0
- data/lib/ynab/models/save_category_response.rb +13 -20
- data/lib/ynab/models/save_category_response_data.rb +13 -20
- data/lib/ynab/models/save_month_category.rb +13 -20
- data/lib/ynab/models/save_payee.rb +220 -0
- data/lib/ynab/models/save_payee_response.rb +213 -0
- data/lib/ynab/models/save_payee_response_data.rb +224 -0
- data/lib/ynab/models/save_sub_transaction.rb +13 -20
- data/lib/ynab/models/save_transaction_with_id_or_import_id.rb +388 -0
- data/lib/ynab/models/save_transaction_with_optional_fields.rb +17 -59
- data/lib/ynab/models/save_transactions_response.rb +13 -20
- data/lib/ynab/models/save_transactions_response_data.rb +13 -20
- data/lib/ynab/models/scheduled_sub_transaction.rb +13 -20
- data/lib/ynab/models/scheduled_transaction_detail.rb +26 -32
- data/lib/ynab/models/scheduled_transaction_response.rb +13 -20
- data/lib/ynab/models/scheduled_transaction_response_data.rb +13 -20
- data/lib/ynab/models/scheduled_transaction_summary.rb +26 -31
- data/lib/ynab/models/scheduled_transactions_response.rb +13 -20
- data/lib/ynab/models/scheduled_transactions_response_data.rb +13 -20
- data/lib/ynab/models/sub_transaction.rb +13 -20
- data/lib/ynab/models/transaction_cleared_status.rb +41 -0
- data/lib/ynab/models/transaction_detail.rb +28 -43
- data/lib/ynab/models/transaction_flag_color.rb +45 -0
- data/lib/ynab/models/transaction_response.rb +13 -20
- data/lib/ynab/models/transaction_response_data.rb +13 -20
- data/lib/ynab/models/transaction_summary.rb +28 -42
- data/lib/ynab/models/transactions_import_response.rb +13 -20
- data/lib/ynab/models/transactions_import_response_data.rb +13 -20
- data/lib/ynab/models/transactions_response.rb +13 -20
- data/lib/ynab/models/transactions_response_data.rb +13 -20
- data/lib/ynab/models/user.rb +13 -20
- data/lib/ynab/models/user_response.rb +13 -20
- data/lib/ynab/models/user_response_data.rb +13 -20
- data/lib/ynab/version.rb +1 -1
- data/lib/ynab.rb +13 -12
- data/open_api_spec.yaml +464 -343
- data/ynab.gemspec +4 -3
- metadata +53 -31
@@ -3,10 +3,10 @@
|
|
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
|
-
The version of the OpenAPI document: 1.
|
6
|
+
The version of the OpenAPI document: 1.70.0
|
7
7
|
|
8
8
|
Generated by: https://openapi-generator.tech
|
9
|
-
|
9
|
+
Generator version: 7.6.0
|
10
10
|
|
11
11
|
=end
|
12
12
|
|
@@ -111,37 +111,30 @@ module YNAB
|
|
111
111
|
# @param [Hash] attributes Model attributes in the form of hash
|
112
112
|
# @return [Object] Returns the model itself
|
113
113
|
def self.build_from_hash(attributes)
|
114
|
-
new.build_from_hash(attributes)
|
115
|
-
end
|
116
|
-
|
117
|
-
# Builds the object from hash
|
118
|
-
# @param [Hash] attributes Model attributes in the form of hash
|
119
|
-
# @return [Object] Returns the model itself
|
120
|
-
def build_from_hash(attributes)
|
121
114
|
return nil unless attributes.is_a?(Hash)
|
122
115
|
attributes = attributes.transform_keys(&:to_sym)
|
123
|
-
|
124
|
-
|
125
|
-
|
116
|
+
transformed_hash = {}
|
117
|
+
openapi_types.each_pair do |key, type|
|
118
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
119
|
+
transformed_hash["#{key}"] = nil
|
126
120
|
elsif type =~ /\AArray<(.*)>/i
|
127
121
|
# check to ensure the input is an array given that the attribute
|
128
122
|
# is documented as an array but the input is not
|
129
|
-
if attributes[
|
130
|
-
|
123
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
124
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
131
125
|
end
|
132
|
-
elsif !attributes[
|
133
|
-
|
126
|
+
elsif !attributes[attribute_map[key]].nil?
|
127
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
134
128
|
end
|
135
129
|
end
|
136
|
-
|
137
|
-
self
|
130
|
+
new(transformed_hash)
|
138
131
|
end
|
139
132
|
|
140
133
|
# Deserializes the data based on type
|
141
134
|
# @param string type Data type
|
142
135
|
# @param string value Value to be deserialized
|
143
136
|
# @return [Object] Deserialized data
|
144
|
-
def _deserialize(type, value)
|
137
|
+
def self._deserialize(type, value)
|
145
138
|
case type.to_sym
|
146
139
|
when :Time
|
147
140
|
Time.parse(value)
|
@@ -176,7 +169,7 @@ module YNAB
|
|
176
169
|
else # model
|
177
170
|
# models (e.g. Pet) or oneOf
|
178
171
|
klass = YNAB.const_get(type)
|
179
|
-
klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
172
|
+
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
180
173
|
end
|
181
174
|
end
|
182
175
|
|
@@ -3,10 +3,10 @@
|
|
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
|
-
The version of the OpenAPI document: 1.
|
6
|
+
The version of the OpenAPI document: 1.70.0
|
7
7
|
|
8
8
|
Generated by: https://openapi-generator.tech
|
9
|
-
|
9
|
+
Generator version: 7.6.0
|
10
10
|
|
11
11
|
=end
|
12
12
|
|
@@ -100,37 +100,30 @@ module YNAB
|
|
100
100
|
# @param [Hash] attributes Model attributes in the form of hash
|
101
101
|
# @return [Object] Returns the model itself
|
102
102
|
def self.build_from_hash(attributes)
|
103
|
-
new.build_from_hash(attributes)
|
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 build_from_hash(attributes)
|
110
103
|
return nil unless attributes.is_a?(Hash)
|
111
104
|
attributes = attributes.transform_keys(&:to_sym)
|
112
|
-
|
113
|
-
|
114
|
-
|
105
|
+
transformed_hash = {}
|
106
|
+
openapi_types.each_pair do |key, type|
|
107
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
108
|
+
transformed_hash["#{key}"] = nil
|
115
109
|
elsif type =~ /\AArray<(.*)>/i
|
116
110
|
# check to ensure the input is an array given that the attribute
|
117
111
|
# is documented as an array but the input is not
|
118
|
-
if attributes[
|
119
|
-
|
112
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
113
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
120
114
|
end
|
121
|
-
elsif !attributes[
|
122
|
-
|
115
|
+
elsif !attributes[attribute_map[key]].nil?
|
116
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
123
117
|
end
|
124
118
|
end
|
125
|
-
|
126
|
-
self
|
119
|
+
new(transformed_hash)
|
127
120
|
end
|
128
121
|
|
129
122
|
# Deserializes the data based on type
|
130
123
|
# @param string type Data type
|
131
124
|
# @param string value Value to be deserialized
|
132
125
|
# @return [Object] Deserialized data
|
133
|
-
def _deserialize(type, value)
|
126
|
+
def self._deserialize(type, value)
|
134
127
|
case type.to_sym
|
135
128
|
when :Time
|
136
129
|
Time.parse(value)
|
@@ -165,7 +158,7 @@ module YNAB
|
|
165
158
|
else # model
|
166
159
|
# models (e.g. Pet) or oneOf
|
167
160
|
klass = YNAB.const_get(type)
|
168
|
-
klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
161
|
+
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
169
162
|
end
|
170
163
|
end
|
171
164
|
|
@@ -3,10 +3,10 @@
|
|
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
|
-
The version of the OpenAPI document: 1.
|
6
|
+
The version of the OpenAPI document: 1.70.0
|
7
7
|
|
8
8
|
Generated by: https://openapi-generator.tech
|
9
|
-
|
9
|
+
Generator version: 7.6.0
|
10
10
|
|
11
11
|
=end
|
12
12
|
|
@@ -100,37 +100,30 @@ module YNAB
|
|
100
100
|
# @param [Hash] attributes Model attributes in the form of hash
|
101
101
|
# @return [Object] Returns the model itself
|
102
102
|
def self.build_from_hash(attributes)
|
103
|
-
new.build_from_hash(attributes)
|
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 build_from_hash(attributes)
|
110
103
|
return nil unless attributes.is_a?(Hash)
|
111
104
|
attributes = attributes.transform_keys(&:to_sym)
|
112
|
-
|
113
|
-
|
114
|
-
|
105
|
+
transformed_hash = {}
|
106
|
+
openapi_types.each_pair do |key, type|
|
107
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
108
|
+
transformed_hash["#{key}"] = nil
|
115
109
|
elsif type =~ /\AArray<(.*)>/i
|
116
110
|
# check to ensure the input is an array given that the attribute
|
117
111
|
# is documented as an array but the input is not
|
118
|
-
if attributes[
|
119
|
-
|
112
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
113
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
120
114
|
end
|
121
|
-
elsif !attributes[
|
122
|
-
|
115
|
+
elsif !attributes[attribute_map[key]].nil?
|
116
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
123
117
|
end
|
124
118
|
end
|
125
|
-
|
126
|
-
self
|
119
|
+
new(transformed_hash)
|
127
120
|
end
|
128
121
|
|
129
122
|
# Deserializes the data based on type
|
130
123
|
# @param string type Data type
|
131
124
|
# @param string value Value to be deserialized
|
132
125
|
# @return [Object] Deserialized data
|
133
|
-
def _deserialize(type, value)
|
126
|
+
def self._deserialize(type, value)
|
134
127
|
case type.to_sym
|
135
128
|
when :Time
|
136
129
|
Time.parse(value)
|
@@ -165,7 +158,7 @@ module YNAB
|
|
165
158
|
else # model
|
166
159
|
# models (e.g. Pet) or oneOf
|
167
160
|
klass = YNAB.const_get(type)
|
168
|
-
klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
161
|
+
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
169
162
|
end
|
170
163
|
end
|
171
164
|
|
@@ -3,10 +3,10 @@
|
|
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
|
-
The version of the OpenAPI document: 1.
|
6
|
+
The version of the OpenAPI document: 1.70.0
|
7
7
|
|
8
8
|
Generated by: https://openapi-generator.tech
|
9
|
-
|
9
|
+
Generator version: 7.6.0
|
10
10
|
|
11
11
|
=end
|
12
12
|
|
@@ -116,37 +116,30 @@ module YNAB
|
|
116
116
|
# @param [Hash] attributes Model attributes in the form of hash
|
117
117
|
# @return [Object] Returns the model itself
|
118
118
|
def self.build_from_hash(attributes)
|
119
|
-
new.build_from_hash(attributes)
|
120
|
-
end
|
121
|
-
|
122
|
-
# Builds the object from hash
|
123
|
-
# @param [Hash] attributes Model attributes in the form of hash
|
124
|
-
# @return [Object] Returns the model itself
|
125
|
-
def build_from_hash(attributes)
|
126
119
|
return nil unless attributes.is_a?(Hash)
|
127
120
|
attributes = attributes.transform_keys(&:to_sym)
|
128
|
-
|
129
|
-
|
130
|
-
|
121
|
+
transformed_hash = {}
|
122
|
+
openapi_types.each_pair do |key, type|
|
123
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
124
|
+
transformed_hash["#{key}"] = nil
|
131
125
|
elsif type =~ /\AArray<(.*)>/i
|
132
126
|
# check to ensure the input is an array given that the attribute
|
133
127
|
# is documented as an array but the input is not
|
134
|
-
if attributes[
|
135
|
-
|
128
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
129
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
136
130
|
end
|
137
|
-
elsif !attributes[
|
138
|
-
|
131
|
+
elsif !attributes[attribute_map[key]].nil?
|
132
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
139
133
|
end
|
140
134
|
end
|
141
|
-
|
142
|
-
self
|
135
|
+
new(transformed_hash)
|
143
136
|
end
|
144
137
|
|
145
138
|
# Deserializes the data based on type
|
146
139
|
# @param string type Data type
|
147
140
|
# @param string value Value to be deserialized
|
148
141
|
# @return [Object] Deserialized data
|
149
|
-
def _deserialize(type, value)
|
142
|
+
def self._deserialize(type, value)
|
150
143
|
case type.to_sym
|
151
144
|
when :Time
|
152
145
|
Time.parse(value)
|
@@ -181,7 +174,7 @@ module YNAB
|
|
181
174
|
else # model
|
182
175
|
# models (e.g. Pet) or oneOf
|
183
176
|
klass = YNAB.const_get(type)
|
184
|
-
klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
177
|
+
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
185
178
|
end
|
186
179
|
end
|
187
180
|
|
@@ -3,10 +3,10 @@
|
|
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
|
-
The version of the OpenAPI document: 1.
|
6
|
+
The version of the OpenAPI document: 1.70.0
|
7
7
|
|
8
8
|
Generated by: https://openapi-generator.tech
|
9
|
-
|
9
|
+
Generator version: 7.6.0
|
10
10
|
|
11
11
|
=end
|
12
12
|
|
@@ -32,7 +32,7 @@ module YNAB
|
|
32
32
|
# Attribute type mapping.
|
33
33
|
def self.openapi_types
|
34
34
|
{
|
35
|
-
:'transactions' => :'Array<
|
35
|
+
:'transactions' => :'Array<SaveTransactionWithOptionalFields>'
|
36
36
|
}
|
37
37
|
end
|
38
38
|
|
@@ -102,37 +102,30 @@ module YNAB
|
|
102
102
|
# @param [Hash] attributes Model attributes in the form of hash
|
103
103
|
# @return [Object] Returns the model itself
|
104
104
|
def self.build_from_hash(attributes)
|
105
|
-
new.build_from_hash(attributes)
|
106
|
-
end
|
107
|
-
|
108
|
-
# Builds the object from hash
|
109
|
-
# @param [Hash] attributes Model attributes in the form of hash
|
110
|
-
# @return [Object] Returns the model itself
|
111
|
-
def build_from_hash(attributes)
|
112
105
|
return nil unless attributes.is_a?(Hash)
|
113
106
|
attributes = attributes.transform_keys(&:to_sym)
|
114
|
-
|
115
|
-
|
116
|
-
|
107
|
+
transformed_hash = {}
|
108
|
+
openapi_types.each_pair do |key, type|
|
109
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
110
|
+
transformed_hash["#{key}"] = nil
|
117
111
|
elsif type =~ /\AArray<(.*)>/i
|
118
112
|
# check to ensure the input is an array given that the attribute
|
119
113
|
# is documented as an array but the input is not
|
120
|
-
if attributes[
|
121
|
-
|
114
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
115
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
122
116
|
end
|
123
|
-
elsif !attributes[
|
124
|
-
|
117
|
+
elsif !attributes[attribute_map[key]].nil?
|
118
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
125
119
|
end
|
126
120
|
end
|
127
|
-
|
128
|
-
self
|
121
|
+
new(transformed_hash)
|
129
122
|
end
|
130
123
|
|
131
124
|
# Deserializes the data based on type
|
132
125
|
# @param string type Data type
|
133
126
|
# @param string value Value to be deserialized
|
134
127
|
# @return [Object] Deserialized data
|
135
|
-
def _deserialize(type, value)
|
128
|
+
def self._deserialize(type, value)
|
136
129
|
case type.to_sym
|
137
130
|
when :Time
|
138
131
|
Time.parse(value)
|
@@ -167,7 +160,7 @@ module YNAB
|
|
167
160
|
else # model
|
168
161
|
# models (e.g. Pet) or oneOf
|
169
162
|
klass = YNAB.const_get(type)
|
170
|
-
klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
163
|
+
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
171
164
|
end
|
172
165
|
end
|
173
166
|
|
@@ -3,10 +3,10 @@
|
|
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
|
-
The version of the OpenAPI document: 1.
|
6
|
+
The version of the OpenAPI document: 1.70.0
|
7
7
|
|
8
8
|
Generated by: https://openapi-generator.tech
|
9
|
-
|
9
|
+
Generator version: 7.6.0
|
10
10
|
|
11
11
|
=end
|
12
12
|
|
@@ -100,37 +100,30 @@ module YNAB
|
|
100
100
|
# @param [Hash] attributes Model attributes in the form of hash
|
101
101
|
# @return [Object] Returns the model itself
|
102
102
|
def self.build_from_hash(attributes)
|
103
|
-
new.build_from_hash(attributes)
|
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 build_from_hash(attributes)
|
110
103
|
return nil unless attributes.is_a?(Hash)
|
111
104
|
attributes = attributes.transform_keys(&:to_sym)
|
112
|
-
|
113
|
-
|
114
|
-
|
105
|
+
transformed_hash = {}
|
106
|
+
openapi_types.each_pair do |key, type|
|
107
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
108
|
+
transformed_hash["#{key}"] = nil
|
115
109
|
elsif type =~ /\AArray<(.*)>/i
|
116
110
|
# check to ensure the input is an array given that the attribute
|
117
111
|
# is documented as an array but the input is not
|
118
|
-
if attributes[
|
119
|
-
|
112
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
113
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
120
114
|
end
|
121
|
-
elsif !attributes[
|
122
|
-
|
115
|
+
elsif !attributes[attribute_map[key]].nil?
|
116
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
123
117
|
end
|
124
118
|
end
|
125
|
-
|
126
|
-
self
|
119
|
+
new(transformed_hash)
|
127
120
|
end
|
128
121
|
|
129
122
|
# Deserializes the data based on type
|
130
123
|
# @param string type Data type
|
131
124
|
# @param string value Value to be deserialized
|
132
125
|
# @return [Object] Deserialized data
|
133
|
-
def _deserialize(type, value)
|
126
|
+
def self._deserialize(type, value)
|
134
127
|
case type.to_sym
|
135
128
|
when :Time
|
136
129
|
Time.parse(value)
|
@@ -165,7 +158,7 @@ module YNAB
|
|
165
158
|
else # model
|
166
159
|
# models (e.g. Pet) or oneOf
|
167
160
|
klass = YNAB.const_get(type)
|
168
|
-
klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
161
|
+
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
169
162
|
end
|
170
163
|
end
|
171
164
|
|
@@ -3,10 +3,10 @@
|
|
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
|
-
The version of the OpenAPI document: 1.
|
6
|
+
The version of the OpenAPI document: 1.70.0
|
7
7
|
|
8
8
|
Generated by: https://openapi-generator.tech
|
9
|
-
|
9
|
+
Generator version: 7.6.0
|
10
10
|
|
11
11
|
=end
|
12
12
|
|
@@ -113,37 +113,30 @@ module YNAB
|
|
113
113
|
# @param [Hash] attributes Model attributes in the form of hash
|
114
114
|
# @return [Object] Returns the model itself
|
115
115
|
def self.build_from_hash(attributes)
|
116
|
-
new.build_from_hash(attributes)
|
117
|
-
end
|
118
|
-
|
119
|
-
# Builds the object from hash
|
120
|
-
# @param [Hash] attributes Model attributes in the form of hash
|
121
|
-
# @return [Object] Returns the model itself
|
122
|
-
def build_from_hash(attributes)
|
123
116
|
return nil unless attributes.is_a?(Hash)
|
124
117
|
attributes = attributes.transform_keys(&:to_sym)
|
125
|
-
|
126
|
-
|
127
|
-
|
118
|
+
transformed_hash = {}
|
119
|
+
openapi_types.each_pair do |key, type|
|
120
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
121
|
+
transformed_hash["#{key}"] = nil
|
128
122
|
elsif type =~ /\AArray<(.*)>/i
|
129
123
|
# check to ensure the input is an array given that the attribute
|
130
124
|
# is documented as an array but the input is not
|
131
|
-
if attributes[
|
132
|
-
|
125
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
126
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
133
127
|
end
|
134
|
-
elsif !attributes[
|
135
|
-
|
128
|
+
elsif !attributes[attribute_map[key]].nil?
|
129
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
136
130
|
end
|
137
131
|
end
|
138
|
-
|
139
|
-
self
|
132
|
+
new(transformed_hash)
|
140
133
|
end
|
141
134
|
|
142
135
|
# Deserializes the data based on type
|
143
136
|
# @param string type Data type
|
144
137
|
# @param string value Value to be deserialized
|
145
138
|
# @return [Object] Deserialized data
|
146
|
-
def _deserialize(type, value)
|
139
|
+
def self._deserialize(type, value)
|
147
140
|
case type.to_sym
|
148
141
|
when :Time
|
149
142
|
Time.parse(value)
|
@@ -178,7 +171,7 @@ module YNAB
|
|
178
171
|
else # model
|
179
172
|
# models (e.g. Pet) or oneOf
|
180
173
|
klass = YNAB.const_get(type)
|
181
|
-
klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
174
|
+
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
182
175
|
end
|
183
176
|
end
|
184
177
|
|
data/lib/ynab/models/category.rb
CHANGED
@@ -3,10 +3,10 @@
|
|
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
|
-
The version of the OpenAPI document: 1.
|
6
|
+
The version of the OpenAPI document: 1.70.0
|
7
7
|
|
8
8
|
Generated by: https://openapi-generator.tech
|
9
|
-
|
9
|
+
Generator version: 7.6.0
|
10
10
|
|
11
11
|
=end
|
12
12
|
|
@@ -43,6 +43,9 @@ module YNAB
|
|
43
43
|
# The type of goal, if the category has a goal (TB='Target Category Balance', TBD='Target Category Balance by Date', MF='Monthly Funding', NEED='Plan Your Spending')
|
44
44
|
attr_accessor :goal_type
|
45
45
|
|
46
|
+
# Indicates the monthly rollover behavior for \"NEED\"-type goals. When \"true\", the goal will always ask for the target amount in the new month (\"Set Aside\"). When \"false\", previous month category funding is used (\"Refill\"). For other goal types, this field will be null.
|
47
|
+
attr_accessor :goal_needs_whole_amount
|
48
|
+
|
46
49
|
# A day offset modifier for the goal's due date. When goal_cadence is 2 (Weekly), this value specifies which day of the week the goal is due (0 = Sunday, 6 = Saturday). Otherwise, this value specifies which day of the month the goal is due (1 = 1st, 31 = 31st, null = Last day of Month).
|
47
50
|
attr_accessor :goal_day
|
48
51
|
|
@@ -115,6 +118,7 @@ module YNAB
|
|
115
118
|
:'activity' => :'activity',
|
116
119
|
:'balance' => :'balance',
|
117
120
|
:'goal_type' => :'goal_type',
|
121
|
+
:'goal_needs_whole_amount' => :'goal_needs_whole_amount',
|
118
122
|
:'goal_day' => :'goal_day',
|
119
123
|
:'goal_cadence' => :'goal_cadence',
|
120
124
|
:'goal_cadence_frequency' => :'goal_cadence_frequency',
|
@@ -149,6 +153,7 @@ module YNAB
|
|
149
153
|
:'activity' => :'Integer',
|
150
154
|
:'balance' => :'Integer',
|
151
155
|
:'goal_type' => :'String',
|
156
|
+
:'goal_needs_whole_amount' => :'Boolean',
|
152
157
|
:'goal_day' => :'Integer',
|
153
158
|
:'goal_cadence' => :'Integer',
|
154
159
|
:'goal_cadence_frequency' => :'Integer',
|
@@ -170,6 +175,7 @@ module YNAB
|
|
170
175
|
:'original_category_group_id',
|
171
176
|
:'note',
|
172
177
|
:'goal_type',
|
178
|
+
:'goal_needs_whole_amount',
|
173
179
|
:'goal_day',
|
174
180
|
:'goal_cadence',
|
175
181
|
:'goal_cadence_frequency',
|
@@ -243,6 +249,10 @@ module YNAB
|
|
243
249
|
self.goal_type = attributes[:'goal_type']
|
244
250
|
end
|
245
251
|
|
252
|
+
if attributes.key?(:'goal_needs_whole_amount')
|
253
|
+
self.goal_needs_whole_amount = attributes[:'goal_needs_whole_amount']
|
254
|
+
end
|
255
|
+
|
246
256
|
if attributes.key?(:'goal_day')
|
247
257
|
self.goal_day = attributes[:'goal_day']
|
248
258
|
end
|
@@ -337,6 +347,7 @@ module YNAB
|
|
337
347
|
activity == o.activity &&
|
338
348
|
balance == o.balance &&
|
339
349
|
goal_type == o.goal_type &&
|
350
|
+
goal_needs_whole_amount == o.goal_needs_whole_amount &&
|
340
351
|
goal_day == o.goal_day &&
|
341
352
|
goal_cadence == o.goal_cadence &&
|
342
353
|
goal_cadence_frequency == o.goal_cadence_frequency &&
|
@@ -360,44 +371,37 @@ module YNAB
|
|
360
371
|
# Calculates hash code according to all attributes.
|
361
372
|
# @return [Integer] Hash code
|
362
373
|
def hash
|
363
|
-
[id, category_group_id, category_group_name, name, hidden, original_category_group_id, note, budgeted, activity, balance, goal_type, goal_day, goal_cadence, goal_cadence_frequency, goal_creation_month, goal_target, goal_target_month, goal_percentage_complete, goal_months_to_budget, goal_under_funded, goal_overall_funded, goal_overall_left, deleted].hash
|
374
|
+
[id, category_group_id, category_group_name, name, hidden, original_category_group_id, note, budgeted, activity, balance, goal_type, goal_needs_whole_amount, goal_day, goal_cadence, goal_cadence_frequency, goal_creation_month, goal_target, goal_target_month, goal_percentage_complete, goal_months_to_budget, goal_under_funded, goal_overall_funded, goal_overall_left, deleted].hash
|
364
375
|
end
|
365
376
|
|
366
377
|
# Builds the object from hash
|
367
378
|
# @param [Hash] attributes Model attributes in the form of hash
|
368
379
|
# @return [Object] Returns the model itself
|
369
380
|
def self.build_from_hash(attributes)
|
370
|
-
new.build_from_hash(attributes)
|
371
|
-
end
|
372
|
-
|
373
|
-
# Builds the object from hash
|
374
|
-
# @param [Hash] attributes Model attributes in the form of hash
|
375
|
-
# @return [Object] Returns the model itself
|
376
|
-
def build_from_hash(attributes)
|
377
381
|
return nil unless attributes.is_a?(Hash)
|
378
382
|
attributes = attributes.transform_keys(&:to_sym)
|
379
|
-
|
380
|
-
|
381
|
-
|
383
|
+
transformed_hash = {}
|
384
|
+
openapi_types.each_pair do |key, type|
|
385
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
386
|
+
transformed_hash["#{key}"] = nil
|
382
387
|
elsif type =~ /\AArray<(.*)>/i
|
383
388
|
# check to ensure the input is an array given that the attribute
|
384
389
|
# is documented as an array but the input is not
|
385
|
-
if attributes[
|
386
|
-
|
390
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
391
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
387
392
|
end
|
388
|
-
elsif !attributes[
|
389
|
-
|
393
|
+
elsif !attributes[attribute_map[key]].nil?
|
394
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
390
395
|
end
|
391
396
|
end
|
392
|
-
|
393
|
-
self
|
397
|
+
new(transformed_hash)
|
394
398
|
end
|
395
399
|
|
396
400
|
# Deserializes the data based on type
|
397
401
|
# @param string type Data type
|
398
402
|
# @param string value Value to be deserialized
|
399
403
|
# @return [Object] Deserialized data
|
400
|
-
def _deserialize(type, value)
|
404
|
+
def self._deserialize(type, value)
|
401
405
|
case type.to_sym
|
402
406
|
when :Time
|
403
407
|
Time.parse(value)
|
@@ -432,7 +436,7 @@ module YNAB
|
|
432
436
|
else # model
|
433
437
|
# models (e.g. Pet) or oneOf
|
434
438
|
klass = YNAB.const_get(type)
|
435
|
-
klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
439
|
+
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
436
440
|
end
|
437
441
|
end
|
438
442
|
|