ynab 1.29.0 → 2.0.0.rc1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/DEVELOPMENT.md +11 -0
- data/Gemfile +8 -0
- data/Gemfile.lock +42 -0
- data/README.md +6 -6
- data/Rakefile +58 -0
- data/config.json +9 -0
- data/docs/Account.md +25 -0
- data/docs/AccountResponse.md +8 -0
- data/docs/AccountResponseData.md +8 -0
- data/docs/AccountType.md +7 -0
- data/docs/AccountWrapper.md +8 -0
- data/docs/AccountsApi.md +70 -0
- data/docs/AccountsResponse.md +8 -0
- data/docs/AccountsResponseData.md +9 -0
- data/docs/AccountsWrapper.md +9 -0
- data/docs/BudgetDetail.md +24 -0
- data/docs/BudgetDetailAllOf.md +17 -0
- data/docs/BudgetDetailResponse.md +8 -0
- data/docs/BudgetDetailResponseData.md +9 -0
- data/docs/BudgetDetailWrapper.md +9 -0
- data/docs/BudgetSettings.md +9 -0
- data/docs/BudgetSettingsResponse.md +8 -0
- data/docs/BudgetSettingsResponseData.md +8 -0
- data/docs/BudgetSettingsWrapper.md +8 -0
- data/docs/BudgetSummary.md +15 -0
- data/docs/BudgetSummaryResponse.md +8 -0
- data/docs/BudgetSummaryResponseData.md +9 -0
- data/docs/BudgetSummaryWrapper.md +9 -0
- data/docs/BudgetsApi.md +68 -0
- data/docs/BulkIdWrapper.md +8 -0
- data/docs/BulkIds.md +9 -0
- data/docs/BulkResponse.md +8 -0
- data/docs/BulkResponseData.md +8 -0
- data/docs/BulkResponseDataBulk.md +9 -0
- data/docs/BulkTransactionCreateResponse.md +8 -0
- data/docs/BulkTransactionIds.md +8 -0
- data/docs/BulkTransactions.md +8 -0
- data/docs/CategoriesApi.md +94 -0
- data/docs/CategoriesResponse.md +8 -0
- data/docs/CategoriesResponseData.md +9 -0
- data/docs/Category.md +30 -0
- data/docs/CategoryGroup.md +11 -0
- data/docs/CategoryGroupWithCategories.md +12 -0
- data/docs/CategoryGroupWithCategoriesAllOf.md +8 -0
- data/docs/CategoryGroupsWrapper.md +9 -0
- data/docs/CategoryResponse.md +8 -0
- data/docs/CategoryResponseData.md +8 -0
- data/docs/CategoryWrapper.md +9 -0
- data/docs/CurrencyFormat.md +15 -0
- data/docs/DateFormat.md +8 -0
- data/docs/DeprecatedApi.md +28 -0
- data/docs/ErrorDetail.md +10 -0
- data/docs/ErrorResponse.md +8 -0
- data/docs/HybridTransaction.md +30 -0
- data/docs/HybridTransactionAllOf.md +12 -0
- data/docs/HybridTransactionsResponse.md +8 -0
- data/docs/HybridTransactionsResponseData.md +9 -0
- data/docs/HybridTransactionsWrapper.md +8 -0
- data/docs/LoanAccountPeriodicValue.md +7 -0
- data/docs/MonthDetail.md +16 -0
- data/docs/MonthDetailAllOf.md +8 -0
- data/docs/MonthDetailResponse.md +8 -0
- data/docs/MonthDetailResponseData.md +8 -0
- data/docs/MonthDetailWrapper.md +8 -0
- data/docs/MonthSummariesResponse.md +8 -0
- data/docs/MonthSummariesResponseData.md +9 -0
- data/docs/MonthSummariesWrapper.md +9 -0
- data/docs/MonthSummary.md +15 -0
- data/docs/MonthsApi.md +49 -0
- data/docs/PatchMonthCategoryWrapper.md +8 -0
- data/docs/PatchTransactionsWrapper.md +8 -0
- data/docs/Payee.md +11 -0
- data/docs/PayeeLocation.md +12 -0
- data/docs/PayeeLocationResponse.md +8 -0
- data/docs/PayeeLocationResponseData.md +8 -0
- data/docs/PayeeLocationWrapper.md +8 -0
- data/docs/PayeeLocationsApi.md +69 -0
- data/docs/PayeeLocationsResponse.md +8 -0
- data/docs/PayeeLocationsResponseData.md +8 -0
- data/docs/PayeeLocationsWrapper.md +8 -0
- data/docs/PayeeResponse.md +8 -0
- data/docs/PayeeResponseData.md +8 -0
- data/docs/PayeeWrapper.md +8 -0
- data/docs/PayeesApi.md +49 -0
- data/docs/PayeesResponse.md +8 -0
- data/docs/PayeesResponseData.md +9 -0
- data/docs/PayeesWrapper.md +9 -0
- data/docs/PostAccountWrapper.md +8 -0
- data/docs/PostTransactionsWrapper.md +9 -0
- data/docs/PutTransactionWrapper.md +8 -0
- data/docs/SaveAccount.md +10 -0
- data/docs/SaveAccountWrapper.md +8 -0
- data/docs/SaveCategoryResponse.md +8 -0
- data/docs/SaveCategoryResponseData.md +9 -0
- data/docs/SaveMonthCategory.md +8 -0
- data/docs/SaveMonthCategoryWrapper.md +8 -0
- data/docs/SaveSubTransaction.md +12 -0
- data/docs/SaveTransaction.md +19 -0
- data/docs/SaveTransactionWithId.md +20 -0
- data/docs/SaveTransactionWithIdAllOf.md +8 -0
- data/docs/SaveTransactionWithOptionalFields.md +19 -0
- data/docs/SaveTransactionWrapper.md +8 -0
- data/docs/SaveTransactionsResponse.md +8 -0
- data/docs/SaveTransactionsResponseData.md +12 -0
- data/docs/SaveTransactionsWrapper.md +9 -0
- data/docs/ScheduledSubTransaction.md +15 -0
- data/docs/ScheduledTransactionDetail.md +23 -0
- data/docs/ScheduledTransactionDetailAllOf.md +11 -0
- data/docs/ScheduledTransactionResponse.md +8 -0
- data/docs/ScheduledTransactionResponseData.md +8 -0
- data/docs/ScheduledTransactionSummary.md +19 -0
- data/docs/ScheduledTransactionWrapper.md +8 -0
- data/docs/ScheduledTransactionsApi.md +49 -0
- data/docs/ScheduledTransactionsResponse.md +8 -0
- data/docs/ScheduledTransactionsResponseData.md +9 -0
- data/docs/ScheduledTransactionsWrapper.md +8 -0
- data/docs/SubTransaction.md +18 -0
- data/docs/TransactionDetail.md +29 -0
- data/docs/TransactionDetailAllOf.md +11 -0
- data/docs/TransactionResponse.md +8 -0
- data/docs/TransactionResponseData.md +8 -0
- data/docs/TransactionSummary.md +25 -0
- data/docs/TransactionWrapper.md +8 -0
- data/docs/TransactionsApi.md +228 -0
- data/docs/TransactionsImportResponse.md +8 -0
- data/docs/TransactionsImportResponseData.md +8 -0
- data/docs/TransactionsResponse.md +8 -0
- data/docs/TransactionsResponseData.md +9 -0
- data/docs/TransactionsWrapper.md +9 -0
- data/docs/UpdateTransaction.md +20 -0
- data/docs/UpdateTransactionsWrapper.md +8 -0
- data/docs/User.md +8 -0
- data/docs/UserApi.md +25 -0
- data/docs/UserResponse.md +8 -0
- data/docs/UserResponseData.md +8 -0
- data/docs/UserWrapper.md +8 -0
- data/examples/budget-list.rb +21 -0
- data/examples/budget-month.rb +33 -0
- data/examples/category-balance.rb +23 -0
- data/examples/create-multiple-transactions.rb +42 -0
- data/examples/create-transaction.rb +30 -0
- data/examples/update-category-budgeted.rb +25 -0
- data/examples/update-multiple-transactions.rb +20 -0
- data/lib/ynab/api/accounts_api.rb +79 -42
- data/lib/ynab/api/budgets_api.rb +69 -37
- data/lib/ynab/api/categories_api.rb +109 -61
- data/lib/ynab/api/deprecated_api.rb +33 -18
- data/lib/ynab/api/months_api.rb +50 -29
- data/lib/ynab/api/payee_locations_api.rb +74 -42
- data/lib/ynab/api/payees_api.rb +50 -29
- data/lib/ynab/api/scheduled_transactions_api.rb +50 -29
- data/lib/ynab/api/transactions_api.rb +269 -141
- data/lib/ynab/api/user_api.rb +23 -13
- data/lib/ynab/api_client.rb +98 -96
- data/lib/ynab/configuration.rb +103 -16
- data/lib/ynab/models/account.rb +118 -56
- data/lib/ynab/models/account_response.rb +54 -19
- data/lib/ynab/models/account_response_data.rb +54 -19
- data/lib/ynab/models/account_type.rb +31 -21
- data/lib/ynab/models/accounts_response.rb +54 -19
- data/lib/ynab/models/accounts_response_data.rb +55 -20
- data/lib/ynab/models/budget_detail.rb +81 -36
- data/lib/ynab/models/budget_detail_all_of.rb +320 -0
- data/lib/ynab/models/budget_detail_response.rb +54 -19
- data/lib/ynab/models/budget_detail_response_data.rb +55 -20
- data/lib/ynab/models/budget_settings.rb +57 -30
- data/lib/ynab/models/budget_settings_response.rb +54 -19
- data/lib/ynab/models/budget_settings_response_data.rb +54 -19
- data/lib/ynab/models/budget_summary.rb +64 -27
- data/lib/ynab/models/budget_summary_response.rb +54 -19
- data/lib/ynab/models/budget_summary_response_data.rb +55 -21
- data/lib/ynab/models/bulk_response.rb +54 -19
- data/lib/ynab/models/bulk_response_data.rb +54 -19
- data/lib/ynab/models/bulk_response_data_bulk.rb +55 -20
- data/lib/ynab/models/bulk_transactions.rb +54 -19
- data/lib/ynab/models/categories_response.rb +54 -19
- data/lib/ynab/models/categories_response_data.rb +55 -20
- data/lib/ynab/models/category.rb +111 -49
- data/lib/ynab/models/category_group.rb +59 -24
- data/lib/ynab/models/category_group_with_categories.rb +68 -25
- data/lib/ynab/models/{save_month_category_wrapper.rb → category_group_with_categories_all_of.rb} +67 -29
- data/lib/ynab/models/category_response.rb +54 -19
- data/lib/ynab/models/category_response_data.rb +54 -19
- data/lib/ynab/models/currency_format.rb +63 -28
- data/lib/ynab/models/date_format.rb +54 -19
- data/lib/ynab/models/error_detail.rb +56 -21
- data/lib/ynab/models/error_response.rb +54 -19
- data/lib/ynab/models/hybrid_transaction.rb +120 -47
- data/lib/ynab/models/hybrid_transaction_all_of.rb +304 -0
- data/lib/ynab/models/hybrid_transactions_response.rb +54 -19
- data/lib/ynab/models/hybrid_transactions_response_data.rb +55 -20
- data/lib/ynab/models/month_detail.rb +73 -28
- data/lib/ynab/models/{update_transactions_wrapper.rb → month_detail_all_of.rb} +66 -30
- data/lib/ynab/models/month_detail_response.rb +54 -19
- data/lib/ynab/models/month_detail_response_data.rb +54 -19
- data/lib/ynab/models/month_summaries_response.rb +54 -19
- data/lib/ynab/models/month_summaries_response_data.rb +55 -20
- data/lib/ynab/models/month_summary.rb +64 -27
- data/lib/ynab/models/patch_month_category_wrapper.rb +54 -19
- data/lib/ynab/models/patch_transactions_wrapper.rb +54 -19
- data/lib/ynab/models/payee.rb +59 -23
- data/lib/ynab/models/payee_location.rb +59 -24
- data/lib/ynab/models/payee_location_response.rb +54 -19
- data/lib/ynab/models/payee_location_response_data.rb +54 -19
- data/lib/ynab/models/payee_locations_response.rb +54 -19
- data/lib/ynab/models/payee_locations_response_data.rb +54 -19
- data/lib/ynab/models/payee_response.rb +54 -19
- data/lib/ynab/models/payee_response_data.rb +54 -19
- data/lib/ynab/models/payees_response.rb +54 -19
- data/lib/ynab/models/payees_response_data.rb +55 -20
- data/lib/ynab/models/post_account_wrapper.rb +54 -19
- data/lib/ynab/models/post_transactions_wrapper.rb +55 -20
- data/lib/ynab/models/put_transaction_wrapper.rb +54 -19
- data/lib/ynab/models/save_account.rb +78 -21
- data/lib/ynab/models/save_category_response.rb +54 -19
- data/lib/ynab/models/save_category_response_data.rb +55 -20
- data/lib/ynab/models/save_month_category.rb +54 -19
- data/lib/ynab/models/save_sub_transaction.rb +62 -23
- data/lib/ynab/models/save_transaction.rb +89 -34
- data/lib/ynab/models/save_transaction_with_id.rb +103 -47
- data/lib/ynab/models/{save_transactions_wrapper.rb → save_transaction_with_id_all_of.rb} +60 -36
- data/lib/ynab/models/save_transaction_with_optional_fields.rb +82 -34
- data/lib/ynab/models/save_transactions_response.rb +54 -19
- data/lib/ynab/models/save_transactions_response_data.rb +58 -24
- data/lib/ynab/models/scheduled_sub_transaction.rb +67 -28
- data/lib/ynab/models/scheduled_transaction_detail.rb +96 -37
- data/lib/ynab/models/scheduled_transaction_detail_all_of.rb +262 -0
- data/lib/ynab/models/scheduled_transaction_response.rb +54 -19
- data/lib/ynab/models/scheduled_transaction_response_data.rb +54 -19
- data/lib/ynab/models/scheduled_transaction_summary.rb +81 -33
- data/lib/ynab/models/scheduled_transactions_response.rb +54 -19
- data/lib/ynab/models/scheduled_transactions_response_data.rb +55 -20
- data/lib/ynab/models/sub_transaction.rb +72 -30
- data/lib/ynab/models/transaction_detail.rb +114 -45
- data/lib/ynab/models/{save_transaction_wrapper.rb → transaction_detail_all_of.rb} +102 -29
- data/lib/ynab/models/transaction_response.rb +54 -19
- data/lib/ynab/models/transaction_response_data.rb +54 -19
- data/lib/ynab/models/transaction_summary.rb +99 -41
- data/lib/ynab/models/transactions_import_response.rb +54 -19
- data/lib/ynab/models/transactions_import_response_data.rb +54 -19
- data/lib/ynab/models/transactions_response.rb +54 -19
- data/lib/ynab/models/transactions_response_data.rb +55 -20
- data/lib/ynab/models/user.rb +54 -19
- data/lib/ynab/models/user_response.rb +54 -19
- data/lib/ynab/models/user_response_data.rb +54 -19
- data/lib/ynab/version.rb +1 -1
- data/lib/ynab.rb +21 -16
- data/open_api_spec.yaml +3012 -0
- data/templates/api_client.mustache +274 -0
- data/templates/api_client_typhoeus_partial.mustache +156 -0
- data/templates/api_doc.mustache +44 -0
- data/templates/gem.mustache +84 -0
- data/templates/partial_model_generic_doc.mustache +9 -0
- data/ynab.gemspec +38 -0
- metadata +197 -90
- data/lib/ynab/models/loan_account_periodic_value.rb +0 -175
- data/lib/ynab/models/save_account_wrapper.rb +0 -189
- data/lib/ynab/models/update_transaction.rb +0 -407
- data/spec/models/transaction_detail_spec.rb +0 -11
data/lib/ynab/models/payee.rb
CHANGED
@@ -1,16 +1,17 @@
|
|
1
1
|
=begin
|
2
2
|
#YNAB API Endpoints
|
3
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.
|
4
|
+
#Our API uses a REST based design, leverages the JSON data format, and relies upon HTTPS for transport. We respond with meaningful HTTP response codes and if an error occurs, we include error details in the response body. API Documentation is at https://api.ynab.com
|
5
5
|
|
6
|
-
OpenAPI
|
6
|
+
The version of the OpenAPI document: 1.0.0
|
7
7
|
|
8
|
-
Generated by: https://
|
9
|
-
|
8
|
+
Generated by: https://openapi-generator.tech
|
9
|
+
OpenAPI Generator version: 6.6.0
|
10
10
|
|
11
11
|
=end
|
12
12
|
|
13
13
|
require 'date'
|
14
|
+
require 'time'
|
14
15
|
|
15
16
|
module YNAB
|
16
17
|
class Payee
|
@@ -34,37 +35,56 @@ module YNAB
|
|
34
35
|
}
|
35
36
|
end
|
36
37
|
|
38
|
+
# Returns all the JSON keys this model knows about
|
39
|
+
def self.acceptable_attributes
|
40
|
+
attribute_map.values
|
41
|
+
end
|
42
|
+
|
37
43
|
# Attribute type mapping.
|
38
|
-
def self.
|
44
|
+
def self.openapi_types
|
39
45
|
{
|
40
46
|
:'id' => :'String',
|
41
47
|
:'name' => :'String',
|
42
48
|
:'transfer_account_id' => :'String',
|
43
|
-
:'deleted' => :'
|
49
|
+
:'deleted' => :'Boolean'
|
44
50
|
}
|
45
51
|
end
|
46
52
|
|
53
|
+
# List of attributes with nullable: true
|
54
|
+
def self.openapi_nullable
|
55
|
+
Set.new([
|
56
|
+
:'transfer_account_id',
|
57
|
+
])
|
58
|
+
end
|
59
|
+
|
47
60
|
# Initializes the object
|
48
61
|
# @param [Hash] attributes Model attributes in the form of hash
|
49
62
|
def initialize(attributes = {})
|
50
|
-
|
63
|
+
if (!attributes.is_a?(Hash))
|
64
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `YNAB::Payee` initialize method"
|
65
|
+
end
|
51
66
|
|
52
|
-
# convert string to symbol for hash key
|
53
|
-
attributes = attributes.each_with_object({}) { |(k, v), h|
|
67
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
68
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
69
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
70
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `YNAB::Payee`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
71
|
+
end
|
72
|
+
h[k.to_sym] = v
|
73
|
+
}
|
54
74
|
|
55
|
-
if attributes.
|
75
|
+
if attributes.key?(:'id')
|
56
76
|
self.id = attributes[:'id']
|
57
77
|
end
|
58
78
|
|
59
|
-
if attributes.
|
79
|
+
if attributes.key?(:'name')
|
60
80
|
self.name = attributes[:'name']
|
61
81
|
end
|
62
82
|
|
63
|
-
if attributes.
|
83
|
+
if attributes.key?(:'transfer_account_id')
|
64
84
|
self.transfer_account_id = attributes[:'transfer_account_id']
|
65
85
|
end
|
66
86
|
|
67
|
-
if attributes.
|
87
|
+
if attributes.key?(:'deleted')
|
68
88
|
self.deleted = attributes[:'deleted']
|
69
89
|
end
|
70
90
|
end
|
@@ -115,17 +135,28 @@ module YNAB
|
|
115
135
|
end
|
116
136
|
|
117
137
|
# Calculates hash code according to all attributes.
|
118
|
-
# @return [
|
138
|
+
# @return [Integer] Hash code
|
119
139
|
def hash
|
120
140
|
[id, name, transfer_account_id, deleted].hash
|
121
141
|
end
|
142
|
+
|
143
|
+
# Builds the object from hash
|
144
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
145
|
+
# @return [Object] Returns the model itself
|
146
|
+
def self.build_from_hash(attributes)
|
147
|
+
new.build_from_hash(attributes)
|
148
|
+
end
|
149
|
+
|
122
150
|
# Builds the object from hash
|
123
151
|
# @param [Hash] attributes Model attributes in the form of hash
|
124
152
|
# @return [Object] Returns the model itself
|
125
153
|
def build_from_hash(attributes)
|
126
154
|
return nil unless attributes.is_a?(Hash)
|
127
|
-
|
128
|
-
|
155
|
+
attributes = attributes.transform_keys(&:to_sym)
|
156
|
+
self.class.openapi_types.each_pair do |key, type|
|
157
|
+
if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
|
158
|
+
self.send("#{key}=", nil)
|
159
|
+
elsif type =~ /\AArray<(.*)>/i
|
129
160
|
# check to ensure the input is an array given that the attribute
|
130
161
|
# is documented as an array but the input is not
|
131
162
|
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
@@ -133,7 +164,7 @@ module YNAB
|
|
133
164
|
end
|
134
165
|
elsif !attributes[self.class.attribute_map[key]].nil?
|
135
166
|
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
136
|
-
end
|
167
|
+
end
|
137
168
|
end
|
138
169
|
|
139
170
|
self
|
@@ -145,8 +176,8 @@ module YNAB
|
|
145
176
|
# @return [Object] Deserialized data
|
146
177
|
def _deserialize(type, value)
|
147
178
|
case type.to_sym
|
148
|
-
when :
|
149
|
-
|
179
|
+
when :Time
|
180
|
+
Time.parse(value)
|
150
181
|
when :Date
|
151
182
|
Date.parse(value)
|
152
183
|
when :String
|
@@ -155,7 +186,7 @@ module YNAB
|
|
155
186
|
value.to_i
|
156
187
|
when :Float
|
157
188
|
value.to_f
|
158
|
-
when :
|
189
|
+
when :Boolean
|
159
190
|
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
160
191
|
true
|
161
192
|
else
|
@@ -176,8 +207,9 @@ module YNAB
|
|
176
207
|
end
|
177
208
|
end
|
178
209
|
else # model
|
179
|
-
|
180
|
-
|
210
|
+
# models (e.g. Pet) or oneOf
|
211
|
+
klass = YNAB.const_get(type)
|
212
|
+
klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
181
213
|
end
|
182
214
|
end
|
183
215
|
|
@@ -199,7 +231,11 @@ module YNAB
|
|
199
231
|
hash = {}
|
200
232
|
self.class.attribute_map.each_pair do |attr, param|
|
201
233
|
value = self.send(attr)
|
202
|
-
|
234
|
+
if value.nil?
|
235
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
236
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
237
|
+
end
|
238
|
+
|
203
239
|
hash[param] = _to_hash(value)
|
204
240
|
end
|
205
241
|
hash
|
@@ -1,16 +1,17 @@
|
|
1
1
|
=begin
|
2
2
|
#YNAB API Endpoints
|
3
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.
|
4
|
+
#Our API uses a REST based design, leverages the JSON data format, and relies upon HTTPS for transport. We respond with meaningful HTTP response codes and if an error occurs, we include error details in the response body. API Documentation is at https://api.ynab.com
|
5
5
|
|
6
|
-
OpenAPI
|
6
|
+
The version of the OpenAPI document: 1.0.0
|
7
7
|
|
8
|
-
Generated by: https://
|
9
|
-
|
8
|
+
Generated by: https://openapi-generator.tech
|
9
|
+
OpenAPI Generator version: 6.6.0
|
10
10
|
|
11
11
|
=end
|
12
12
|
|
13
13
|
require 'date'
|
14
|
+
require 'time'
|
14
15
|
|
15
16
|
module YNAB
|
16
17
|
class PayeeLocation
|
@@ -36,42 +37,60 @@ module YNAB
|
|
36
37
|
}
|
37
38
|
end
|
38
39
|
|
40
|
+
# Returns all the JSON keys this model knows about
|
41
|
+
def self.acceptable_attributes
|
42
|
+
attribute_map.values
|
43
|
+
end
|
44
|
+
|
39
45
|
# Attribute type mapping.
|
40
|
-
def self.
|
46
|
+
def self.openapi_types
|
41
47
|
{
|
42
48
|
:'id' => :'String',
|
43
49
|
:'payee_id' => :'String',
|
44
50
|
:'latitude' => :'String',
|
45
51
|
:'longitude' => :'String',
|
46
|
-
:'deleted' => :'
|
52
|
+
:'deleted' => :'Boolean'
|
47
53
|
}
|
48
54
|
end
|
49
55
|
|
56
|
+
# List of attributes with nullable: true
|
57
|
+
def self.openapi_nullable
|
58
|
+
Set.new([
|
59
|
+
])
|
60
|
+
end
|
61
|
+
|
50
62
|
# Initializes the object
|
51
63
|
# @param [Hash] attributes Model attributes in the form of hash
|
52
64
|
def initialize(attributes = {})
|
53
|
-
|
65
|
+
if (!attributes.is_a?(Hash))
|
66
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `YNAB::PayeeLocation` initialize method"
|
67
|
+
end
|
54
68
|
|
55
|
-
# convert string to symbol for hash key
|
56
|
-
attributes = attributes.each_with_object({}) { |(k, v), h|
|
69
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
70
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
71
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
72
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `YNAB::PayeeLocation`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
73
|
+
end
|
74
|
+
h[k.to_sym] = v
|
75
|
+
}
|
57
76
|
|
58
|
-
if attributes.
|
77
|
+
if attributes.key?(:'id')
|
59
78
|
self.id = attributes[:'id']
|
60
79
|
end
|
61
80
|
|
62
|
-
if attributes.
|
81
|
+
if attributes.key?(:'payee_id')
|
63
82
|
self.payee_id = attributes[:'payee_id']
|
64
83
|
end
|
65
84
|
|
66
|
-
if attributes.
|
85
|
+
if attributes.key?(:'latitude')
|
67
86
|
self.latitude = attributes[:'latitude']
|
68
87
|
end
|
69
88
|
|
70
|
-
if attributes.
|
89
|
+
if attributes.key?(:'longitude')
|
71
90
|
self.longitude = attributes[:'longitude']
|
72
91
|
end
|
73
92
|
|
74
|
-
if attributes.
|
93
|
+
if attributes.key?(:'deleted')
|
75
94
|
self.deleted = attributes[:'deleted']
|
76
95
|
end
|
77
96
|
end
|
@@ -133,17 +152,28 @@ module YNAB
|
|
133
152
|
end
|
134
153
|
|
135
154
|
# Calculates hash code according to all attributes.
|
136
|
-
# @return [
|
155
|
+
# @return [Integer] Hash code
|
137
156
|
def hash
|
138
157
|
[id, payee_id, latitude, longitude, deleted].hash
|
139
158
|
end
|
159
|
+
|
160
|
+
# Builds the object from hash
|
161
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
162
|
+
# @return [Object] Returns the model itself
|
163
|
+
def self.build_from_hash(attributes)
|
164
|
+
new.build_from_hash(attributes)
|
165
|
+
end
|
166
|
+
|
140
167
|
# Builds the object from hash
|
141
168
|
# @param [Hash] attributes Model attributes in the form of hash
|
142
169
|
# @return [Object] Returns the model itself
|
143
170
|
def build_from_hash(attributes)
|
144
171
|
return nil unless attributes.is_a?(Hash)
|
145
|
-
|
146
|
-
|
172
|
+
attributes = attributes.transform_keys(&:to_sym)
|
173
|
+
self.class.openapi_types.each_pair do |key, type|
|
174
|
+
if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
|
175
|
+
self.send("#{key}=", nil)
|
176
|
+
elsif type =~ /\AArray<(.*)>/i
|
147
177
|
# check to ensure the input is an array given that the attribute
|
148
178
|
# is documented as an array but the input is not
|
149
179
|
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
@@ -151,7 +181,7 @@ module YNAB
|
|
151
181
|
end
|
152
182
|
elsif !attributes[self.class.attribute_map[key]].nil?
|
153
183
|
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
154
|
-
end
|
184
|
+
end
|
155
185
|
end
|
156
186
|
|
157
187
|
self
|
@@ -163,8 +193,8 @@ module YNAB
|
|
163
193
|
# @return [Object] Deserialized data
|
164
194
|
def _deserialize(type, value)
|
165
195
|
case type.to_sym
|
166
|
-
when :
|
167
|
-
|
196
|
+
when :Time
|
197
|
+
Time.parse(value)
|
168
198
|
when :Date
|
169
199
|
Date.parse(value)
|
170
200
|
when :String
|
@@ -173,7 +203,7 @@ module YNAB
|
|
173
203
|
value.to_i
|
174
204
|
when :Float
|
175
205
|
value.to_f
|
176
|
-
when :
|
206
|
+
when :Boolean
|
177
207
|
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
178
208
|
true
|
179
209
|
else
|
@@ -194,8 +224,9 @@ module YNAB
|
|
194
224
|
end
|
195
225
|
end
|
196
226
|
else # model
|
197
|
-
|
198
|
-
|
227
|
+
# models (e.g. Pet) or oneOf
|
228
|
+
klass = YNAB.const_get(type)
|
229
|
+
klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
199
230
|
end
|
200
231
|
end
|
201
232
|
|
@@ -217,7 +248,11 @@ module YNAB
|
|
217
248
|
hash = {}
|
218
249
|
self.class.attribute_map.each_pair do |attr, param|
|
219
250
|
value = self.send(attr)
|
220
|
-
|
251
|
+
if value.nil?
|
252
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
253
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
254
|
+
end
|
255
|
+
|
221
256
|
hash[param] = _to_hash(value)
|
222
257
|
end
|
223
258
|
hash
|
@@ -1,16 +1,17 @@
|
|
1
1
|
=begin
|
2
2
|
#YNAB API Endpoints
|
3
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.
|
4
|
+
#Our API uses a REST based design, leverages the JSON data format, and relies upon HTTPS for transport. We respond with meaningful HTTP response codes and if an error occurs, we include error details in the response body. API Documentation is at https://api.ynab.com
|
5
5
|
|
6
|
-
OpenAPI
|
6
|
+
The version of the OpenAPI document: 1.0.0
|
7
7
|
|
8
|
-
Generated by: https://
|
9
|
-
|
8
|
+
Generated by: https://openapi-generator.tech
|
9
|
+
OpenAPI Generator version: 6.6.0
|
10
10
|
|
11
11
|
=end
|
12
12
|
|
13
13
|
require 'date'
|
14
|
+
require 'time'
|
14
15
|
|
15
16
|
module YNAB
|
16
17
|
class PayeeLocationResponse
|
@@ -23,22 +24,40 @@ module YNAB
|
|
23
24
|
}
|
24
25
|
end
|
25
26
|
|
27
|
+
# Returns all the JSON keys this model knows about
|
28
|
+
def self.acceptable_attributes
|
29
|
+
attribute_map.values
|
30
|
+
end
|
31
|
+
|
26
32
|
# Attribute type mapping.
|
27
|
-
def self.
|
33
|
+
def self.openapi_types
|
28
34
|
{
|
29
35
|
:'data' => :'PayeeLocationResponseData'
|
30
36
|
}
|
31
37
|
end
|
32
38
|
|
39
|
+
# List of attributes with nullable: true
|
40
|
+
def self.openapi_nullable
|
41
|
+
Set.new([
|
42
|
+
])
|
43
|
+
end
|
44
|
+
|
33
45
|
# Initializes the object
|
34
46
|
# @param [Hash] attributes Model attributes in the form of hash
|
35
47
|
def initialize(attributes = {})
|
36
|
-
|
48
|
+
if (!attributes.is_a?(Hash))
|
49
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `YNAB::PayeeLocationResponse` initialize method"
|
50
|
+
end
|
37
51
|
|
38
|
-
# convert string to symbol for hash key
|
39
|
-
attributes = attributes.each_with_object({}) { |(k, v), h|
|
52
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
53
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
54
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
55
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `YNAB::PayeeLocationResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
56
|
+
end
|
57
|
+
h[k.to_sym] = v
|
58
|
+
}
|
40
59
|
|
41
|
-
if attributes.
|
60
|
+
if attributes.key?(:'data')
|
42
61
|
self.data = attributes[:'data']
|
43
62
|
end
|
44
63
|
end
|
@@ -76,17 +95,28 @@ module YNAB
|
|
76
95
|
end
|
77
96
|
|
78
97
|
# Calculates hash code according to all attributes.
|
79
|
-
# @return [
|
98
|
+
# @return [Integer] Hash code
|
80
99
|
def hash
|
81
100
|
[data].hash
|
82
101
|
end
|
102
|
+
|
103
|
+
# Builds the object from hash
|
104
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
105
|
+
# @return [Object] Returns the model itself
|
106
|
+
def self.build_from_hash(attributes)
|
107
|
+
new.build_from_hash(attributes)
|
108
|
+
end
|
109
|
+
|
83
110
|
# Builds the object from hash
|
84
111
|
# @param [Hash] attributes Model attributes in the form of hash
|
85
112
|
# @return [Object] Returns the model itself
|
86
113
|
def build_from_hash(attributes)
|
87
114
|
return nil unless attributes.is_a?(Hash)
|
88
|
-
|
89
|
-
|
115
|
+
attributes = attributes.transform_keys(&:to_sym)
|
116
|
+
self.class.openapi_types.each_pair do |key, type|
|
117
|
+
if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
|
118
|
+
self.send("#{key}=", nil)
|
119
|
+
elsif type =~ /\AArray<(.*)>/i
|
90
120
|
# check to ensure the input is an array given that the attribute
|
91
121
|
# is documented as an array but the input is not
|
92
122
|
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
@@ -94,7 +124,7 @@ module YNAB
|
|
94
124
|
end
|
95
125
|
elsif !attributes[self.class.attribute_map[key]].nil?
|
96
126
|
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
97
|
-
end
|
127
|
+
end
|
98
128
|
end
|
99
129
|
|
100
130
|
self
|
@@ -106,8 +136,8 @@ module YNAB
|
|
106
136
|
# @return [Object] Deserialized data
|
107
137
|
def _deserialize(type, value)
|
108
138
|
case type.to_sym
|
109
|
-
when :
|
110
|
-
|
139
|
+
when :Time
|
140
|
+
Time.parse(value)
|
111
141
|
when :Date
|
112
142
|
Date.parse(value)
|
113
143
|
when :String
|
@@ -116,7 +146,7 @@ module YNAB
|
|
116
146
|
value.to_i
|
117
147
|
when :Float
|
118
148
|
value.to_f
|
119
|
-
when :
|
149
|
+
when :Boolean
|
120
150
|
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
121
151
|
true
|
122
152
|
else
|
@@ -137,8 +167,9 @@ module YNAB
|
|
137
167
|
end
|
138
168
|
end
|
139
169
|
else # model
|
140
|
-
|
141
|
-
|
170
|
+
# models (e.g. Pet) or oneOf
|
171
|
+
klass = YNAB.const_get(type)
|
172
|
+
klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
142
173
|
end
|
143
174
|
end
|
144
175
|
|
@@ -160,7 +191,11 @@ module YNAB
|
|
160
191
|
hash = {}
|
161
192
|
self.class.attribute_map.each_pair do |attr, param|
|
162
193
|
value = self.send(attr)
|
163
|
-
|
194
|
+
if value.nil?
|
195
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
196
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
197
|
+
end
|
198
|
+
|
164
199
|
hash[param] = _to_hash(value)
|
165
200
|
end
|
166
201
|
hash
|
@@ -1,16 +1,17 @@
|
|
1
1
|
=begin
|
2
2
|
#YNAB API Endpoints
|
3
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.
|
4
|
+
#Our API uses a REST based design, leverages the JSON data format, and relies upon HTTPS for transport. We respond with meaningful HTTP response codes and if an error occurs, we include error details in the response body. API Documentation is at https://api.ynab.com
|
5
5
|
|
6
|
-
OpenAPI
|
6
|
+
The version of the OpenAPI document: 1.0.0
|
7
7
|
|
8
|
-
Generated by: https://
|
9
|
-
|
8
|
+
Generated by: https://openapi-generator.tech
|
9
|
+
OpenAPI Generator version: 6.6.0
|
10
10
|
|
11
11
|
=end
|
12
12
|
|
13
13
|
require 'date'
|
14
|
+
require 'time'
|
14
15
|
|
15
16
|
module YNAB
|
16
17
|
class PayeeLocationResponseData
|
@@ -23,22 +24,40 @@ module YNAB
|
|
23
24
|
}
|
24
25
|
end
|
25
26
|
|
27
|
+
# Returns all the JSON keys this model knows about
|
28
|
+
def self.acceptable_attributes
|
29
|
+
attribute_map.values
|
30
|
+
end
|
31
|
+
|
26
32
|
# Attribute type mapping.
|
27
|
-
def self.
|
33
|
+
def self.openapi_types
|
28
34
|
{
|
29
35
|
:'payee_location' => :'PayeeLocation'
|
30
36
|
}
|
31
37
|
end
|
32
38
|
|
39
|
+
# List of attributes with nullable: true
|
40
|
+
def self.openapi_nullable
|
41
|
+
Set.new([
|
42
|
+
])
|
43
|
+
end
|
44
|
+
|
33
45
|
# Initializes the object
|
34
46
|
# @param [Hash] attributes Model attributes in the form of hash
|
35
47
|
def initialize(attributes = {})
|
36
|
-
|
48
|
+
if (!attributes.is_a?(Hash))
|
49
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `YNAB::PayeeLocationResponseData` initialize method"
|
50
|
+
end
|
37
51
|
|
38
|
-
# convert string to symbol for hash key
|
39
|
-
attributes = attributes.each_with_object({}) { |(k, v), h|
|
52
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
53
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
54
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
55
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `YNAB::PayeeLocationResponseData`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
56
|
+
end
|
57
|
+
h[k.to_sym] = v
|
58
|
+
}
|
40
59
|
|
41
|
-
if attributes.
|
60
|
+
if attributes.key?(:'payee_location')
|
42
61
|
self.payee_location = attributes[:'payee_location']
|
43
62
|
end
|
44
63
|
end
|
@@ -76,17 +95,28 @@ module YNAB
|
|
76
95
|
end
|
77
96
|
|
78
97
|
# Calculates hash code according to all attributes.
|
79
|
-
# @return [
|
98
|
+
# @return [Integer] Hash code
|
80
99
|
def hash
|
81
100
|
[payee_location].hash
|
82
101
|
end
|
102
|
+
|
103
|
+
# Builds the object from hash
|
104
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
105
|
+
# @return [Object] Returns the model itself
|
106
|
+
def self.build_from_hash(attributes)
|
107
|
+
new.build_from_hash(attributes)
|
108
|
+
end
|
109
|
+
|
83
110
|
# Builds the object from hash
|
84
111
|
# @param [Hash] attributes Model attributes in the form of hash
|
85
112
|
# @return [Object] Returns the model itself
|
86
113
|
def build_from_hash(attributes)
|
87
114
|
return nil unless attributes.is_a?(Hash)
|
88
|
-
|
89
|
-
|
115
|
+
attributes = attributes.transform_keys(&:to_sym)
|
116
|
+
self.class.openapi_types.each_pair do |key, type|
|
117
|
+
if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
|
118
|
+
self.send("#{key}=", nil)
|
119
|
+
elsif type =~ /\AArray<(.*)>/i
|
90
120
|
# check to ensure the input is an array given that the attribute
|
91
121
|
# is documented as an array but the input is not
|
92
122
|
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
@@ -94,7 +124,7 @@ module YNAB
|
|
94
124
|
end
|
95
125
|
elsif !attributes[self.class.attribute_map[key]].nil?
|
96
126
|
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
97
|
-
end
|
127
|
+
end
|
98
128
|
end
|
99
129
|
|
100
130
|
self
|
@@ -106,8 +136,8 @@ module YNAB
|
|
106
136
|
# @return [Object] Deserialized data
|
107
137
|
def _deserialize(type, value)
|
108
138
|
case type.to_sym
|
109
|
-
when :
|
110
|
-
|
139
|
+
when :Time
|
140
|
+
Time.parse(value)
|
111
141
|
when :Date
|
112
142
|
Date.parse(value)
|
113
143
|
when :String
|
@@ -116,7 +146,7 @@ module YNAB
|
|
116
146
|
value.to_i
|
117
147
|
when :Float
|
118
148
|
value.to_f
|
119
|
-
when :
|
149
|
+
when :Boolean
|
120
150
|
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
121
151
|
true
|
122
152
|
else
|
@@ -137,8 +167,9 @@ module YNAB
|
|
137
167
|
end
|
138
168
|
end
|
139
169
|
else # model
|
140
|
-
|
141
|
-
|
170
|
+
# models (e.g. Pet) or oneOf
|
171
|
+
klass = YNAB.const_get(type)
|
172
|
+
klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
142
173
|
end
|
143
174
|
end
|
144
175
|
|
@@ -160,7 +191,11 @@ module YNAB
|
|
160
191
|
hash = {}
|
161
192
|
self.class.attribute_map.each_pair do |attr, param|
|
162
193
|
value = self.send(attr)
|
163
|
-
|
194
|
+
if value.nil?
|
195
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
196
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
197
|
+
end
|
198
|
+
|
164
199
|
hash[param] = _to_hash(value)
|
165
200
|
end
|
166
201
|
hash
|