ynab 2.1.0 → 3.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (138) hide show
  1. checksums.yaml +4 -4
  2. data/DEVELOPMENT.md +6 -2
  3. data/Gemfile.lock +1 -1
  4. data/README.md +3 -1
  5. data/Rakefile +3 -1
  6. data/docs/BulkTransactions.md +1 -1
  7. data/docs/CategoriesApi.md +22 -0
  8. data/docs/Category.md +1 -0
  9. data/docs/ExistingTransaction.md +18 -0
  10. data/docs/HybridTransaction.md +3 -2
  11. data/docs/NewTransaction.md +19 -0
  12. data/docs/PatchCategoryWrapper.md +8 -0
  13. data/docs/PatchPayeeWrapper.md +8 -0
  14. data/docs/PatchTransactionsWrapper.md +1 -1
  15. data/docs/PayeesApi.md +22 -0
  16. data/docs/PostTransactionsWrapper.md +2 -2
  17. data/docs/PutTransactionWrapper.md +1 -1
  18. data/docs/SaveCategory.md +10 -0
  19. data/docs/SavePayee.md +8 -0
  20. data/docs/SavePayeeResponse.md +8 -0
  21. data/docs/SavePayeeResponseData.md +9 -0
  22. data/docs/SaveTransactionWithIdOrImportId.md +20 -0
  23. data/docs/SaveTransactionWithOptionalFields.md +2 -3
  24. data/docs/ScheduledTransactionDetail.md +2 -1
  25. data/docs/ScheduledTransactionSummary.md +2 -1
  26. data/docs/TransactionClearedStatus.md +7 -0
  27. data/docs/TransactionDetail.md +3 -2
  28. data/docs/TransactionFlagColor.md +7 -0
  29. data/docs/TransactionSummary.md +3 -2
  30. data/docs/TransactionsApi.md +7 -7
  31. data/lib/ynab/api/accounts_api.rb +2 -2
  32. data/lib/ynab/api/budgets_api.rb +2 -2
  33. data/lib/ynab/api/categories_api.rb +82 -2
  34. data/lib/ynab/api/months_api.rb +2 -2
  35. data/lib/ynab/api/payee_locations_api.rb +2 -2
  36. data/lib/ynab/api/payees_api.rb +82 -2
  37. data/lib/ynab/api/scheduled_transactions_api.rb +2 -2
  38. data/lib/ynab/api/transactions_api.rb +12 -12
  39. data/lib/ynab/api/user_api.rb +2 -2
  40. data/lib/ynab/api_client.rb +2 -2
  41. data/lib/ynab/configuration.rb +14 -11
  42. data/lib/ynab/models/account.rb +13 -20
  43. data/lib/ynab/models/account_response.rb +13 -20
  44. data/lib/ynab/models/account_response_data.rb +13 -20
  45. data/lib/ynab/models/account_type.rb +2 -2
  46. data/lib/ynab/models/accounts_response.rb +13 -20
  47. data/lib/ynab/models/accounts_response_data.rb +13 -20
  48. data/lib/ynab/models/budget_detail.rb +13 -21
  49. data/lib/ynab/models/budget_detail_response.rb +13 -20
  50. data/lib/ynab/models/budget_detail_response_data.rb +13 -20
  51. data/lib/ynab/models/budget_settings.rb +13 -20
  52. data/lib/ynab/models/budget_settings_response.rb +13 -20
  53. data/lib/ynab/models/budget_settings_response_data.rb +13 -20
  54. data/lib/ynab/models/budget_summary.rb +13 -20
  55. data/lib/ynab/models/budget_summary_response.rb +13 -20
  56. data/lib/ynab/models/budget_summary_response_data.rb +13 -20
  57. data/lib/ynab/models/bulk_response.rb +13 -20
  58. data/lib/ynab/models/bulk_response_data.rb +13 -20
  59. data/lib/ynab/models/bulk_response_data_bulk.rb +13 -20
  60. data/lib/ynab/models/bulk_transactions.rb +14 -21
  61. data/lib/ynab/models/categories_response.rb +13 -20
  62. data/lib/ynab/models/categories_response_data.rb +13 -20
  63. data/lib/ynab/models/category.rb +25 -21
  64. data/lib/ynab/models/category_group.rb +13 -20
  65. data/lib/ynab/models/category_group_with_categories.rb +14 -22
  66. data/lib/ynab/models/category_response.rb +13 -20
  67. data/lib/ynab/models/category_response_data.rb +13 -20
  68. data/lib/ynab/models/currency_format.rb +13 -20
  69. data/lib/ynab/models/date_format.rb +13 -20
  70. data/lib/ynab/models/error_detail.rb +13 -20
  71. data/lib/ynab/models/error_response.rb +13 -20
  72. data/lib/ynab/models/existing_transaction.rb +359 -0
  73. data/lib/ynab/models/hybrid_transaction.rb +28 -43
  74. data/lib/ynab/models/hybrid_transactions_response.rb +13 -20
  75. data/lib/ynab/models/hybrid_transactions_response_data.rb +13 -20
  76. data/lib/ynab/models/month_detail.rb +13 -21
  77. data/lib/ynab/models/month_detail_response.rb +13 -20
  78. data/lib/ynab/models/month_detail_response_data.rb +13 -20
  79. data/lib/ynab/models/month_summaries_response.rb +13 -20
  80. data/lib/ynab/models/month_summaries_response_data.rb +13 -20
  81. data/lib/ynab/models/month_summary.rb +13 -20
  82. data/lib/ynab/models/new_transaction.rb +377 -0
  83. data/lib/ynab/models/patch_category_wrapper.rb +213 -0
  84. data/lib/ynab/models/patch_month_category_wrapper.rb +13 -20
  85. data/lib/ynab/models/patch_payee_wrapper.rb +213 -0
  86. data/lib/ynab/models/patch_transactions_wrapper.rb +14 -21
  87. data/lib/ynab/models/payee.rb +13 -20
  88. data/lib/ynab/models/payee_location.rb +13 -20
  89. data/lib/ynab/models/payee_location_response.rb +13 -20
  90. data/lib/ynab/models/payee_location_response_data.rb +13 -20
  91. data/lib/ynab/models/payee_locations_response.rb +13 -20
  92. data/lib/ynab/models/payee_locations_response_data.rb +13 -20
  93. data/lib/ynab/models/payee_response.rb +13 -20
  94. data/lib/ynab/models/payee_response_data.rb +13 -20
  95. data/lib/ynab/models/payees_response.rb +13 -20
  96. data/lib/ynab/models/payees_response_data.rb +13 -20
  97. data/lib/ynab/models/post_account_wrapper.rb +13 -20
  98. data/lib/ynab/models/post_transactions_wrapper.rb +15 -22
  99. data/lib/ynab/models/put_transaction_wrapper.rb +14 -21
  100. data/lib/ynab/models/save_account.rb +13 -20
  101. data/lib/ynab/models/save_category.rb +232 -0
  102. data/lib/ynab/models/save_category_response.rb +13 -20
  103. data/lib/ynab/models/save_category_response_data.rb +13 -20
  104. data/lib/ynab/models/save_month_category.rb +13 -20
  105. data/lib/ynab/models/save_payee.rb +220 -0
  106. data/lib/ynab/models/save_payee_response.rb +213 -0
  107. data/lib/ynab/models/save_payee_response_data.rb +224 -0
  108. data/lib/ynab/models/save_sub_transaction.rb +13 -20
  109. data/lib/ynab/models/save_transaction_with_id_or_import_id.rb +388 -0
  110. data/lib/ynab/models/save_transaction_with_optional_fields.rb +17 -59
  111. data/lib/ynab/models/save_transactions_response.rb +13 -20
  112. data/lib/ynab/models/save_transactions_response_data.rb +13 -20
  113. data/lib/ynab/models/scheduled_sub_transaction.rb +13 -20
  114. data/lib/ynab/models/scheduled_transaction_detail.rb +26 -32
  115. data/lib/ynab/models/scheduled_transaction_response.rb +13 -20
  116. data/lib/ynab/models/scheduled_transaction_response_data.rb +13 -20
  117. data/lib/ynab/models/scheduled_transaction_summary.rb +26 -31
  118. data/lib/ynab/models/scheduled_transactions_response.rb +13 -20
  119. data/lib/ynab/models/scheduled_transactions_response_data.rb +13 -20
  120. data/lib/ynab/models/sub_transaction.rb +13 -20
  121. data/lib/ynab/models/transaction_cleared_status.rb +41 -0
  122. data/lib/ynab/models/transaction_detail.rb +28 -43
  123. data/lib/ynab/models/transaction_flag_color.rb +45 -0
  124. data/lib/ynab/models/transaction_response.rb +13 -20
  125. data/lib/ynab/models/transaction_response_data.rb +13 -20
  126. data/lib/ynab/models/transaction_summary.rb +28 -42
  127. data/lib/ynab/models/transactions_import_response.rb +13 -20
  128. data/lib/ynab/models/transactions_import_response_data.rb +13 -20
  129. data/lib/ynab/models/transactions_response.rb +13 -20
  130. data/lib/ynab/models/transactions_response_data.rb +13 -20
  131. data/lib/ynab/models/user.rb +13 -20
  132. data/lib/ynab/models/user_response.rb +13 -20
  133. data/lib/ynab/models/user_response_data.rb +13 -20
  134. data/lib/ynab/version.rb +1 -1
  135. data/lib/ynab.rb +13 -12
  136. data/open_api_spec.yaml +464 -343
  137. data/ynab.gemspec +4 -3
  138. metadata +53 -31
