ynab 0.6.0 → 0.7.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 +24 -24
- data/Rakefile +1 -1
- data/config.json +1 -1
- data/docs/AccountsApi.md +0 -76
- data/docs/BudgetsApi.md +0 -74
- data/docs/CategoriesApi.md +0 -76
- data/docs/CurrencyFormat.md +8 -1
- data/docs/DateFormat.md +1 -1
- data/docs/HybridTransaction.md +3 -0
- data/docs/MonthsApi.md +0 -76
- data/docs/PayeeLocationsApi.md +0 -115
- data/docs/PayeesApi.md +0 -76
- data/docs/ScheduledTransactionsApi.md +0 -76
- data/docs/TransactionsApi.md +0 -325
- data/docs/UserApi.md +0 -34
- data/lib/ynab/api/accounts_api.rb +8 -10
- data/lib/ynab/api/budgets_api.rb +8 -10
- data/lib/ynab/api/categories_api.rb +8 -10
- data/lib/ynab/api/months_api.rb +8 -10
- data/lib/ynab/api/payee_locations_api.rb +11 -14
- data/lib/ynab/api/payees_api.rb +8 -10
- data/lib/ynab/api/scheduled_transactions_api.rb +8 -10
- data/lib/ynab/api/transactions_api.rb +26 -34
- data/lib/ynab/api/user_api.rb +5 -6
- data/lib/ynab/api_client.rb +1 -1
- data/lib/ynab/api_error.rb +1 -1
- data/lib/ynab/configuration.rb +2 -2
- data/lib/ynab/models/account.rb +18 -22
- data/lib/ynab/models/account_response.rb +7 -12
- data/lib/ynab/models/account_wrapper.rb +7 -12
- data/lib/ynab/models/accounts_response.rb +7 -12
- data/lib/ynab/models/accounts_wrapper.rb +7 -12
- data/lib/ynab/models/budget_detail.rb +8 -13
- data/lib/ynab/models/budget_detail_response.rb +7 -12
- data/lib/ynab/models/budget_detail_wrapper.rb +8 -13
- data/lib/ynab/models/budget_summary.rb +8 -13
- data/lib/ynab/models/budget_summary_response.rb +7 -12
- data/lib/ynab/models/budget_summary_wrapper.rb +7 -12
- data/lib/ynab/models/bulk_id_wrapper.rb +7 -12
- data/lib/ynab/models/bulk_ids.rb +8 -13
- data/lib/ynab/models/bulk_response.rb +7 -12
- data/lib/ynab/models/bulk_transactions.rb +7 -12
- data/lib/ynab/models/categories_response.rb +7 -12
- data/lib/ynab/models/category.rb +14 -19
- data/lib/ynab/models/category_group.rb +9 -14
- data/lib/ynab/models/category_group_with_categories.rb +10 -15
- data/lib/ynab/models/category_groups_wrapper.rb +7 -12
- data/lib/ynab/models/category_response.rb +7 -12
- data/lib/ynab/models/category_wrapper.rb +7 -12
- data/lib/ynab/models/currency_format.rb +112 -19
- data/lib/ynab/models/date_format.rb +16 -21
- data/lib/ynab/models/error_detail.rb +9 -14
- data/lib/ynab/models/error_response.rb +7 -12
- data/lib/ynab/models/hybrid_transaction.rb +74 -36
- data/lib/ynab/models/hybrid_transactions_response.rb +7 -12
- data/lib/ynab/models/hybrid_transactions_wrapper.rb +7 -12
- data/lib/ynab/models/month_detail.rb +11 -16
- data/lib/ynab/models/month_detail_response.rb +7 -12
- data/lib/ynab/models/month_detail_wrapper.rb +7 -12
- data/lib/ynab/models/month_summaries_response.rb +7 -12
- data/lib/ynab/models/month_summaries_wrapper.rb +7 -12
- data/lib/ynab/models/month_summary.rb +10 -15
- data/lib/ynab/models/payee.rb +9 -14
- data/lib/ynab/models/payee_location.rb +10 -15
- data/lib/ynab/models/payee_location_response.rb +7 -12
- data/lib/ynab/models/payee_location_wrapper.rb +7 -12
- data/lib/ynab/models/payee_locations_response.rb +7 -12
- data/lib/ynab/models/payee_locations_wrapper.rb +7 -12
- data/lib/ynab/models/payee_response.rb +7 -12
- data/lib/ynab/models/payee_wrapper.rb +7 -12
- data/lib/ynab/models/payees_response.rb +7 -12
- data/lib/ynab/models/payees_wrapper.rb +7 -12
- data/lib/ynab/models/save_transaction.rb +15 -19
- data/lib/ynab/models/save_transaction_wrapper.rb +7 -12
- data/lib/ynab/models/scheduled_sub_transaction.rb +13 -18
- data/lib/ynab/models/scheduled_transaction_detail.rb +27 -31
- data/lib/ynab/models/scheduled_transaction_response.rb +7 -12
- data/lib/ynab/models/scheduled_transaction_summary.rb +23 -27
- data/lib/ynab/models/scheduled_transaction_wrapper.rb +7 -12
- data/lib/ynab/models/scheduled_transactions_response.rb +7 -12
- data/lib/ynab/models/scheduled_transactions_wrapper.rb +7 -12
- data/lib/ynab/models/sub_transaction.rb +13 -18
- data/lib/ynab/models/transaction_detail.rb +28 -32
- data/lib/ynab/models/transaction_response.rb +7 -12
- data/lib/ynab/models/transaction_summary.rb +24 -28
- data/lib/ynab/models/transaction_wrapper.rb +7 -12
- data/lib/ynab/models/transactions_response.rb +7 -12
- data/lib/ynab/models/transactions_wrapper.rb +7 -12
- data/lib/ynab/models/user.rb +7 -12
- data/lib/ynab/models/user_response.rb +7 -12
- data/lib/ynab/models/user_wrapper.rb +7 -12
- data/lib/ynab/version.rb +2 -2
- data/spec-v1-swagger.json +50 -5
- data/swagger-templates/api_doc.mustache +32 -0
- data/ynab.gemspec +1 -1
- metadata +4 -3
@@ -6,18 +6,16 @@
|
|
6
6
|
OpenAPI spec version: 1.0.0
|
7
7
|
|
8
8
|
Generated by: https://github.com/swagger-api/swagger-codegen.git
|
9
|
-
Swagger Codegen version: 2.
|
9
|
+
Swagger Codegen version: 2.4.0-SNAPSHOT
|
10
10
|
|
11
11
|
=end
|
12
12
|
|
13
13
|
require 'date'
|
14
14
|
|
15
15
|
module YnabApi
|
16
|
-
|
17
16
|
class PayeesWrapper
|
18
17
|
attr_accessor :payees
|
19
18
|
|
20
|
-
|
21
19
|
# Attribute mapping from ruby-style variable name to JSON key.
|
22
20
|
def self.attribute_map
|
23
21
|
{
|
@@ -38,14 +36,13 @@ module YnabApi
|
|
38
36
|
return unless attributes.is_a?(Hash)
|
39
37
|
|
40
38
|
# convert string to symbol for hash key
|
41
|
-
attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
|
39
|
+
attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
|
42
40
|
|
43
41
|
if attributes.has_key?(:'payees')
|
44
42
|
if (value = attributes[:'payees']).is_a?(Array)
|
45
43
|
self.payees = value
|
46
44
|
end
|
47
45
|
end
|
48
|
-
|
49
46
|
end
|
50
47
|
|
51
48
|
# Show invalid properties with the reasons. Usually used together with valid?
|
@@ -53,17 +50,17 @@ module YnabApi
|
|
53
50
|
def list_invalid_properties
|
54
51
|
invalid_properties = Array.new
|
55
52
|
if @payees.nil?
|
56
|
-
invalid_properties.push(
|
53
|
+
invalid_properties.push('invalid value for "payees", payees cannot be nil.')
|
57
54
|
end
|
58
55
|
|
59
|
-
|
56
|
+
invalid_properties
|
60
57
|
end
|
61
58
|
|
62
59
|
# Check to see if the all the properties in the model are valid
|
63
60
|
# @return true if the model is valid
|
64
61
|
def valid?
|
65
62
|
return false if @payees.nil?
|
66
|
-
|
63
|
+
true
|
67
64
|
end
|
68
65
|
|
69
66
|
# Checks equality by comparing each attribute.
|
@@ -96,7 +93,7 @@ module YnabApi
|
|
96
93
|
# check to ensure the input is an array given that the the attribute
|
97
94
|
# is documented as an array but the input is not
|
98
95
|
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
99
|
-
self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) }
|
96
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
100
97
|
end
|
101
98
|
elsif !attributes[self.class.attribute_map[key]].nil?
|
102
99
|
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
@@ -178,7 +175,7 @@ module YnabApi
|
|
178
175
|
# @return [Hash] Returns the value in the form of hash
|
179
176
|
def _to_hash(value)
|
180
177
|
if value.is_a?(Array)
|
181
|
-
value.compact.map{ |v| _to_hash(v) }
|
178
|
+
value.compact.map { |v| _to_hash(v) }
|
182
179
|
elsif value.is_a?(Hash)
|
183
180
|
{}.tap do |hash|
|
184
181
|
value.each { |k, v| hash[k] = _to_hash(v) }
|
@@ -189,7 +186,5 @@ module YnabApi
|
|
189
186
|
value
|
190
187
|
end
|
191
188
|
end
|
192
|
-
|
193
189
|
end
|
194
|
-
|
195
190
|
end
|
@@ -6,14 +6,13 @@
|
|
6
6
|
OpenAPI spec version: 1.0.0
|
7
7
|
|
8
8
|
Generated by: https://github.com/swagger-api/swagger-codegen.git
|
9
|
-
Swagger Codegen version: 2.
|
9
|
+
Swagger Codegen version: 2.4.0-SNAPSHOT
|
10
10
|
|
11
11
|
=end
|
12
12
|
|
13
13
|
require 'date'
|
14
14
|
|
15
15
|
module YnabApi
|
16
|
-
|
17
16
|
class SaveTransaction
|
18
17
|
attr_accessor :account_id
|
19
18
|
|
@@ -107,7 +106,7 @@ module YnabApi
|
|
107
106
|
return unless attributes.is_a?(Hash)
|
108
107
|
|
109
108
|
# convert string to symbol for hash key
|
110
|
-
attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
|
109
|
+
attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
|
111
110
|
|
112
111
|
if attributes.has_key?(:'account_id')
|
113
112
|
self.account_id = attributes[:'account_id']
|
@@ -152,7 +151,6 @@ module YnabApi
|
|
152
151
|
if attributes.has_key?(:'import_id')
|
153
152
|
self.import_id = attributes[:'import_id']
|
154
153
|
end
|
155
|
-
|
156
154
|
end
|
157
155
|
|
158
156
|
# Show invalid properties with the reasons. Usually used together with valid?
|
@@ -160,18 +158,18 @@ module YnabApi
|
|
160
158
|
def list_invalid_properties
|
161
159
|
invalid_properties = Array.new
|
162
160
|
if @account_id.nil?
|
163
|
-
invalid_properties.push(
|
161
|
+
invalid_properties.push('invalid value for "account_id", account_id cannot be nil.')
|
164
162
|
end
|
165
163
|
|
166
164
|
if @date.nil?
|
167
|
-
invalid_properties.push(
|
165
|
+
invalid_properties.push('invalid value for "date", date cannot be nil.')
|
168
166
|
end
|
169
167
|
|
170
168
|
if @amount.nil?
|
171
|
-
invalid_properties.push(
|
169
|
+
invalid_properties.push('invalid value for "amount", amount cannot be nil.')
|
172
170
|
end
|
173
171
|
|
174
|
-
|
172
|
+
invalid_properties
|
175
173
|
end
|
176
174
|
|
177
175
|
# Check to see if the all the properties in the model are valid
|
@@ -180,19 +178,19 @@ module YnabApi
|
|
180
178
|
return false if @account_id.nil?
|
181
179
|
return false if @date.nil?
|
182
180
|
return false if @amount.nil?
|
183
|
-
cleared_validator = EnumAttributeValidator.new('String', [
|
181
|
+
cleared_validator = EnumAttributeValidator.new('String', ['cleared', 'uncleared', 'reconciled'])
|
184
182
|
return false unless cleared_validator.valid?(@cleared)
|
185
|
-
flag_color_validator = EnumAttributeValidator.new('String', [
|
183
|
+
flag_color_validator = EnumAttributeValidator.new('String', ['red', 'orange', 'yellow', 'green', 'blue', 'purple'])
|
186
184
|
return false unless flag_color_validator.valid?(@flag_color)
|
187
|
-
|
185
|
+
true
|
188
186
|
end
|
189
187
|
|
190
188
|
# Custom attribute writer method checking allowed values (enum).
|
191
189
|
# @param [Object] cleared Object to be assigned
|
192
190
|
def cleared=(cleared)
|
193
|
-
validator = EnumAttributeValidator.new('String', [
|
191
|
+
validator = EnumAttributeValidator.new('String', ['cleared', 'uncleared', 'reconciled'])
|
194
192
|
unless validator.valid?(cleared)
|
195
|
-
fail ArgumentError,
|
193
|
+
fail ArgumentError, 'invalid value for "cleared", must be one of #{validator.allowable_values}.'
|
196
194
|
end
|
197
195
|
@cleared = cleared
|
198
196
|
end
|
@@ -200,9 +198,9 @@ module YnabApi
|
|
200
198
|
# Custom attribute writer method checking allowed values (enum).
|
201
199
|
# @param [Object] flag_color Object to be assigned
|
202
200
|
def flag_color=(flag_color)
|
203
|
-
validator = EnumAttributeValidator.new('String', [
|
201
|
+
validator = EnumAttributeValidator.new('String', ['red', 'orange', 'yellow', 'green', 'blue', 'purple'])
|
204
202
|
unless validator.valid?(flag_color)
|
205
|
-
fail ArgumentError,
|
203
|
+
fail ArgumentError, 'invalid value for "flag_color", must be one of #{validator.allowable_values}.'
|
206
204
|
end
|
207
205
|
@flag_color = flag_color
|
208
206
|
end
|
@@ -247,7 +245,7 @@ module YnabApi
|
|
247
245
|
# check to ensure the input is an array given that the the attribute
|
248
246
|
# is documented as an array but the input is not
|
249
247
|
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
250
|
-
self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) }
|
248
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
251
249
|
end
|
252
250
|
elsif !attributes[self.class.attribute_map[key]].nil?
|
253
251
|
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
@@ -329,7 +327,7 @@ module YnabApi
|
|
329
327
|
# @return [Hash] Returns the value in the form of hash
|
330
328
|
def _to_hash(value)
|
331
329
|
if value.is_a?(Array)
|
332
|
-
value.compact.map{ |v| _to_hash(v) }
|
330
|
+
value.compact.map { |v| _to_hash(v) }
|
333
331
|
elsif value.is_a?(Hash)
|
334
332
|
{}.tap do |hash|
|
335
333
|
value.each { |k, v| hash[k] = _to_hash(v) }
|
@@ -340,7 +338,5 @@ module YnabApi
|
|
340
338
|
value
|
341
339
|
end
|
342
340
|
end
|
343
|
-
|
344
341
|
end
|
345
|
-
|
346
342
|
end
|
@@ -6,18 +6,16 @@
|
|
6
6
|
OpenAPI spec version: 1.0.0
|
7
7
|
|
8
8
|
Generated by: https://github.com/swagger-api/swagger-codegen.git
|
9
|
-
Swagger Codegen version: 2.
|
9
|
+
Swagger Codegen version: 2.4.0-SNAPSHOT
|
10
10
|
|
11
11
|
=end
|
12
12
|
|
13
13
|
require 'date'
|
14
14
|
|
15
15
|
module YnabApi
|
16
|
-
|
17
16
|
class SaveTransactionWrapper
|
18
17
|
attr_accessor :transaction
|
19
18
|
|
20
|
-
|
21
19
|
# Attribute mapping from ruby-style variable name to JSON key.
|
22
20
|
def self.attribute_map
|
23
21
|
{
|
@@ -38,12 +36,11 @@ module YnabApi
|
|
38
36
|
return unless attributes.is_a?(Hash)
|
39
37
|
|
40
38
|
# convert string to symbol for hash key
|
41
|
-
attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
|
39
|
+
attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
|
42
40
|
|
43
41
|
if attributes.has_key?(:'transaction')
|
44
42
|
self.transaction = attributes[:'transaction']
|
45
43
|
end
|
46
|
-
|
47
44
|
end
|
48
45
|
|
49
46
|
# Show invalid properties with the reasons. Usually used together with valid?
|
@@ -51,17 +48,17 @@ module YnabApi
|
|
51
48
|
def list_invalid_properties
|
52
49
|
invalid_properties = Array.new
|
53
50
|
if @transaction.nil?
|
54
|
-
invalid_properties.push(
|
51
|
+
invalid_properties.push('invalid value for "transaction", transaction cannot be nil.')
|
55
52
|
end
|
56
53
|
|
57
|
-
|
54
|
+
invalid_properties
|
58
55
|
end
|
59
56
|
|
60
57
|
# Check to see if the all the properties in the model are valid
|
61
58
|
# @return true if the model is valid
|
62
59
|
def valid?
|
63
60
|
return false if @transaction.nil?
|
64
|
-
|
61
|
+
true
|
65
62
|
end
|
66
63
|
|
67
64
|
# Checks equality by comparing each attribute.
|
@@ -94,7 +91,7 @@ module YnabApi
|
|
94
91
|
# check to ensure the input is an array given that the the attribute
|
95
92
|
# is documented as an array but the input is not
|
96
93
|
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
97
|
-
self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) }
|
94
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
98
95
|
end
|
99
96
|
elsif !attributes[self.class.attribute_map[key]].nil?
|
100
97
|
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
@@ -176,7 +173,7 @@ module YnabApi
|
|
176
173
|
# @return [Hash] Returns the value in the form of hash
|
177
174
|
def _to_hash(value)
|
178
175
|
if value.is_a?(Array)
|
179
|
-
value.compact.map{ |v| _to_hash(v) }
|
176
|
+
value.compact.map { |v| _to_hash(v) }
|
180
177
|
elsif value.is_a?(Hash)
|
181
178
|
{}.tap do |hash|
|
182
179
|
value.each { |k, v| hash[k] = _to_hash(v) }
|
@@ -187,7 +184,5 @@ module YnabApi
|
|
187
184
|
value
|
188
185
|
end
|
189
186
|
end
|
190
|
-
|
191
187
|
end
|
192
|
-
|
193
188
|
end
|
@@ -6,14 +6,13 @@
|
|
6
6
|
OpenAPI spec version: 1.0.0
|
7
7
|
|
8
8
|
Generated by: https://github.com/swagger-api/swagger-codegen.git
|
9
|
-
Swagger Codegen version: 2.
|
9
|
+
Swagger Codegen version: 2.4.0-SNAPSHOT
|
10
10
|
|
11
11
|
=end
|
12
12
|
|
13
13
|
require 'date'
|
14
14
|
|
15
15
|
module YnabApi
|
16
|
-
|
17
16
|
class ScheduledSubTransaction
|
18
17
|
attr_accessor :id
|
19
18
|
|
@@ -31,7 +30,6 @@ module YnabApi
|
|
31
30
|
# If a transfer, the account_id which the scheduled sub transaction transfers to
|
32
31
|
attr_accessor :transfer_account_id
|
33
32
|
|
34
|
-
|
35
33
|
# Attribute mapping from ruby-style variable name to JSON key.
|
36
34
|
def self.attribute_map
|
37
35
|
{
|
@@ -64,7 +62,7 @@ module YnabApi
|
|
64
62
|
return unless attributes.is_a?(Hash)
|
65
63
|
|
66
64
|
# convert string to symbol for hash key
|
67
|
-
attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
|
65
|
+
attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
|
68
66
|
|
69
67
|
if attributes.has_key?(:'id')
|
70
68
|
self.id = attributes[:'id']
|
@@ -93,7 +91,6 @@ module YnabApi
|
|
93
91
|
if attributes.has_key?(:'transfer_account_id')
|
94
92
|
self.transfer_account_id = attributes[:'transfer_account_id']
|
95
93
|
end
|
96
|
-
|
97
94
|
end
|
98
95
|
|
99
96
|
# Show invalid properties with the reasons. Usually used together with valid?
|
@@ -101,34 +98,34 @@ module YnabApi
|
|
101
98
|
def list_invalid_properties
|
102
99
|
invalid_properties = Array.new
|
103
100
|
if @id.nil?
|
104
|
-
invalid_properties.push(
|
101
|
+
invalid_properties.push('invalid value for "id", id cannot be nil.')
|
105
102
|
end
|
106
103
|
|
107
104
|
if @scheduled_transaction_id.nil?
|
108
|
-
invalid_properties.push(
|
105
|
+
invalid_properties.push('invalid value for "scheduled_transaction_id", scheduled_transaction_id cannot be nil.')
|
109
106
|
end
|
110
107
|
|
111
108
|
if @amount.nil?
|
112
|
-
invalid_properties.push(
|
109
|
+
invalid_properties.push('invalid value for "amount", amount cannot be nil.')
|
113
110
|
end
|
114
111
|
|
115
112
|
if @memo.nil?
|
116
|
-
invalid_properties.push(
|
113
|
+
invalid_properties.push('invalid value for "memo", memo cannot be nil.')
|
117
114
|
end
|
118
115
|
|
119
116
|
if @payee_id.nil?
|
120
|
-
invalid_properties.push(
|
117
|
+
invalid_properties.push('invalid value for "payee_id", payee_id cannot be nil.')
|
121
118
|
end
|
122
119
|
|
123
120
|
if @category_id.nil?
|
124
|
-
invalid_properties.push(
|
121
|
+
invalid_properties.push('invalid value for "category_id", category_id cannot be nil.')
|
125
122
|
end
|
126
123
|
|
127
124
|
if @transfer_account_id.nil?
|
128
|
-
invalid_properties.push(
|
125
|
+
invalid_properties.push('invalid value for "transfer_account_id", transfer_account_id cannot be nil.')
|
129
126
|
end
|
130
127
|
|
131
|
-
|
128
|
+
invalid_properties
|
132
129
|
end
|
133
130
|
|
134
131
|
# Check to see if the all the properties in the model are valid
|
@@ -141,7 +138,7 @@ module YnabApi
|
|
141
138
|
return false if @payee_id.nil?
|
142
139
|
return false if @category_id.nil?
|
143
140
|
return false if @transfer_account_id.nil?
|
144
|
-
|
141
|
+
true
|
145
142
|
end
|
146
143
|
|
147
144
|
# Checks equality by comparing each attribute.
|
@@ -180,7 +177,7 @@ module YnabApi
|
|
180
177
|
# check to ensure the input is an array given that the the attribute
|
181
178
|
# is documented as an array but the input is not
|
182
179
|
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
183
|
-
self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) }
|
180
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
184
181
|
end
|
185
182
|
elsif !attributes[self.class.attribute_map[key]].nil?
|
186
183
|
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
@@ -262,7 +259,7 @@ module YnabApi
|
|
262
259
|
# @return [Hash] Returns the value in the form of hash
|
263
260
|
def _to_hash(value)
|
264
261
|
if value.is_a?(Array)
|
265
|
-
value.compact.map{ |v| _to_hash(v) }
|
262
|
+
value.compact.map { |v| _to_hash(v) }
|
266
263
|
elsif value.is_a?(Hash)
|
267
264
|
{}.tap do |hash|
|
268
265
|
value.each { |k, v| hash[k] = _to_hash(v) }
|
@@ -273,7 +270,5 @@ module YnabApi
|
|
273
270
|
value
|
274
271
|
end
|
275
272
|
end
|
276
|
-
|
277
273
|
end
|
278
|
-
|
279
274
|
end
|
@@ -6,14 +6,13 @@
|
|
6
6
|
OpenAPI spec version: 1.0.0
|
7
7
|
|
8
8
|
Generated by: https://github.com/swagger-api/swagger-codegen.git
|
9
|
-
Swagger Codegen version: 2.
|
9
|
+
Swagger Codegen version: 2.4.0-SNAPSHOT
|
10
10
|
|
11
11
|
=end
|
12
12
|
|
13
13
|
require 'date'
|
14
14
|
|
15
15
|
module YnabApi
|
16
|
-
|
17
16
|
class ScheduledTransactionDetail
|
18
17
|
attr_accessor :id
|
19
18
|
|
@@ -121,7 +120,7 @@ module YnabApi
|
|
121
120
|
return unless attributes.is_a?(Hash)
|
122
121
|
|
123
122
|
# convert string to symbol for hash key
|
124
|
-
attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
|
123
|
+
attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
|
125
124
|
|
126
125
|
if attributes.has_key?(:'id')
|
127
126
|
self.id = attributes[:'id']
|
@@ -184,7 +183,6 @@ module YnabApi
|
|
184
183
|
self.subtransactions = value
|
185
184
|
end
|
186
185
|
end
|
187
|
-
|
188
186
|
end
|
189
187
|
|
190
188
|
# Show invalid properties with the reasons. Usually used together with valid?
|
@@ -192,66 +190,66 @@ module YnabApi
|
|
192
190
|
def list_invalid_properties
|
193
191
|
invalid_properties = Array.new
|
194
192
|
if @id.nil?
|
195
|
-
invalid_properties.push(
|
193
|
+
invalid_properties.push('invalid value for "id", id cannot be nil.')
|
196
194
|
end
|
197
195
|
|
198
196
|
if @date_first.nil?
|
199
|
-
invalid_properties.push(
|
197
|
+
invalid_properties.push('invalid value for "date_first", date_first cannot be nil.')
|
200
198
|
end
|
201
199
|
|
202
200
|
if @date_next.nil?
|
203
|
-
invalid_properties.push(
|
201
|
+
invalid_properties.push('invalid value for "date_next", date_next cannot be nil.')
|
204
202
|
end
|
205
203
|
|
206
204
|
if @frequency.nil?
|
207
|
-
invalid_properties.push(
|
205
|
+
invalid_properties.push('invalid value for "frequency", frequency cannot be nil.')
|
208
206
|
end
|
209
207
|
|
210
208
|
if @amount.nil?
|
211
|
-
invalid_properties.push(
|
209
|
+
invalid_properties.push('invalid value for "amount", amount cannot be nil.')
|
212
210
|
end
|
213
211
|
|
214
212
|
if @memo.nil?
|
215
|
-
invalid_properties.push(
|
213
|
+
invalid_properties.push('invalid value for "memo", memo cannot be nil.')
|
216
214
|
end
|
217
215
|
|
218
216
|
if @flag_color.nil?
|
219
|
-
invalid_properties.push(
|
217
|
+
invalid_properties.push('invalid value for "flag_color", flag_color cannot be nil.')
|
220
218
|
end
|
221
219
|
|
222
220
|
if @account_id.nil?
|
223
|
-
invalid_properties.push(
|
221
|
+
invalid_properties.push('invalid value for "account_id", account_id cannot be nil.')
|
224
222
|
end
|
225
223
|
|
226
224
|
if @payee_id.nil?
|
227
|
-
invalid_properties.push(
|
225
|
+
invalid_properties.push('invalid value for "payee_id", payee_id cannot be nil.')
|
228
226
|
end
|
229
227
|
|
230
228
|
if @category_id.nil?
|
231
|
-
invalid_properties.push(
|
229
|
+
invalid_properties.push('invalid value for "category_id", category_id cannot be nil.')
|
232
230
|
end
|
233
231
|
|
234
232
|
if @transfer_account_id.nil?
|
235
|
-
invalid_properties.push(
|
233
|
+
invalid_properties.push('invalid value for "transfer_account_id", transfer_account_id cannot be nil.')
|
236
234
|
end
|
237
235
|
|
238
236
|
if @account_name.nil?
|
239
|
-
invalid_properties.push(
|
237
|
+
invalid_properties.push('invalid value for "account_name", account_name cannot be nil.')
|
240
238
|
end
|
241
239
|
|
242
240
|
if @payee_name.nil?
|
243
|
-
invalid_properties.push(
|
241
|
+
invalid_properties.push('invalid value for "payee_name", payee_name cannot be nil.')
|
244
242
|
end
|
245
243
|
|
246
244
|
if @category_name.nil?
|
247
|
-
invalid_properties.push(
|
245
|
+
invalid_properties.push('invalid value for "category_name", category_name cannot be nil.')
|
248
246
|
end
|
249
247
|
|
250
248
|
if @subtransactions.nil?
|
251
|
-
invalid_properties.push(
|
249
|
+
invalid_properties.push('invalid value for "subtransactions", subtransactions cannot be nil.')
|
252
250
|
end
|
253
251
|
|
254
|
-
|
252
|
+
invalid_properties
|
255
253
|
end
|
256
254
|
|
257
255
|
# Check to see if the all the properties in the model are valid
|
@@ -261,12 +259,12 @@ module YnabApi
|
|
261
259
|
return false if @date_first.nil?
|
262
260
|
return false if @date_next.nil?
|
263
261
|
return false if @frequency.nil?
|
264
|
-
frequency_validator = EnumAttributeValidator.new('String', [
|
262
|
+
frequency_validator = EnumAttributeValidator.new('String', ['never', 'daily', 'weekly', 'everyOtherWeek', 'twiceAMonth', 'every4Weeks', 'monthly', 'everyOtherMonth', 'every3Months', 'every4Months', 'twiceAYear', 'yearly', 'everyOtherYear'])
|
265
263
|
return false unless frequency_validator.valid?(@frequency)
|
266
264
|
return false if @amount.nil?
|
267
265
|
return false if @memo.nil?
|
268
266
|
return false if @flag_color.nil?
|
269
|
-
flag_color_validator = EnumAttributeValidator.new('String', [
|
267
|
+
flag_color_validator = EnumAttributeValidator.new('String', ['red', 'orange', 'yellow', 'green', 'blue', 'purple'])
|
270
268
|
return false unless flag_color_validator.valid?(@flag_color)
|
271
269
|
return false if @account_id.nil?
|
272
270
|
return false if @payee_id.nil?
|
@@ -276,15 +274,15 @@ module YnabApi
|
|
276
274
|
return false if @payee_name.nil?
|
277
275
|
return false if @category_name.nil?
|
278
276
|
return false if @subtransactions.nil?
|
279
|
-
|
277
|
+
true
|
280
278
|
end
|
281
279
|
|
282
280
|
# Custom attribute writer method checking allowed values (enum).
|
283
281
|
# @param [Object] frequency Object to be assigned
|
284
282
|
def frequency=(frequency)
|
285
|
-
validator = EnumAttributeValidator.new('String', [
|
283
|
+
validator = EnumAttributeValidator.new('String', ['never', 'daily', 'weekly', 'everyOtherWeek', 'twiceAMonth', 'every4Weeks', 'monthly', 'everyOtherMonth', 'every3Months', 'every4Months', 'twiceAYear', 'yearly', 'everyOtherYear'])
|
286
284
|
unless validator.valid?(frequency)
|
287
|
-
fail ArgumentError,
|
285
|
+
fail ArgumentError, 'invalid value for "frequency", must be one of #{validator.allowable_values}.'
|
288
286
|
end
|
289
287
|
@frequency = frequency
|
290
288
|
end
|
@@ -292,9 +290,9 @@ module YnabApi
|
|
292
290
|
# Custom attribute writer method checking allowed values (enum).
|
293
291
|
# @param [Object] flag_color Object to be assigned
|
294
292
|
def flag_color=(flag_color)
|
295
|
-
validator = EnumAttributeValidator.new('String', [
|
293
|
+
validator = EnumAttributeValidator.new('String', ['red', 'orange', 'yellow', 'green', 'blue', 'purple'])
|
296
294
|
unless validator.valid?(flag_color)
|
297
|
-
fail ArgumentError,
|
295
|
+
fail ArgumentError, 'invalid value for "flag_color", must be one of #{validator.allowable_values}.'
|
298
296
|
end
|
299
297
|
@flag_color = flag_color
|
300
298
|
end
|
@@ -343,7 +341,7 @@ module YnabApi
|
|
343
341
|
# check to ensure the input is an array given that the the attribute
|
344
342
|
# is documented as an array but the input is not
|
345
343
|
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
346
|
-
self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) }
|
344
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
347
345
|
end
|
348
346
|
elsif !attributes[self.class.attribute_map[key]].nil?
|
349
347
|
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
@@ -425,7 +423,7 @@ module YnabApi
|
|
425
423
|
# @return [Hash] Returns the value in the form of hash
|
426
424
|
def _to_hash(value)
|
427
425
|
if value.is_a?(Array)
|
428
|
-
value.compact.map{ |v| _to_hash(v) }
|
426
|
+
value.compact.map { |v| _to_hash(v) }
|
429
427
|
elsif value.is_a?(Hash)
|
430
428
|
{}.tap do |hash|
|
431
429
|
value.each { |k, v| hash[k] = _to_hash(v) }
|
@@ -436,7 +434,5 @@ module YnabApi
|
|
436
434
|
value
|
437
435
|
end
|
438
436
|
end
|
439
|
-
|
440
437
|
end
|
441
|
-
|
442
438
|
end
|