ynab 5.2.0 → 5.3.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.
Files changed (153) hide show
  1. checksums.yaml +4 -4
  2. data/DEVELOPMENT.md +6 -3
  3. data/Gemfile.lock +21 -19
  4. data/Rakefile +9 -8
  5. data/docs/ExistingCategory.md +4 -3
  6. data/docs/ExistingTransaction.md +1 -1
  7. data/docs/NewCategory.md +4 -3
  8. data/docs/NewTransaction.md +1 -1
  9. data/docs/SaveCategory.md +4 -3
  10. data/docs/SaveTransactionWithIdOrImportId.md +1 -1
  11. data/docs/SaveTransactionWithOptionalFields.md +1 -1
  12. data/docs/TransactionsApi.md +1 -1
  13. data/lib/ynab/api/accounts_api.rb +1 -1
  14. data/lib/ynab/api/categories_api.rb +1 -1
  15. data/lib/ynab/api/money_movements_api.rb +1 -1
  16. data/lib/ynab/api/months_api.rb +1 -1
  17. data/lib/ynab/api/payee_locations_api.rb +1 -1
  18. data/lib/ynab/api/payees_api.rb +1 -1
  19. data/lib/ynab/api/plans_api.rb +1 -1
  20. data/lib/ynab/api/scheduled_transactions_api.rb +1 -1
  21. data/lib/ynab/api/transactions_api.rb +3 -3
  22. data/lib/ynab/api/user_api.rb +1 -1
  23. data/lib/ynab/api_client.rb +1 -1
  24. data/lib/ynab/api_model_base.rb +1 -1
  25. data/lib/ynab/configuration.rb +1 -1
  26. data/lib/ynab/models/account.rb +38 -13
  27. data/lib/ynab/models/account_base.rb +34 -12
  28. data/lib/ynab/models/account_response.rb +31 -12
  29. data/lib/ynab/models/account_response_data.rb +31 -12
  30. data/lib/ynab/models/account_type.rb +1 -1
  31. data/lib/ynab/models/accounts_response.rb +31 -12
  32. data/lib/ynab/models/accounts_response_data.rb +31 -12
  33. data/lib/ynab/models/bulk_response.rb +31 -12
  34. data/lib/ynab/models/bulk_response_data.rb +31 -12
  35. data/lib/ynab/models/bulk_response_data_bulk.rb +31 -12
  36. data/lib/ynab/models/bulk_transactions.rb +31 -12
  37. data/lib/ynab/models/categories_response.rb +31 -12
  38. data/lib/ynab/models/categories_response_data.rb +31 -12
  39. data/lib/ynab/models/category.rb +47 -12
  40. data/lib/ynab/models/category_base.rb +31 -12
  41. data/lib/ynab/models/category_group.rb +31 -12
  42. data/lib/ynab/models/category_group_with_categories.rb +31 -12
  43. data/lib/ynab/models/category_response.rb +31 -12
  44. data/lib/ynab/models/category_response_data.rb +31 -12
  45. data/lib/ynab/models/currency_format.rb +31 -12
  46. data/lib/ynab/models/date_format.rb +31 -12
  47. data/lib/ynab/models/error_detail.rb +31 -12
  48. data/lib/ynab/models/error_response.rb +31 -12
  49. data/lib/ynab/models/existing_category.rb +83 -19
  50. data/lib/ynab/models/existing_transaction.rb +36 -13
  51. data/lib/ynab/models/hybrid_transaction.rb +41 -12
  52. data/lib/ynab/models/hybrid_transactions_response.rb +31 -12
  53. data/lib/ynab/models/hybrid_transactions_response_data.rb +31 -12
  54. data/lib/ynab/models/money_movement.rb +38 -12
  55. data/lib/ynab/models/money_movement_base.rb +31 -12
  56. data/lib/ynab/models/money_movement_group.rb +31 -12
  57. data/lib/ynab/models/money_movement_groups_response.rb +31 -12
  58. data/lib/ynab/models/money_movement_groups_response_data.rb +31 -12
  59. data/lib/ynab/models/money_movements_response.rb +31 -12
  60. data/lib/ynab/models/money_movements_response_data.rb +31 -12
  61. data/lib/ynab/models/month_detail.rb +33 -12
  62. data/lib/ynab/models/month_detail_base.rb +33 -12
  63. data/lib/ynab/models/month_detail_response.rb +31 -12
  64. data/lib/ynab/models/month_detail_response_data.rb +31 -12
  65. data/lib/ynab/models/month_summaries_response.rb +31 -12
  66. data/lib/ynab/models/month_summaries_response_data.rb +31 -12
  67. data/lib/ynab/models/month_summary.rb +33 -12
  68. data/lib/ynab/models/month_summary_base.rb +31 -12
  69. data/lib/ynab/models/new_category.rb +83 -19
  70. data/lib/ynab/models/new_transaction.rb +36 -13
  71. data/lib/ynab/models/patch_category_group_wrapper.rb +31 -12
  72. data/lib/ynab/models/patch_category_wrapper.rb +31 -12
  73. data/lib/ynab/models/patch_month_category_wrapper.rb +31 -12
  74. data/lib/ynab/models/patch_payee_wrapper.rb +31 -12
  75. data/lib/ynab/models/patch_transactions_wrapper.rb +31 -12
  76. data/lib/ynab/models/payee.rb +31 -12
  77. data/lib/ynab/models/payee_location.rb +31 -12
  78. data/lib/ynab/models/payee_location_response.rb +31 -12
  79. data/lib/ynab/models/payee_location_response_data.rb +31 -12
  80. data/lib/ynab/models/payee_locations_response.rb +31 -12
  81. data/lib/ynab/models/payee_locations_response_data.rb +31 -12
  82. data/lib/ynab/models/payee_response.rb +31 -12
  83. data/lib/ynab/models/payee_response_data.rb +31 -12
  84. data/lib/ynab/models/payees_response.rb +31 -12
  85. data/lib/ynab/models/payees_response_data.rb +31 -12
  86. data/lib/ynab/models/plan_detail.rb +33 -12
  87. data/lib/ynab/models/plan_detail_response.rb +31 -12
  88. data/lib/ynab/models/plan_detail_response_data.rb +31 -12
  89. data/lib/ynab/models/plan_settings.rb +33 -14
  90. data/lib/ynab/models/plan_settings_response.rb +31 -12
  91. data/lib/ynab/models/plan_settings_response_data.rb +31 -12
  92. data/lib/ynab/models/plan_summary.rb +33 -12
  93. data/lib/ynab/models/plan_summary_response.rb +31 -12
  94. data/lib/ynab/models/plan_summary_response_data.rb +31 -12
  95. data/lib/ynab/models/post_account_wrapper.rb +31 -12
  96. data/lib/ynab/models/post_category_group_wrapper.rb +31 -12
  97. data/lib/ynab/models/post_category_wrapper.rb +31 -12
  98. data/lib/ynab/models/post_payee.rb +31 -12
  99. data/lib/ynab/models/post_payee_wrapper.rb +31 -12
  100. data/lib/ynab/models/post_scheduled_transaction_wrapper.rb +31 -12
  101. data/lib/ynab/models/post_transactions_wrapper.rb +31 -12
  102. data/lib/ynab/models/put_scheduled_transaction_wrapper.rb +31 -12
  103. data/lib/ynab/models/put_transaction_wrapper.rb +31 -12
  104. data/lib/ynab/models/save_account.rb +31 -12
  105. data/lib/ynab/models/save_account_type.rb +1 -1
  106. data/lib/ynab/models/save_category.rb +79 -20
  107. data/lib/ynab/models/save_category_group.rb +31 -12
  108. data/lib/ynab/models/save_category_group_response.rb +31 -12
  109. data/lib/ynab/models/save_category_group_response_data.rb +31 -12
  110. data/lib/ynab/models/save_category_response.rb +31 -12
  111. data/lib/ynab/models/save_category_response_data.rb +31 -12
  112. data/lib/ynab/models/save_month_category.rb +31 -12
  113. data/lib/ynab/models/save_payee.rb +31 -12
  114. data/lib/ynab/models/save_payee_response.rb +31 -12
  115. data/lib/ynab/models/save_payee_response_data.rb +31 -12
  116. data/lib/ynab/models/save_scheduled_transaction.rb +31 -12
  117. data/lib/ynab/models/save_sub_transaction.rb +31 -12
  118. data/lib/ynab/models/save_transaction_with_id_or_import_id.rb +36 -13
  119. data/lib/ynab/models/save_transaction_with_optional_fields.rb +32 -13
  120. data/lib/ynab/models/save_transactions_response.rb +31 -12
  121. data/lib/ynab/models/save_transactions_response_data.rb +31 -12
  122. data/lib/ynab/models/scheduled_sub_transaction.rb +37 -12
  123. data/lib/ynab/models/scheduled_sub_transaction_base.rb +31 -12
  124. data/lib/ynab/models/scheduled_transaction_detail.rb +36 -12
  125. data/lib/ynab/models/scheduled_transaction_frequency.rb +1 -1
  126. data/lib/ynab/models/scheduled_transaction_response.rb +31 -12
  127. data/lib/ynab/models/scheduled_transaction_response_data.rb +31 -12
  128. data/lib/ynab/models/scheduled_transaction_summary.rb +36 -12
  129. data/lib/ynab/models/scheduled_transaction_summary_base.rb +31 -12
  130. data/lib/ynab/models/scheduled_transactions_response.rb +31 -12
  131. data/lib/ynab/models/scheduled_transactions_response_data.rb +31 -12
  132. data/lib/ynab/models/sub_transaction.rb +38 -12
  133. data/lib/ynab/models/sub_transaction_base.rb +31 -12
  134. data/lib/ynab/models/transaction_cleared_status.rb +1 -1
  135. data/lib/ynab/models/transaction_detail.rb +41 -12
  136. data/lib/ynab/models/transaction_flag_color.rb +1 -1
  137. data/lib/ynab/models/transaction_response.rb +31 -12
  138. data/lib/ynab/models/transaction_response_data.rb +31 -12
  139. data/lib/ynab/models/transaction_summary.rb +41 -12
  140. data/lib/ynab/models/transaction_summary_base.rb +31 -12
  141. data/lib/ynab/models/transactions_import_response.rb +31 -12
  142. data/lib/ynab/models/transactions_import_response_data.rb +31 -12
  143. data/lib/ynab/models/transactions_response.rb +31 -12
  144. data/lib/ynab/models/transactions_response_data.rb +31 -12
  145. data/lib/ynab/models/user.rb +31 -12
  146. data/lib/ynab/models/user_response.rb +31 -12
  147. data/lib/ynab/models/user_response_data.rb +31 -12
  148. data/lib/ynab/version.rb +1 -1
  149. data/lib/ynab.rb +1 -1
  150. data/open_api_spec.yaml +61 -30
  151. data/templates/partial_model_generic.mustache +37 -11
  152. data/ynab.gemspec +2 -2
  153. metadata +3 -3