@@ -3,10 +3,10 @@
3
3
 
4
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
- The version of the OpenAPI document: 1.0.0
6
+ The version of the OpenAPI document: 1.70.0
7
7
 
8
8
  Generated by: https://openapi-generator.tech
9
- OpenAPI Generator version: 6.6.0
9
+ Generator version: 7.6.0
10
10
 
11
11
  =end
12
12
 
@@ -132,37 +132,30 @@ module YNAB
132
132
  # @param [Hash] attributes Model attributes in the form of hash
133
133
  # @return [Object] Returns the model itself
134
134
  def self.build_from_hash(attributes)
135
- new.build_from_hash(attributes)
136
- end
137
-
138
- # Builds the object from hash
139
- # @param [Hash] attributes Model attributes in the form of hash
140
- # @return [Object] Returns the model itself
141
- def build_from_hash(attributes)
142
135
  return nil unless attributes.is_a?(Hash)
143
136
  attributes = attributes.transform_keys(&:to_sym)
144
- self.class.openapi_types.each_pair do |key, type|
145
- if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
146
- self.send("#{key}=", nil)
137
+ transformed_hash = {}
138
+ openapi_types.each_pair do |key, type|
139
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
140
+ transformed_hash["#{key}"] = nil
147
141
  elsif type =~ /\AArray<(.*)>/i
