ynab 4.9.0 → 5.1.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.lock +2 -2
- data/Rakefile +2 -2
- data/docs/Account.md +6 -0
- data/docs/AccountBase.md +25 -0
- data/docs/AccountsApi.md +3 -3
- data/docs/CategoriesApi.md +8 -8
- data/docs/Category.md +14 -0
- data/docs/CategoryBase.md +33 -0
- data/docs/ExistingCategory.md +2 -1
- data/docs/HybridTransaction.md +2 -0
- data/docs/MoneyMovement.md +2 -0
- data/docs/MoneyMovementBase.md +16 -0
- data/docs/MoneyMovementsApi.md +4 -4
- data/docs/MonthDetail.md +8 -0
- data/docs/MonthDetailBase.md +16 -0
- data/docs/MonthSummary.md +8 -0
- data/docs/MonthSummaryBase.md +15 -0
- data/docs/MonthsApi.md +2 -2
- data/docs/NewCategory.md +2 -1
- data/docs/PayeeLocationsApi.md +3 -3
- data/docs/PayeesApi.md +24 -3
- data/docs/PlanDetail.md +7 -7
- data/docs/PlanDetailResponseData.md +1 -1
- data/docs/PlanSummaryResponseData.md +2 -2
- data/docs/PlansApi.md +3 -3
- data/docs/PostPayee.md +8 -0
- data/docs/PostPayeeWrapper.md +8 -0
- data/docs/SaveAccount.md +1 -1
- data/docs/SaveAccountType.md +7 -0
- data/docs/SaveCategory.md +2 -1
- data/docs/SavePayee.md +1 -1
- data/docs/ScheduledSubTransaction.md +2 -0
- data/docs/ScheduledSubTransactionBase.md +17 -0
- data/docs/ScheduledTransactionDetail.md +2 -0
- data/docs/ScheduledTransactionSummary.md +2 -0
- data/docs/ScheduledTransactionSummaryBase.md +20 -0
- data/docs/ScheduledTransactionsApi.md +5 -5
- data/docs/SubTransaction.md +2 -0
- data/docs/SubTransactionBase.md +18 -0
- data/docs/TransactionDetail.md +2 -0
- data/docs/TransactionSummary.md +2 -0
- data/docs/TransactionSummaryBase.md +26 -0
- data/docs/TransactionsApi.md +11 -11
- data/lib/ynab/api/accounts_api.rb +3 -3
- data/lib/ynab/api/categories_api.rb +8 -8
- data/lib/ynab/api/deprecated_api.rb +3 -3
- data/lib/ynab/api/money_movements_api.rb +4 -4
- data/lib/ynab/api/months_api.rb +2 -2
- data/lib/ynab/api/payee_locations_api.rb +3 -3
- data/lib/ynab/api/payees_api.rb +77 -3
- data/lib/ynab/api/plans_api.rb +3 -3
- data/lib/ynab/api/scheduled_transactions_api.rb +5 -5
- data/lib/ynab/api/transactions_api.rb +11 -11
- data/lib/ynab/models/account.rb +72 -8
- data/lib/ynab/models/account_base.rb +340 -0
- data/lib/ynab/models/category.rb +159 -20
- data/lib/ynab/models/category_base.rb +436 -0
- data/lib/ynab/models/existing_category.rb +15 -5
- data/lib/ynab/models/hybrid_transaction.rb +21 -1
- data/lib/ynab/models/money_movement.rb +31 -11
- data/lib/ynab/models/money_movement_base.rb +223 -0
- data/lib/ynab/models/month_detail.rb +81 -1
- data/lib/ynab/models/month_detail_base.rb +230 -0
- data/lib/ynab/models/month_summary.rb +91 -6
- data/lib/ynab/models/month_summary_base.rb +212 -0
- data/lib/ynab/models/new_category.rb +15 -5
- data/lib/ynab/models/plan_detail.rb +7 -7
- data/lib/ynab/models/plan_detail_response_data.rb +8 -8
- data/lib/ynab/models/plan_summary_response_data.rb +15 -15
- data/lib/ynab/models/post_payee.rb +148 -0
- data/lib/ynab/models/post_payee_wrapper.rb +136 -0
- data/lib/ynab/models/save_account.rb +1 -1
- data/lib/ynab/models/save_account_type.rb +45 -0
- data/lib/ynab/models/save_category.rb +17 -6
- data/lib/ynab/models/save_payee.rb +1 -1
- data/lib/ynab/models/scheduled_sub_transaction.rb +31 -10
- data/lib/ynab/models/scheduled_sub_transaction_base.rb +229 -0
- data/lib/ynab/models/scheduled_transaction_detail.rb +21 -1
- data/lib/ynab/models/scheduled_transaction_summary.rb +31 -9
- data/lib/ynab/models/scheduled_transaction_summary_base.rb +292 -0
- data/lib/ynab/models/sub_transaction.rb +31 -11
- data/lib/ynab/models/sub_transaction_base.rb +240 -0
- data/lib/ynab/models/transaction_detail.rb +21 -1
- data/lib/ynab/models/transaction_summary.rb +31 -14
- data/lib/ynab/models/transaction_summary_base.rb +358 -0
- data/lib/ynab/version.rb +1 -1
- data/lib/ynab.rb +12 -0
- data/open_api_spec.yaml +330 -56
- data/spec/api/accounts_spec.rb +3 -3
- data/spec/api/categories_spec.rb +3 -3
- data/spec/api/months_spec.rb +2 -2
- data/spec/api/payee_locations_spec.rb +2 -2
- data/spec/api/payees_spec.rb +2 -2
- data/spec/api/plans_spec.rb +9 -9
- data/spec/api/scheduled_transactions_spec.rb +3 -3
- data/spec/api/transactions_spec.rb +11 -11
- 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/plans.yml +3 -3
- data/spec/fixtures/vcr_cassettes/plans_unauthorized.yml +2 -2
- 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/ynab.gemspec +1 -1
- metadata +29 -9
- data/spec/fixtures/vcr_cassettes/budgets.yml +0 -49
- data/spec/fixtures/vcr_cassettes/budgets_unauthorized.yml +0 -49
|
@@ -18,12 +18,15 @@ module YNAB
|
|
|
18
18
|
|
|
19
19
|
attr_accessor :category_group_id
|
|
20
20
|
|
|
21
|
-
# The goal target amount in milliunits format. If value is specified and goal has not already been configured for category, a monthly
|
|
21
|
+
# The goal target amount in milliunits format. If value is specified and goal has not already been configured for category, a monthly goal will be created for the category with this target amount. If goal_type is not specified, it will default to 'NEED' or 'MF' for Credit Card Payment categories.
|
|
22
22
|
attr_accessor :goal_target
|
|
23
23
|
|
|
24
24
|
# The goal target date in ISO format (e.g. 2016-12-01).
|
|
25
25
|
attr_accessor :goal_target_date
|
|
26
26
|
|
|
27
|
+
# Whether the goal requires the full target amount each period. Only supported for 'NEED' goals. When true, the goal is configured as 'Set aside another...'. When false, the goal is configured as 'Refill up to...'.
|
|
28
|
+
attr_accessor :goal_needs_whole_amount
|
|
29
|
+
|
|
27
30
|
# Attribute mapping from ruby-style variable name to JSON key.
|
|
28
31
|
def self.attribute_map
|
|
29
32
|
{
|
|
@@ -31,7 +34,8 @@ module YNAB
|
|
|
31
34
|
:'note' => :'note',
|
|
32
35
|
:'category_group_id' => :'category_group_id',
|
|
33
36
|
:'goal_target' => :'goal_target',
|
|
34
|
-
:'goal_target_date' => :'goal_target_date'
|
|
37
|
+
:'goal_target_date' => :'goal_target_date',
|
|
38
|
+
:'goal_needs_whole_amount' => :'goal_needs_whole_amount'
|
|
35
39
|
}
|
|
36
40
|
end
|
|
37
41
|
|
|
@@ -47,7 +51,8 @@ module YNAB
|
|
|
47
51
|
:'note' => :'String',
|
|
48
52
|
:'category_group_id' => :'String',
|
|
49
53
|
:'goal_target' => :'Integer',
|
|
50
|
-
:'goal_target_date' => :'Date'
|
|
54
|
+
:'goal_target_date' => :'Date',
|
|
55
|
+
:'goal_needs_whole_amount' => :'Boolean'
|
|
51
56
|
}
|
|
52
57
|
end
|
|
53
58
|
|
|
@@ -98,6 +103,10 @@ module YNAB
|
|
|
98
103
|
if attributes.key?(:'goal_target_date')
|
|
99
104
|
self.goal_target_date = attributes[:'goal_target_date']
|
|
100
105
|
end
|
|
106
|
+
|
|
107
|
+
if attributes.key?(:'goal_needs_whole_amount')
|
|
108
|
+
self.goal_needs_whole_amount = attributes[:'goal_needs_whole_amount']
|
|
109
|
+
end
|
|
101
110
|
end
|
|
102
111
|
|
|
103
112
|
# Show invalid properties with the reasons. Usually used together with valid?
|
|
@@ -122,7 +131,8 @@ module YNAB
|
|
|
122
131
|
note == o.note &&
|
|
123
132
|
category_group_id == o.category_group_id &&
|
|
124
133
|
goal_target == o.goal_target &&
|
|
125
|
-
goal_target_date == o.goal_target_date
|
|
134
|
+
goal_target_date == o.goal_target_date &&
|
|
135
|
+
goal_needs_whole_amount == o.goal_needs_whole_amount
|
|
126
136
|
end
|
|
127
137
|
|
|
128
138
|
# @see the `==` method
|
|
@@ -134,7 +144,7 @@ module YNAB
|
|
|
134
144
|
# Calculates hash code according to all attributes.
|
|
135
145
|
# @return [Integer] Hash code
|
|
136
146
|
def hash
|
|
137
|
-
[name, note, category_group_id, goal_target, goal_target_date].hash
|
|
147
|
+
[name, note, category_group_id, goal_target, goal_target_date, goal_needs_whole_amount].hash
|
|
138
148
|
end
|
|
139
149
|
|
|
140
150
|
# Builds the object from hash
|
|
@@ -62,6 +62,12 @@ module YNAB
|
|
|
62
62
|
# Whether or not the transaction has been deleted. Deleted transactions will only be included in delta requests.
|
|
63
63
|
attr_accessor :deleted
|
|
64
64
|
|
|
65
|
+
# The transaction amount formatted in the plan's currency format
|
|
66
|
+
attr_accessor :amount_formatted
|
|
67
|
+
|
|
68
|
+
# The transaction amount as a decimal currency amount
|
|
69
|
+
attr_accessor :amount_currency
|
|
70
|
+
|
|
65
71
|
# Whether the hybrid transaction represents a regular transaction or a subtransaction
|
|
66
72
|
attr_accessor :type
|
|
67
73
|
|
|
@@ -119,6 +125,8 @@ module YNAB
|
|
|
119
125
|
:'import_payee_name_original' => :'import_payee_name_original',
|
|
120
126
|
:'debt_transaction_type' => :'debt_transaction_type',
|
|
121
127
|
:'deleted' => :'deleted',
|
|
128
|
+
:'amount_formatted' => :'amount_formatted',
|
|
129
|
+
:'amount_currency' => :'amount_currency',
|
|
122
130
|
:'type' => :'type',
|
|
123
131
|
:'parent_transaction_id' => :'parent_transaction_id',
|
|
124
132
|
:'account_name' => :'account_name',
|
|
@@ -154,6 +162,8 @@ module YNAB
|
|
|
154
162
|
:'import_payee_name_original' => :'String',
|
|
155
163
|
:'debt_transaction_type' => :'String',
|
|
156
164
|
:'deleted' => :'Boolean',
|
|
165
|
+
:'amount_formatted' => :'String',
|
|
166
|
+
:'amount_currency' => :'Float',
|
|
157
167
|
:'type' => :'String',
|
|
158
168
|
:'parent_transaction_id' => :'String',
|
|
159
169
|
:'account_name' => :'String',
|
|
@@ -270,6 +280,14 @@ module YNAB
|
|
|
270
280
|
self.deleted = attributes[:'deleted']
|
|
271
281
|
end
|
|
272
282
|
|
|
283
|
+
if attributes.key?(:'amount_formatted')
|
|
284
|
+
self.amount_formatted = attributes[:'amount_formatted']
|
|
285
|
+
end
|
|
286
|
+
|
|
287
|
+
if attributes.key?(:'amount_currency')
|
|
288
|
+
self.amount_currency = attributes[:'amount_currency']
|
|
289
|
+
end
|
|
290
|
+
|
|
273
291
|
if attributes.key?(:'type')
|
|
274
292
|
self.type = attributes[:'type']
|
|
275
293
|
end
|
|
@@ -353,6 +371,8 @@ module YNAB
|
|
|
353
371
|
import_payee_name_original == o.import_payee_name_original &&
|
|
354
372
|
debt_transaction_type == o.debt_transaction_type &&
|
|
355
373
|
deleted == o.deleted &&
|
|
374
|
+
amount_formatted == o.amount_formatted &&
|
|
375
|
+
amount_currency == o.amount_currency &&
|
|
356
376
|
type == o.type &&
|
|
357
377
|
parent_transaction_id == o.parent_transaction_id &&
|
|
358
378
|
account_name == o.account_name &&
|
|
@@ -369,7 +389,7 @@ module YNAB
|
|
|
369
389
|
# Calculates hash code according to all attributes.
|
|
370
390
|
# @return [Integer] Hash code
|
|
371
391
|
def hash
|
|
372
|
-
[id, date, amount, memo, cleared, approved, flag_color, flag_name, account_id, payee_id, category_id, transfer_account_id, transfer_transaction_id, matched_transaction_id, import_id, import_payee_name, import_payee_name_original, debt_transaction_type, deleted, type, parent_transaction_id, account_name, payee_name, category_name].hash
|
|
392
|
+
[id, date, amount, memo, cleared, approved, flag_color, flag_name, account_id, payee_id, category_id, transfer_account_id, transfer_transaction_id, matched_transaction_id, import_id, import_payee_name, import_payee_name_original, debt_transaction_type, deleted, amount_formatted, amount_currency, type, parent_transaction_id, account_name, payee_name, category_name].hash
|
|
373
393
|
end
|
|
374
394
|
|
|
375
395
|
# Builds the object from hash
|
|
@@ -37,6 +37,12 @@ module YNAB
|
|
|
37
37
|
# The amount of the money movement in milliunits format
|
|
38
38
|
attr_accessor :amount
|
|
39
39
|
|
|
40
|
+
# The money movement amount formatted in the plan's currency format
|
|
41
|
+
attr_accessor :amount_formatted
|
|
42
|
+
|
|
43
|
+
# The money movement amount as a decimal currency amount
|
|
44
|
+
attr_accessor :amount_currency
|
|
45
|
+
|
|
40
46
|
# Attribute mapping from ruby-style variable name to JSON key.
|
|
41
47
|
def self.attribute_map
|
|
42
48
|
{
|
|
@@ -48,7 +54,9 @@ module YNAB
|
|
|
48
54
|
:'performed_by_user_id' => :'performed_by_user_id',
|
|
49
55
|
:'from_category_id' => :'from_category_id',
|
|
50
56
|
:'to_category_id' => :'to_category_id',
|
|
51
|
-
:'amount' => :'amount'
|
|
57
|
+
:'amount' => :'amount',
|
|
58
|
+
:'amount_formatted' => :'amount_formatted',
|
|
59
|
+
:'amount_currency' => :'amount_currency'
|
|
52
60
|
}
|
|
53
61
|
end
|
|
54
62
|
|
|
@@ -68,23 +76,25 @@ module YNAB
|
|
|
68
76
|
:'performed_by_user_id' => :'String',
|
|
69
77
|
:'from_category_id' => :'String',
|
|
70
78
|
:'to_category_id' => :'String',
|
|
71
|
-
:'amount' => :'Integer'
|
|
79
|
+
:'amount' => :'Integer',
|
|
80
|
+
:'amount_formatted' => :'String',
|
|
81
|
+
:'amount_currency' => :'Float'
|
|
72
82
|
}
|
|
73
83
|
end
|
|
74
84
|
|
|
75
85
|
# List of attributes with nullable: true
|
|
76
86
|
def self.openapi_nullable
|
|
77
87
|
Set.new([
|
|
78
|
-
:'month',
|
|
79
|
-
:'moved_at',
|
|
80
|
-
:'note',
|
|
81
|
-
:'money_movement_group_id',
|
|
82
|
-
:'performed_by_user_id',
|
|
83
|
-
:'from_category_id',
|
|
84
|
-
:'to_category_id',
|
|
85
88
|
])
|
|
86
89
|
end
|
|
87
90
|
|
|
91
|
+
# List of class defined in allOf (OpenAPI v3)
|
|
92
|
+
def self.openapi_all_of
|
|
93
|
+
[
|
|
94
|
+
:'MoneyMovementBase'
|
|
95
|
+
]
|
|
96
|
+
end
|
|
97
|
+
|
|
88
98
|
# Initializes the object
|
|
89
99
|
# @param [Hash] attributes Model attributes in the form of hash
|
|
90
100
|
def initialize(attributes = {})
|
|
@@ -135,6 +145,14 @@ module YNAB
|
|
|
135
145
|
if attributes.key?(:'amount')
|
|
136
146
|
self.amount = attributes[:'amount']
|
|
137
147
|
end
|
|
148
|
+
|
|
149
|
+
if attributes.key?(:'amount_formatted')
|
|
150
|
+
self.amount_formatted = attributes[:'amount_formatted']
|
|
151
|
+
end
|
|
152
|
+
|
|
153
|
+
if attributes.key?(:'amount_currency')
|
|
154
|
+
self.amount_currency = attributes[:'amount_currency']
|
|
155
|
+
end
|
|
138
156
|
end
|
|
139
157
|
|
|
140
158
|
# Show invalid properties with the reasons. Usually used together with valid?
|
|
@@ -165,7 +183,9 @@ module YNAB
|
|
|
165
183
|
performed_by_user_id == o.performed_by_user_id &&
|
|
166
184
|
from_category_id == o.from_category_id &&
|
|
167
185
|
to_category_id == o.to_category_id &&
|
|
168
|
-
amount == o.amount
|
|
186
|
+
amount == o.amount &&
|
|
187
|
+
amount_formatted == o.amount_formatted &&
|
|
188
|
+
amount_currency == o.amount_currency
|
|
169
189
|
end
|
|
170
190
|
|
|
171
191
|
# @see the `==` method
|
|
@@ -177,7 +197,7 @@ module YNAB
|
|
|
177
197
|
# Calculates hash code according to all attributes.
|
|
178
198
|
# @return [Integer] Hash code
|
|
179
199
|
def hash
|
|
180
|
-
[id, month, moved_at, note, money_movement_group_id, performed_by_user_id, from_category_id, to_category_id, amount].hash
|
|
200
|
+
[id, month, moved_at, note, money_movement_group_id, performed_by_user_id, from_category_id, to_category_id, amount, amount_formatted, amount_currency].hash
|
|
181
201
|
end
|
|
182
202
|
|
|
183
203
|
# Builds the object from hash
|
|
@@ -0,0 +1,223 @@
|
|
|
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
|
+
require 'date'
|
|
11
|
+
require 'time'
|
|
12
|
+
|
|
13
|
+
module YNAB
|
|
14
|
+
class MoneyMovementBase < ApiModelBase
|
|
15
|
+
attr_accessor :id
|
|
16
|
+
|
|
17
|
+
# The month of the money movement in ISO format (e.g. 2024-01-01)
|
|
18
|
+
attr_accessor :month
|
|
19
|
+
|
|
20
|
+
# The date/time the money movement was processed on the server in ISO format (e.g. 2024-01-01T12:00:00Z)
|
|
21
|
+
attr_accessor :moved_at
|
|
22
|
+
|
|
23
|
+
attr_accessor :note
|
|
24
|
+
|
|
25
|
+
# The id of the money movement group this movement belongs to
|
|
26
|
+
attr_accessor :money_movement_group_id
|
|
27
|
+
|
|
28
|
+
# The id of the user who performed the money movement
|
|
29
|
+
attr_accessor :performed_by_user_id
|
|
30
|
+
|
|
31
|
+
# The id of the category the money was moved from
|
|
32
|
+
attr_accessor :from_category_id
|
|
33
|
+
|
|
34
|
+
# The id of the category the money was moved to
|
|
35
|
+
attr_accessor :to_category_id
|
|
36
|
+
|
|
37
|
+
# The amount of the money movement in milliunits format
|
|
38
|
+
attr_accessor :amount
|
|
39
|
+
|
|
40
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
41
|
+
def self.attribute_map
|
|
42
|
+
{
|
|
43
|
+
:'id' => :'id',
|
|
44
|
+
:'month' => :'month',
|
|
45
|
+
:'moved_at' => :'moved_at',
|
|
46
|
+
:'note' => :'note',
|
|
47
|
+
:'money_movement_group_id' => :'money_movement_group_id',
|
|
48
|
+
:'performed_by_user_id' => :'performed_by_user_id',
|
|
49
|
+
:'from_category_id' => :'from_category_id',
|
|
50
|
+
:'to_category_id' => :'to_category_id',
|
|
51
|
+
:'amount' => :'amount'
|
|
52
|
+
}
|
|
53
|
+
end
|
|
54
|
+
|
|
55
|
+
# Returns all the JSON keys this model knows about
|
|
56
|
+
def self.acceptable_attributes
|
|
57
|
+
attribute_map.values
|
|
58
|
+
end
|
|
59
|
+
|
|
60
|
+
# Attribute type mapping.
|
|
61
|
+
def self.openapi_types
|
|
62
|
+
{
|
|
63
|
+
:'id' => :'String',
|
|
64
|
+
:'month' => :'Date',
|
|
65
|
+
:'moved_at' => :'Time',
|
|
66
|
+
:'note' => :'String',
|
|
67
|
+
:'money_movement_group_id' => :'String',
|
|
68
|
+
:'performed_by_user_id' => :'String',
|
|
69
|
+
:'from_category_id' => :'String',
|
|
70
|
+
:'to_category_id' => :'String',
|
|
71
|
+
:'amount' => :'Integer'
|
|
72
|
+
}
|
|
73
|
+
end
|
|
74
|
+
|
|
75
|
+
# List of attributes with nullable: true
|
|
76
|
+
def self.openapi_nullable
|
|
77
|
+
Set.new([
|
|
78
|
+
:'month',
|
|
79
|
+
:'moved_at',
|
|
80
|
+
:'note',
|
|
81
|
+
:'money_movement_group_id',
|
|
82
|
+
:'performed_by_user_id',
|
|
83
|
+
:'from_category_id',
|
|
84
|
+
:'to_category_id',
|
|
85
|
+
])
|
|
86
|
+
end
|
|
87
|
+
|
|
88
|
+
# Initializes the object
|
|
89
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
90
|
+
def initialize(attributes = {})
|
|
91
|
+
if (!attributes.is_a?(Hash))
|
|
92
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `YNAB::MoneyMovementBase` initialize method"
|
|
93
|
+
end
|
|
94
|
+
|
|
95
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
|
96
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
97
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
|
98
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `YNAB::MoneyMovementBase`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
|
99
|
+
end
|
|
100
|
+
h[k.to_sym] = v
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
if attributes.key?(:'id')
|
|
104
|
+
self.id = attributes[:'id']
|
|
105
|
+
end
|
|
106
|
+
|
|
107
|
+
if attributes.key?(:'month')
|
|
108
|
+
self.month = attributes[:'month']
|
|
109
|
+
end
|
|
110
|
+
|
|
111
|
+
if attributes.key?(:'moved_at')
|
|
112
|
+
self.moved_at = attributes[:'moved_at']
|
|
113
|
+
end
|
|
114
|
+
|
|
115
|
+
if attributes.key?(:'note')
|
|
116
|
+
self.note = attributes[:'note']
|
|
117
|
+
end
|
|
118
|
+
|
|
119
|
+
if attributes.key?(:'money_movement_group_id')
|
|
120
|
+
self.money_movement_group_id = attributes[:'money_movement_group_id']
|
|
121
|
+
end
|
|
122
|
+
|
|
123
|
+
if attributes.key?(:'performed_by_user_id')
|
|
124
|
+
self.performed_by_user_id = attributes[:'performed_by_user_id']
|
|
125
|
+
end
|
|
126
|
+
|
|
127
|
+
if attributes.key?(:'from_category_id')
|
|
128
|
+
self.from_category_id = attributes[:'from_category_id']
|
|
129
|
+
end
|
|
130
|
+
|
|
131
|
+
if attributes.key?(:'to_category_id')
|
|
132
|
+
self.to_category_id = attributes[:'to_category_id']
|
|
133
|
+
end
|
|
134
|
+
|
|
135
|
+
if attributes.key?(:'amount')
|
|
136
|
+
self.amount = attributes[:'amount']
|
|
137
|
+
end
|
|
138
|
+
end
|
|
139
|
+
|
|
140
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
141
|
+
# @return Array for valid properties with the reasons
|
|
142
|
+
def list_invalid_properties
|
|
143
|
+
invalid_properties = Array.new
|
|
144
|
+
invalid_properties
|
|
145
|
+
end
|
|
146
|
+
|
|
147
|
+
# Check to see if the all the properties in the model are valid
|
|
148
|
+
# @return true if the model is valid
|
|
149
|
+
def valid?
|
|
150
|
+
return false if @id.nil?
|
|
151
|
+
return false if @amount.nil?
|
|
152
|
+
true
|
|
153
|
+
end
|
|
154
|
+
|
|
155
|
+
# Checks equality by comparing each attribute.
|
|
156
|
+
# @param [Object] Object to be compared
|
|
157
|
+
def ==(o)
|
|
158
|
+
return true if self.equal?(o)
|
|
159
|
+
self.class == o.class &&
|
|
160
|
+
id == o.id &&
|
|
161
|
+
month == o.month &&
|
|
162
|
+
moved_at == o.moved_at &&
|
|
163
|
+
note == o.note &&
|
|
164
|
+
money_movement_group_id == o.money_movement_group_id &&
|
|
165
|
+
performed_by_user_id == o.performed_by_user_id &&
|
|
166
|
+
from_category_id == o.from_category_id &&
|
|
167
|
+
to_category_id == o.to_category_id &&
|
|
168
|
+
amount == o.amount
|
|
169
|
+
end
|
|
170
|
+
|
|
171
|
+
# @see the `==` method
|
|
172
|
+
# @param [Object] Object to be compared
|
|
173
|
+
def eql?(o)
|
|
174
|
+
self == o
|
|
175
|
+
end
|
|
176
|
+
|
|
177
|
+
# Calculates hash code according to all attributes.
|
|
178
|
+
# @return [Integer] Hash code
|
|
179
|
+
def hash
|
|
180
|
+
[id, month, moved_at, note, money_movement_group_id, performed_by_user_id, from_category_id, to_category_id, amount].hash
|
|
181
|
+
end
|
|
182
|
+
|
|
183
|
+
# Builds the object from hash
|
|
184
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
185
|
+
# @return [Object] Returns the model itself
|
|
186
|
+
def self.build_from_hash(attributes)
|
|
187
|
+
return nil unless attributes.is_a?(Hash)
|
|
188
|
+
attributes = attributes.transform_keys(&:to_sym)
|
|
189
|
+
transformed_hash = {}
|
|
190
|
+
openapi_types.each_pair do |key, type|
|
|
191
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
|
192
|
+
transformed_hash["#{key}"] = nil
|
|
193
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
194
|
+
# check to ensure the input is an array given that the attribute
|
|
195
|
+
# is documented as an array but the input is not
|
|
196
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
|
197
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
|
198
|
+
end
|
|
199
|
+
elsif !attributes[attribute_map[key]].nil?
|
|
200
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
|
201
|
+
end
|
|
202
|
+
end
|
|
203
|
+
new(transformed_hash)
|
|
204
|
+
end
|
|
205
|
+
|
|
206
|
+
# Returns the object in the form of hash
|
|
207
|
+
# @return [Hash] Returns the object in the form of hash
|
|
208
|
+
def to_hash
|
|
209
|
+
hash = {}
|
|
210
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
211
|
+
value = self.send(attr)
|
|
212
|
+
if value.nil?
|
|
213
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
|
214
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
215
|
+
end
|
|
216
|
+
|
|
217
|
+
hash[param] = _to_hash(value)
|
|
218
|
+
end
|
|
219
|
+
hash
|
|
220
|
+
end
|
|
221
|
+
end
|
|
222
|
+
|
|
223
|
+
end
|
|
@@ -34,6 +34,30 @@ module YNAB
|
|
|
34
34
|
# Whether or not the month has been deleted. Deleted months will only be included in delta requests.
|
|
35
35
|
attr_accessor :deleted
|
|
36
36
|
|
|
37
|
+
# The total income formatted in the plan's currency format
|
|
38
|
+
attr_accessor :income_formatted
|
|
39
|
+
|
|
40
|
+
# The total income as a decimal currency amount
|
|
41
|
+
attr_accessor :income_currency
|
|
42
|
+
|
|
43
|
+
# The total amount assigned formatted in the plan's currency format
|
|
44
|
+
attr_accessor :budgeted_formatted
|
|
45
|
+
|
|
46
|
+
# The total amount assigned as a decimal currency amount
|
|
47
|
+
attr_accessor :budgeted_currency
|
|
48
|
+
|
|
49
|
+
# The total activity amount formatted in the plan's currency format
|
|
50
|
+
attr_accessor :activity_formatted
|
|
51
|
+
|
|
52
|
+
# The total activity amount as a decimal currency amount
|
|
53
|
+
attr_accessor :activity_currency
|
|
54
|
+
|
|
55
|
+
# The available amount for 'Ready to Assign' formatted in the plan's currency format
|
|
56
|
+
attr_accessor :to_be_budgeted_formatted
|
|
57
|
+
|
|
58
|
+
# The available amount for 'Ready to Assign' as a decimal currency amount
|
|
59
|
+
attr_accessor :to_be_budgeted_currency
|
|
60
|
+
|
|
37
61
|
# The plan month categories. Amounts (budgeted, activity, balance, etc.) are specific to the {month} parameter specified.
|
|
38
62
|
attr_accessor :categories
|
|
39
63
|
|
|
@@ -48,6 +72,14 @@ module YNAB
|
|
|
48
72
|
:'to_be_budgeted' => :'to_be_budgeted',
|
|
49
73
|
:'age_of_money' => :'age_of_money',
|
|
50
74
|
:'deleted' => :'deleted',
|
|
75
|
+
:'income_formatted' => :'income_formatted',
|
|
76
|
+
:'income_currency' => :'income_currency',
|
|
77
|
+
:'budgeted_formatted' => :'budgeted_formatted',
|
|
78
|
+
:'budgeted_currency' => :'budgeted_currency',
|
|
79
|
+
:'activity_formatted' => :'activity_formatted',
|
|
80
|
+
:'activity_currency' => :'activity_currency',
|
|
81
|
+
:'to_be_budgeted_formatted' => :'to_be_budgeted_formatted',
|
|
82
|
+
:'to_be_budgeted_currency' => :'to_be_budgeted_currency',
|
|
51
83
|
:'categories' => :'categories'
|
|
52
84
|
}
|
|
53
85
|
end
|
|
@@ -68,6 +100,14 @@ module YNAB
|
|
|
68
100
|
:'to_be_budgeted' => :'Integer',
|
|
69
101
|
:'age_of_money' => :'Integer',
|
|
70
102
|
:'deleted' => :'Boolean',
|
|
103
|
+
:'income_formatted' => :'String',
|
|
104
|
+
:'income_currency' => :'Float',
|
|
105
|
+
:'budgeted_formatted' => :'String',
|
|
106
|
+
:'budgeted_currency' => :'Float',
|
|
107
|
+
:'activity_formatted' => :'String',
|
|
108
|
+
:'activity_currency' => :'Float',
|
|
109
|
+
:'to_be_budgeted_formatted' => :'String',
|
|
110
|
+
:'to_be_budgeted_currency' => :'Float',
|
|
71
111
|
:'categories' => :'Array<Category>'
|
|
72
112
|
}
|
|
73
113
|
end
|
|
@@ -132,6 +172,38 @@ module YNAB
|
|
|
132
172
|
self.deleted = attributes[:'deleted']
|
|
133
173
|
end
|
|
134
174
|
|
|
175
|
+
if attributes.key?(:'income_formatted')
|
|
176
|
+
self.income_formatted = attributes[:'income_formatted']
|
|
177
|
+
end
|
|
178
|
+
|
|
179
|
+
if attributes.key?(:'income_currency')
|
|
180
|
+
self.income_currency = attributes[:'income_currency']
|
|
181
|
+
end
|
|
182
|
+
|
|
183
|
+
if attributes.key?(:'budgeted_formatted')
|
|
184
|
+
self.budgeted_formatted = attributes[:'budgeted_formatted']
|
|
185
|
+
end
|
|
186
|
+
|
|
187
|
+
if attributes.key?(:'budgeted_currency')
|
|
188
|
+
self.budgeted_currency = attributes[:'budgeted_currency']
|
|
189
|
+
end
|
|
190
|
+
|
|
191
|
+
if attributes.key?(:'activity_formatted')
|
|
192
|
+
self.activity_formatted = attributes[:'activity_formatted']
|
|
193
|
+
end
|
|
194
|
+
|
|
195
|
+
if attributes.key?(:'activity_currency')
|
|
196
|
+
self.activity_currency = attributes[:'activity_currency']
|
|
197
|
+
end
|
|
198
|
+
|
|
199
|
+
if attributes.key?(:'to_be_budgeted_formatted')
|
|
200
|
+
self.to_be_budgeted_formatted = attributes[:'to_be_budgeted_formatted']
|
|
201
|
+
end
|
|
202
|
+
|
|
203
|
+
if attributes.key?(:'to_be_budgeted_currency')
|
|
204
|
+
self.to_be_budgeted_currency = attributes[:'to_be_budgeted_currency']
|
|
205
|
+
end
|
|
206
|
+
|
|
135
207
|
if attributes.key?(:'categories')
|
|
136
208
|
if (value = attributes[:'categories']).is_a?(Array)
|
|
137
209
|
self.categories = value
|
|
@@ -172,6 +244,14 @@ module YNAB
|
|
|
172
244
|
to_be_budgeted == o.to_be_budgeted &&
|
|
173
245
|
age_of_money == o.age_of_money &&
|
|
174
246
|
deleted == o.deleted &&
|
|
247
|
+
income_formatted == o.income_formatted &&
|
|
248
|
+
income_currency == o.income_currency &&
|
|
249
|
+
budgeted_formatted == o.budgeted_formatted &&
|
|
250
|
+
budgeted_currency == o.budgeted_currency &&
|
|
251
|
+
activity_formatted == o.activity_formatted &&
|
|
252
|
+
activity_currency == o.activity_currency &&
|
|
253
|
+
to_be_budgeted_formatted == o.to_be_budgeted_formatted &&
|
|
254
|
+
to_be_budgeted_currency == o.to_be_budgeted_currency &&
|
|
175
255
|
categories == o.categories
|
|
176
256
|
end
|
|
177
257
|
|
|
@@ -184,7 +264,7 @@ module YNAB
|
|
|
184
264
|
# Calculates hash code according to all attributes.
|
|
185
265
|
# @return [Integer] Hash code
|
|
186
266
|
def hash
|
|
187
|
-
[month, note, income, budgeted, activity, to_be_budgeted, age_of_money, deleted, categories].hash
|
|
267
|
+
[month, note, income, budgeted, activity, to_be_budgeted, age_of_money, deleted, income_formatted, income_currency, budgeted_formatted, budgeted_currency, activity_formatted, activity_currency, to_be_budgeted_formatted, to_be_budgeted_currency, categories].hash
|
|
188
268
|
end
|
|
189
269
|
|
|
190
270
|
# Builds the object from hash
|