@@ -1,7 +1,7 @@
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.ynab.com
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. Read the [API Documentation](https://api.ynab.com) for more information about the API, including how to obtain an access token and how to use it to make requests.
5
5
 
6
6
  Generated by: OpenAPI Generator (https://openapi-generator.tech)
7
7
 
@@ -37,9 +37,14 @@ module YNAB
37
37
  }
38
38
  end
39
39
 
40
+ # Returns attribute mapping this model knows about
41
+ def self.acceptable_attribute_map
42
+ attribute_map
43
+ end
44
+
40
45
  # Returns all the JSON keys this model knows about
41
46
  def self.acceptable_attributes
42
- attribute_map.values
47
+ acceptable_attribute_map.values
43
48
  end
44
49
 
45
50
  # Attribute type mapping.
@@ -59,6 +64,16 @@ module YNAB
59
64
  ])
60
65
  end
61
66
 
67
+ # Returns attribute type mapping
68
+ def self.acceptable_openapi_types
69
+ openapi_types
70
+ end
71
+
72
+ # Returns the nullable attributes
73
+ def self.acceptable_openapi_nullable
74
+ openapi_nullable
75
+ end
76
+
62
77
  # Initializes the object
63
78
  # @param [Hash] attributes Model attributes in the form of hash
64
79
  def initialize(attributes = {})