148
142
  # check to ensure the input is an array given that the attribute
149
143
  # is documented as an array but the input is not
150
- if attributes[self.class.attribute_map[key]].is_a?(Array)
151
- self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
144
+ if attributes[attribute_map[key]].is_a?(Array)
145
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
152
146
  end
153
- elsif !attributes[self.class.attribute_map[key]].nil?
154
- self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
147
+ elsif !attributes[attribute_map[key]].nil?
148
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
155
149
  end
156
150
  end
157
-
158
- self
151
+ new(transformed_hash)
159
152
  end
160
153
 
161
154
  # Deserializes the data based on type
162
155
  # @param string type Data type
163
156
  # @param string value Value to be deserialized
164
157
  # @return [Object] Deserialized data
165
- def _deserialize(type, value)
158
+ def self._deserialize(type, value)
166
159
  case type.to_sym
167
160
  when :Time
168
161
  Time.parse(value)
@@ -197,7 +190,7 @@ module YNAB
197
190
  else # model
198
191
  # models (e.g. Pet) or oneOf
199
192
  klass = YNAB.const_get(type)
200
- klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
193
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
201
194
  end
202
195
  end
203
196
 
@@ -3,10 +3,10 @@
3
3
 
4
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
- The version of the OpenAPI document: 1.0.0
6
+ The version of the OpenAPI document: 1.70.0
7
7
 
8
8
  Generated by: https://openapi-generator.tech
9
- OpenAPI Generator version: 6.6.0
9
+ Generator version: 7.6.0
10
10
 
11
11
  =end
12
12
 
@@ -64,8 +64,7 @@ module YNAB
64
64
  # List of class defined in allOf (OpenAPI v3)
65
65
  def self.openapi_all_of
66
66
  [
67
- :'CategoryGroup',
68
- :'CategoryGroupWithCategoriesAllOf'
67
+ :'CategoryGroup'
69
68
  ]
