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
data/lib/ynab/api/user_api.rb
CHANGED
|
@@ -4,7 +4,6 @@
|
|
|
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
6
|
Generated by: OpenAPI Generator (https://openapi-generator.tech)
|
|
7
|
-
|
|
8
7
|
=end
|
|
9
8
|
|
|
10
9
|
require 'cgi'
|
|
@@ -16,7 +15,7 @@ module YNAB
|
|
|
16
15
|
def initialize(api_client = ApiClient.default)
|
|
17
16
|
@api_client = api_client
|
|
18
17
|
end
|
|
19
|
-
#
|
|
18
|
+
# Get user
|
|
20
19
|
# Returns authenticated user information
|
|
21
20
|
# @param [Hash] opts the optional parameters
|
|
22
21
|
# @return [UserResponse]
|
|
@@ -25,7 +24,7 @@ module YNAB
|
|
|
25
24
|
data
|
|
26
25
|
end
|
|
27
26
|
|
|
28
|
-
#
|
|
27
|
+
# Get user
|
|
29
28
|
# Returns authenticated user information
|
|
30
29
|
# @param [Hash] opts the optional parameters
|
|
31
30
|
# @return [Array<(UserResponse, Integer, Hash)>] UserResponse data, response status code and response headers
|
data/lib/ynab/api_client.rb
CHANGED
|
@@ -4,7 +4,6 @@
|
|
|
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
6
|
Generated by: OpenAPI Generator (https://openapi-generator.tech)
|
|
7
|
-
|
|
8
7
|
=end
|
|
9
8
|
|
|
10
9
|
require 'date'
|
|
@@ -195,7 +194,6 @@ module YNAB
|
|
|
195
194
|
end
|
|
196
195
|
end
|
|
197
196
|
end
|
|
198
|
-
|
|
199
197
|
# Check if the given MIME is a JSON MIME.
|
|
200
198
|
# JSON MIME examples:
|
|
201
199
|
# application/json
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
=begin
|
|
2
|
+
#YNAB API Endpoints
|
|
3
|
+
|
|
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
|
+
|
|
6
|
+
Generated by: OpenAPI Generator (https://openapi-generator.tech)
|
|
7
|
+
|
|
8
|
+
=end
|
|
9
|
+
|
|
10
|
+
module YNAB
|
|
11
|
+
class ApiModelBase
|
|
12
|
+
# Deserializes the data based on type
|
|
13
|
+
# @param string type Data type
|
|
14
|
+
# @param string value Value to be deserialized
|
|
15
|
+
# @return [Object] Deserialized data
|
|
16
|
+
def self._deserialize(type, value)
|
|
17
|
+
case type.to_sym
|
|
18
|
+
when :Time
|
|
19
|
+
Time.parse(value)
|
|
20
|
+
when :Date
|
|
21
|
+
Date.parse(value)
|
|
22
|
+
when :String
|
|
23
|
+
value.to_s
|
|
24
|
+
when :Integer
|
|
25
|
+
value.to_i
|
|
26
|
+
when :Float
|
|
27
|
+
value.to_f
|
|
28
|
+
when :Boolean
|
|
29
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
|
30
|
+
true
|
|
31
|
+
else
|
|
32
|
+
false
|
|
33
|
+
end
|
|
34
|
+
when :Object
|
|
35
|
+
# generic object (usually a Hash), return directly
|
|
36
|
+
value
|
|
37
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
|
38
|
+
inner_type = Regexp.last_match[:inner_type]
|
|
39
|
+
value.map { |v| _deserialize(inner_type, v) }
|
|
40
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
|
41
|
+
k_type = Regexp.last_match[:k_type]
|
|
42
|
+
v_type = Regexp.last_match[:v_type]
|
|
43
|
+
{}.tap do |hash|
|
|
44
|
+
value.each do |k, v|
|
|
45
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
|
46
|
+
end
|
|
47
|
+
end
|
|
48
|
+
else # model
|
|
49
|
+
# models (e.g. Pet) or oneOf
|
|
50
|
+
klass = YNAB.const_get(type)
|
|
51
|
+
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
|
52
|
+
end
|
|
53
|
+
end
|
|
54
|
+
|
|
55
|
+
# Returns the string representation of the object
|
|
56
|
+
# @return [String] String presentation of the object
|
|
57
|
+
def to_s
|
|
58
|
+
to_hash.to_s
|
|
59
|
+
end
|
|
60
|
+
|
|
61
|
+
# to_body is an alias to to_hash (backward compatibility)
|
|
62
|
+
# @return [Hash] Returns the object in the form of hash
|
|
63
|
+
def to_body
|
|
64
|
+
to_hash
|
|
65
|
+
end
|
|
66
|
+
|
|
67
|
+
# Outputs non-array value in the form of hash
|
|
68
|
+
# For object, use to_hash. Otherwise, just return the value
|
|
69
|
+
# @param [Object] value Any valid value
|
|
70
|
+
# @return [Hash] Returns the value in the form of hash
|
|
71
|
+
def _to_hash(value)
|
|
72
|
+
if value.is_a?(Array)
|
|
73
|
+
value.compact.map { |v| _to_hash(v) }
|
|
74
|
+
elsif value.is_a?(Hash)
|
|
75
|
+
{}.tap do |hash|
|
|
76
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
|
77
|
+
end
|
|
78
|
+
elsif value.respond_to? :to_hash
|
|
79
|
+
value.to_hash
|
|
80
|
+
else
|
|
81
|
+
value
|
|
82
|
+
end
|
|
83
|
+
end
|
|
84
|
+
end
|
|
85
|
+
end
|
data/lib/ynab/models/account.rb
CHANGED
|
@@ -11,14 +11,14 @@ require 'date'
|
|
|
11
11
|
require 'time'
|
|
12
12
|
|
|
13
13
|
module YNAB
|
|
14
|
-
class Account
|
|
14
|
+
class Account < ApiModelBase
|
|
15
15
|
attr_accessor :id
|
|
16
16
|
|
|
17
17
|
attr_accessor :name
|
|
18
18
|
|
|
19
19
|
attr_accessor :type
|
|
20
20
|
|
|
21
|
-
# Whether this account is on budget or not
|
|
21
|
+
# Whether this account is \"on budget\" or not
|
|
22
22
|
attr_accessor :on_budget
|
|
23
23
|
|
|
24
24
|
# Whether this account is closed or not
|
|
@@ -26,7 +26,7 @@ module YNAB
|
|
|
26
26
|
|
|
27
27
|
attr_accessor :note
|
|
28
28
|
|
|
29
|
-
# The current balance of the account in milliunits format
|
|
29
|
+
# The current available balance of the account in milliunits format
|
|
30
30
|
attr_accessor :balance
|
|
31
31
|
|
|
32
32
|
# The current cleared balance of the account in milliunits format
|
|
@@ -47,7 +47,7 @@ module YNAB
|
|
|
47
47
|
# A date/time specifying when the account was last reconciled.
|
|
48
48
|
attr_accessor :last_reconciled_at
|
|
49
49
|
|
|
50
|
-
#
|
|
50
|
+
# This field is deprecated and will always be null.
|
|
51
51
|
attr_accessor :debt_original_balance
|
|
52
52
|
|
|
53
53
|
attr_accessor :debt_interest_rates
|
|
@@ -141,9 +141,6 @@ module YNAB
|
|
|
141
141
|
:'transfer_payee_id',
|
|
142
142
|
:'last_reconciled_at',
|
|
143
143
|
:'debt_original_balance',
|
|
144
|
-
:'debt_interest_rates',
|
|
145
|
-
:'debt_minimum_payments',
|
|
146
|
-
:'debt_escrow_amounts',
|
|
147
144
|
])
|
|
148
145
|
end
|
|
149
146
|
|
|
@@ -323,61 +320,6 @@ module YNAB
|
|
|
323
320
|
new(transformed_hash)
|
|
324
321
|
end
|
|
325
322
|
|
|
326
|
-
# Deserializes the data based on type
|
|
327
|
-
# @param string type Data type
|
|
328
|
-
# @param string value Value to be deserialized
|
|
329
|
-
# @return [Object] Deserialized data
|
|
330
|
-
def self._deserialize(type, value)
|
|
331
|
-
case type.to_sym
|
|
332
|
-
when :Time
|
|
333
|
-
Time.parse(value)
|
|
334
|
-
when :Date
|
|
335
|
-
Date.parse(value)
|
|
336
|
-
when :String
|
|
337
|
-
value.to_s
|
|
338
|
-
when :Integer
|
|
339
|
-
value.to_i
|
|
340
|
-
when :Float
|
|
341
|
-
value.to_f
|
|
342
|
-
when :Boolean
|
|
343
|
-
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
|
344
|
-
true
|
|
345
|
-
else
|
|
346
|
-
false
|
|
347
|
-
end
|
|
348
|
-
when :Object
|
|
349
|
-
# generic object (usually a Hash), return directly
|
|
350
|
-
value
|
|
351
|
-
when /\AArray<(?<inner_type>.+)>\z/
|
|
352
|
-
inner_type = Regexp.last_match[:inner_type]
|
|
353
|
-
value.map { |v| _deserialize(inner_type, v) }
|
|
354
|
-
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
|
355
|
-
k_type = Regexp.last_match[:k_type]
|
|
356
|
-
v_type = Regexp.last_match[:v_type]
|
|
357
|
-
{}.tap do |hash|
|
|
358
|
-
value.each do |k, v|
|
|
359
|
-
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
|
360
|
-
end
|
|
361
|
-
end
|
|
362
|
-
else # model
|
|
363
|
-
# models (e.g. Pet) or oneOf
|
|
364
|
-
klass = YNAB.const_get(type)
|
|
365
|
-
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
|
366
|
-
end
|
|
367
|
-
end
|
|
368
|
-
|
|
369
|
-
# Returns the string representation of the object
|
|
370
|
-
# @return [String] String presentation of the object
|
|
371
|
-
def to_s
|
|
372
|
-
to_hash.to_s
|
|
373
|
-
end
|
|
374
|
-
|
|
375
|
-
# to_body is an alias to to_hash (backward compatibility)
|
|
376
|
-
# @return [Hash] Returns the object in the form of hash
|
|
377
|
-
def to_body
|
|
378
|
-
to_hash
|
|
379
|
-
end
|
|
380
|
-
|
|
381
323
|
# Returns the object in the form of hash
|
|
382
324
|
# @return [Hash] Returns the object in the form of hash
|
|
383
325
|
def to_hash
|
|
@@ -393,25 +335,6 @@ module YNAB
|
|
|
393
335
|
end
|
|
394
336
|
hash
|
|
395
337
|
end
|
|
396
|
-
|
|
397
|
-
# Outputs non-array value in the form of hash
|
|
398
|
-
# For object, use to_hash. Otherwise, just return the value
|
|
399
|
-
# @param [Object] value Any valid value
|
|
400
|
-
# @return [Hash] Returns the value in the form of hash
|
|
401
|
-
def _to_hash(value)
|
|
402
|
-
if value.is_a?(Array)
|
|
403
|
-
value.compact.map { |v| _to_hash(v) }
|
|
404
|
-
elsif value.is_a?(Hash)
|
|
405
|
-
{}.tap do |hash|
|
|
406
|
-
value.each { |k, v| hash[k] = _to_hash(v) }
|
|
407
|
-
end
|
|
408
|
-
elsif value.respond_to? :to_hash
|
|
409
|
-
value.to_hash
|
|
410
|
-
else
|
|
411
|
-
value
|
|
412
|
-
end
|
|
413
|
-
end
|
|
414
|
-
|
|
415
338
|
end
|
|
416
339
|
|
|
417
340
|
end
|
|
@@ -11,7 +11,7 @@ require 'date'
|
|
|
11
11
|
require 'time'
|
|
12
12
|
|
|
13
13
|
module YNAB
|
|
14
|
-
class AccountResponse
|
|
14
|
+
class AccountResponse < 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 AccountResponseData
|
|
14
|
+
class AccountResponseData < ApiModelBase
|
|
15
15
|
attr_accessor :account
|
|
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 AccountsResponse
|
|
14
|
+
class AccountsResponse < 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 AccountsResponseData
|
|
14
|
+
class AccountsResponseData < ApiModelBase
|
|
15
15
|
attr_accessor :accounts
|
|
16
16
|
|
|
17
17
|
# The knowledge of the server
|
|
@@ -129,61 +129,6 @@ module YNAB
|
|
|
129
129
|
new(transformed_hash)
|
|
130
130
|
end
|
|
131
131
|
|
|
132
|
-
# Deserializes the data based on type
|
|
133
|
-
# @param string type Data type
|
|
134
|
-
# @param string value Value to be deserialized
|
|
135
|
-
# @return [Object] Deserialized data
|
|
136
|
-
def self._deserialize(type, value)
|
|
137
|
-
case type.to_sym
|
|
138
|
-
when :Time
|
|
139
|
-
Time.parse(value)
|
|
140
|
-
when :Date
|
|
141
|
-
Date.parse(value)
|
|
142
|
-
when :String
|
|
143
|
-
value.to_s
|
|
144
|
-
when :Integer
|
|
145
|
-
value.to_i
|
|
146
|
-
when :Float
|
|
147
|
-
value.to_f
|
|
148
|
-
when :Boolean
|
|
149
|
-
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
|
150
|
-
true
|
|
151
|
-
else
|
|
152
|
-
false
|
|
153
|
-
end
|
|
154
|
-
when :Object
|
|
155
|
-
# generic object (usually a Hash), return directly
|
|
156
|
-
value
|
|
157
|
-
when /\AArray<(?<inner_type>.+)>\z/
|
|
158
|
-
inner_type = Regexp.last_match[:inner_type]
|
|
159
|
-
value.map { |v| _deserialize(inner_type, v) }
|
|
160
|
-
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
|
161
|
-
k_type = Regexp.last_match[:k_type]
|
|
162
|
-
v_type = Regexp.last_match[:v_type]
|
|
163
|
-
{}.tap do |hash|
|
|
164
|
-
value.each do |k, v|
|
|
165
|
-
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
|
166
|
-
end
|
|
167
|
-
end
|
|
168
|
-
else # model
|
|
169
|
-
# models (e.g. Pet) or oneOf
|
|
170
|
-
klass = YNAB.const_get(type)
|
|
171
|
-
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
|
172
|
-
end
|
|
173
|
-
end
|
|
174
|
-
|
|
175
|
-
# Returns the string representation of the object
|
|
176
|
-
# @return [String] String presentation of the object
|
|
177
|
-
def to_s
|
|
178
|
-
to_hash.to_s
|
|
179
|
-
end
|
|
180
|
-
|
|
181
|
-
# to_body is an alias to to_hash (backward compatibility)
|
|
182
|
-
# @return [Hash] Returns the object in the form of hash
|
|
183
|
-
def to_body
|
|
184
|
-
to_hash
|
|
185
|
-
end
|
|
186
|
-
|
|
187
132
|
# Returns the object in the form of hash
|
|
188
133
|
# @return [Hash] Returns the object in the form of hash
|
|
189
134
|
def to_hash
|
|
@@ -199,25 +144,6 @@ module YNAB
|
|
|
199
144
|
end
|
|
200
145
|
hash
|
|
201
146
|
end
|
|
202
|
-
|
|
203
|
-
# Outputs non-array value in the form of hash
|
|
204
|
-
# For object, use to_hash. Otherwise, just return the value
|
|
205
|
-
# @param [Object] value Any valid value
|
|
206
|
-
# @return [Hash] Returns the value in the form of hash
|
|
207
|
-
def _to_hash(value)
|
|
208
|
-
if value.is_a?(Array)
|
|
209
|
-
value.compact.map { |v| _to_hash(v) }
|
|
210
|
-
elsif value.is_a?(Hash)
|
|
211
|
-
{}.tap do |hash|
|
|
212
|
-
value.each { |k, v| hash[k] = _to_hash(v) }
|
|
213
|
-
end
|
|
214
|
-
elsif value.respond_to? :to_hash
|
|
215
|
-
value.to_hash
|
|
216
|
-
else
|
|
217
|
-
value
|
|
218
|
-
end
|
|
219
|
-
end
|
|
220
|
-
|
|
221
147
|
end
|
|
222
148
|
|
|
223
149
|
end
|