@@ -67,9 +82,10 @@ module YNAB
67
82
  end
68
83
 
69
84
  # check to see if the attribute exists and convert string to symbol for hash key
85
+ acceptable_attribute_map = self.class.acceptable_attribute_map
70
86
  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::SaveTransactionsResponseData`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
87
+ if (!acceptable_attribute_map.key?(k.to_sym))
88
+ fail ArgumentError, "`#{k}` is not a valid attribute in `YNAB::SaveTransactionsResponseData`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
73
89
  end
74
90
  h[k.to_sym] = v
75
91
  }
@@ -146,18 +162,20 @@ module YNAB
146
162
  def self.build_from_hash(attributes)
147
163
  return nil unless attributes.is_a?(Hash)
148
164
  attributes = attributes.transform_keys(&:to_sym)
165
+ # include attributes inherited from allOf parents (the nearest declaration wins)
166
+ map = acceptable_attribute_map
149
167
  transformed_hash = {}
150
- openapi_types.each_pair do |key, type|
151
- if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
168
+ acceptable_openapi_types.each_pair do |key, type|
169
+ if attributes.key?(map[key]) && attributes[map[key]].nil?
152
170
  transformed_hash["#{key}"] = nil
153
171
  elsif type =~ /\AArray<(.*)>/i