70
69
  end
71
70
 
@@ -153,37 +152,30 @@ module YNAB
153
152
  # @param [Hash] attributes Model attributes in the form of hash
154
153
  # @return [Object] Returns the model itself
155
154
  def self.build_from_hash(attributes)
156
- new.build_from_hash(attributes)
157
- end
158
-
159
- # Builds the object from hash
160
- # @param [Hash] attributes Model attributes in the form of hash
161
- # @return [Object] Returns the model itself
162
- def build_from_hash(attributes)
163
155
  return nil unless attributes.is_a?(Hash)
164
156
  attributes = attributes.transform_keys(&:to_sym)
165
- self.class.openapi_types.each_pair do |key, type|
166
- if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
167
- self.send("#{key}=", nil)
157
+ transformed_hash = {}
158
+ openapi_types.each_pair do |key, type|
159
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
160
+ transformed_hash["#{key}"] = nil
168
161
  elsif type =~ /\AArray<(.*)>/i
169
162
  # check to ensure the input is an array given that the attribute
170
163
  # is documented as an array but the input is not
171
- if attributes[self.class.attribute_map[key]].is_a?(Array)
172
- self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
164
+ if attributes[attribute_map[key]].is_a?(Array)
165
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
173
166
  end
174
- elsif !attributes[self.class.attribute_map[key]].nil?
175
- self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
167
+ elsif !attributes[attribute_map[key]].nil?
168
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
176
169
  end
177
170
  end
178
-
179
- self
171
+ new(transformed_hash)
180
172
  end
181
173
 
182
174
  # Deserializes the data based on type
183
175
  # @param string type Data type
184
176
  # @param string value Value to be deserialized
185
177
  # @return [Object] Deserialized data
186
- def _deserialize(type, value)
178
+ def self._deserialize(type, value)
187
179
  case type.to_sym
188
180
  when :Time
189
181
  Time.parse(value)
@@ -218,7 +210,7 @@ module YNAB
218
210
  else # model
219
211
  # models (e.g. Pet) or oneOf
220
212
  klass = YNAB.const_get(type)
221
- klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
213
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
222
214
  end
223
215
  end
224
216
 
@@ -3,10 +3,10 @@
3
3
 
4
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
- The version of the OpenAPI document: 1.0.0
6
+ The version of the OpenAPI document: 1.70.0
7
7
 
8
8
  Generated by: https://openapi-generator.tech
9
- OpenAPI Generator version: 6.6.0
9
+ Generator version: 7.6.0
10
10
 
11
11
  =end
12
12
 
@@ -100,37 +100,30 @@ module YNAB
100
100
  # @param [Hash] attributes Model attributes in the form of hash
101
101
  # @return [Object] Returns the model itself
102
102
  def self.build_from_hash(attributes)
103
- new.build_from_hash(attributes)
104
- end
105
-
106
- # Builds the object from hash
107
- # @param [Hash] attributes Model attributes in the form of hash
108
- # @return [Object] Returns the model itself
109
- def build_from_hash(attributes)
110
103
  return nil unless attributes.is_a?(Hash)
111
104
  attributes = attributes.transform_keys(&:to_sym)
112
- self.class.openapi_types.each_pair do |key, type|
113
- if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
114
- self.send("#{key}=", nil)
105
+ transformed_hash = {}
106
+ openapi_types.each_pair do |key, type|
107
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
108
+ transformed_hash["#{key}"] = nil
115
109
  elsif type =~ /\AArray<(.*)>/i
116
110
  # check to ensure the input is an array given that the attribute
117
111
  # is documented as an array but the input is not
118
- if attributes[self.class.attribute_map[key]].is_a?(Array)
119
- self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
112
+ if attributes[attribute_map[key]].is_a?(Array)
113
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
120
114
  end
121
- elsif !attributes[self.class.attribute_map[key]].nil?
122
- self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
115
+ elsif !attributes[attribute_map[key]].nil?
116
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
123
117
  end
124
118
  end
125
-
126
- self
119
+ new(transformed_hash)
127
120
  end
128
121
 
129
122
  # Deserializes the data based on type
130
123
  # @param string type Data type
131
124
  # @param string value Value to be deserialized
132
125
  # @return [Object] Deserialized data
