ynab 3.9.0 → 5.0.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 +4 -2
- data/README.md +47 -39
- data/Rakefile +3 -3
- data/docs/Account.md +3 -3
- data/docs/AccountsApi.md +12 -12
- data/docs/CategoriesApi.md +89 -25
- data/docs/Category.md +4 -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/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} +55 -56
- 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 +16 -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/{budget_summary_response_data.rb → money_movement.rb} +95 -93
- 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/{budget_detail_response_data.rb → money_movements_response_data.rb} +13 -85
- 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/plan_detail_response_data.rb +147 -0
- 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/plan_summary_response_data.rb +147 -0
- 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_response.rb +1 -75
- data/lib/ynab/models/transaction_response_data.rb +1 -75
- 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 +1161 -916
- 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/plans_spec.rb +55 -0
- data/spec/api/scheduled_transactions_spec.rb +9 -9
- data/spec/api/transactions_spec.rb +27 -27
- data/spec/fixtures/vcr_cassettes/account.yml +2 -2
- data/spec/fixtures/vcr_cassettes/accounts.yml +2 -2
- data/spec/fixtures/vcr_cassettes/accounts_unauthorized.yml +2 -2
- data/spec/fixtures/vcr_cassettes/bulk_transactions.yml +2 -2
- data/spec/fixtures/vcr_cassettes/categories.yml +2 -2
- data/spec/fixtures/vcr_cassettes/categories_unauthorized.yml +2 -2
- data/spec/fixtures/vcr_cassettes/category.yml +2 -2
- data/spec/fixtures/vcr_cassettes/category_transactions.yml +2 -2
- data/spec/fixtures/vcr_cassettes/create_account.yml +2 -2
- data/spec/fixtures/vcr_cassettes/create_scheduled_transaction.yml +2 -2
- data/spec/fixtures/vcr_cassettes/create_transaction.yml +2 -2
- data/spec/fixtures/vcr_cassettes/create_transactions.yml +2 -2
- data/spec/fixtures/vcr_cassettes/import_transactions.yml +2 -2
- data/spec/fixtures/vcr_cassettes/month.yml +2 -2
- data/spec/fixtures/vcr_cassettes/month_transactions.yml +2 -2
- data/spec/fixtures/vcr_cassettes/months.yml +2 -2
- data/spec/fixtures/vcr_cassettes/months_unauthorized.yml +2 -2
- data/spec/fixtures/vcr_cassettes/multiple_transactions.yml +2 -2
- data/spec/fixtures/vcr_cassettes/patch_month_category.yml +2 -2
- data/spec/fixtures/vcr_cassettes/payee.yml +2 -2
- data/spec/fixtures/vcr_cassettes/payee_location.yml +2 -2
- data/spec/fixtures/vcr_cassettes/payee_locations.yml +2 -2
- data/spec/fixtures/vcr_cassettes/payee_locations_unauthorized.yml +2 -2
- data/spec/fixtures/vcr_cassettes/payee_transactions.yml +2 -2
- data/spec/fixtures/vcr_cassettes/payees.yml +2 -2
- data/spec/fixtures/vcr_cassettes/payees_unauthorized.yml +2 -2
- data/spec/fixtures/vcr_cassettes/{budget.yml → plan.yml} +3 -3
- data/spec/fixtures/vcr_cassettes/{budgets.yml → plans.yml} +3 -3
- data/spec/fixtures/vcr_cassettes/{budgets_unauthorized.yml → plans_unauthorized.yml} +3 -3
- data/spec/fixtures/vcr_cassettes/scheduled_transaction.yml +2 -2
- data/spec/fixtures/vcr_cassettes/scheduled_transactions.yml +2 -2
- data/spec/fixtures/vcr_cassettes/scheduled_transactions_unauthorized.yml +2 -2
- data/spec/fixtures/vcr_cassettes/transaction.yml +2 -2
- data/spec/fixtures/vcr_cassettes/transactions.yml +2 -2
- data/spec/fixtures/vcr_cassettes/transactions_invalid_flags.yml +2 -2
- data/spec/fixtures/vcr_cassettes/transactions_unauthorized.yml +2 -2
- data/spec/fixtures/vcr_cassettes/update_transaction.yml +2 -2
- data/spec/fixtures/vcr_cassettes/update_transactions.yml +2 -2
- data/templates/gem.mustache +3 -2
- data/templates/partial_model_generic.mustache +1 -1
- data/ynab.gemspec +1 -2
- metadata +64 -33
- 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
- data/spec/api/budgets_spec.rb +0 -55
data/lib/ynab/models/payee.rb
CHANGED
|
@@ -11,7 +11,7 @@ require 'date'
|
|
|
11
11
|
require 'time'
|
|
12
12
|
|
|
13
13
|
module YNAB
|
|
14
|
-
class Payee
|
|
14
|
+
class Payee < ApiModelBase
|
|
15
15
|
attr_accessor :id
|
|
16
16
|
|
|
17
17
|
attr_accessor :name
|
|
@@ -148,61 +148,6 @@ module YNAB
|
|
|
148
148
|
new(transformed_hash)
|
|
149
149
|
end
|
|
150
150
|
|
|
151
|
-
# Deserializes the data based on type
|
|
152
|
-
# @param string type Data type
|
|
153
|
-
# @param string value Value to be deserialized
|
|
154
|
-
# @return [Object] Deserialized data
|
|
155
|
-
def self._deserialize(type, value)
|
|
156
|
-
case type.to_sym
|
|
157
|
-
when :Time
|
|
158
|
-
Time.parse(value)
|
|
159
|
-
when :Date
|
|
160
|
-
Date.parse(value)
|
|
161
|
-
when :String
|
|
162
|
-
value.to_s
|
|
163
|
-
when :Integer
|
|
164
|
-
value.to_i
|
|
165
|
-
when :Float
|
|
166
|
-
value.to_f
|
|
167
|
-
when :Boolean
|
|
168
|
-
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
|
169
|
-
true
|
|
170
|
-
else
|
|
171
|
-
false
|
|
172
|
-
end
|
|
173
|
-
when :Object
|
|
174
|
-
# generic object (usually a Hash), return directly
|
|
175
|
-
value
|
|
176
|
-
when /\AArray<(?<inner_type>.+)>\z/
|
|
177
|
-
inner_type = Regexp.last_match[:inner_type]
|
|
178
|
-
value.map { |v| _deserialize(inner_type, v) }
|
|
179
|
-
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
|
180
|
-
k_type = Regexp.last_match[:k_type]
|
|
181
|
-
v_type = Regexp.last_match[:v_type]
|
|
182
|
-
{}.tap do |hash|
|
|
183
|
-
value.each do |k, v|
|
|
184
|
-
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
|
185
|
-
end
|
|
186
|
-
end
|
|
187
|
-
else # model
|
|
188
|
-
# models (e.g. Pet) or oneOf
|
|
189
|
-
klass = YNAB.const_get(type)
|
|
190
|
-
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
|
191
|
-
end
|
|
192
|
-
end
|
|
193
|
-
|
|
194
|
-
# Returns the string representation of the object
|
|
195
|
-
# @return [String] String presentation of the object
|
|
196
|
-
def to_s
|
|
197
|
-
to_hash.to_s
|
|
198
|
-
end
|
|
199
|
-
|
|
200
|
-
# to_body is an alias to to_hash (backward compatibility)
|
|
201
|
-
# @return [Hash] Returns the object in the form of hash
|
|
202
|
-
def to_body
|
|
203
|
-
to_hash
|
|
204
|
-
end
|
|
205
|
-
|
|
206
151
|
# Returns the object in the form of hash
|
|
207
152
|
# @return [Hash] Returns the object in the form of hash
|
|
208
153
|
def to_hash
|
|
@@ -218,25 +163,6 @@ module YNAB
|
|
|
218
163
|
end
|
|
219
164
|
hash
|
|
220
165
|
end
|
|
221
|
-
|
|
222
|
-
# Outputs non-array value in the form of hash
|
|
223
|
-
# For object, use to_hash. Otherwise, just return the value
|
|
224
|
-
# @param [Object] value Any valid value
|
|
225
|
-
# @return [Hash] Returns the value in the form of hash
|
|
226
|
-
def _to_hash(value)
|
|
227
|
-
if value.is_a?(Array)
|
|
228
|
-
value.compact.map { |v| _to_hash(v) }
|
|
229
|
-
elsif value.is_a?(Hash)
|
|
230
|
-
{}.tap do |hash|
|
|
231
|
-
value.each { |k, v| hash[k] = _to_hash(v) }
|
|
232
|
-
end
|
|
233
|
-
elsif value.respond_to? :to_hash
|
|
234
|
-
value.to_hash
|
|
235
|
-
else
|
|
236
|
-
value
|
|
237
|
-
end
|
|
238
|
-
end
|
|
239
|
-
|
|
240
166
|
end
|
|
241
167
|
|
|
242
168
|
end
|
|
@@ -11,7 +11,7 @@ require 'date'
|
|
|
11
11
|
require 'time'
|
|
12
12
|
|
|
13
13
|
module YNAB
|
|
14
|
-
class PayeeLocation
|
|
14
|
+
class PayeeLocation < ApiModelBase
|
|
15
15
|
attr_accessor :id
|
|
16
16
|
|
|
17
17
|
attr_accessor :payee_id
|
|
@@ -157,61 +157,6 @@ module YNAB
|
|
|
157
157
|
new(transformed_hash)
|
|
158
158
|
end
|
|
159
159
|
|
|
160
|
-
# Deserializes the data based on type
|
|
161
|
-
# @param string type Data type
|
|
162
|
-
# @param string value Value to be deserialized
|
|
163
|
-
# @return [Object] Deserialized data
|
|
164
|
-
def self._deserialize(type, value)
|
|
165
|
-
case type.to_sym
|
|
166
|
-
when :Time
|
|
167
|
-
Time.parse(value)
|
|
168
|
-
when :Date
|
|
169
|
-
Date.parse(value)
|
|
170
|
-
when :String
|
|
171
|
-
value.to_s
|
|
172
|
-
when :Integer
|
|
173
|
-
value.to_i
|
|
174
|
-
when :Float
|
|
175
|
-
value.to_f
|
|
176
|
-
when :Boolean
|
|
177
|
-
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
|
178
|
-
true
|
|
179
|
-
else
|
|
180
|
-
false
|
|
181
|
-
end
|
|
182
|
-
when :Object
|
|
183
|
-
# generic object (usually a Hash), return directly
|
|
184
|
-
value
|
|
185
|
-
when /\AArray<(?<inner_type>.+)>\z/
|
|
186
|
-
inner_type = Regexp.last_match[:inner_type]
|
|
187
|
-
value.map { |v| _deserialize(inner_type, v) }
|
|
188
|
-
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
|
189
|
-
k_type = Regexp.last_match[:k_type]
|
|
190
|
-
v_type = Regexp.last_match[:v_type]
|
|
191
|
-
{}.tap do |hash|
|
|
192
|
-
value.each do |k, v|
|
|
193
|
-
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
|
194
|
-
end
|
|
195
|
-
end
|
|
196
|
-
else # model
|
|
197
|
-
# models (e.g. Pet) or oneOf
|
|
198
|
-
klass = YNAB.const_get(type)
|
|
199
|
-
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
|
200
|
-
end
|
|
201
|
-
end
|
|
202
|
-
|
|
203
|
-
# Returns the string representation of the object
|
|
204
|
-
# @return [String] String presentation of the object
|
|
205
|
-
def to_s
|
|
206
|
-
to_hash.to_s
|
|
207
|
-
end
|
|
208
|
-
|
|
209
|
-
# to_body is an alias to to_hash (backward compatibility)
|
|
210
|
-
# @return [Hash] Returns the object in the form of hash
|
|
211
|
-
def to_body
|
|
212
|
-
to_hash
|
|
213
|
-
end
|
|
214
|
-
|
|
215
160
|
# Returns the object in the form of hash
|
|
216
161
|
# @return [Hash] Returns the object in the form of hash
|
|
217
162
|
def to_hash
|
|
@@ -227,25 +172,6 @@ module YNAB
|
|
|
227
172
|
end
|
|
228
173
|
hash
|
|
229
174
|
end
|
|
230
|
-
|
|
231
|
-
# Outputs non-array value in the form of hash
|
|
232
|
-
# For object, use to_hash. Otherwise, just return the value
|
|
233
|
-
# @param [Object] value Any valid value
|
|
234
|
-
# @return [Hash] Returns the value in the form of hash
|
|
235
|
-
def _to_hash(value)
|
|
236
|
-
if value.is_a?(Array)
|
|
237
|
-
value.compact.map { |v| _to_hash(v) }
|
|
238
|
-
elsif value.is_a?(Hash)
|
|
239
|
-
{}.tap do |hash|
|
|
240
|
-
value.each { |k, v| hash[k] = _to_hash(v) }
|
|
241
|
-
end
|
|
242
|
-
elsif value.respond_to? :to_hash
|
|
243
|
-
value.to_hash
|
|
244
|
-
else
|
|
245
|
-
value
|
|
246
|
-
end
|
|
247
|
-
end
|
|
248
|
-
|
|
249
175
|
end
|
|
250
176
|
|
|
251
177
|
end
|
|
@@ -11,7 +11,7 @@ require 'date'
|
|
|
11
11
|
require 'time'
|
|
12
12
|
|
|
13
13
|
module YNAB
|
|
14
|
-
class PayeeLocationResponse
|
|
14
|
+
class PayeeLocationResponse < 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 PayeeLocationResponseData
|
|
14
|
+
class PayeeLocationResponseData < ApiModelBase
|
|
15
15
|
attr_accessor :payee_location
|
|
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 PayeeLocationsResponse
|
|
14
|
+
class PayeeLocationsResponse < 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 PayeeLocationsResponseData
|
|
14
|
+
class PayeeLocationsResponseData < ApiModelBase
|
|
15
15
|
attr_accessor :payee_locations
|
|
16
16
|
|
|
17
17
|
# Attribute mapping from ruby-style variable name to JSON key.
|
|
@@ -118,61 +118,6 @@ module YNAB
|
|
|
118
118
|
new(transformed_hash)
|
|
119
119
|
end
|
|
120
120
|
|
|
121
|
-
# Deserializes the data based on type
|
|
122
|
-
# @param string type Data type
|
|
123
|
-
# @param string value Value to be deserialized
|
|
124
|
-
# @return [Object] Deserialized data
|
|
125
|
-
def self._deserialize(type, value)
|
|
126
|
-
case type.to_sym
|
|
127
|
-
when :Time
|
|
128
|
-
Time.parse(value)
|
|
129
|
-
when :Date
|
|
130
|
-
Date.parse(value)
|
|
131
|
-
when :String
|
|
132
|
-
value.to_s
|
|
133
|
-
when :Integer
|
|
134
|
-
value.to_i
|
|
135
|
-
when :Float
|
|
136
|
-
value.to_f
|
|
137
|
-
when :Boolean
|
|
138
|
-
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
|
139
|
-
true
|
|
140
|
-
else
|
|
141
|
-
false
|
|
142
|
-
end
|
|
143
|
-
when :Object
|
|
144
|
-
# generic object (usually a Hash), return directly
|
|
145
|
-
value
|
|
146
|
-
when /\AArray<(?<inner_type>.+)>\z/
|
|
147
|
-
inner_type = Regexp.last_match[:inner_type]
|
|
148
|
-
value.map { |v| _deserialize(inner_type, v) }
|
|
149
|
-
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
|
150
|
-
k_type = Regexp.last_match[:k_type]
|
|
151
|
-
v_type = Regexp.last_match[:v_type]
|
|
152
|
-
{}.tap do |hash|
|
|
153
|
-
value.each do |k, v|
|
|
154
|
-
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
|
155
|
-
end
|
|
156
|
-
end
|
|
157
|
-
else # model
|
|
158
|
-
# models (e.g. Pet) or oneOf
|
|
159
|
-
klass = YNAB.const_get(type)
|
|
160
|
-
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
|
161
|
-
end
|
|
162
|
-
end
|
|
163
|
-
|
|
164
|
-
# Returns the string representation of the object
|
|
165
|
-
# @return [String] String presentation of the object
|
|
166
|
-
def to_s
|
|
167
|
-
to_hash.to_s
|
|
168
|
-
end
|
|
169
|
-
|
|
170
|
-
# to_body is an alias to to_hash (backward compatibility)
|
|
171
|
-
# @return [Hash] Returns the object in the form of hash
|
|
172
|
-
def to_body
|
|
173
|
-
to_hash
|
|
174
|
-
end
|
|
175
|
-
|
|
176
121
|
# Returns the object in the form of hash
|
|
177
122
|
# @return [Hash] Returns the object in the form of hash
|
|
178
123
|
def to_hash
|
|
@@ -188,25 +133,6 @@ module YNAB
|
|
|
188
133
|
end
|
|
189
134
|
hash
|
|
190
135
|
end
|
|
191
|
-
|
|
192
|
-
# Outputs non-array value in the form of hash
|
|
193
|
-
# For object, use to_hash. Otherwise, just return the value
|
|
194
|
-
# @param [Object] value Any valid value
|
|
195
|
-
# @return [Hash] Returns the value in the form of hash
|
|
196
|
-
def _to_hash(value)
|
|
197
|
-
if value.is_a?(Array)
|
|
198
|
-
value.compact.map { |v| _to_hash(v) }
|
|
199
|
-
elsif value.is_a?(Hash)
|
|
200
|
-
{}.tap do |hash|
|
|
201
|
-
value.each { |k, v| hash[k] = _to_hash(v) }
|
|
202
|
-
end
|
|
203
|
-
elsif value.respond_to? :to_hash
|
|
204
|
-
value.to_hash
|
|
205
|
-
else
|
|
206
|
-
value
|
|
207
|
-
end
|
|
208
|
-
end
|
|
209
|
-
|
|
210
136
|
end
|
|
211
137
|
|
|
212
138
|
end
|
|
@@ -11,7 +11,7 @@ require 'date'
|
|
|
11
11
|
require 'time'
|
|
12
12
|
|
|
13
13
|
module YNAB
|
|
14
|
-
class PayeeResponse
|
|
14
|
+
class PayeeResponse < 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
|