ynab 5.0.0 → 5.2.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 +1 -1
- data/README.md +1 -0
- data/docs/Account.md +6 -0
- data/docs/AccountBase.md +25 -0
- data/docs/Category.md +15 -0
- data/docs/CategoryBase.md +34 -0
- data/docs/CategoryGroup.md +1 -0
- data/docs/CategoryGroupWithCategories.md +1 -0
- data/docs/ExistingCategory.md +3 -2
- data/docs/HybridTransaction.md +2 -0
- data/docs/MoneyMovement.md +2 -0
- data/docs/MoneyMovementBase.md +16 -0
- 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/NewCategory.md +3 -2
- data/docs/PayeesApi.md +21 -0
- data/docs/PlanDetail.md +7 -7
- 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 +3 -2
- 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/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 +19 -14
- data/lib/ynab/api/payees_api.rb +74 -0
- data/lib/ynab/api/transactions_api.rb +33 -18
- data/lib/ynab/models/account.rb +72 -8
- data/lib/ynab/models/account_base.rb +340 -0
- data/lib/ynab/models/category.rb +170 -20
- data/lib/ynab/models/category_base.rb +447 -0
- data/lib/ynab/models/category_group.rb +12 -1
- data/lib/ynab/models/category_group_with_categories.rb +12 -1
- data/lib/ynab/models/existing_category.rb +16 -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 +16 -5
- data/lib/ynab/models/plan_detail.rb +7 -7
- 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 +18 -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 +348 -26
- data/ynab.gemspec +1 -1
- metadata +27 -3
|
@@ -0,0 +1,447 @@
|
|
|
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 CategoryBase < ApiModelBase
|
|
15
|
+
attr_accessor :id
|
|
16
|
+
|
|
17
|
+
attr_accessor :category_group_id
|
|
18
|
+
|
|
19
|
+
attr_accessor :category_group_name
|
|
20
|
+
|
|
21
|
+
attr_accessor :name
|
|
22
|
+
|
|
23
|
+
# Whether or not the category is hidden
|
|
24
|
+
attr_accessor :hidden
|
|
25
|
+
|
|
26
|
+
# Whether or not the category is internal
|
|
27
|
+
attr_accessor :internal
|
|
28
|
+
|
|
29
|
+
# DEPRECATED: No longer used. Value will always be null.
|
|
30
|
+
attr_accessor :original_category_group_id
|
|
31
|
+
|
|
32
|
+
attr_accessor :note
|
|
33
|
+
|
|
34
|
+
# Assigned (budgeted) amount in milliunits format
|
|
35
|
+
attr_accessor :budgeted
|
|
36
|
+
|
|
37
|
+
# Activity amount in milliunits format
|
|
38
|
+
attr_accessor :activity
|
|
39
|
+
|
|
40
|
+
# Available balance in milliunits format
|
|
41
|
+
attr_accessor :balance
|
|
42
|
+
|
|
43
|
+
# The type of goal, if the category has a goal (TB='Target Category Balance', TBD='Target Category Balance by Date', MF='Monthly Funding', NEED='Plan Your Spending')
|
|
44
|
+
attr_accessor :goal_type
|
|
45
|
+
|
|
46
|
+
# Indicates the monthly rollover behavior for \"NEED\"-type goals. When \"true\", the goal will always ask for the target amount in the new month (\"Set Aside\"). When \"false\", previous month category funding is used (\"Refill\"). For other goal types, this field will be null.
|
|
47
|
+
attr_accessor :goal_needs_whole_amount
|
|
48
|
+
|
|
49
|
+
# A day offset modifier for the goal's due date. When goal_cadence is 2 (Weekly), this value specifies which day of the week the goal is due (0 = Sunday, 6 = Saturday). Otherwise, this value specifies which day of the month the goal is due (1 = 1st, 31 = 31st, null = Last day of Month).
|
|
50
|
+
attr_accessor :goal_day
|
|
51
|
+
|
|
52
|
+
# The goal cadence. Value in range 0-14. There are two subsets of these values which behave differently. For values 0, 1, 2, and 13, the goal's due date repeats every goal_cadence * goal_cadence_frequency, where 0 = None, 1 = Monthly, 2 = Weekly, and 13 = Yearly. For example, goal_cadence 1 with goal_cadence_frequency 2 means the goal is due every other month. For values 3-12 and 14, goal_cadence_frequency is ignored and the goal's due date repeats every goal_cadence, where 3 = Every 2 Months, 4 = Every 3 Months, ..., 12 = Every 11 Months, and 14 = Every 2 Years.
|
|
53
|
+
attr_accessor :goal_cadence
|
|
54
|
+
|
|
55
|
+
# The goal cadence frequency. When goal_cadence is 0, 1, 2, or 13, a goal's due date repeats every goal_cadence * goal_cadence_frequency. For example, goal_cadence 1 with goal_cadence_frequency 2 means the goal is due every other month. When goal_cadence is 3-12 or 14, goal_cadence_frequency is ignored.
|
|
56
|
+
attr_accessor :goal_cadence_frequency
|
|
57
|
+
|
|
58
|
+
# The month a goal was created
|
|
59
|
+
attr_accessor :goal_creation_month
|
|
60
|
+
|
|
61
|
+
# The goal target amount in milliunits
|
|
62
|
+
attr_accessor :goal_target
|
|
63
|
+
|
|
64
|
+
# DEPRECATED: No longer used. Use `goal_target_date` instead.
|
|
65
|
+
attr_accessor :goal_target_month
|
|
66
|
+
|
|
67
|
+
# The target date for the goal to be completed. Only some goal types specify this date.
|
|
68
|
+
attr_accessor :goal_target_date
|
|
69
|
+
|
|
70
|
+
# The percentage completion of the goal
|
|
71
|
+
attr_accessor :goal_percentage_complete
|
|
72
|
+
|
|
73
|
+
# The number of months, including the current month, left in the current goal period.
|
|
74
|
+
attr_accessor :goal_months_to_budget
|
|
75
|
+
|
|
76
|
+
# The amount of funding still needed in the current month to stay on track towards completing the goal within the current goal period. This amount will generally correspond to the 'Underfunded' amount in the web and mobile clients except when viewing a category with a Needed for Spending Goal in a future month. The web and mobile clients will ignore any funding from a prior goal period when viewing category with a Needed for Spending Goal in a future month.
|
|
77
|
+
attr_accessor :goal_under_funded
|
|
78
|
+
|
|
79
|
+
# The total amount funded towards the goal within the current goal period.
|
|
80
|
+
attr_accessor :goal_overall_funded
|
|
81
|
+
|
|
82
|
+
# The amount of funding still needed to complete the goal within the current goal period.
|
|
83
|
+
attr_accessor :goal_overall_left
|
|
84
|
+
|
|
85
|
+
# The date/time the goal was snoozed. If the goal is not snoozed, this will be null.
|
|
86
|
+
attr_accessor :goal_snoozed_at
|
|
87
|
+
|
|
88
|
+
# Whether or not the category has been deleted. Deleted categories will only be included in delta requests.
|
|
89
|
+
attr_accessor :deleted
|
|
90
|
+
|
|
91
|
+
class EnumAttributeValidator
|
|
92
|
+
attr_reader :datatype
|
|
93
|
+
attr_reader :allowable_values
|
|
94
|
+
|
|
95
|
+
def initialize(datatype, allowable_values)
|
|
96
|
+
@allowable_values = allowable_values.map do |value|
|
|
97
|
+
case datatype.to_s
|
|
98
|
+
when /Integer/i
|
|
99
|
+
value.to_i
|
|
100
|
+
when /Float/i
|
|
101
|
+
value.to_f
|
|
102
|
+
else
|
|
103
|
+
value
|
|
104
|
+
end
|
|
105
|
+
end
|
|
106
|
+
end
|
|
107
|
+
|
|
108
|
+
def valid?(value)
|
|
109
|
+
!value || allowable_values.include?(value)
|
|
110
|
+
end
|
|
111
|
+
end
|
|
112
|
+
|
|
113
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
114
|
+
def self.attribute_map
|
|
115
|
+
{
|
|
116
|
+
:'id' => :'id',
|
|
117
|
+
:'category_group_id' => :'category_group_id',
|
|
118
|
+
:'category_group_name' => :'category_group_name',
|
|
119
|
+
:'name' => :'name',
|
|
120
|
+
:'hidden' => :'hidden',
|
|
121
|
+
:'internal' => :'internal',
|
|
122
|
+
:'original_category_group_id' => :'original_category_group_id',
|
|
123
|
+
:'note' => :'note',
|
|
124
|
+
:'budgeted' => :'budgeted',
|
|
125
|
+
:'activity' => :'activity',
|
|
126
|
+
:'balance' => :'balance',
|
|
127
|
+
:'goal_type' => :'goal_type',
|
|
128
|
+
:'goal_needs_whole_amount' => :'goal_needs_whole_amount',
|
|
129
|
+
:'goal_day' => :'goal_day',
|
|
130
|
+
:'goal_cadence' => :'goal_cadence',
|
|
131
|
+
:'goal_cadence_frequency' => :'goal_cadence_frequency',
|
|
132
|
+
:'goal_creation_month' => :'goal_creation_month',
|
|
133
|
+
:'goal_target' => :'goal_target',
|
|
134
|
+
:'goal_target_month' => :'goal_target_month',
|
|
135
|
+
:'goal_target_date' => :'goal_target_date',
|
|
136
|
+
:'goal_percentage_complete' => :'goal_percentage_complete',
|
|
137
|
+
:'goal_months_to_budget' => :'goal_months_to_budget',
|
|
138
|
+
:'goal_under_funded' => :'goal_under_funded',
|
|
139
|
+
:'goal_overall_funded' => :'goal_overall_funded',
|
|
140
|
+
:'goal_overall_left' => :'goal_overall_left',
|
|
141
|
+
:'goal_snoozed_at' => :'goal_snoozed_at',
|
|
142
|
+
:'deleted' => :'deleted'
|
|
143
|
+
}
|
|
144
|
+
end
|
|
145
|
+
|
|
146
|
+
# Returns all the JSON keys this model knows about
|
|
147
|
+
def self.acceptable_attributes
|
|
148
|
+
attribute_map.values
|
|
149
|
+
end
|
|
150
|
+
|
|
151
|
+
# Attribute type mapping.
|
|
152
|
+
def self.openapi_types
|
|
153
|
+
{
|
|
154
|
+
:'id' => :'String',
|
|
155
|
+
:'category_group_id' => :'String',
|
|
156
|
+
:'category_group_name' => :'String',
|
|
157
|
+
:'name' => :'String',
|
|
158
|
+
:'hidden' => :'Boolean',
|
|
159
|
+
:'internal' => :'Boolean',
|
|
160
|
+
:'original_category_group_id' => :'String',
|
|
161
|
+
:'note' => :'String',
|
|
162
|
+
:'budgeted' => :'Integer',
|
|
163
|
+
:'activity' => :'Integer',
|
|
164
|
+
:'balance' => :'Integer',
|
|
165
|
+
:'goal_type' => :'String',
|
|
166
|
+
:'goal_needs_whole_amount' => :'Boolean',
|
|
167
|
+
:'goal_day' => :'Integer',
|
|
168
|
+
:'goal_cadence' => :'Integer',
|
|
169
|
+
:'goal_cadence_frequency' => :'Integer',
|
|
170
|
+
:'goal_creation_month' => :'Date',
|
|
171
|
+
:'goal_target' => :'Integer',
|
|
172
|
+
:'goal_target_month' => :'Date',
|
|
173
|
+
:'goal_target_date' => :'Date',
|
|
174
|
+
:'goal_percentage_complete' => :'Integer',
|
|
175
|
+
:'goal_months_to_budget' => :'Integer',
|
|
176
|
+
:'goal_under_funded' => :'Integer',
|
|
177
|
+
:'goal_overall_funded' => :'Integer',
|
|
178
|
+
:'goal_overall_left' => :'Integer',
|
|
179
|
+
:'goal_snoozed_at' => :'Time',
|
|
180
|
+
:'deleted' => :'Boolean'
|
|
181
|
+
}
|
|
182
|
+
end
|
|
183
|
+
|
|
184
|
+
# List of attributes with nullable: true
|
|
185
|
+
def self.openapi_nullable
|
|
186
|
+
Set.new([
|
|
187
|
+
:'original_category_group_id',
|
|
188
|
+
:'note',
|
|
189
|
+
:'goal_type',
|
|
190
|
+
:'goal_needs_whole_amount',
|
|
191
|
+
:'goal_day',
|
|
192
|
+
:'goal_cadence',
|
|
193
|
+
:'goal_cadence_frequency',
|
|
194
|
+
:'goal_creation_month',
|
|
195
|
+
:'goal_target',
|
|
196
|
+
:'goal_target_month',
|
|
197
|
+
:'goal_target_date',
|
|
198
|
+
:'goal_percentage_complete',
|
|
199
|
+
:'goal_months_to_budget',
|
|
200
|
+
:'goal_under_funded',
|
|
201
|
+
:'goal_overall_funded',
|
|
202
|
+
:'goal_overall_left',
|
|
203
|
+
:'goal_snoozed_at',
|
|
204
|
+
])
|
|
205
|
+
end
|
|
206
|
+
|
|
207
|
+
# Initializes the object
|
|
208
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
209
|
+
def initialize(attributes = {})
|
|
210
|
+
if (!attributes.is_a?(Hash))
|
|
211
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `YNAB::CategoryBase` initialize method"
|
|
212
|
+
end
|
|
213
|
+
|
|
214
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
|
215
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
216
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
|
217
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `YNAB::CategoryBase`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
|
218
|
+
end
|
|
219
|
+
h[k.to_sym] = v
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
if attributes.key?(:'id')
|
|
223
|
+
self.id = attributes[:'id']
|
|
224
|
+
end
|
|
225
|
+
|
|
226
|
+
if attributes.key?(:'category_group_id')
|
|
227
|
+
self.category_group_id = attributes[:'category_group_id']
|
|
228
|
+
end
|
|
229
|
+
|
|
230
|
+
if attributes.key?(:'category_group_name')
|
|
231
|
+
self.category_group_name = attributes[:'category_group_name']
|
|
232
|
+
end
|
|
233
|
+
|
|
234
|
+
if attributes.key?(:'name')
|
|
235
|
+
self.name = attributes[:'name']
|
|
236
|
+
end
|
|
237
|
+
|
|
238
|
+
if attributes.key?(:'hidden')
|
|
239
|
+
self.hidden = attributes[:'hidden']
|
|
240
|
+
end
|
|
241
|
+
|
|
242
|
+
if attributes.key?(:'internal')
|
|
243
|
+
self.internal = attributes[:'internal']
|
|
244
|
+
end
|
|
245
|
+
|
|
246
|
+
if attributes.key?(:'original_category_group_id')
|
|
247
|
+
self.original_category_group_id = attributes[:'original_category_group_id']
|
|
248
|
+
end
|
|
249
|
+
|
|
250
|
+
if attributes.key?(:'note')
|
|
251
|
+
self.note = attributes[:'note']
|
|
252
|
+
end
|
|
253
|
+
|
|
254
|
+
if attributes.key?(:'budgeted')
|
|
255
|
+
self.budgeted = attributes[:'budgeted']
|
|
256
|
+
end
|
|
257
|
+
|
|
258
|
+
if attributes.key?(:'activity')
|
|
259
|
+
self.activity = attributes[:'activity']
|
|
260
|
+
end
|
|
261
|
+
|
|
262
|
+
if attributes.key?(:'balance')
|
|
263
|
+
self.balance = attributes[:'balance']
|
|
264
|
+
end
|
|
265
|
+
|
|
266
|
+
if attributes.key?(:'goal_type')
|
|
267
|
+
self.goal_type = attributes[:'goal_type']
|
|
268
|
+
end
|
|
269
|
+
|
|
270
|
+
if attributes.key?(:'goal_needs_whole_amount')
|
|
271
|
+
self.goal_needs_whole_amount = attributes[:'goal_needs_whole_amount']
|
|
272
|
+
end
|
|
273
|
+
|
|
274
|
+
if attributes.key?(:'goal_day')
|
|
275
|
+
self.goal_day = attributes[:'goal_day']
|
|
276
|
+
end
|
|
277
|
+
|
|
278
|
+
if attributes.key?(:'goal_cadence')
|
|
279
|
+
self.goal_cadence = attributes[:'goal_cadence']
|
|
280
|
+
end
|
|
281
|
+
|
|
282
|
+
if attributes.key?(:'goal_cadence_frequency')
|
|
283
|
+
self.goal_cadence_frequency = attributes[:'goal_cadence_frequency']
|
|
284
|
+
end
|
|
285
|
+
|
|
286
|
+
if attributes.key?(:'goal_creation_month')
|
|
287
|
+
self.goal_creation_month = attributes[:'goal_creation_month']
|
|
288
|
+
end
|
|
289
|
+
|
|
290
|
+
if attributes.key?(:'goal_target')
|
|
291
|
+
self.goal_target = attributes[:'goal_target']
|
|
292
|
+
end
|
|
293
|
+
|
|
294
|
+
if attributes.key?(:'goal_target_month')
|
|
295
|
+
self.goal_target_month = attributes[:'goal_target_month']
|
|
296
|
+
end
|
|
297
|
+
|
|
298
|
+
if attributes.key?(:'goal_target_date')
|
|
299
|
+
self.goal_target_date = attributes[:'goal_target_date']
|
|
300
|
+
end
|
|
301
|
+
|
|
302
|
+
if attributes.key?(:'goal_percentage_complete')
|
|
303
|
+
self.goal_percentage_complete = attributes[:'goal_percentage_complete']
|
|
304
|
+
end
|
|
305
|
+
|
|
306
|
+
if attributes.key?(:'goal_months_to_budget')
|
|
307
|
+
self.goal_months_to_budget = attributes[:'goal_months_to_budget']
|
|
308
|
+
end
|
|
309
|
+
|
|
310
|
+
if attributes.key?(:'goal_under_funded')
|
|
311
|
+
self.goal_under_funded = attributes[:'goal_under_funded']
|
|
312
|
+
end
|
|
313
|
+
|
|
314
|
+
if attributes.key?(:'goal_overall_funded')
|
|
315
|
+
self.goal_overall_funded = attributes[:'goal_overall_funded']
|
|
316
|
+
end
|
|
317
|
+
|
|
318
|
+
if attributes.key?(:'goal_overall_left')
|
|
319
|
+
self.goal_overall_left = attributes[:'goal_overall_left']
|
|
320
|
+
end
|
|
321
|
+
|
|
322
|
+
if attributes.key?(:'goal_snoozed_at')
|
|
323
|
+
self.goal_snoozed_at = attributes[:'goal_snoozed_at']
|
|
324
|
+
end
|
|
325
|
+
|
|
326
|
+
if attributes.key?(:'deleted')
|
|
327
|
+
self.deleted = attributes[:'deleted']
|
|
328
|
+
end
|
|
329
|
+
end
|
|
330
|
+
|
|
331
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
332
|
+
# @return Array for valid properties with the reasons
|
|
333
|
+
def list_invalid_properties
|
|
334
|
+
invalid_properties = Array.new
|
|
335
|
+
invalid_properties
|
|
336
|
+
end
|
|
337
|
+
|
|
338
|
+
# Check to see if the all the properties in the model are valid
|
|
339
|
+
# @return true if the model is valid
|
|
340
|
+
def valid?
|
|
341
|
+
return false if @id.nil?
|
|
342
|
+
return false if @category_group_id.nil?
|
|
343
|
+
return false if @name.nil?
|
|
344
|
+
return false if @hidden.nil?
|
|
345
|
+
return false if @internal.nil?
|
|
346
|
+
return false if @budgeted.nil?
|
|
347
|
+
return false if @activity.nil?
|
|
348
|
+
return false if @balance.nil?
|
|
349
|
+
goal_type_validator = EnumAttributeValidator.new('String', ["TB", "TBD", "MF", "NEED", "DEBT"])
|
|
350
|
+
return false unless goal_type_validator.valid?(@goal_type)
|
|
351
|
+
return false if @deleted.nil?
|
|
352
|
+
true
|
|
353
|
+
end
|
|
354
|
+
|
|
355
|
+
# Custom attribute writer method checking allowed values (enum).
|
|
356
|
+
# @param [Object] goal_type Object to be assigned
|
|
357
|
+
def goal_type=(goal_type)
|
|
358
|
+
@goal_type = goal_type
|
|
359
|
+
end
|
|
360
|
+
|
|
361
|
+
# Checks equality by comparing each attribute.
|
|
362
|
+
# @param [Object] Object to be compared
|
|
363
|
+
def ==(o)
|
|
364
|
+
return true if self.equal?(o)
|
|
365
|
+
self.class == o.class &&
|
|
366
|
+
id == o.id &&
|
|
367
|
+
category_group_id == o.category_group_id &&
|
|
368
|
+
category_group_name == o.category_group_name &&
|
|
369
|
+
name == o.name &&
|
|
370
|
+
hidden == o.hidden &&
|
|
371
|
+
internal == o.internal &&
|
|
372
|
+
original_category_group_id == o.original_category_group_id &&
|
|
373
|
+
note == o.note &&
|
|
374
|
+
budgeted == o.budgeted &&
|
|
375
|
+
activity == o.activity &&
|
|
376
|
+
balance == o.balance &&
|
|
377
|
+
goal_type == o.goal_type &&
|
|
378
|
+
goal_needs_whole_amount == o.goal_needs_whole_amount &&
|
|
379
|
+
goal_day == o.goal_day &&
|
|
380
|
+
goal_cadence == o.goal_cadence &&
|
|
381
|
+
goal_cadence_frequency == o.goal_cadence_frequency &&
|
|
382
|
+
goal_creation_month == o.goal_creation_month &&
|
|
383
|
+
goal_target == o.goal_target &&
|
|
384
|
+
goal_target_month == o.goal_target_month &&
|
|
385
|
+
goal_target_date == o.goal_target_date &&
|
|
386
|
+
goal_percentage_complete == o.goal_percentage_complete &&
|
|
387
|
+
goal_months_to_budget == o.goal_months_to_budget &&
|
|
388
|
+
goal_under_funded == o.goal_under_funded &&
|
|
389
|
+
goal_overall_funded == o.goal_overall_funded &&
|
|
390
|
+
goal_overall_left == o.goal_overall_left &&
|
|
391
|
+
goal_snoozed_at == o.goal_snoozed_at &&
|
|
392
|
+
deleted == o.deleted
|
|
393
|
+
end
|
|
394
|
+
|
|
395
|
+
# @see the `==` method
|
|
396
|
+
# @param [Object] Object to be compared
|
|
397
|
+
def eql?(o)
|
|
398
|
+
self == o
|
|
399
|
+
end
|
|
400
|
+
|
|
401
|
+
# Calculates hash code according to all attributes.
|
|
402
|
+
# @return [Integer] Hash code
|
|
403
|
+
def hash
|
|
404
|
+
[id, category_group_id, category_group_name, name, hidden, internal, original_category_group_id, note, budgeted, activity, balance, goal_type, goal_needs_whole_amount, goal_day, goal_cadence, goal_cadence_frequency, goal_creation_month, goal_target, goal_target_month, goal_target_date, goal_percentage_complete, goal_months_to_budget, goal_under_funded, goal_overall_funded, goal_overall_left, goal_snoozed_at, deleted].hash
|
|
405
|
+
end
|
|
406
|
+
|
|
407
|
+
# Builds the object from hash
|
|
408
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
409
|
+
# @return [Object] Returns the model itself
|
|
410
|
+
def self.build_from_hash(attributes)
|
|
411
|
+
return nil unless attributes.is_a?(Hash)
|
|
412
|
+
attributes = attributes.transform_keys(&:to_sym)
|
|
413
|
+
transformed_hash = {}
|
|
414
|
+
openapi_types.each_pair do |key, type|
|
|
415
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
|
416
|
+
transformed_hash["#{key}"] = nil
|
|
417
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
418
|
+
# check to ensure the input is an array given that the attribute
|
|
419
|
+
# is documented as an array but the input is not
|
|
420
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
|
421
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
|
422
|
+
end
|
|
423
|
+
elsif !attributes[attribute_map[key]].nil?
|
|
424
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
|
425
|
+
end
|
|
426
|
+
end
|
|
427
|
+
new(transformed_hash)
|
|
428
|
+
end
|
|
429
|
+
|
|
430
|
+
# Returns the object in the form of hash
|
|
431
|
+
# @return [Hash] Returns the object in the form of hash
|
|
432
|
+
def to_hash
|
|
433
|
+
hash = {}
|
|
434
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
435
|
+
value = self.send(attr)
|
|
436
|
+
if value.nil?
|
|
437
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
|
438
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
439
|
+
end
|
|
440
|
+
|
|
441
|
+
hash[param] = _to_hash(value)
|
|
442
|
+
end
|
|
443
|
+
hash
|
|
444
|
+
end
|
|
445
|
+
end
|
|
446
|
+
|
|
447
|
+
end
|
|
@@ -19,6 +19,9 @@ module YNAB
|
|
|
19
19
|
# Whether or not the category group is hidden
|
|
20
20
|
attr_accessor :hidden
|
|
21
21
|
|
|
22
|
+
# Whether or not the category group is internal
|
|
23
|
+
attr_accessor :internal
|
|
24
|
+
|
|
22
25
|
# Whether or not the category group has been deleted. Deleted category groups will only be included in delta requests.
|
|
23
26
|
attr_accessor :deleted
|
|
24
27
|
|
|
@@ -28,6 +31,7 @@ module YNAB
|
|
|
28
31
|
:'id' => :'id',
|
|
29
32
|
:'name' => :'name',
|
|
30
33
|
:'hidden' => :'hidden',
|
|
34
|
+
:'internal' => :'internal',
|
|
31
35
|
:'deleted' => :'deleted'
|
|
32
36
|
}
|
|
33
37
|
end
|
|
@@ -43,6 +47,7 @@ module YNAB
|
|
|
43
47
|
:'id' => :'String',
|
|
44
48
|
:'name' => :'String',
|
|
45
49
|
:'hidden' => :'Boolean',
|
|
50
|
+
:'internal' => :'Boolean',
|
|
46
51
|
:'deleted' => :'Boolean'
|
|
47
52
|
}
|
|
48
53
|
end
|
|
@@ -80,6 +85,10 @@ module YNAB
|
|
|
80
85
|
self.hidden = attributes[:'hidden']
|
|
81
86
|
end
|
|
82
87
|
|
|
88
|
+
if attributes.key?(:'internal')
|
|
89
|
+
self.internal = attributes[:'internal']
|
|
90
|
+
end
|
|
91
|
+
|
|
83
92
|
if attributes.key?(:'deleted')
|
|
84
93
|
self.deleted = attributes[:'deleted']
|
|
85
94
|
end
|
|
@@ -98,6 +107,7 @@ module YNAB
|
|
|
98
107
|
return false if @id.nil?
|
|
99
108
|
return false if @name.nil?
|
|
100
109
|
return false if @hidden.nil?
|
|
110
|
+
return false if @internal.nil?
|
|
101
111
|
return false if @deleted.nil?
|
|
102
112
|
true
|
|
103
113
|
end
|
|
@@ -110,6 +120,7 @@ module YNAB
|
|
|
110
120
|
id == o.id &&
|
|
111
121
|
name == o.name &&
|
|
112
122
|
hidden == o.hidden &&
|
|
123
|
+
internal == o.internal &&
|
|
113
124
|
deleted == o.deleted
|
|
114
125
|
end
|
|
115
126
|
|
|
@@ -122,7 +133,7 @@ module YNAB
|
|
|
122
133
|
# Calculates hash code according to all attributes.
|
|
123
134
|
# @return [Integer] Hash code
|
|
124
135
|
def hash
|
|
125
|
-
[id, name, hidden, deleted].hash
|
|
136
|
+
[id, name, hidden, internal, deleted].hash
|
|
126
137
|
end
|
|
127
138
|
|
|
128
139
|
# Builds the object from hash
|
|
@@ -19,6 +19,9 @@ module YNAB
|
|
|
19
19
|
# Whether or not the category group is hidden
|
|
20
20
|
attr_accessor :hidden
|
|
21
21
|
|
|
22
|
+
# Whether or not the category group is internal
|
|
23
|
+
attr_accessor :internal
|
|
24
|
+
|
|
22
25
|
# Whether or not the category group has been deleted. Deleted category groups will only be included in delta requests.
|
|
23
26
|
attr_accessor :deleted
|
|
24
27
|
|
|
@@ -31,6 +34,7 @@ module YNAB
|
|
|
31
34
|
:'id' => :'id',
|
|
32
35
|
:'name' => :'name',
|
|
33
36
|
:'hidden' => :'hidden',
|
|
37
|
+
:'internal' => :'internal',
|
|
34
38
|
:'deleted' => :'deleted',
|
|
35
39
|
:'categories' => :'categories'
|
|
36
40
|
}
|
|
@@ -47,6 +51,7 @@ module YNAB
|
|
|
47
51
|
:'id' => :'String',
|
|
48
52
|
:'name' => :'String',
|
|
49
53
|
:'hidden' => :'Boolean',
|
|
54
|
+
:'internal' => :'Boolean',
|
|
50
55
|
:'deleted' => :'Boolean',
|
|
51
56
|
:'categories' => :'Array<Category>'
|
|
52
57
|
}
|
|
@@ -92,6 +97,10 @@ module YNAB
|
|
|
92
97
|
self.hidden = attributes[:'hidden']
|
|
93
98
|
end
|
|
94
99
|
|
|
100
|
+
if attributes.key?(:'internal')
|
|
101
|
+
self.internal = attributes[:'internal']
|
|
102
|
+
end
|
|
103
|
+
|
|
95
104
|
if attributes.key?(:'deleted')
|
|
96
105
|
self.deleted = attributes[:'deleted']
|
|
97
106
|
end
|
|
@@ -116,6 +125,7 @@ module YNAB
|
|
|
116
125
|
return false if @id.nil?
|
|
117
126
|
return false if @name.nil?
|
|
118
127
|
return false if @hidden.nil?
|
|
128
|
+
return false if @internal.nil?
|
|
119
129
|
return false if @deleted.nil?
|
|
120
130
|
return false if @categories.nil?
|
|
121
131
|
true
|
|
@@ -129,6 +139,7 @@ module YNAB
|
|
|
129
139
|
id == o.id &&
|
|
130
140
|
name == o.name &&
|
|
131
141
|
hidden == o.hidden &&
|
|
142
|
+
internal == o.internal &&
|
|
132
143
|
deleted == o.deleted &&
|
|
133
144
|
categories == o.categories
|
|
134
145
|
end
|
|
@@ -142,7 +153,7 @@ module YNAB
|
|
|
142
153
|
# Calculates hash code according to all attributes.
|
|
143
154
|
# @return [Integer] Hash code
|
|
144
155
|
def hash
|
|
145
|
-
[id, name, hidden, deleted, categories].hash
|
|
156
|
+
[id, name, hidden, internal, deleted, categories].hash
|
|
146
157
|
end
|
|
147
158
|
|
|
148
159
|
# Builds the object from hash
|
|
@@ -16,14 +16,18 @@ module YNAB
|
|
|
16
16
|
|
|
17
17
|
attr_accessor :note
|
|
18
18
|
|
|
19
|
+
# The id of the category group to which this category belongs. An internal category group may not be specified.
|
|
19
20
|
attr_accessor :category_group_id
|
|
20
21
|
|
|
21
|
-
# The goal target amount in milliunits format. If value is specified and goal has not already been configured for category, a monthly
|
|
22
|
+
# 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
23
|
attr_accessor :goal_target
|
|
23
24
|
|
|
24
25
|
# The goal target date in ISO format (e.g. 2016-12-01).
|
|
25
26
|
attr_accessor :goal_target_date
|
|
26
27
|
|
|
28
|
+
# 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...'.
|
|
29
|
+
attr_accessor :goal_needs_whole_amount
|
|
30
|
+
|
|
27
31
|
# Attribute mapping from ruby-style variable name to JSON key.
|
|
28
32
|
def self.attribute_map
|
|
29
33
|
{
|
|
@@ -31,7 +35,8 @@ module YNAB
|
|
|
31
35
|
:'note' => :'note',
|
|
32
36
|
:'category_group_id' => :'category_group_id',
|
|
33
37
|
:'goal_target' => :'goal_target',
|
|
34
|
-
:'goal_target_date' => :'goal_target_date'
|
|
38
|
+
:'goal_target_date' => :'goal_target_date',
|
|
39
|
+
:'goal_needs_whole_amount' => :'goal_needs_whole_amount'
|
|
35
40
|
}
|
|
36
41
|
end
|
|
37
42
|
|
|
@@ -47,7 +52,8 @@ module YNAB
|
|
|
47
52
|
:'note' => :'String',
|
|
48
53
|
:'category_group_id' => :'String',
|
|
49
54
|
:'goal_target' => :'Integer',
|
|
50
|
-
:'goal_target_date' => :'Date'
|
|
55
|
+
:'goal_target_date' => :'Date',
|
|
56
|
+
:'goal_needs_whole_amount' => :'Boolean'
|
|
51
57
|
}
|
|
52
58
|
end
|
|
53
59
|
|
|
@@ -98,6 +104,10 @@ module YNAB
|
|
|
98
104
|
if attributes.key?(:'goal_target_date')
|
|
99
105
|
self.goal_target_date = attributes[:'goal_target_date']
|
|
100
106
|
end
|
|
107
|
+
|
|
108
|
+
if attributes.key?(:'goal_needs_whole_amount')
|
|
109
|
+
self.goal_needs_whole_amount = attributes[:'goal_needs_whole_amount']
|
|
110
|
+
end
|
|
101
111
|
end
|
|
102
112
|
|
|
103
113
|
# Show invalid properties with the reasons. Usually used together with valid?
|
|
@@ -122,7 +132,8 @@ module YNAB
|
|
|
122
132
|
note == o.note &&
|
|
123
133
|
category_group_id == o.category_group_id &&
|
|
124
134
|
goal_target == o.goal_target &&
|
|
125
|
-
goal_target_date == o.goal_target_date
|
|
135
|
+
goal_target_date == o.goal_target_date &&
|
|
136
|
+
goal_needs_whole_amount == o.goal_needs_whole_amount
|
|
126
137
|
end
|
|
127
138
|
|
|
128
139
|
# @see the `==` method
|
|
@@ -134,7 +145,7 @@ module YNAB
|
|
|
134
145
|
# Calculates hash code according to all attributes.
|
|
135
146
|
# @return [Integer] Hash code
|
|
136
147
|
def hash
|
|
137
|
-
[name, note, category_group_id, goal_target, goal_target_date].hash
|
|
148
|
+
[name, note, category_group_id, goal_target, goal_target_date, goal_needs_whole_amount].hash
|
|
138
149
|
end
|
|
139
150
|
|
|
140
151
|
# Builds the object from hash
|