133
- def _deserialize(type, value)
126
+ def self._deserialize(type, value)
134
127
  case type.to_sym
135
128
  when :Time
136
129
  Time.parse(value)
@@ -165,7 +158,7 @@ module YNAB
165
158
  else # model
166
159
  # models (e.g. Pet) or oneOf
167
160
  klass = YNAB.const_get(type)
168
- klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
161
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
169
162
  end
170
163
  end
171
164
 
@@ -3,10 +3,10 @@
3
3
 
4
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
- The version of the OpenAPI document: 1.0.0
6
+ The version of the OpenAPI document: 1.70.0
7
7
 
8
8
  Generated by: https://openapi-generator.tech
9
- OpenAPI Generator version: 6.6.0
9
+ Generator version: 7.6.0
10
10
 
11
11
  =end
12
12
 
@@ -100,37 +100,30 @@ module YNAB
100
100
  # @param [Hash] attributes Model attributes in the form of hash
101
101
  # @return [Object] Returns the model itself
102
102
  def self.build_from_hash(attributes)
103
- new.build_from_hash(attributes)
104
- end
105
-
106
- # Builds the object from hash
107
- # @param [Hash] attributes Model attributes in the form of hash
108
- # @return [Object] Returns the model itself
109
- def build_from_hash(attributes)
110
103
  return nil unless attributes.is_a?(Hash)
111
104
  attributes = attributes.transform_keys(&:to_sym)
112
- self.class.openapi_types.each_pair do |key, type|
113
- if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
114
- self.send("#{key}=", nil)
105
+ transformed_hash = {}
106
+ openapi_types.each_pair do |key, type|
107
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
108
+ transformed_hash["#{key}"] = nil
115
109
  elsif type =~ /\AArray<(.*)>/i
116
110
  # check to ensure the input is an array given that the attribute
117
111
  # is documented as an array but the input is not
118
- if attributes[self.class.attribute_map[key]].is_a?(Array)
119
- self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
112
+ if attributes[attribute_map[key]].is_a?(Array)
113
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
120
114
  end
121
- elsif !attributes[self.class.attribute_map[key]].nil?
122
- self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
115
+ elsif !attributes[attribute_map[key]].nil?
116
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
123
117
  end
124
118
  end
125
-
126
- self
119
+ new(transformed_hash)
127
120
  end
128
121
 
129
122
  # Deserializes the data based on type
130
123
  # @param string type Data type
131
124
  # @param string value Value to be deserialized
132
125
  # @return [Object] Deserialized data
133
- def _deserialize(type, value)
126
+ def self._deserialize(type, value)
134
127
  case type.to_sym
135
128
  when :Time
136
129
  Time.parse(value)
@@ -165,7 +158,7 @@ module YNAB
165
158
  else # model
166
159
  # models (e.g. Pet) or oneOf
167
160
  klass = YNAB.const_get(type)
168
- klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
161
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
169
162
  end
170
163
  end
171
164
 
@@ -3,10 +3,10 @@
3
3
 
4
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
- The version of the OpenAPI document: 1.0.0
6
+ The version of the OpenAPI document: 1.70.0
7
7
 
8
8
  Generated by: https://openapi-generator.tech
9
- OpenAPI Generator version: 6.6.0
9
+ Generator version: 7.6.0
10
10
 
11
11
  =end
12
12
 
@@ -171,37 +171,30 @@ module YNAB
171
171
  # @param [Hash] attributes Model attributes in the form of hash
172
172
  # @return [Object] Returns the model itself
173
173
  def self.build_from_hash(attributes)
174
- new.build_from_hash(attributes)
175
- end
176
-
177
- # Builds the object from hash
178
- # @param [Hash] attributes Model attributes in the form of hash
179
- # @return [Object] Returns the model itself
180
- def build_from_hash(attributes)
181
174
  return nil unless attributes.is_a?(Hash)
182
175
  attributes = attributes.transform_keys(&:to_sym)
183
- self.class.openapi_types.each_pair do |key, type|
184
- if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
185
- self.send("#{key}=", nil)
176
+ transformed_hash = {}
177
+ openapi_types.each_pair do |key, type|
178
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
179
+ transformed_hash["#{key}"] = nil
186
180
  elsif type =~ /\AArray<(.*)>/i
187
181
  # check to ensure the input is an array given that the attribute
188
182
  # is documented as an array but the input is not
