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
|
@@ -38,6 +38,12 @@ module YNAB
|
|
|
38
38
|
# Whether or not the subtransaction has been deleted. Deleted subtransactions will only be included in delta requests.
|
|
39
39
|
attr_accessor :deleted
|
|
40
40
|
|
|
41
|
+
# The subtransaction amount formatted in the plan's currency format
|
|
42
|
+
attr_accessor :amount_formatted
|
|
43
|
+
|
|
44
|
+
# The subtransaction amount as a decimal currency amount
|
|
45
|
+
attr_accessor :amount_currency
|
|
46
|
+
|
|
41
47
|
# Attribute mapping from ruby-style variable name to JSON key.
|
|
42
48
|
def self.attribute_map
|
|
43
49
|
{
|
|
@@ -51,7 +57,9 @@ module YNAB
|
|
|
51
57
|
:'category_name' => :'category_name',
|
|
52
58
|
:'transfer_account_id' => :'transfer_account_id',
|
|
53
59
|
:'transfer_transaction_id' => :'transfer_transaction_id',
|
|
54
|
-
:'deleted' => :'deleted'
|
|
60
|
+
:'deleted' => :'deleted',
|
|
61
|
+
:'amount_formatted' => :'amount_formatted',
|
|
62
|
+
:'amount_currency' => :'amount_currency'
|
|
55
63
|
}
|
|
56
64
|
end
|
|
57
65
|
|
|
@@ -73,23 +81,25 @@ module YNAB
|
|
|
73
81
|
:'category_name' => :'String',
|
|
74
82
|
:'transfer_account_id' => :'String',
|
|
75
83
|
:'transfer_transaction_id' => :'String',
|
|
76
|
-
:'deleted' => :'Boolean'
|
|
84
|
+
:'deleted' => :'Boolean',
|
|
85
|
+
:'amount_formatted' => :'String',
|
|
86
|
+
:'amount_currency' => :'Float'
|
|
77
87
|
}
|
|
78
88
|
end
|
|
79
89
|
|
|
80
90
|
# List of attributes with nullable: true
|
|
81
91
|
def self.openapi_nullable
|
|
82
92
|
Set.new([
|
|
83
|
-
:'memo',
|
|
84
|
-
:'payee_id',
|
|
85
|
-
:'payee_name',
|
|
86
|
-
:'category_id',
|
|
87
|
-
:'category_name',
|
|
88
|
-
:'transfer_account_id',
|
|
89
|
-
:'transfer_transaction_id',
|
|
90
93
|
])
|
|
91
94
|
end
|
|
92
95
|
|
|
96
|
+
# List of class defined in allOf (OpenAPI v3)
|
|
97
|
+
def self.openapi_all_of
|
|
98
|
+
[
|
|
99
|
+
:'SubTransactionBase'
|
|
100
|
+
]
|
|
101
|
+
end
|
|
102
|
+
|
|
93
103
|
# Initializes the object
|
|
94
104
|
# @param [Hash] attributes Model attributes in the form of hash
|
|
95
105
|
def initialize(attributes = {})
|
|
@@ -148,6 +158,14 @@ module YNAB
|
|
|
148
158
|
if attributes.key?(:'deleted')
|
|
149
159
|
self.deleted = attributes[:'deleted']
|
|
150
160
|
end
|
|
161
|
+
|
|
162
|
+
if attributes.key?(:'amount_formatted')
|
|
163
|
+
self.amount_formatted = attributes[:'amount_formatted']
|
|
164
|
+
end
|
|
165
|
+
|
|
166
|
+
if attributes.key?(:'amount_currency')
|
|
167
|
+
self.amount_currency = attributes[:'amount_currency']
|
|
168
|
+
end
|
|
151
169
|
end
|
|
152
170
|
|
|
153
171
|
# Show invalid properties with the reasons. Usually used together with valid?
|
|
@@ -182,7 +200,9 @@ module YNAB
|
|
|
182
200
|
category_name == o.category_name &&
|
|
183
201
|
transfer_account_id == o.transfer_account_id &&
|
|
184
202
|
transfer_transaction_id == o.transfer_transaction_id &&
|
|
185
|
-
deleted == o.deleted
|
|
203
|
+
deleted == o.deleted &&
|
|
204
|
+
amount_formatted == o.amount_formatted &&
|
|
205
|
+
amount_currency == o.amount_currency
|
|
186
206
|
end
|
|
187
207
|
|
|
188
208
|
# @see the `==` method
|
|
@@ -194,7 +214,7 @@ module YNAB
|
|
|
194
214
|
# Calculates hash code according to all attributes.
|
|
195
215
|
# @return [Integer] Hash code
|
|
196
216
|
def hash
|
|
197
|
-
[id, transaction_id, amount, memo, payee_id, payee_name, category_id, category_name, transfer_account_id, transfer_transaction_id, deleted].hash
|
|
217
|
+
[id, transaction_id, amount, memo, payee_id, payee_name, category_id, category_name, transfer_account_id, transfer_transaction_id, deleted, amount_formatted, amount_currency].hash
|
|
198
218
|
end
|
|
199
219
|
|
|
200
220
|
# Builds the object from hash
|
|
@@ -0,0 +1,240 @@
|
|
|
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 SubTransactionBase < ApiModelBase
|
|
15
|
+
attr_accessor :id
|
|
16
|
+
|
|
17
|
+
attr_accessor :transaction_id
|
|
18
|
+
|
|
19
|
+
# The subtransaction amount in milliunits format
|
|
20
|
+
attr_accessor :amount
|
|
21
|
+
|
|
22
|
+
attr_accessor :memo
|
|
23
|
+
|
|
24
|
+
attr_accessor :payee_id
|
|
25
|
+
|
|
26
|
+
attr_accessor :payee_name
|
|
27
|
+
|
|
28
|
+
attr_accessor :category_id
|
|
29
|
+
|
|
30
|
+
attr_accessor :category_name
|
|
31
|
+
|
|
32
|
+
# If a transfer, the account_id which the subtransaction transfers to
|
|
33
|
+
attr_accessor :transfer_account_id
|
|
34
|
+
|
|
35
|
+
# If a transfer, the id of transaction on the other side of the transfer
|
|
36
|
+
attr_accessor :transfer_transaction_id
|
|
37
|
+
|
|
38
|
+
# Whether or not the subtransaction has been deleted. Deleted subtransactions will only be included in delta requests.
|
|
39
|
+
attr_accessor :deleted
|
|
40
|
+
|
|
41
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
42
|
+
def self.attribute_map
|
|
43
|
+
{
|
|
44
|
+
:'id' => :'id',
|
|
45
|
+
:'transaction_id' => :'transaction_id',
|
|
46
|
+
:'amount' => :'amount',
|
|
47
|
+
:'memo' => :'memo',
|
|
48
|
+
:'payee_id' => :'payee_id',
|
|
49
|
+
:'payee_name' => :'payee_name',
|
|
50
|
+
:'category_id' => :'category_id',
|
|
51
|
+
:'category_name' => :'category_name',
|
|
52
|
+
:'transfer_account_id' => :'transfer_account_id',
|
|
53
|
+
:'transfer_transaction_id' => :'transfer_transaction_id',
|
|
54
|
+
:'deleted' => :'deleted'
|
|
55
|
+
}
|
|
56
|
+
end
|
|
57
|
+
|
|
58
|
+
# Returns all the JSON keys this model knows about
|
|
59
|
+
def self.acceptable_attributes
|
|
60
|
+
attribute_map.values
|
|
61
|
+
end
|
|
62
|
+
|
|
63
|
+
# Attribute type mapping.
|
|
64
|
+
def self.openapi_types
|
|
65
|
+
{
|
|
66
|
+
:'id' => :'String',
|
|
67
|
+
:'transaction_id' => :'String',
|
|
68
|
+
:'amount' => :'Integer',
|
|
69
|
+
:'memo' => :'String',
|
|
70
|
+
:'payee_id' => :'String',
|
|
71
|
+
:'payee_name' => :'String',
|
|
72
|
+
:'category_id' => :'String',
|
|
73
|
+
:'category_name' => :'String',
|
|
74
|
+
:'transfer_account_id' => :'String',
|
|
75
|
+
:'transfer_transaction_id' => :'String',
|
|
76
|
+
:'deleted' => :'Boolean'
|
|
77
|
+
}
|
|
78
|
+
end
|
|
79
|
+
|
|
80
|
+
# List of attributes with nullable: true
|
|
81
|
+
def self.openapi_nullable
|
|
82
|
+
Set.new([
|
|
83
|
+
:'memo',
|
|
84
|
+
:'payee_id',
|
|
85
|
+
:'payee_name',
|
|
86
|
+
:'category_id',
|
|
87
|
+
:'category_name',
|
|
88
|
+
:'transfer_account_id',
|
|
89
|
+
:'transfer_transaction_id',
|
|
90
|
+
])
|
|
91
|
+
end
|
|
92
|
+
|
|
93
|
+
# Initializes the object
|
|
94
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
95
|
+
def initialize(attributes = {})
|
|
96
|
+
if (!attributes.is_a?(Hash))
|
|
97
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `YNAB::SubTransactionBase` initialize method"
|
|
98
|
+
end
|
|
99
|
+
|
|
100
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
|
101
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
102
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
|
103
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `YNAB::SubTransactionBase`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
|
104
|
+
end
|
|
105
|
+
h[k.to_sym] = v
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
if attributes.key?(:'id')
|
|
109
|
+
self.id = attributes[:'id']
|
|
110
|
+
end
|
|
111
|
+
|
|
112
|
+
if attributes.key?(:'transaction_id')
|
|
113
|
+
self.transaction_id = attributes[:'transaction_id']
|
|
114
|
+
end
|
|
115
|
+
|
|
116
|
+
if attributes.key?(:'amount')
|
|
117
|
+
self.amount = attributes[:'amount']
|
|
118
|
+
end
|
|
119
|
+
|
|
120
|
+
if attributes.key?(:'memo')
|
|
121
|
+
self.memo = attributes[:'memo']
|
|
122
|
+
end
|
|
123
|
+
|
|
124
|
+
if attributes.key?(:'payee_id')
|
|
125
|
+
self.payee_id = attributes[:'payee_id']
|
|
126
|
+
end
|
|
127
|
+
|
|
128
|
+
if attributes.key?(:'payee_name')
|
|
129
|
+
self.payee_name = attributes[:'payee_name']
|
|
130
|
+
end
|
|
131
|
+
|
|
132
|
+
if attributes.key?(:'category_id')
|
|
133
|
+
self.category_id = attributes[:'category_id']
|
|
134
|
+
end
|
|
135
|
+
|
|
136
|
+
if attributes.key?(:'category_name')
|
|
137
|
+
self.category_name = attributes[:'category_name']
|
|
138
|
+
end
|
|
139
|
+
|
|
140
|
+
if attributes.key?(:'transfer_account_id')
|
|
141
|
+
self.transfer_account_id = attributes[:'transfer_account_id']
|
|
142
|
+
end
|
|
143
|
+
|
|
144
|
+
if attributes.key?(:'transfer_transaction_id')
|
|
145
|
+
self.transfer_transaction_id = attributes[:'transfer_transaction_id']
|
|
146
|
+
end
|
|
147
|
+
|
|
148
|
+
if attributes.key?(:'deleted')
|
|
149
|
+
self.deleted = attributes[:'deleted']
|
|
150
|
+
end
|
|
151
|
+
end
|
|
152
|
+
|
|
153
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
154
|
+
# @return Array for valid properties with the reasons
|
|
155
|
+
def list_invalid_properties
|
|
156
|
+
invalid_properties = Array.new
|
|
157
|
+
invalid_properties
|
|
158
|
+
end
|
|
159
|
+
|
|
160
|
+
# Check to see if the all the properties in the model are valid
|
|
161
|
+
# @return true if the model is valid
|
|
162
|
+
def valid?
|
|
163
|
+
return false if @id.nil?
|
|
164
|
+
return false if @transaction_id.nil?
|
|
165
|
+
return false if @amount.nil?
|
|
166
|
+
return false if @deleted.nil?
|
|
167
|
+
true
|
|
168
|
+
end
|
|
169
|
+
|
|
170
|
+
# Checks equality by comparing each attribute.
|
|
171
|
+
# @param [Object] Object to be compared
|
|
172
|
+
def ==(o)
|
|
173
|
+
return true if self.equal?(o)
|
|
174
|
+
self.class == o.class &&
|
|
175
|
+
id == o.id &&
|
|
176
|
+
transaction_id == o.transaction_id &&
|
|
177
|
+
amount == o.amount &&
|
|
178
|
+
memo == o.memo &&
|
|
179
|
+
payee_id == o.payee_id &&
|
|
180
|
+
payee_name == o.payee_name &&
|
|
181
|
+
category_id == o.category_id &&
|
|
182
|
+
category_name == o.category_name &&
|
|
183
|
+
transfer_account_id == o.transfer_account_id &&
|
|
184
|
+
transfer_transaction_id == o.transfer_transaction_id &&
|
|
185
|
+
deleted == o.deleted
|
|
186
|
+
end
|
|
187
|
+
|
|
188
|
+
# @see the `==` method
|
|
189
|
+
# @param [Object] Object to be compared
|
|
190
|
+
def eql?(o)
|
|
191
|
+
self == o
|
|
192
|
+
end
|
|
193
|
+
|
|
194
|
+
# Calculates hash code according to all attributes.
|
|
195
|
+
# @return [Integer] Hash code
|
|
196
|
+
def hash
|
|
197
|
+
[id, transaction_id, amount, memo, payee_id, payee_name, category_id, category_name, transfer_account_id, transfer_transaction_id, deleted].hash
|
|
198
|
+
end
|
|
199
|
+
|
|
200
|
+
# Builds the object from hash
|
|
201
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
202
|
+
# @return [Object] Returns the model itself
|
|
203
|
+
def self.build_from_hash(attributes)
|
|
204
|
+
return nil unless attributes.is_a?(Hash)
|
|
205
|
+
attributes = attributes.transform_keys(&:to_sym)
|
|
206
|
+
transformed_hash = {}
|
|
207
|
+
openapi_types.each_pair do |key, type|
|
|
208
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
|
209
|
+
transformed_hash["#{key}"] = nil
|
|
210
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
211
|
+
# check to ensure the input is an array given that the attribute
|
|
212
|
+
# is documented as an array but the input is not
|
|
213
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
|
214
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
|
215
|
+
end
|
|
216
|
+
elsif !attributes[attribute_map[key]].nil?
|
|
217
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
|
218
|
+
end
|
|
219
|
+
end
|
|
220
|
+
new(transformed_hash)
|
|
221
|
+
end
|
|
222
|
+
|
|
223
|
+
# Returns the object in the form of hash
|
|
224
|
+
# @return [Hash] Returns the object in the form of hash
|
|
225
|
+
def to_hash
|
|
226
|
+
hash = {}
|
|
227
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
228
|
+
value = self.send(attr)
|
|
229
|
+
if value.nil?
|
|
230
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
|
231
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
232
|
+
end
|
|
233
|
+
|
|
234
|
+
hash[param] = _to_hash(value)
|
|
235
|
+
end
|
|
236
|
+
hash
|
|
237
|
+
end
|
|
238
|
+
end
|
|
239
|
+
|
|
240
|
+
end
|
|
@@ -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
|
attr_accessor :account_name
|
|
66
72
|
|
|
67
73
|
attr_accessor :payee_name
|
|
@@ -116,6 +122,8 @@ module YNAB
|
|
|
116
122
|
:'import_payee_name_original' => :'import_payee_name_original',
|
|
117
123
|
:'debt_transaction_type' => :'debt_transaction_type',
|
|
118
124
|
:'deleted' => :'deleted',
|
|
125
|
+
:'amount_formatted' => :'amount_formatted',
|
|
126
|
+
:'amount_currency' => :'amount_currency',
|
|
119
127
|
:'account_name' => :'account_name',
|
|
120
128
|
:'payee_name' => :'payee_name',
|
|
121
129
|
:'category_name' => :'category_name',
|
|
@@ -150,6 +158,8 @@ module YNAB
|
|
|
150
158
|
:'import_payee_name_original' => :'String',
|
|
151
159
|
:'debt_transaction_type' => :'String',
|
|
152
160
|
:'deleted' => :'Boolean',
|
|
161
|
+
:'amount_formatted' => :'String',
|
|
162
|
+
:'amount_currency' => :'Float',
|
|
153
163
|
:'account_name' => :'String',
|
|
154
164
|
:'payee_name' => :'String',
|
|
155
165
|
:'category_name' => :'String',
|
|
@@ -265,6 +275,14 @@ module YNAB
|
|
|
265
275
|
self.deleted = attributes[:'deleted']
|
|
266
276
|
end
|
|
267
277
|
|
|
278
|
+
if attributes.key?(:'amount_formatted')
|
|
279
|
+
self.amount_formatted = attributes[:'amount_formatted']
|
|
280
|
+
end
|
|
281
|
+
|
|
282
|
+
if attributes.key?(:'amount_currency')
|
|
283
|
+
self.amount_currency = attributes[:'amount_currency']
|
|
284
|
+
end
|
|
285
|
+
|
|
268
286
|
if attributes.key?(:'account_name')
|
|
269
287
|
self.account_name = attributes[:'account_name']
|
|
270
288
|
end
|
|
@@ -338,6 +356,8 @@ module YNAB
|
|
|
338
356
|
import_payee_name_original == o.import_payee_name_original &&
|
|
339
357
|
debt_transaction_type == o.debt_transaction_type &&
|
|
340
358
|
deleted == o.deleted &&
|
|
359
|
+
amount_formatted == o.amount_formatted &&
|
|
360
|
+
amount_currency == o.amount_currency &&
|
|
341
361
|
account_name == o.account_name &&
|
|
342
362
|
payee_name == o.payee_name &&
|
|
343
363
|
category_name == o.category_name &&
|
|
@@ -353,7 +373,7 @@ module YNAB
|
|
|
353
373
|
# Calculates hash code according to all attributes.
|
|
354
374
|
# @return [Integer] Hash code
|
|
355
375
|
def hash
|
|
356
|
-
[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, account_name, payee_name, category_name, subtransactions].hash
|
|
376
|
+
[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, account_name, payee_name, category_name, subtransactions].hash
|
|
357
377
|
end
|
|
358
378
|
|
|
359
379
|
# 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
|
class EnumAttributeValidator
|
|
66
72
|
attr_reader :datatype
|
|
67
73
|
attr_reader :allowable_values
|
|
@@ -105,7 +111,9 @@ module YNAB
|
|
|
105
111
|
:'import_payee_name' => :'import_payee_name',
|
|
106
112
|
:'import_payee_name_original' => :'import_payee_name_original',
|
|
107
113
|
:'debt_transaction_type' => :'debt_transaction_type',
|
|
108
|
-
:'deleted' => :'deleted'
|
|
114
|
+
:'deleted' => :'deleted',
|
|
115
|
+
:'amount_formatted' => :'amount_formatted',
|
|
116
|
+
:'amount_currency' => :'amount_currency'
|
|
109
117
|
}
|
|
110
118
|
end
|
|
111
119
|
|
|
@@ -135,28 +143,27 @@ module YNAB
|
|
|
135
143
|
:'import_payee_name' => :'String',
|
|
136
144
|
:'import_payee_name_original' => :'String',
|
|
137
145
|
:'debt_transaction_type' => :'String',
|
|
138
|
-
:'deleted' => :'Boolean'
|
|
146
|
+
:'deleted' => :'Boolean',
|
|
147
|
+
:'amount_formatted' => :'String',
|
|
148
|
+
:'amount_currency' => :'Float'
|
|
139
149
|
}
|
|
140
150
|
end
|
|
141
151
|
|
|
142
152
|
# List of attributes with nullable: true
|
|
143
153
|
def self.openapi_nullable
|
|
144
154
|
Set.new([
|
|
145
|
-
:'memo',
|
|
146
155
|
:'flag_color',
|
|
147
|
-
:'flag_name',
|
|
148
|
-
:'payee_id',
|
|
149
|
-
:'category_id',
|
|
150
|
-
:'transfer_account_id',
|
|
151
|
-
:'transfer_transaction_id',
|
|
152
|
-
:'matched_transaction_id',
|
|
153
|
-
:'import_id',
|
|
154
|
-
:'import_payee_name',
|
|
155
|
-
:'import_payee_name_original',
|
|
156
156
|
:'debt_transaction_type',
|
|
157
157
|
])
|
|
158
158
|
end
|
|
159
159
|
|
|
160
|
+
# List of class defined in allOf (OpenAPI v3)
|
|
161
|
+
def self.openapi_all_of
|
|
162
|
+
[
|
|
163
|
+
:'TransactionSummaryBase'
|
|
164
|
+
]
|
|
165
|
+
end
|
|
166
|
+
|
|
160
167
|
# Initializes the object
|
|
161
168
|
# @param [Hash] attributes Model attributes in the form of hash
|
|
162
169
|
def initialize(attributes = {})
|
|
@@ -247,6 +254,14 @@ module YNAB
|
|
|
247
254
|
if attributes.key?(:'deleted')
|
|
248
255
|
self.deleted = attributes[:'deleted']
|
|
249
256
|
end
|
|
257
|
+
|
|
258
|
+
if attributes.key?(:'amount_formatted')
|
|
259
|
+
self.amount_formatted = attributes[:'amount_formatted']
|
|
260
|
+
end
|
|
261
|
+
|
|
262
|
+
if attributes.key?(:'amount_currency')
|
|
263
|
+
self.amount_currency = attributes[:'amount_currency']
|
|
264
|
+
end
|
|
250
265
|
end
|
|
251
266
|
|
|
252
267
|
# Show invalid properties with the reasons. Usually used together with valid?
|
|
@@ -300,7 +315,9 @@ module YNAB
|
|
|
300
315
|
import_payee_name == o.import_payee_name &&
|
|
301
316
|
import_payee_name_original == o.import_payee_name_original &&
|
|
302
317
|
debt_transaction_type == o.debt_transaction_type &&
|
|
303
|
-
deleted == o.deleted
|
|
318
|
+
deleted == o.deleted &&
|
|
319
|
+
amount_formatted == o.amount_formatted &&
|
|
320
|
+
amount_currency == o.amount_currency
|
|
304
321
|
end
|
|
305
322
|
|
|
306
323
|
# @see the `==` method
|
|
@@ -312,7 +329,7 @@ module YNAB
|
|
|
312
329
|
# Calculates hash code according to all attributes.
|
|
313
330
|
# @return [Integer] Hash code
|
|
314
331
|
def hash
|
|
315
|
-
[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].hash
|
|
332
|
+
[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].hash
|
|
316
333
|
end
|
|
317
334
|
|
|
318
335
|
# Builds the object from hash
|