ynab 3.8.0 → 4.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/Gemfile +1 -0
- data/Gemfile.lock +3 -1
- data/README.md +48 -40
- data/Rakefile +1 -1
- data/docs/Account.md +3 -3
- data/docs/AccountsApi.md +12 -12
- data/docs/CategoriesApi.md +89 -25
- data/docs/Category.md +5 -3
- data/docs/CategoryGroupWithCategories.md +1 -1
- data/docs/ExistingCategory.md +12 -0
- data/docs/MoneyMovement.md +16 -0
- data/docs/MoneyMovementGroup.md +12 -0
- data/docs/MoneyMovementGroupsResponse.md +8 -0
- data/docs/MoneyMovementGroupsResponseData.md +9 -0
- data/docs/MoneyMovementsApi.md +89 -0
- data/docs/{BudgetSettingsResponse.md → MoneyMovementsResponse.md} +2 -2
- data/docs/MoneyMovementsResponseData.md +9 -0
- data/docs/MonthDetail.md +2 -2
- data/docs/MonthSummary.md +1 -1
- data/docs/MonthsApi.md +13 -13
- data/docs/NewCategory.md +12 -0
- data/docs/PatchCategoryGroupWrapper.md +8 -0
- data/docs/PatchCategoryWrapper.md +1 -1
- data/docs/PayeeLocationsApi.md +12 -12
- data/docs/PayeesApi.md +11 -11
- data/docs/{BudgetDetail.md → PlanDetail.md} +4 -4
- data/docs/PlanDetailResponse.md +8 -0
- data/docs/{BudgetDetailResponseData.md → PlanDetailResponseData.md} +2 -2
- data/docs/{BudgetSettings.md → PlanSettings.md} +1 -1
- data/docs/{BudgetDetailResponse.md → PlanSettingsResponse.md} +2 -2
- data/docs/PlanSettingsResponseData.md +8 -0
- data/docs/PlanSummary.md +15 -0
- data/docs/PlanSummaryResponse.md +8 -0
- data/docs/PlanSummaryResponseData.md +9 -0
- data/docs/PlansApi.md +68 -0
- data/docs/PostCategoryGroupWrapper.md +8 -0
- data/docs/PostCategoryWrapper.md +8 -0
- data/docs/SaveCategory.md +2 -1
- data/docs/SaveCategoryGroup.md +8 -0
- data/docs/SaveCategoryGroupResponse.md +8 -0
- data/docs/SaveCategoryGroupResponseData.md +9 -0
- data/docs/SaveMonthCategory.md +1 -1
- data/docs/ScheduledTransactionsApi.md +20 -20
- data/docs/TransactionResponseData.md +1 -0
- data/docs/TransactionsApi.md +48 -48
- data/docs/UserApi.md +2 -2
- data/examples/category-balance.rb +2 -2
- data/examples/create-multiple-transactions.rb +2 -2
- data/examples/create-transaction.rb +2 -2
- data/examples/{budget-list.rb → plan-list.rb} +6 -6
- data/examples/{budget-month.rb → plan-month.rb} +9 -10
- data/examples/update-category-budgeted.rb +2 -2
- data/examples/update-multiple-transactions.rb +3 -3
- data/lib/ynab/api/accounts_api.rb +33 -34
- data/lib/ynab/api/categories_api.rb +293 -66
- data/lib/ynab/api/deprecated_api.rb +11 -11
- data/lib/ynab/api/money_movements_api.rb +282 -0
- data/lib/ynab/api/months_api.rb +35 -36
- data/lib/ynab/api/payee_locations_api.rb +33 -34
- data/lib/ynab/api/payees_api.rb +31 -32
- data/lib/ynab/api/{budgets_api.rb → plans_api.rb} +54 -55
- data/lib/ynab/api/scheduled_transactions_api.rb +55 -56
- data/lib/ynab/api/transactions_api.rb +130 -131
- data/lib/ynab/api/user_api.rb +2 -3
- data/lib/ynab/api_client.rb +0 -2
- data/lib/ynab/api_model_base.rb +85 -0
- data/lib/ynab/models/account.rb +4 -81
- data/lib/ynab/models/account_response.rb +1 -75
- data/lib/ynab/models/account_response_data.rb +1 -75
- data/lib/ynab/models/accounts_response.rb +1 -75
- data/lib/ynab/models/accounts_response_data.rb +1 -75
- data/lib/ynab/models/bulk_response.rb +1 -75
- data/lib/ynab/models/bulk_response_data.rb +1 -75
- data/lib/ynab/models/bulk_response_data_bulk.rb +1 -75
- data/lib/ynab/models/bulk_transactions.rb +1 -75
- data/lib/ynab/models/categories_response.rb +1 -75
- data/lib/ynab/models/categories_response_data.rb +1 -75
- data/lib/ynab/models/category.rb +27 -79
- data/lib/ynab/models/category_group.rb +1 -75
- data/lib/ynab/models/category_group_with_categories.rb +2 -76
- data/lib/ynab/models/category_response.rb +1 -75
- data/lib/ynab/models/category_response_data.rb +1 -75
- data/lib/ynab/models/currency_format.rb +2 -76
- data/lib/ynab/models/date_format.rb +2 -76
- data/lib/ynab/models/error_detail.rb +1 -75
- data/lib/ynab/models/error_response.rb +1 -75
- data/lib/ynab/models/existing_category.rb +180 -0
- data/lib/ynab/models/existing_transaction.rb +1 -79
- data/lib/ynab/models/hybrid_transaction.rb +1 -85
- data/lib/ynab/models/hybrid_transactions_response.rb +1 -75
- data/lib/ynab/models/hybrid_transactions_response_data.rb +1 -75
- data/lib/ynab/models/money_movement.rb +223 -0
- data/lib/ynab/models/money_movement_group.rb +179 -0
- data/lib/ynab/models/{budget_summary_response.rb → money_movement_groups_response.rb} +4 -78
- data/lib/ynab/models/money_movement_groups_response_data.rb +149 -0
- data/lib/ynab/models/{budget_settings_response.rb → money_movements_response.rb} +4 -78
- data/lib/ynab/models/money_movements_response_data.rb +149 -0
- data/lib/ynab/models/month_detail.rb +3 -79
- data/lib/ynab/models/month_detail_response.rb +1 -75
- data/lib/ynab/models/month_detail_response_data.rb +1 -75
- data/lib/ynab/models/month_summaries_response.rb +1 -75
- data/lib/ynab/models/month_summaries_response_data.rb +1 -75
- data/lib/ynab/models/month_summary.rb +2 -76
- data/lib/ynab/models/new_category.rb +180 -0
- data/lib/ynab/models/new_transaction.rb +1 -79
- data/lib/ynab/models/patch_category_group_wrapper.rb +136 -0
- data/lib/ynab/models/patch_category_wrapper.rb +2 -76
- data/lib/ynab/models/patch_month_category_wrapper.rb +1 -75
- data/lib/ynab/models/patch_payee_wrapper.rb +1 -75
- data/lib/ynab/models/patch_transactions_wrapper.rb +1 -75
- data/lib/ynab/models/payee.rb +1 -75
- data/lib/ynab/models/payee_location.rb +1 -75
- data/lib/ynab/models/payee_location_response.rb +1 -75
- data/lib/ynab/models/payee_location_response_data.rb +1 -75
- data/lib/ynab/models/payee_locations_response.rb +1 -75
- data/lib/ynab/models/payee_locations_response_data.rb +1 -75
- data/lib/ynab/models/payee_response.rb +1 -75
- data/lib/ynab/models/payee_response_data.rb +1 -75
- data/lib/ynab/models/payees_response.rb +1 -75
- data/lib/ynab/models/payees_response_data.rb +1 -75
- data/lib/ynab/models/{budget_detail.rb → plan_detail.rb} +7 -83
- data/lib/ynab/models/plan_detail_response.rb +136 -0
- data/lib/ynab/models/{budget_detail_response_data.rb → plan_detail_response_data.rb} +4 -78
- data/lib/ynab/models/{budget_settings.rb → plan_settings.rb} +5 -79
- data/lib/ynab/models/{budget_detail_response.rb → plan_settings_response.rb} +4 -78
- data/lib/ynab/models/{budget_settings_response_data.rb → plan_settings_response_data.rb} +4 -78
- data/lib/ynab/models/{budget_summary.rb → plan_summary.rb} +7 -83
- data/lib/ynab/models/plan_summary_response.rb +136 -0
- data/lib/ynab/models/{budget_summary_response_data.rb → plan_summary_response_data.rb} +5 -79
- data/lib/ynab/models/post_account_wrapper.rb +1 -75
- data/lib/ynab/models/post_category_group_wrapper.rb +136 -0
- data/lib/ynab/models/post_category_wrapper.rb +136 -0
- data/lib/ynab/models/post_scheduled_transaction_wrapper.rb +1 -75
- data/lib/ynab/models/post_transactions_wrapper.rb +1 -75
- data/lib/ynab/models/put_scheduled_transaction_wrapper.rb +1 -75
- data/lib/ynab/models/put_transaction_wrapper.rb +1 -75
- data/lib/ynab/models/save_account.rb +1 -75
- data/lib/ynab/models/save_category.rb +18 -81
- data/lib/ynab/models/save_category_group.rb +148 -0
- data/lib/ynab/models/save_category_group_response.rb +136 -0
- data/lib/ynab/models/save_category_group_response_data.rb +147 -0
- data/lib/ynab/models/save_category_response.rb +1 -75
- data/lib/ynab/models/save_category_response_data.rb +1 -75
- data/lib/ynab/models/save_month_category.rb +2 -76
- data/lib/ynab/models/save_payee.rb +1 -75
- data/lib/ynab/models/save_payee_response.rb +1 -75
- data/lib/ynab/models/save_payee_response_data.rb +1 -75
- data/lib/ynab/models/save_scheduled_transaction.rb +1 -75
- data/lib/ynab/models/save_sub_transaction.rb +1 -75
- data/lib/ynab/models/save_transaction_with_id_or_import_id.rb +1 -79
- data/lib/ynab/models/save_transaction_with_optional_fields.rb +1 -75
- data/lib/ynab/models/save_transactions_response.rb +1 -75
- data/lib/ynab/models/save_transactions_response_data.rb +1 -75
- data/lib/ynab/models/scheduled_sub_transaction.rb +1 -75
- data/lib/ynab/models/scheduled_transaction_detail.rb +1 -80
- data/lib/ynab/models/scheduled_transaction_response.rb +1 -75
- data/lib/ynab/models/scheduled_transaction_response_data.rb +1 -75
- data/lib/ynab/models/scheduled_transaction_summary.rb +1 -75
- data/lib/ynab/models/scheduled_transactions_response.rb +1 -75
- data/lib/ynab/models/scheduled_transactions_response_data.rb +1 -75
- data/lib/ynab/models/sub_transaction.rb +1 -75
- data/lib/ynab/models/transaction_detail.rb +1 -85
- data/lib/ynab/models/transaction_flag_color.rb +2 -1
- data/lib/ynab/models/transaction_response.rb +1 -75
- data/lib/ynab/models/transaction_response_data.rb +16 -79
- data/lib/ynab/models/transaction_summary.rb +1 -75
- data/lib/ynab/models/transactions_import_response.rb +1 -75
- data/lib/ynab/models/transactions_import_response_data.rb +1 -75
- data/lib/ynab/models/transactions_response.rb +1 -75
- data/lib/ynab/models/transactions_response_data.rb +1 -75
- data/lib/ynab/models/user.rb +1 -75
- data/lib/ynab/models/user_response.rb +1 -75
- data/lib/ynab/models/user_response_data.rb +1 -75
- data/lib/ynab/overrides/transactions_api.rb +6 -6
- data/lib/ynab/version.rb +1 -1
- data/lib/ynab.rb +28 -13
- data/open_api_spec.yaml +1163 -905
- data/spec/api/accounts_spec.rb +9 -9
- data/spec/api/categories_spec.rb +9 -9
- data/spec/api/months_spec.rb +7 -7
- data/spec/api/payee_locations_spec.rb +7 -7
- data/spec/api/payees_spec.rb +7 -7
- data/spec/api/{budgets_spec.rb → plans_spec.rb} +12 -12
- data/spec/api/scheduled_transactions_spec.rb +9 -9
- data/spec/api/transactions_spec.rb +28 -28
- data/spec/fixtures/vcr_cassettes/plans.yml +49 -0
- data/spec/fixtures/vcr_cassettes/plans_unauthorized.yml +49 -0
- data/templates/gem.mustache +3 -2
- data/templates/partial_model_generic.mustache +1 -1
- data/ynab.gemspec +1 -2
- metadata +94 -59
- data/docs/BudgetSettingsResponseData.md +0 -8
- data/docs/BudgetSummary.md +0 -15
- data/docs/BudgetSummaryResponse.md +0 -8
- data/docs/BudgetSummaryResponseData.md +0 -9
- data/docs/BudgetsApi.md +0 -68
|
@@ -11,7 +11,7 @@ require 'date'
|
|
|
11
11
|
require 'time'
|
|
12
12
|
|
|
13
13
|
module YNAB
|
|
14
|
-
class SavePayeeResponse
|
|
14
|
+
class SavePayeeResponse < ApiModelBase
|
|
15
15
|
attr_accessor :data
|
|
16
16
|
|
|
17
17
|
# Attribute mapping from ruby-style variable name to JSON key.
|
|
@@ -116,61 +116,6 @@ module YNAB
|
|
|
116
116
|
new(transformed_hash)
|
|
117
117
|
end
|
|
118
118
|
|
|
119
|
-
# Deserializes the data based on type
|
|
120
|
-
# @param string type Data type
|
|
121
|
-
# @param string value Value to be deserialized
|
|
122
|
-
# @return [Object] Deserialized data
|
|
123
|
-
def self._deserialize(type, value)
|
|
124
|
-
case type.to_sym
|
|
125
|
-
when :Time
|
|
126
|
-
Time.parse(value)
|
|
127
|
-
when :Date
|
|
128
|
-
Date.parse(value)
|
|
129
|
-
when :String
|
|
130
|
-
value.to_s
|
|
131
|
-
when :Integer
|
|
132
|
-
value.to_i
|
|
133
|
-
when :Float
|
|
134
|
-
value.to_f
|
|
135
|
-
when :Boolean
|
|
136
|
-
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
|
137
|
-
true
|
|
138
|
-
else
|
|
139
|
-
false
|
|
140
|
-
end
|
|
141
|
-
when :Object
|
|
142
|
-
# generic object (usually a Hash), return directly
|
|
143
|
-
value
|
|
144
|
-
when /\AArray<(?<inner_type>.+)>\z/
|
|
145
|
-
inner_type = Regexp.last_match[:inner_type]
|
|
146
|
-
value.map { |v| _deserialize(inner_type, v) }
|
|
147
|
-
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
|
148
|
-
k_type = Regexp.last_match[:k_type]
|
|
149
|
-
v_type = Regexp.last_match[:v_type]
|
|
150
|
-
{}.tap do |hash|
|
|
151
|
-
value.each do |k, v|
|
|
152
|
-
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
|
153
|
-
end
|
|
154
|
-
end
|
|
155
|
-
else # model
|
|
156
|
-
# models (e.g. Pet) or oneOf
|
|
157
|
-
klass = YNAB.const_get(type)
|
|
158
|
-
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
|
159
|
-
end
|
|
160
|
-
end
|
|
161
|
-
|
|
162
|
-
# Returns the string representation of the object
|
|
163
|
-
# @return [String] String presentation of the object
|
|
164
|
-
def to_s
|
|
165
|
-
to_hash.to_s
|
|
166
|
-
end
|
|
167
|
-
|
|
168
|
-
# to_body is an alias to to_hash (backward compatibility)
|
|
169
|
-
# @return [Hash] Returns the object in the form of hash
|
|
170
|
-
def to_body
|
|
171
|
-
to_hash
|
|
172
|
-
end
|
|
173
|
-
|
|
174
119
|
# Returns the object in the form of hash
|
|
175
120
|
# @return [Hash] Returns the object in the form of hash
|
|
176
121
|
def to_hash
|
|
@@ -186,25 +131,6 @@ module YNAB
|
|
|
186
131
|
end
|
|
187
132
|
hash
|
|
188
133
|
end
|
|
189
|
-
|
|
190
|
-
# Outputs non-array value in the form of hash
|
|
191
|
-
# For object, use to_hash. Otherwise, just return the value
|
|
192
|
-
# @param [Object] value Any valid value
|
|
193
|
-
# @return [Hash] Returns the value in the form of hash
|
|
194
|
-
def _to_hash(value)
|
|
195
|
-
if value.is_a?(Array)
|
|
196
|
-
value.compact.map { |v| _to_hash(v) }
|
|
197
|
-
elsif value.is_a?(Hash)
|
|
198
|
-
{}.tap do |hash|
|
|
199
|
-
value.each { |k, v| hash[k] = _to_hash(v) }
|
|
200
|
-
end
|
|
201
|
-
elsif value.respond_to? :to_hash
|
|
202
|
-
value.to_hash
|
|
203
|
-
else
|
|
204
|
-
value
|
|
205
|
-
end
|
|
206
|
-
end
|
|
207
|
-
|
|
208
134
|
end
|
|
209
135
|
|
|
210
136
|
end
|
|
@@ -11,7 +11,7 @@ require 'date'
|
|
|
11
11
|
require 'time'
|
|
12
12
|
|
|
13
13
|
module YNAB
|
|
14
|
-
class SavePayeeResponseData
|
|
14
|
+
class SavePayeeResponseData < ApiModelBase
|
|
15
15
|
attr_accessor :payee
|
|
16
16
|
|
|
17
17
|
# The knowledge of the server
|
|
@@ -127,61 +127,6 @@ module YNAB
|
|
|
127
127
|
new(transformed_hash)
|
|
128
128
|
end
|
|
129
129
|
|
|
130
|
-
# Deserializes the data based on type
|
|
131
|
-
# @param string type Data type
|
|
132
|
-
# @param string value Value to be deserialized
|
|
133
|
-
# @return [Object] Deserialized data
|
|
134
|
-
def self._deserialize(type, value)
|
|
135
|
-
case type.to_sym
|
|
136
|
-
when :Time
|
|
137
|
-
Time.parse(value)
|
|
138
|
-
when :Date
|
|
139
|
-
Date.parse(value)
|
|
140
|
-
when :String
|
|
141
|
-
value.to_s
|
|
142
|
-
when :Integer
|
|
143
|
-
value.to_i
|
|
144
|
-
when :Float
|
|
145
|
-
value.to_f
|
|
146
|
-
when :Boolean
|
|
147
|
-
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
|
148
|
-
true
|
|
149
|
-
else
|
|
150
|
-
false
|
|
151
|
-
end
|
|
152
|
-
when :Object
|
|
153
|
-
# generic object (usually a Hash), return directly
|
|
154
|
-
value
|
|
155
|
-
when /\AArray<(?<inner_type>.+)>\z/
|
|
156
|
-
inner_type = Regexp.last_match[:inner_type]
|
|
157
|
-
value.map { |v| _deserialize(inner_type, v) }
|
|
158
|
-
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
|
159
|
-
k_type = Regexp.last_match[:k_type]
|
|
160
|
-
v_type = Regexp.last_match[:v_type]
|
|
161
|
-
{}.tap do |hash|
|
|
162
|
-
value.each do |k, v|
|
|
163
|
-
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
|
164
|
-
end
|
|
165
|
-
end
|
|
166
|
-
else # model
|
|
167
|
-
# models (e.g. Pet) or oneOf
|
|
168
|
-
klass = YNAB.const_get(type)
|
|
169
|
-
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
|
170
|
-
end
|
|
171
|
-
end
|
|
172
|
-
|
|
173
|
-
# Returns the string representation of the object
|
|
174
|
-
# @return [String] String presentation of the object
|
|
175
|
-
def to_s
|
|
176
|
-
to_hash.to_s
|
|
177
|
-
end
|
|
178
|
-
|
|
179
|
-
# to_body is an alias to to_hash (backward compatibility)
|
|
180
|
-
# @return [Hash] Returns the object in the form of hash
|
|
181
|
-
def to_body
|
|
182
|
-
to_hash
|
|
183
|
-
end
|
|
184
|
-
|
|
185
130
|
# Returns the object in the form of hash
|
|
186
131
|
# @return [Hash] Returns the object in the form of hash
|
|
187
132
|
def to_hash
|
|
@@ -197,25 +142,6 @@ module YNAB
|
|
|
197
142
|
end
|
|
198
143
|
hash
|
|
199
144
|
end
|
|
200
|
-
|
|
201
|
-
# Outputs non-array value in the form of hash
|
|
202
|
-
# For object, use to_hash. Otherwise, just return the value
|
|
203
|
-
# @param [Object] value Any valid value
|
|
204
|
-
# @return [Hash] Returns the value in the form of hash
|
|
205
|
-
def _to_hash(value)
|
|
206
|
-
if value.is_a?(Array)
|
|
207
|
-
value.compact.map { |v| _to_hash(v) }
|
|
208
|
-
elsif value.is_a?(Hash)
|
|
209
|
-
{}.tap do |hash|
|
|
210
|
-
value.each { |k, v| hash[k] = _to_hash(v) }
|
|
211
|
-
end
|
|
212
|
-
elsif value.respond_to? :to_hash
|
|
213
|
-
value.to_hash
|
|
214
|
-
else
|
|
215
|
-
value
|
|
216
|
-
end
|
|
217
|
-
end
|
|
218
|
-
|
|
219
145
|
end
|
|
220
146
|
|
|
221
147
|
end
|
|
@@ -11,7 +11,7 @@ require 'date'
|
|
|
11
11
|
require 'time'
|
|
12
12
|
|
|
13
13
|
module YNAB
|
|
14
|
-
class SaveScheduledTransaction
|
|
14
|
+
class SaveScheduledTransaction < ApiModelBase
|
|
15
15
|
attr_accessor :account_id
|
|
16
16
|
|
|
17
17
|
# The scheduled transaction date in ISO format (e.g. 2016-12-01). This should be a future date no more than 5 years into the future.
|
|
@@ -235,61 +235,6 @@ module YNAB
|
|
|
235
235
|
new(transformed_hash)
|
|
236
236
|
end
|
|
237
237
|
|
|
238
|
-
# Deserializes the data based on type
|
|
239
|
-
# @param string type Data type
|
|
240
|
-
# @param string value Value to be deserialized
|
|
241
|
-
# @return [Object] Deserialized data
|
|
242
|
-
def self._deserialize(type, value)
|
|
243
|
-
case type.to_sym
|
|
244
|
-
when :Time
|
|
245
|
-
Time.parse(value)
|
|
246
|
-
when :Date
|
|
247
|
-
Date.parse(value)
|
|
248
|
-
when :String
|
|
249
|
-
value.to_s
|
|
250
|
-
when :Integer
|
|
251
|
-
value.to_i
|
|
252
|
-
when :Float
|
|
253
|
-
value.to_f
|
|
254
|
-
when :Boolean
|
|
255
|
-
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
|
256
|
-
true
|
|
257
|
-
else
|
|
258
|
-
false
|
|
259
|
-
end
|
|
260
|
-
when :Object
|
|
261
|
-
# generic object (usually a Hash), return directly
|
|
262
|
-
value
|
|
263
|
-
when /\AArray<(?<inner_type>.+)>\z/
|
|
264
|
-
inner_type = Regexp.last_match[:inner_type]
|
|
265
|
-
value.map { |v| _deserialize(inner_type, v) }
|
|
266
|
-
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
|
267
|
-
k_type = Regexp.last_match[:k_type]
|
|
268
|
-
v_type = Regexp.last_match[:v_type]
|
|
269
|
-
{}.tap do |hash|
|
|
270
|
-
value.each do |k, v|
|
|
271
|
-
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
|
272
|
-
end
|
|
273
|
-
end
|
|
274
|
-
else # model
|
|
275
|
-
# models (e.g. Pet) or oneOf
|
|
276
|
-
klass = YNAB.const_get(type)
|
|
277
|
-
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
|
278
|
-
end
|
|
279
|
-
end
|
|
280
|
-
|
|
281
|
-
# Returns the string representation of the object
|
|
282
|
-
# @return [String] String presentation of the object
|
|
283
|
-
def to_s
|
|
284
|
-
to_hash.to_s
|
|
285
|
-
end
|
|
286
|
-
|
|
287
|
-
# to_body is an alias to to_hash (backward compatibility)
|
|
288
|
-
# @return [Hash] Returns the object in the form of hash
|
|
289
|
-
def to_body
|
|
290
|
-
to_hash
|
|
291
|
-
end
|
|
292
|
-
|
|
293
238
|
# Returns the object in the form of hash
|
|
294
239
|
# @return [Hash] Returns the object in the form of hash
|
|
295
240
|
def to_hash
|
|
@@ -305,25 +250,6 @@ module YNAB
|
|
|
305
250
|
end
|
|
306
251
|
hash
|
|
307
252
|
end
|
|
308
|
-
|
|
309
|
-
# Outputs non-array value in the form of hash
|
|
310
|
-
# For object, use to_hash. Otherwise, just return the value
|
|
311
|
-
# @param [Object] value Any valid value
|
|
312
|
-
# @return [Hash] Returns the value in the form of hash
|
|
313
|
-
def _to_hash(value)
|
|
314
|
-
if value.is_a?(Array)
|
|
315
|
-
value.compact.map { |v| _to_hash(v) }
|
|
316
|
-
elsif value.is_a?(Hash)
|
|
317
|
-
{}.tap do |hash|
|
|
318
|
-
value.each { |k, v| hash[k] = _to_hash(v) }
|
|
319
|
-
end
|
|
320
|
-
elsif value.respond_to? :to_hash
|
|
321
|
-
value.to_hash
|
|
322
|
-
else
|
|
323
|
-
value
|
|
324
|
-
end
|
|
325
|
-
end
|
|
326
|
-
|
|
327
253
|
end
|
|
328
254
|
|
|
329
255
|
end
|
|
@@ -11,7 +11,7 @@ require 'date'
|
|
|
11
11
|
require 'time'
|
|
12
12
|
|
|
13
13
|
module YNAB
|
|
14
|
-
class SaveSubTransaction
|
|
14
|
+
class SaveSubTransaction < ApiModelBase
|
|
15
15
|
# The subtransaction amount in milliunits format.
|
|
16
16
|
attr_accessor :amount
|
|
17
17
|
|
|
@@ -174,61 +174,6 @@ module YNAB
|
|
|
174
174
|
new(transformed_hash)
|
|
175
175
|
end
|
|
176
176
|
|
|
177
|
-
# Deserializes the data based on type
|
|
178
|
-
# @param string type Data type
|
|
179
|
-
# @param string value Value to be deserialized
|
|
180
|
-
# @return [Object] Deserialized data
|
|
181
|
-
def self._deserialize(type, value)
|
|
182
|
-
case type.to_sym
|
|
183
|
-
when :Time
|
|
184
|
-
Time.parse(value)
|
|
185
|
-
when :Date
|
|
186
|
-
Date.parse(value)
|
|
187
|
-
when :String
|
|
188
|
-
value.to_s
|
|
189
|
-
when :Integer
|
|
190
|
-
value.to_i
|
|
191
|
-
when :Float
|
|
192
|
-
value.to_f
|
|
193
|
-
when :Boolean
|
|
194
|
-
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
|
195
|
-
true
|
|
196
|
-
else
|
|
197
|
-
false
|
|
198
|
-
end
|
|
199
|
-
when :Object
|
|
200
|
-
# generic object (usually a Hash), return directly
|
|
201
|
-
value
|
|
202
|
-
when /\AArray<(?<inner_type>.+)>\z/
|
|
203
|
-
inner_type = Regexp.last_match[:inner_type]
|
|
204
|
-
value.map { |v| _deserialize(inner_type, v) }
|
|
205
|
-
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
|
206
|
-
k_type = Regexp.last_match[:k_type]
|
|
207
|
-
v_type = Regexp.last_match[:v_type]
|
|
208
|
-
{}.tap do |hash|
|
|
209
|
-
value.each do |k, v|
|
|
210
|
-
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
|
211
|
-
end
|
|
212
|
-
end
|
|
213
|
-
else # model
|
|
214
|
-
# models (e.g. Pet) or oneOf
|
|
215
|
-
klass = YNAB.const_get(type)
|
|
216
|
-
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
|
217
|
-
end
|
|
218
|
-
end
|
|
219
|
-
|
|
220
|
-
# Returns the string representation of the object
|
|
221
|
-
# @return [String] String presentation of the object
|
|
222
|
-
def to_s
|
|
223
|
-
to_hash.to_s
|
|
224
|
-
end
|
|
225
|
-
|
|
226
|
-
# to_body is an alias to to_hash (backward compatibility)
|
|
227
|
-
# @return [Hash] Returns the object in the form of hash
|
|
228
|
-
def to_body
|
|
229
|
-
to_hash
|
|
230
|
-
end
|
|
231
|
-
|
|
232
177
|
# Returns the object in the form of hash
|
|
233
178
|
# @return [Hash] Returns the object in the form of hash
|
|
234
179
|
def to_hash
|
|
@@ -244,25 +189,6 @@ module YNAB
|
|
|
244
189
|
end
|
|
245
190
|
hash
|
|
246
191
|
end
|
|
247
|
-
|
|
248
|
-
# Outputs non-array value in the form of hash
|
|
249
|
-
# For object, use to_hash. Otherwise, just return the value
|
|
250
|
-
# @param [Object] value Any valid value
|
|
251
|
-
# @return [Hash] Returns the value in the form of hash
|
|
252
|
-
def _to_hash(value)
|
|
253
|
-
if value.is_a?(Array)
|
|
254
|
-
value.compact.map { |v| _to_hash(v) }
|
|
255
|
-
elsif value.is_a?(Hash)
|
|
256
|
-
{}.tap do |hash|
|
|
257
|
-
value.each { |k, v| hash[k] = _to_hash(v) }
|
|
258
|
-
end
|
|
259
|
-
elsif value.respond_to? :to_hash
|
|
260
|
-
value.to_hash
|
|
261
|
-
else
|
|
262
|
-
value
|
|
263
|
-
end
|
|
264
|
-
end
|
|
265
|
-
|
|
266
192
|
end
|
|
267
193
|
|
|
268
194
|
end
|
|
@@ -11,7 +11,7 @@ require 'date'
|
|
|
11
11
|
require 'time'
|
|
12
12
|
|
|
13
13
|
module YNAB
|
|
14
|
-
class SaveTransactionWithIdOrImportId
|
|
14
|
+
class SaveTransactionWithIdOrImportId < ApiModelBase
|
|
15
15
|
attr_accessor :account_id
|
|
16
16
|
|
|
17
17
|
# The transaction date in ISO format (e.g. 2016-12-01). Future dates (scheduled transactions) are not permitted. Split transaction dates cannot be changed and if a different date is supplied it will be ignored.
|
|
@@ -115,10 +115,6 @@ module YNAB
|
|
|
115
115
|
# List of attributes with nullable: true
|
|
116
116
|
def self.openapi_nullable
|
|
117
117
|
Set.new([
|
|
118
|
-
:'payee_id',
|
|
119
|
-
:'payee_name',
|
|
120
|
-
:'category_id',
|
|
121
|
-
:'memo',
|
|
122
118
|
:'flag_color',
|
|
123
119
|
:'id',
|
|
124
120
|
:'import_id'
|
|
@@ -291,61 +287,6 @@ module YNAB
|
|
|
291
287
|
new(transformed_hash)
|
|
292
288
|
end
|
|
293
289
|
|
|
294
|
-
# Deserializes the data based on type
|
|
295
|
-
# @param string type Data type
|
|
296
|
-
# @param string value Value to be deserialized
|
|
297
|
-
# @return [Object] Deserialized data
|
|
298
|
-
def self._deserialize(type, value)
|
|
299
|
-
case type.to_sym
|
|
300
|
-
when :Time
|
|
301
|
-
Time.parse(value)
|
|
302
|
-
when :Date
|
|
303
|
-
Date.parse(value)
|
|
304
|
-
when :String
|
|
305
|
-
value.to_s
|
|
306
|
-
when :Integer
|
|
307
|
-
value.to_i
|
|
308
|
-
when :Float
|
|
309
|
-
value.to_f
|
|
310
|
-
when :Boolean
|
|
311
|
-
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
|
312
|
-
true
|
|
313
|
-
else
|
|
314
|
-
false
|
|
315
|
-
end
|
|
316
|
-
when :Object
|
|
317
|
-
# generic object (usually a Hash), return directly
|
|
318
|
-
value
|
|
319
|
-
when /\AArray<(?<inner_type>.+)>\z/
|
|
320
|
-
inner_type = Regexp.last_match[:inner_type]
|
|
321
|
-
value.map { |v| _deserialize(inner_type, v) }
|
|
322
|
-
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
|
323
|
-
k_type = Regexp.last_match[:k_type]
|
|
324
|
-
v_type = Regexp.last_match[:v_type]
|
|
325
|
-
{}.tap do |hash|
|
|
326
|
-
value.each do |k, v|
|
|
327
|
-
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
|
328
|
-
end
|
|
329
|
-
end
|
|
330
|
-
else # model
|
|
331
|
-
# models (e.g. Pet) or oneOf
|
|
332
|
-
klass = YNAB.const_get(type)
|
|
333
|
-
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
|
334
|
-
end
|
|
335
|
-
end
|
|
336
|
-
|
|
337
|
-
# Returns the string representation of the object
|
|
338
|
-
# @return [String] String presentation of the object
|
|
339
|
-
def to_s
|
|
340
|
-
to_hash.to_s
|
|
341
|
-
end
|
|
342
|
-
|
|
343
|
-
# to_body is an alias to to_hash (backward compatibility)
|
|
344
|
-
# @return [Hash] Returns the object in the form of hash
|
|
345
|
-
def to_body
|
|
346
|
-
to_hash
|
|
347
|
-
end
|
|
348
|
-
|
|
349
290
|
# Returns the object in the form of hash
|
|
350
291
|
# @return [Hash] Returns the object in the form of hash
|
|
351
292
|
def to_hash
|
|
@@ -361,25 +302,6 @@ module YNAB
|
|
|
361
302
|
end
|
|
362
303
|
hash
|
|
363
304
|
end
|
|
364
|
-
|
|
365
|
-
# Outputs non-array value in the form of hash
|
|
366
|
-
# For object, use to_hash. Otherwise, just return the value
|
|
367
|
-
# @param [Object] value Any valid value
|
|
368
|
-
# @return [Hash] Returns the value in the form of hash
|
|
369
|
-
def _to_hash(value)
|
|
370
|
-
if value.is_a?(Array)
|
|
371
|
-
value.compact.map { |v| _to_hash(v) }
|
|
372
|
-
elsif value.is_a?(Hash)
|
|
373
|
-
{}.tap do |hash|
|
|
374
|
-
value.each { |k, v| hash[k] = _to_hash(v) }
|
|
375
|
-
end
|
|
376
|
-
elsif value.respond_to? :to_hash
|
|
377
|
-
value.to_hash
|
|
378
|
-
else
|
|
379
|
-
value
|
|
380
|
-
end
|
|
381
|
-
end
|
|
382
|
-
|
|
383
305
|
end
|
|
384
306
|
|
|
385
307
|
end
|
|
@@ -11,7 +11,7 @@ require 'date'
|
|
|
11
11
|
require 'time'
|
|
12
12
|
|
|
13
13
|
module YNAB
|
|
14
|
-
class SaveTransactionWithOptionalFields
|
|
14
|
+
class SaveTransactionWithOptionalFields < ApiModelBase
|
|
15
15
|
attr_accessor :account_id
|
|
16
16
|
|
|
17
17
|
# The transaction date in ISO format (e.g. 2016-12-01). Future dates (scheduled transactions) are not permitted. Split transaction dates cannot be changed and if a different date is supplied it will be ignored.
|
|
@@ -255,61 +255,6 @@ module YNAB
|
|
|
255
255
|
new(transformed_hash)
|
|
256
256
|
end
|
|
257
257
|
|
|
258
|
-
# Deserializes the data based on type
|
|
259
|
-
# @param string type Data type
|
|
260
|
-
# @param string value Value to be deserialized
|
|
261
|
-
# @return [Object] Deserialized data
|
|
262
|
-
def self._deserialize(type, value)
|
|
263
|
-
case type.to_sym
|
|
264
|
-
when :Time
|
|
265
|
-
Time.parse(value)
|
|
266
|
-
when :Date
|
|
267
|
-
Date.parse(value)
|
|
268
|
-
when :String
|
|
269
|
-
value.to_s
|
|
270
|
-
when :Integer
|
|
271
|
-
value.to_i
|
|
272
|
-
when :Float
|
|
273
|
-
value.to_f
|
|
274
|
-
when :Boolean
|
|
275
|
-
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
|
276
|
-
true
|
|
277
|
-
else
|
|
278
|
-
false
|
|
279
|
-
end
|
|
280
|
-
when :Object
|
|
281
|
-
# generic object (usually a Hash), return directly
|
|
282
|
-
value
|
|
283
|
-
when /\AArray<(?<inner_type>.+)>\z/
|
|
284
|
-
inner_type = Regexp.last_match[:inner_type]
|
|
285
|
-
value.map { |v| _deserialize(inner_type, v) }
|
|
286
|
-
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
|
287
|
-
k_type = Regexp.last_match[:k_type]
|
|
288
|
-
v_type = Regexp.last_match[:v_type]
|
|
289
|
-
{}.tap do |hash|
|
|
290
|
-
value.each do |k, v|
|
|
291
|
-
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
|
292
|
-
end
|
|
293
|
-
end
|
|
294
|
-
else # model
|
|
295
|
-
# models (e.g. Pet) or oneOf
|
|
296
|
-
klass = YNAB.const_get(type)
|
|
297
|
-
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
|
298
|
-
end
|
|
299
|
-
end
|
|
300
|
-
|
|
301
|
-
# Returns the string representation of the object
|
|
302
|
-
# @return [String] String presentation of the object
|
|
303
|
-
def to_s
|
|
304
|
-
to_hash.to_s
|
|
305
|
-
end
|
|
306
|
-
|
|
307
|
-
# to_body is an alias to to_hash (backward compatibility)
|
|
308
|
-
# @return [Hash] Returns the object in the form of hash
|
|
309
|
-
def to_body
|
|
310
|
-
to_hash
|
|
311
|
-
end
|
|
312
|
-
|
|
313
258
|
# Returns the object in the form of hash
|
|
314
259
|
# @return [Hash] Returns the object in the form of hash
|
|
315
260
|
def to_hash
|
|
@@ -325,25 +270,6 @@ module YNAB
|
|
|
325
270
|
end
|
|
326
271
|
hash
|
|
327
272
|
end
|
|
328
|
-
|
|
329
|
-
# Outputs non-array value in the form of hash
|
|
330
|
-
# For object, use to_hash. Otherwise, just return the value
|
|
331
|
-
# @param [Object] value Any valid value
|
|
332
|
-
# @return [Hash] Returns the value in the form of hash
|
|
333
|
-
def _to_hash(value)
|
|
334
|
-
if value.is_a?(Array)
|
|
335
|
-
value.compact.map { |v| _to_hash(v) }
|
|
336
|
-
elsif value.is_a?(Hash)
|
|
337
|
-
{}.tap do |hash|
|
|
338
|
-
value.each { |k, v| hash[k] = _to_hash(v) }
|
|
339
|
-
end
|
|
340
|
-
elsif value.respond_to? :to_hash
|
|
341
|
-
value.to_hash
|
|
342
|
-
else
|
|
343
|
-
value
|
|
344
|
-
end
|
|
345
|
-
end
|
|
346
|
-
|
|
347
273
|
end
|
|
348
274
|
|
|
349
275
|
end
|
|
@@ -11,7 +11,7 @@ require 'date'
|
|
|
11
11
|
require 'time'
|
|
12
12
|
|
|
13
13
|
module YNAB
|
|
14
|
-
class SaveTransactionsResponse
|
|
14
|
+
class SaveTransactionsResponse < ApiModelBase
|
|
15
15
|
attr_accessor :data
|
|
16
16
|
|
|
17
17
|
# Attribute mapping from ruby-style variable name to JSON key.
|
|
@@ -116,61 +116,6 @@ module YNAB
|
|
|
116
116
|
new(transformed_hash)
|
|
117
117
|
end
|
|
118
118
|
|
|
119
|
-
# Deserializes the data based on type
|
|
120
|
-
# @param string type Data type
|
|
121
|
-
# @param string value Value to be deserialized
|
|
122
|
-
# @return [Object] Deserialized data
|
|
123
|
-
def self._deserialize(type, value)
|
|
124
|
-
case type.to_sym
|
|
125
|
-
when :Time
|
|
126
|
-
Time.parse(value)
|
|
127
|
-
when :Date
|
|
128
|
-
Date.parse(value)
|
|
129
|
-
when :String
|
|
130
|
-
value.to_s
|
|
131
|
-
when :Integer
|
|
132
|
-
value.to_i
|
|
133
|
-
when :Float
|
|
134
|
-
value.to_f
|
|
135
|
-
when :Boolean
|
|
136
|
-
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
|
137
|
-
true
|
|
138
|
-
else
|
|
139
|
-
false
|
|
140
|
-
end
|
|
141
|
-
when :Object
|
|
142
|
-
# generic object (usually a Hash), return directly
|
|
143
|
-
value
|
|
144
|
-
when /\AArray<(?<inner_type>.+)>\z/
|
|
145
|
-
inner_type = Regexp.last_match[:inner_type]
|
|
146
|
-
value.map { |v| _deserialize(inner_type, v) }
|
|
147
|
-
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
|
148
|
-
k_type = Regexp.last_match[:k_type]
|
|
149
|
-
v_type = Regexp.last_match[:v_type]
|
|
150
|
-
{}.tap do |hash|
|
|
151
|
-
value.each do |k, v|
|
|
152
|
-
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
|
153
|
-
end
|
|
154
|
-
end
|
|
155
|
-
else # model
|
|
156
|
-
# models (e.g. Pet) or oneOf
|
|
157
|
-
klass = YNAB.const_get(type)
|
|
158
|
-
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
|
159
|
-
end
|
|
160
|
-
end
|
|
161
|
-
|
|
162
|
-
# Returns the string representation of the object
|
|
163
|
-
# @return [String] String presentation of the object
|
|
164
|
-
def to_s
|
|
165
|
-
to_hash.to_s
|
|
166
|
-
end
|
|
167
|
-
|
|
168
|
-
# to_body is an alias to to_hash (backward compatibility)
|
|
169
|
-
# @return [Hash] Returns the object in the form of hash
|
|
170
|
-
def to_body
|
|
171
|
-
to_hash
|
|
172
|
-
end
|
|
173
|
-
|
|
174
119
|
# Returns the object in the form of hash
|
|
175
120
|
# @return [Hash] Returns the object in the form of hash
|
|
176
121
|
def to_hash
|
|
@@ -186,25 +131,6 @@ module YNAB
|
|
|
186
131
|
end
|
|
187
132
|
hash
|
|
188
133
|
end
|
|
189
|
-
|
|
190
|
-
# Outputs non-array value in the form of hash
|
|
191
|
-
# For object, use to_hash. Otherwise, just return the value
|
|
192
|
-
# @param [Object] value Any valid value
|
|
193
|
-
# @return [Hash] Returns the value in the form of hash
|
|
194
|
-
def _to_hash(value)
|
|
195
|
-
if value.is_a?(Array)
|
|
196
|
-
value.compact.map { |v| _to_hash(v) }
|
|
197
|
-
elsif value.is_a?(Hash)
|
|
198
|
-
{}.tap do |hash|
|
|
199
|
-
value.each { |k, v| hash[k] = _to_hash(v) }
|
|
200
|
-
end
|
|
201
|
-
elsif value.respond_to? :to_hash
|
|
202
|
-
value.to_hash
|
|
203
|
-
else
|
|
204
|
-
value
|
|
205
|
-
end
|
|
206
|
-
end
|
|
207
|
-
|
|
208
134
|
end
|
|
209
135
|
|
|
210
136
|
end
|