189
- if attributes[self.class.attribute_map[key]].is_a?(Array)
190
- self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
183
+ if attributes[attribute_map[key]].is_a?(Array)
184
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
191
185
  end
192
- elsif !attributes[self.class.attribute_map[key]].nil?
193
- self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
186
+ elsif !attributes[attribute_map[key]].nil?
187
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
194
188
  end
195
189
  end
196
-
197
- self
190
+ new(transformed_hash)
198
191
  end
199
192
 
200
193
  # Deserializes the data based on type
201
194
  # @param string type Data type
202
195
  # @param string value Value to be deserialized
203
196
  # @return [Object] Deserialized data
204
- def _deserialize(type, value)
197
+ def self._deserialize(type, value)
205
198
  case type.to_sym
206
199
  when :Time
207
200
  Time.parse(value)
@@ -236,7 +229,7 @@ module YNAB
236
229
  else # model
237
230
  # models (e.g. Pet) or oneOf
238
231
  klass = YNAB.const_get(type)
239
- klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
232
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
240
233
  end
241
234
  end
242
235
 
@@ -3,10 +3,10 @@
3
3
 
4
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
- The version of the OpenAPI document: 1.0.0
6
+ The version of the OpenAPI document: 1.70.0
7
7
 
8
8
  Generated by: https://openapi-generator.tech
9
- OpenAPI Generator version: 6.6.0
9
+ Generator version: 7.6.0
10
10
 
11
11
  =end
12
12
 
@@ -101,37 +101,30 @@ module YNAB
101
101
  # @param [Hash] attributes Model attributes in the form of hash
102
102
  # @return [Object] Returns the model itself
103
103
  def self.build_from_hash(attributes)
104
- new.build_from_hash(attributes)
105
- end
106
-
107
- # Builds the object from hash
108
- # @param [Hash] attributes Model attributes in the form of hash
109
- # @return [Object] Returns the model itself
110
- def build_from_hash(attributes)
111
104
  return nil unless attributes.is_a?(Hash)
112
105
  attributes = attributes.transform_keys(&:to_sym)
113
- self.class.openapi_types.each_pair do |key, type|
114
- if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
115
- self.send("#{key}=", nil)
106
+ transformed_hash = {}
107
+ openapi_types.each_pair do |key, type|
108
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
109
+ transformed_hash["#{key}"] = nil
116
110
  elsif type =~ /\AArray<(.*)>/i
117
111
  # check to ensure the input is an array given that the attribute
118
112
  # is documented as an array but the input is not
119
- if attributes[self.class.attribute_map[key]].is_a?(Array)
120
- self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
113
+ if attributes[attribute_map[key]].is_a?(Array)
114
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
121
115
  end
122
- elsif !attributes[self.class.attribute_map[key]].nil?
123
- self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
116
+ elsif !attributes[attribute_map[key]].nil?
117
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
124
118
  end
125
119
  end
126
-
127
- self
120
+ new(transformed_hash)
128
121
  end
129
122
 
130
123
  # Deserializes the data based on type
131
124
  # @param string type Data type
132
125
  # @param string value Value to be deserialized
133
126
  # @return [Object] Deserialized data
134
- def _deserialize(type, value)
127
+ def self._deserialize(type, value)
135
128
  case type.to_sym
136
129
  when :Time
137
130
  Time.parse(value)
@@ -166,7 +159,7 @@ module YNAB
166
159
  else # model
167
160
  # models (e.g. Pet) or oneOf
168
161
  klass = YNAB.const_get(type)
169
- klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
162
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
170
163
  end
171
164
  end
172
165
 
@@ -3,10 +3,10 @@
3
3
 
4
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
- The version of the OpenAPI document: 1.0.0
6
+ The version of the OpenAPI document: 1.70.0
7
7
 
8
8
  Generated by: https://openapi-generator.tech
9
- OpenAPI Generator version: 6.6.0
9
+ Generator version: 7.6.0
10
10
 
11
11
  =end
12
12
 
@@ -120,37 +120,30 @@ module YNAB
120
120
  # @param [Hash] attributes Model attributes in the form of hash
121
121
  # @return [Object] Returns the model itself
122
122
  def self.build_from_hash(attributes)