154
172
  # check to ensure the input is an array given that the attribute
155
173
  # is documented as an array but the input is not
156
- if attributes[attribute_map[key]].is_a?(Array)
157
- transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
174
+ if attributes[map[key]].is_a?(Array)
175
+ transformed_hash["#{key}"] = attributes[map[key]].map { |v| _deserialize($1, v) }
158
176
  end
159
- elsif !attributes[attribute_map[key]].nil?
160
- transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
177
+ elsif !attributes[map[key]].nil?
178
+ transformed_hash["#{key}"] = _deserialize(type, attributes[map[key]])
161
179
  end
162
180
  end
163
181
  new(transformed_hash)
@@ -167,10 +185,11 @@ module YNAB
167
185
  # @return [Hash] Returns the object in the form of hash
168
186
  def to_hash
169
187
  hash = {}
170
- self.class.attribute_map.each_pair do |attr, param|
188
+ # include attributes inherited from allOf parents (the nearest declaration wins)
189
+ self.class.acceptable_attribute_map.each_pair do |attr, param|
171
190
  value = self.send(attr)
172
191
  if value.nil?
173
- is_nullable = self.class.openapi_nullable.include?(attr)
192
+ is_nullable = self.class.acceptable_openapi_nullable.include?(attr)
174
193
  next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
175
194
  end
176
195
 