123
- new.build_from_hash(attributes)
124
- end
125
-
126
- # Builds the object from hash
127
- # @param [Hash] attributes Model attributes in the form of hash
128
- # @return [Object] Returns the model itself
129
- def build_from_hash(attributes)
130
123
  return nil unless attributes.is_a?(Hash)
131
124
  attributes = attributes.transform_keys(&:to_sym)
132
- self.class.openapi_types.each_pair do |key, type|
133
- if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
134
- self.send("#{key}=", nil)
125
+ transformed_hash = {}
126
+ openapi_types.each_pair do |key, type|
127
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
128
+ transformed_hash["#{key}"] = nil
135
129
  elsif type =~ /\AArray<(.*)>/i
136
130
  # check to ensure the input is an array given that the attribute
137
131
  # is documented as an array but the input is not
138
- if attributes[self.class.attribute_map[key]].is_a?(Array)
139
- self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
132
+ if attributes[attribute_map[key]].is_a?(Array)
133
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
140
134
  end
141
- elsif !attributes[self.class.attribute_map[key]].nil?
142
- self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
135
+ elsif !attributes[attribute_map[key]].nil?
136
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
143
137
  end
144
138
  end
145
-
146
- self
139
+ new(transformed_hash)
147
140
  end
148
141
 
149
142
  # Deserializes the data based on type
150
143
  # @param string type Data type
151
144
  # @param string value Value to be deserialized
152
145
  # @return [Object] Deserialized data
153
- def _deserialize(type, value)
146
+ def self._deserialize(type, value)
154
147
  case type.to_sym
155
148
  when :Time
156
149
  Time.parse(value)
@@ -185,7 +178,7 @@ module YNAB
185
178
  else # model
186
179
  # models (e.g. Pet) or oneOf
187
180
  klass = YNAB.const_get(type)
188
- klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
181
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
189
182
  end
190
183
  end
191
184
 
@@ -3,10 +3,10 @@
3
3
 
4
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
- The version of the OpenAPI document: 1.0.0
6
+ The version of the OpenAPI document: 1.70.0
7
7
 
8
8
  Generated by: https://openapi-generator.tech
9
- OpenAPI Generator version: 6.6.0
9
+ Generator version: 7.6.0
10
10
 
11
11
  =end
12
12
 
@@ -100,37 +100,30 @@ module YNAB
100
100
  # @param [Hash] attributes Model attributes in the form of hash
101
101
  # @return [Object] Returns the model itself
102
102
  def self.build_from_hash(attributes)
103
- new.build_from_hash(attributes)
104
- end
105
-
106
- # Builds the object from hash
107
- # @param [Hash] attributes Model attributes in the form of hash
108
- # @return [Object] Returns the model itself
109
- def build_from_hash(attributes)
110
103
  return nil unless attributes.is_a?(Hash)
111
104
  attributes = attributes.transform_keys(&:to_sym)
112
- self.class.openapi_types.each_pair do |key, type|
113
- if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
114
- self.send("#{key}=", nil)
105
+ transformed_hash = {}
106
+ openapi_types.each_pair do |key, type|
107
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
108
+ transformed_hash["#{key}"] = nil
115
109
  elsif type =~ /\AArray<(.*)>/i
116
110
  # check to ensure the input is an array given that the attribute
117
111
  # is documented as an array but the input is not
118
- if attributes[self.class.attribute_map[key]].is_a?(Array)
119
- self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
112
+ if attributes[attribute_map[key]].is_a?(Array)
113
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
120
114
  end
121
- elsif !attributes[self.class.attribute_map[key]].nil?
122
- self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
115
+ elsif !attributes[attribute_map[key]].nil?
116
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
123
117
  end
124
118
  end
125
-
126
- self
119
+ new(transformed_hash)
127
120
  end
128
121
 
129
122
  # Deserializes the data based on type
130
123
  # @param string type Data type
131
124
  # @param string value Value to be deserialized
132
125
  # @return [Object] Deserialized data
133
- def _deserialize(type, value)
126
+ def self._deserialize(type, value)
134
127
  case type.to_sym
135
128
  when :Time
136
129
  Time.parse(value)
@@ -165,7 +158,7 @@ module YNAB
165
158
  else # model
166
159
  # models (e.g. Pet) or oneOf
167
160
  klass = YNAB.const_get(type)
168
- klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
161
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
169
162
  end
170
163
  end
171
164