@@ -1,7 +1,7 @@
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.ynab.com
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. Read the [API Documentation](https://api.ynab.com) for more information about the API, including how to obtain an access token and how to use it to make requests.
5
5
 
6
6
  Generated by: OpenAPI Generator (https://openapi-generator.tech)
7
7
 
@@ -59,9 +59,14 @@ module YNAB
59
59
  }
60
60
  end
61
61
 
62
+ # Returns attribute mapping this model knows about
63
+ def self.acceptable_attribute_map
64
+ attribute_map
65
+ end
66
+
62
67
  # Returns all the JSON keys this model knows about
63
68
  def self.acceptable_attributes
64
- attribute_map.values
69
+ acceptable_attribute_map.values
65
70
  end
66
71
 
67
72
  # Attribute type mapping.
@@ -85,9 +90,25 @@ module YNAB
85
90
  # List of attributes with nullable: true
86
91
  def self.openapi_nullable
87
92
  Set.new([
93
+ :'memo',
94
+ :'payee_id',
95
+ :'payee_name',
96
+ :'category_id',
97
+ :'category_name',
98
+ :'transfer_account_id',
88
99
  ])
89
100
  end
90
101
 
102
+ # Returns attribute type mapping
103
+ def self.acceptable_openapi_types
104
+ openapi_types
105
+ end
106
+
107
+ # Returns the nullable attributes
108
+ def self.acceptable_openapi_nullable
109
+ openapi_nullable
110
+ end
111
+
91
112
  # List of class defined in allOf (OpenAPI v3)
92
113
  def self.openapi_all_of
93
114
  [
@@ -103,9 +124,10 @@ module YNAB
103
124
  end
104
125
 
105
126
  # check to see if the attribute exists and convert string to symbol for hash key
127
+ acceptable_attribute_map = self.class.acceptable_attribute_map
106
128
  attributes = attributes.each_with_object({}) { |(k, v), h|
107
- if (!self.class.attribute_map.key?(k.to_sym))
108
- fail ArgumentError, "`#{k}` is not a valid attribute in `YNAB::ScheduledSubTransaction`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
129
+ if (!acceptable_attribute_map.key?(k.to_sym))
130
+ fail ArgumentError, "`#{k}` is not a valid attribute in `YNAB::ScheduledSubTransaction`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
109
131
  end
110
132
  h[k.to_sym] = v
111
133
  }
@@ -213,18 +235,20 @@ module YNAB
213
235
  def self.build_from_hash(attributes)
214
236
  return nil unless attributes.is_a?(Hash)
215
237
  attributes = attributes.transform_keys(&:to_sym)
238
+ # include attributes inherited from allOf parents (the nearest declaration wins)
239
+ map = acceptable_attribute_map
216
240
  transformed_hash = {}
217
- openapi_types.each_pair do |key, type|
218
- if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
241
+ acceptable_openapi_types.each_pair do |key, type|
242
+ if attributes.key?(map[key]) && attributes[map[key]].nil?
219
243
  transformed_hash["#{key}"] = nil
220
244
  elsif type =~ /\AArray<(.*)>/i
221
245
  # check to ensure the input is an array given that the attribute
222
246
  # is documented as an array but the input is not
223
- if attributes[attribute_map[key]].is_a?(Array)
224
- transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
247
+ if attributes[map[key]].is_a?(Array)
248
+ transformed_hash["#{key}"] = attributes[map[key]].map { |v| _deserialize($1, v) }
225
249
  end
226
- elsif !attributes[attribute_map[key]].nil?
227
- transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
250
+ elsif !attributes[map[key]].nil?
251
+ transformed_hash["#{key}"] = _deserialize(type, attributes[map[key]])
228
252
  end
229
253
  end
230
254
  new(transformed_hash)
@@ -234,10 +258,11 @@ module YNAB
234
258
  # @return [Hash] Returns the object in the form of hash
235
259
  def to_hash
236
260
  hash = {}
237
- self.class.attribute_map.each_pair do |attr, param|
261
+ # include attributes inherited from allOf parents (the nearest declaration wins)
262
+ self.class.acceptable_attribute_map.each_pair do |attr, param|
238
263
  value = self.send(attr)
239
264
  if value.nil?
240
- is_nullable = self.class.openapi_nullable.include?(attr)
265
+ is_nullable = self.class.acceptable_openapi_nullable.include?(attr)
241
266
  next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
242
267
  end
243
268
 
@@ -1,7 +1,7 @@
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.ynab.com
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. Read the [API Documentation](https://api.ynab.com) for more information about the API, including how to obtain an access token and how to use it to make requests.
5
5
 
6
6
  Generated by: OpenAPI Generator (https://openapi-generator.tech)
7
7
 
@@ -51,9 +51,14 @@ module YNAB
51
51
  }
52
52
  end
53
53
 
54
+ # Returns attribute mapping this model knows about
55
+ def self.acceptable_attribute_map
56
+ attribute_map
57
+ end
58
+
54
59
  # Returns all the JSON keys this model knows about
55
60
  def self.acceptable_attributes
56
- attribute_map.values
61
+ acceptable_attribute_map.values
57
62
  end
58
63
 
59
64
  # Attribute type mapping.
@@ -84,6 +89,16 @@ module YNAB
84
89
  ])
85
90
  end
86
91
 
92
+ # Returns attribute type mapping
93
+ def self.acceptable_openapi_types
94
+ openapi_types
95
+ end
96
+
97
+ # Returns the nullable attributes
98
+ def self.acceptable_openapi_nullable
99
+ openapi_nullable
100
+ end
101
+
87
102
  # Initializes the object
88
103
  # @param [Hash] attributes Model attributes in the form of hash
89
104
  def initialize(attributes = {})
@@ -92,9 +107,10 @@ module YNAB
92
107
  end
93
108
 
94
109
  # check to see if the attribute exists and convert string to symbol for hash key
110
+ acceptable_attribute_map = self.class.acceptable_attribute_map
95
111
  attributes = attributes.each_with_object({}) { |(k, v), h|
96
- if (!self.class.attribute_map.key?(k.to_sym))
97
- fail ArgumentError, "`#{k}` is not a valid attribute in `YNAB::ScheduledSubTransactionBase`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
112
+ if (!acceptable_attribute_map.key?(k.to_sym))
113
+ fail ArgumentError, "`#{k}` is not a valid attribute in `YNAB::ScheduledSubTransactionBase`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
98
114
  end
99
115
  h[k.to_sym] = v
100
116
  }
@@ -192,18 +208,20 @@ module YNAB
192
208
  def self.build_from_hash(attributes)
193
209
  return nil unless attributes.is_a?(Hash)
194
210
  attributes = attributes.transform_keys(&:to_sym)
211
+ # include attributes inherited from allOf parents (the nearest declaration wins)
212
+ map = acceptable_attribute_map
195
213
  transformed_hash = {}
196
- openapi_types.each_pair do |key, type|
197
- if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
214
+ acceptable_openapi_types.each_pair do |key, type|
215
+ if attributes.key?(map[key]) && attributes[map[key]].nil?
198
216
  transformed_hash["#{key}"] = nil
199
217
  elsif type =~ /\AArray<(.*)>/i
200
218
  # check to ensure the input is an array given that the attribute
201
219
  # is documented as an array but the input is not
202
- if attributes[attribute_map[key]].is_a?(Array)
203
- transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
220
+ if attributes[map[key]].is_a?(Array)
221
+ transformed_hash["#{key}"] = attributes[map[key]].map { |v| _deserialize($1, v) }
204
222
  end
205
- elsif !attributes[attribute_map[key]].nil?
206
- transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
223
+ elsif !attributes[map[key]].nil?
224
+ transformed_hash["#{key}"] = _deserialize(type, attributes[map[key]])
207
225
  end
208
226
  end
209
227
  new(transformed_hash)
@@ -213,10 +231,11 @@ module YNAB
213
231
  # @return [Hash] Returns the object in the form of hash
214
232
  def to_hash
215
233
  hash = {}
216
- self.class.attribute_map.each_pair do |attr, param|
234
+ # include attributes inherited from allOf parents (the nearest declaration wins)
235
+ self.class.acceptable_attribute_map.each_pair do |attr, param|
217
236
  value = self.send(attr)
218
237
  if value.nil?
219
- is_nullable = self.class.openapi_nullable.include?(attr)
238
+ is_nullable = self.class.acceptable_openapi_nullable.include?(attr)
220
239
  next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
221
240
  end
222
241
 
@@ -1,7 +1,7 @@
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.ynab.com
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. Read the [API Documentation](https://api.ynab.com) for more information about the API, including how to obtain an access token and how to use it to make requests.
5
5
 
6
6
  Generated by: OpenAPI Generator (https://openapi-generator.tech)
7
7
 
@@ -107,9 +107,14 @@ module YNAB
107
107
  }
108
108
  end
109
109
 
110
+ # Returns attribute mapping this model knows about
111
+ def self.acceptable_attribute_map
112
+ attribute_map
113
+ end
114
+
110
115
  # Returns all the JSON keys this model knows about
111
116
  def self.acceptable_attributes
112
- attribute_map.values
117
+ acceptable_attribute_map.values
113
118
  end
114
119
 
115
120
  # Attribute type mapping.
@@ -140,12 +145,27 @@ module YNAB
140
145
  # List of attributes with nullable: true
141
146
  def self.openapi_nullable
142
147
  Set.new([
148
+ :'memo',
143
149
  :'flag_color',
150
+ :'flag_name',
151
+ :'payee_id',
152
+ :'category_id',
153
+ :'transfer_account_id',
144
154
  :'payee_name',
145
155
  :'category_name',
146
156
  ])
147
157
  end
148
158
 
159
+ # Returns attribute type mapping
160
+ def self.acceptable_openapi_types
161
+ openapi_types
162
+ end
163
+
164
+ # Returns the nullable attributes
165
+ def self.acceptable_openapi_nullable
166
+ openapi_nullable
167
+ end
168
+
149
169
  # List of class defined in allOf (OpenAPI v3)
150
170
  def self.openapi_all_of
151
171
  [
@@ -161,9 +181,10 @@ module YNAB
161
181
  end
162
182
 
163
183
  # check to see if the attribute exists and convert string to symbol for hash key
184
+ acceptable_attribute_map = self.class.acceptable_attribute_map
164
185
  attributes = attributes.each_with_object({}) { |(k, v), h|
165
- if (!self.class.attribute_map.key?(k.to_sym))
166
- fail ArgumentError, "`#{k}` is not a valid attribute in `YNAB::ScheduledTransactionDetail`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
186
+ if (!acceptable_attribute_map.key?(k.to_sym))
187
+ fail ArgumentError, "`#{k}` is not a valid attribute in `YNAB::ScheduledTransactionDetail`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
167
188
  end
168
189
  h[k.to_sym] = v
169
190
  }
@@ -321,18 +342,20 @@ module YNAB
321
342
  def self.build_from_hash(attributes)
322
343
  return nil unless attributes.is_a?(Hash)
323
344
  attributes = attributes.transform_keys(&:to_sym)
345
+ # include attributes inherited from allOf parents (the nearest declaration wins)
346
+ map = acceptable_attribute_map
324
347
  transformed_hash = {}
325
- openapi_types.each_pair do |key, type|
326
- if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
348
+ acceptable_openapi_types.each_pair do |key, type|
349
+ if attributes.key?(map[key]) && attributes[map[key]].nil?
327
350
  transformed_hash["#{key}"] = nil
328
351
  elsif type =~ /\AArray<(.*)>/i
329
352
  # check to ensure the input is an array given that the attribute
330
353
  # is documented as an array but the input is not
331
- if attributes[attribute_map[key]].is_a?(Array)
332
- transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
354
+ if attributes[map[key]].is_a?(Array)
355
+ transformed_hash["#{key}"] = attributes[map[key]].map { |v| _deserialize($1, v) }
333
356
  end
334
- elsif !attributes[attribute_map[key]].nil?
335
- transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
357
+ elsif !attributes[map[key]].nil?
358
+ transformed_hash["#{key}"] = _deserialize(type, attributes[map[key]])
336
359
  end
337
360
  end
338
361
  new(transformed_hash)
@@ -342,10 +365,11 @@ module YNAB
342
365
  # @return [Hash] Returns the object in the form of hash
343
366
  def to_hash
344
367
  hash = {}
345
- self.class.attribute_map.each_pair do |attr, param|
368
+ # include attributes inherited from allOf parents (the nearest declaration wins)
369
+ self.class.acceptable_attribute_map.each_pair do |attr, param|
346
370
  value = self.send(attr)
347
371
  if value.nil?
348
- is_nullable = self.class.openapi_nullable.include?(attr)
372
+ is_nullable = self.class.acceptable_openapi_nullable.include?(attr)
349
373
  next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
350
374
  end
351
375
 
@@ -1,7 +1,7 @@
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.ynab.com
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. Read the [API Documentation](https://api.ynab.com) for more information about the API, including how to obtain an access token and how to use it to make requests.
5
5
 
6
6
  Generated by: OpenAPI Generator (https://openapi-generator.tech)
7
7
 
@@ -1,7 +1,7 @@
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.ynab.com
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. Read the [API Documentation](https://api.ynab.com) for more information about the API, including how to obtain an access token and how to use it to make requests.
5
5
 
6
6
  Generated by: OpenAPI Generator (https://openapi-generator.tech)
7
7
 
@@ -21,9 +21,14 @@ module YNAB
21
21
  }
22
22
  end
23
23
 
24
+ # Returns attribute mapping this model knows about
25
+ def self.acceptable_attribute_map
26
+ attribute_map
27
+ end
28
+
24
29
  # Returns all the JSON keys this model knows about
25
30
  def self.acceptable_attributes
26
- attribute_map.values
31
+ acceptable_attribute_map.values
27
32
  end
28
33
 
29
34
  # Attribute type mapping.
@@ -39,6 +44,16 @@ module YNAB
39
44
  ])
40
45
  end
41
46
 
47
+ # Returns attribute type mapping
48
+ def self.acceptable_openapi_types
49
+ openapi_types
50
+ end
51
+
52
+ # Returns the nullable attributes
53
+ def self.acceptable_openapi_nullable
54
+ openapi_nullable
55
+ end
56
+
42
57
  # Initializes the object
43
58
  # @param [Hash] attributes Model attributes in the form of hash
44
59
  def initialize(attributes = {})
@@ -47,9 +62,10 @@ module YNAB
47
62
  end
48
63
 
49
64
  # check to see if the attribute exists and convert string to symbol for hash key
65
+ acceptable_attribute_map = self.class.acceptable_attribute_map
50
66
  attributes = attributes.each_with_object({}) { |(k, v), h|
51
- if (!self.class.attribute_map.key?(k.to_sym))
52
- fail ArgumentError, "`#{k}` is not a valid attribute in `YNAB::ScheduledTransactionResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
67
+ if (!acceptable_attribute_map.key?(k.to_sym))
68
+ fail ArgumentError, "`#{k}` is not a valid attribute in `YNAB::ScheduledTransactionResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
53
69
  end
54
70
  h[k.to_sym] = v
55
71
  }
@@ -99,18 +115,20 @@ module YNAB
99
115
  def self.build_from_hash(attributes)
100
116
  return nil unless attributes.is_a?(Hash)
101
117
  attributes = attributes.transform_keys(&:to_sym)
118
+ # include attributes inherited from allOf parents (the nearest declaration wins)
119
+ map = acceptable_attribute_map
102
120
  transformed_hash = {}
103
- openapi_types.each_pair do |key, type|
104
- if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
121
+ acceptable_openapi_types.each_pair do |key, type|
122
+ if attributes.key?(map[key]) && attributes[map[key]].nil?
105
123
  transformed_hash["#{key}"] = nil
106
124
  elsif type =~ /\AArray<(.*)>/i
107
125
  # check to ensure the input is an array given that the attribute
108
126
  # is documented as an array but the input is not
109
- if attributes[attribute_map[key]].is_a?(Array)
110
- transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
127
+ if attributes[map[key]].is_a?(Array)
128
+ transformed_hash["#{key}"] = attributes[map[key]].map { |v| _deserialize($1, v) }
111
129
  end
112
- elsif !attributes[attribute_map[key]].nil?
113
- transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
130
+ elsif !attributes[map[key]].nil?
131
+ transformed_hash["#{key}"] = _deserialize(type, attributes[map[key]])
114
132
  end
115
133
  end
116
134
  new(transformed_hash)
@@ -120,10 +138,11 @@ module YNAB
120
138
  # @return [Hash] Returns the object in the form of hash
121
139
  def to_hash
122
140
  hash = {}
123
- self.class.attribute_map.each_pair do |attr, param|
141
+ # include attributes inherited from allOf parents (the nearest declaration wins)
142
+ self.class.acceptable_attribute_map.each_pair do |attr, param|
124
143
  value = self.send(attr)
125
144
  if value.nil?
126
- is_nullable = self.class.openapi_nullable.include?(attr)
145
+ is_nullable = self.class.acceptable_openapi_nullable.include?(attr)
127
146
  next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
128
147
  end
129
148
 
@@ -1,7 +1,7 @@
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.ynab.com
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. Read the [API Documentation](https://api.ynab.com) for more information about the API, including how to obtain an access token and how to use it to make requests.
5
5
 
6
6
  Generated by: OpenAPI Generator (https://openapi-generator.tech)
7
7
 
@@ -21,9 +21,14 @@ module YNAB
21
21
  }
22
22
  end
23
23
 
24
+ # Returns attribute mapping this model knows about
25
+ def self.acceptable_attribute_map
26
+ attribute_map
27
+ end
28
+
24
29
  # Returns all the JSON keys this model knows about
25
30
  def self.acceptable_attributes
26
- attribute_map.values
31
+ acceptable_attribute_map.values
27
32
  end
28
33
 
29
34
  # Attribute type mapping.
@@ -39,6 +44,16 @@ module YNAB
39
44
  ])
40
45
  end
41
46
 
47
+ # Returns attribute type mapping
48
+ def self.acceptable_openapi_types
49
+ openapi_types
50
+ end
51
+
52
+ # Returns the nullable attributes
53
+ def self.acceptable_openapi_nullable
54
+ openapi_nullable
55
+ end
56
+
42
57
  # Initializes the object
43
58
  # @param [Hash] attributes Model attributes in the form of hash
44
59
  def initialize(attributes = {})
@@ -47,9 +62,10 @@ module YNAB
47
62
  end
48
63
 
49
64
  # check to see if the attribute exists and convert string to symbol for hash key
65
+ acceptable_attribute_map = self.class.acceptable_attribute_map
50
66
  attributes = attributes.each_with_object({}) { |(k, v), h|
51
- if (!self.class.attribute_map.key?(k.to_sym))
52
- fail ArgumentError, "`#{k}` is not a valid attribute in `YNAB::ScheduledTransactionResponseData`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
67
+ if (!acceptable_attribute_map.key?(k.to_sym))
68
+ fail ArgumentError, "`#{k}` is not a valid attribute in `YNAB::ScheduledTransactionResponseData`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
53
69
  end
54
70
  h[k.to_sym] = v
55
71
  }
@@ -99,18 +115,20 @@ module YNAB
99
115
  def self.build_from_hash(attributes)
100
116
  return nil unless attributes.is_a?(Hash)
101
117
  attributes = attributes.transform_keys(&:to_sym)
118
+ # include attributes inherited from allOf parents (the nearest declaration wins)
119
+ map = acceptable_attribute_map
102
120
  transformed_hash = {}
103
- openapi_types.each_pair do |key, type|
104
- if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
121
+ acceptable_openapi_types.each_pair do |key, type|
122
+ if attributes.key?(map[key]) && attributes[map[key]].nil?
105
123
  transformed_hash["#{key}"] = nil
106
124
  elsif type =~ /\AArray<(.*)>/i
107
125
  # check to ensure the input is an array given that the attribute
108
126
  # is documented as an array but the input is not
109
- if attributes[attribute_map[key]].is_a?(Array)
110
- transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
127
+ if attributes[map[key]].is_a?(Array)
128
+ transformed_hash["#{key}"] = attributes[map[key]].map { |v| _deserialize($1, v) }
111
129
  end
112
- elsif !attributes[attribute_map[key]].nil?
113
- transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
130
+ elsif !attributes[map[key]].nil?
131
+ transformed_hash["#{key}"] = _deserialize(type, attributes[map[key]])
114
132
  end
115
133
  end
116
134
  new(transformed_hash)
@@ -120,10 +138,11 @@ module YNAB
120
138
  # @return [Hash] Returns the object in the form of hash
121
139
  def to_hash
122
140
  hash = {}
123
- self.class.attribute_map.each_pair do |attr, param|
141
+ # include attributes inherited from allOf parents (the nearest declaration wins)
142
+ self.class.acceptable_attribute_map.each_pair do |attr, param|
124
143
  value = self.send(attr)
125
144
  if value.nil?
126
- is_nullable = self.class.openapi_nullable.include?(attr)
145
+ is_nullable = self.class.acceptable_openapi_nullable.include?(attr)
127
146
  next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
128
147
  end
129
148