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
 
@@ -25,9 +25,14 @@ module YNAB
25
25
  }
26
26
  end
27
27
 
28
+ # Returns attribute mapping this model knows about
29
+ def self.acceptable_attribute_map
30
+ attribute_map
31
+ end
32
+
28
33
  # Returns all the JSON keys this model knows about
29
34
  def self.acceptable_attributes
30
- attribute_map.values
35
+ acceptable_attribute_map.values
31
36
  end
32
37
 
33
38
  # Attribute type mapping.
@@ -44,6 +49,16 @@ module YNAB
44
49
  ])
45
50
  end
46
51
 
52
+ # Returns attribute type mapping
53
+ def self.acceptable_openapi_types
54
+ openapi_types
55
+ end
56
+
57
+ # Returns the nullable attributes
58
+ def self.acceptable_openapi_nullable
59
+ openapi_nullable
60
+ end
61
+
47
62
  # Initializes the object
48
63
  # @param [Hash] attributes Model attributes in the form of hash
49
64
  def initialize(attributes = {})
@@ -52,9 +67,10 @@ module YNAB
52
67
  end
53
68
 
54
69
  # check to see if the attribute exists and convert string to symbol for hash key
70
+ acceptable_attribute_map = self.class.acceptable_attribute_map
55
71
  attributes = attributes.each_with_object({}) { |(k, v), h|
56
- if (!self.class.attribute_map.key?(k.to_sym))
57
- fail ArgumentError, "`#{k}` is not a valid attribute in `YNAB::SavePayeeResponseData`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
72
+ if (!acceptable_attribute_map.key?(k.to_sym))
73
+ fail ArgumentError, "`#{k}` is not a valid attribute in `YNAB::SavePayeeResponseData`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
58
74
  end
59
75
  h[k.to_sym] = v
60
76
  }
@@ -110,18 +126,20 @@ module YNAB
110
126
  def self.build_from_hash(attributes)
111
127
  return nil unless attributes.is_a?(Hash)
112
128
  attributes = attributes.transform_keys(&:to_sym)
129
+ # include attributes inherited from allOf parents (the nearest declaration wins)
130
+ map = acceptable_attribute_map
113
131
  transformed_hash = {}
114
- openapi_types.each_pair do |key, type|
115
- if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
132
+ acceptable_openapi_types.each_pair do |key, type|
133
+ if attributes.key?(map[key]) && attributes[map[key]].nil?
116
134
  transformed_hash["#{key}"] = nil
117
135
  elsif type =~ /\AArray<(.*)>/i
118
136
  # check to ensure the input is an array given that the attribute
119
137
  # is documented as an array but the input is not
120
- if attributes[attribute_map[key]].is_a?(Array)
121
- transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
138
+ if attributes[map[key]].is_a?(Array)
139
+ transformed_hash["#{key}"] = attributes[map[key]].map { |v| _deserialize($1, v) }
122
140
  end
123
- elsif !attributes[attribute_map[key]].nil?
124
- transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
141
+ elsif !attributes[map[key]].nil?
142
+ transformed_hash["#{key}"] = _deserialize(type, attributes[map[key]])
125
143
  end
126
144
  end
127
145
  new(transformed_hash)
@@ -131,10 +149,11 @@ module YNAB
131
149
  # @return [Hash] Returns the object in the form of hash
132
150
  def to_hash
133
151
  hash = {}
134
- self.class.attribute_map.each_pair do |attr, param|
152
+ # include attributes inherited from allOf parents (the nearest declaration wins)
153
+ self.class.acceptable_attribute_map.each_pair do |attr, param|
135
154
  value = self.send(attr)
136
155
  if value.nil?
137
- is_nullable = self.class.openapi_nullable.include?(attr)
156
+ is_nullable = self.class.acceptable_openapi_nullable.include?(attr)
138
157
  next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
139
158
  end
140
159
 
@@ -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
 
@@ -72,9 +72,14 @@ module YNAB
72
72
  }
73
73
  end
74
74
 
75
+ # Returns attribute mapping this model knows about
76
+ def self.acceptable_attribute_map
77
+ attribute_map
78
+ end
79
+
75
80
  # Returns all the JSON keys this model knows about
76
81
  def self.acceptable_attributes
77
- attribute_map.values
82
+ acceptable_attribute_map.values
78
83
  end
79
84
 
80
85
  # Attribute type mapping.
@@ -103,6 +108,16 @@ module YNAB
103
108
  ])
104
109
  end
105
110
 
111
+ # Returns attribute type mapping
112
+ def self.acceptable_openapi_types
113
+ openapi_types
114
+ end
115
+
116
+ # Returns the nullable attributes
117
+ def self.acceptable_openapi_nullable
118
+ openapi_nullable
119
+ end
120
+
106
121
  # Initializes the object
107
122
  # @param [Hash] attributes Model attributes in the form of hash
108
123
  def initialize(attributes = {})
@@ -111,9 +126,10 @@ module YNAB
111
126
  end
112
127
 
113
128
  # check to see if the attribute exists and convert string to symbol for hash key
129
+ acceptable_attribute_map = self.class.acceptable_attribute_map
114
130
  attributes = attributes.each_with_object({}) { |(k, v), h|
115
- if (!self.class.attribute_map.key?(k.to_sym))
116
- fail ArgumentError, "`#{k}` is not a valid attribute in `YNAB::SaveScheduledTransaction`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
131
+ if (!acceptable_attribute_map.key?(k.to_sym))
132
+ fail ArgumentError, "`#{k}` is not a valid attribute in `YNAB::SaveScheduledTransaction`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
117
133
  end
118
134
  h[k.to_sym] = v
119
135
  }
@@ -218,18 +234,20 @@ module YNAB
218
234
  def self.build_from_hash(attributes)
219
235
  return nil unless attributes.is_a?(Hash)
220
236
  attributes = attributes.transform_keys(&:to_sym)
237
+ # include attributes inherited from allOf parents (the nearest declaration wins)
238
+ map = acceptable_attribute_map
221
239
  transformed_hash = {}
222
- openapi_types.each_pair do |key, type|
223
- if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
240
+ acceptable_openapi_types.each_pair do |key, type|
241
+ if attributes.key?(map[key]) && attributes[map[key]].nil?
224
242
  transformed_hash["#{key}"] = nil
225
243
  elsif type =~ /\AArray<(.*)>/i
226
244
  # check to ensure the input is an array given that the attribute
227
245
  # is documented as an array but the input is not
228
- if attributes[attribute_map[key]].is_a?(Array)
229
- transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
246
+ if attributes[map[key]].is_a?(Array)
247
+ transformed_hash["#{key}"] = attributes[map[key]].map { |v| _deserialize($1, v) }
230
248
  end
231
- elsif !attributes[attribute_map[key]].nil?
232
- transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
249
+ elsif !attributes[map[key]].nil?
250
+ transformed_hash["#{key}"] = _deserialize(type, attributes[map[key]])
233
251
  end
234
252
  end
235
253
  new(transformed_hash)
@@ -239,10 +257,11 @@ module YNAB
239
257
  # @return [Hash] Returns the object in the form of hash
240
258
  def to_hash
241
259
  hash = {}
242
- self.class.attribute_map.each_pair do |attr, param|
260
+ # include attributes inherited from allOf parents (the nearest declaration wins)
261
+ self.class.acceptable_attribute_map.each_pair do |attr, param|
243
262
  value = self.send(attr)
244
263
  if value.nil?
245
- is_nullable = self.class.openapi_nullable.include?(attr)
264
+ is_nullable = self.class.acceptable_openapi_nullable.include?(attr)
246
265
  next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
247
266
  end
248
267
 
@@ -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.
@@ -63,6 +68,16 @@ module YNAB
63
68
  ])
64
69
  end
65
70
 
71
+ # Returns attribute type mapping
72
+ def self.acceptable_openapi_types
73
+ openapi_types
74
+ end
75
+
76
+ # Returns the nullable attributes
77
+ def self.acceptable_openapi_nullable
78
+ openapi_nullable
79
+ end
80
+
66
81
  # Initializes the object
67
82
  # @param [Hash] attributes Model attributes in the form of hash
68
83
  def initialize(attributes = {})
@@ -71,9 +86,10 @@ module YNAB
71
86
  end
72
87
 
73
88
  # check to see if the attribute exists and convert string to symbol for hash key
89
+ acceptable_attribute_map = self.class.acceptable_attribute_map
74
90
  attributes = attributes.each_with_object({}) { |(k, v), h|
75
- if (!self.class.attribute_map.key?(k.to_sym))
76
- fail ArgumentError, "`#{k}` is not a valid attribute in `YNAB::SaveSubTransaction`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
91
+ if (!acceptable_attribute_map.key?(k.to_sym))
92
+ fail ArgumentError, "`#{k}` is not a valid attribute in `YNAB::SaveSubTransaction`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
77
93
  end
78
94
  h[k.to_sym] = v
79
95
  }
@@ -157,18 +173,20 @@ module YNAB
157
173
  def self.build_from_hash(attributes)
158
174
  return nil unless attributes.is_a?(Hash)
159
175
  attributes = attributes.transform_keys(&:to_sym)
176
+ # include attributes inherited from allOf parents (the nearest declaration wins)
177
+ map = acceptable_attribute_map
160
178
  transformed_hash = {}
161
- openapi_types.each_pair do |key, type|
162
- if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
179
+ acceptable_openapi_types.each_pair do |key, type|
180
+ if attributes.key?(map[key]) && attributes[map[key]].nil?
163
181
  transformed_hash["#{key}"] = nil
164
182
  elsif type =~ /\AArray<(.*)>/i
165
183
  # check to ensure the input is an array given that the attribute
166
184
  # is documented as an array but the input is not
167
- if attributes[attribute_map[key]].is_a?(Array)
168
- transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
185
+ if attributes[map[key]].is_a?(Array)
186
+ transformed_hash["#{key}"] = attributes[map[key]].map { |v| _deserialize($1, v) }
169
187
  end
170
- elsif !attributes[attribute_map[key]].nil?
171
- transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
188
+ elsif !attributes[map[key]].nil?
189
+ transformed_hash["#{key}"] = _deserialize(type, attributes[map[key]])
172
190
  end
173
191
  end
174
192
  new(transformed_hash)
@@ -178,10 +196,11 @@ module YNAB
178
196
  # @return [Hash] Returns the object in the form of hash
179
197
  def to_hash
180
198
  hash = {}
181
- self.class.attribute_map.each_pair do |attr, param|
199
+ # include attributes inherited from allOf parents (the nearest declaration wins)
200
+ self.class.acceptable_attribute_map.each_pair do |attr, param|
182
201
  value = self.send(attr)
183
202
  if value.nil?
184
- is_nullable = self.class.openapi_nullable.include?(attr)
203
+ is_nullable = self.class.acceptable_openapi_nullable.include?(attr)
185
204
  next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
186
205
  end
187
206
 
@@ -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
 
@@ -38,7 +38,7 @@ module YNAB
38
38
 
39
39
  attr_accessor :flag_color
40
40
 
41
- # An array of subtransactions to configure a transaction as a split. Updating `subtransactions` on an existing split transaction is not supported.
41
+ # An array of subtransactions to configure a transaction as a split. Updating `subtransactions` on an existing split transaction is not supported and will return an error. Splits are not allowed on tracking accounts or on transfers between on-budget accounts; a transfer to a tracking account can be a split.
42
42
  attr_accessor :subtransactions
43
43
 
44
44
  # If specified, this id will be used to lookup a transaction by its `id` for the purpose of updating the transaction itself. If not specified, an `import_id` should be supplied.
@@ -88,9 +88,14 @@ module YNAB
88
88
  }
89
89
  end
90
90
 
91
+ # Returns attribute mapping this model knows about
92
+ def self.acceptable_attribute_map
93
+ attribute_map
94
+ end
95
+
91
96
  # Returns all the JSON keys this model knows about
92
97
  def self.acceptable_attributes
93
- attribute_map.values
98
+ acceptable_attribute_map.values
94
99
  end
95
100
 
96
101
  # Attribute type mapping.
@@ -115,12 +120,26 @@ module YNAB
115
120
  # List of attributes with nullable: true
116
121
  def self.openapi_nullable
117
122
  Set.new([
123
+ :'payee_id',
124
+ :'payee_name',
125
+ :'category_id',
126
+ :'memo',
118
127
  :'flag_color',
119
128
  :'id',
120
129
  :'import_id'
121
130
  ])
122
131
  end
123
132
 
133
+ # Returns attribute type mapping
134
+ def self.acceptable_openapi_types
135
+ openapi_types
136
+ end
137
+
138
+ # Returns the nullable attributes
139
+ def self.acceptable_openapi_nullable
140
+ openapi_nullable
141
+ end
142
+
124
143
  # List of class defined in allOf (OpenAPI v3)
125
144
  def self.openapi_all_of
126
145
  [
@@ -136,9 +155,10 @@ module YNAB
136
155
  end
137
156
 
138
157
  # check to see if the attribute exists and convert string to symbol for hash key
158
+ acceptable_attribute_map = self.class.acceptable_attribute_map
139
159
  attributes = attributes.each_with_object({}) { |(k, v), h|
140
- if (!self.class.attribute_map.key?(k.to_sym))
141
- fail ArgumentError, "`#{k}` is not a valid attribute in `YNAB::SaveTransactionWithIdOrImportId`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
160
+ if (!acceptable_attribute_map.key?(k.to_sym))
161
+ fail ArgumentError, "`#{k}` is not a valid attribute in `YNAB::SaveTransactionWithIdOrImportId`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
142
162
  end
143
163
  h[k.to_sym] = v
144
164
  }
@@ -270,18 +290,20 @@ module YNAB
270
290
  def self.build_from_hash(attributes)
271
291
  return nil unless attributes.is_a?(Hash)
272
292
  attributes = attributes.transform_keys(&:to_sym)
293
+ # include attributes inherited from allOf parents (the nearest declaration wins)
294
+ map = acceptable_attribute_map
273
295
  transformed_hash = {}
274
- openapi_types.each_pair do |key, type|
275
- if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
296
+ acceptable_openapi_types.each_pair do |key, type|
297
+ if attributes.key?(map[key]) && attributes[map[key]].nil?
276
298
  transformed_hash["#{key}"] = nil
277
299
  elsif type =~ /\AArray<(.*)>/i
278
300
  # check to ensure the input is an array given that the attribute
279
301
  # is documented as an array but the input is not
280
- if attributes[attribute_map[key]].is_a?(Array)
281
- transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
302
+ if attributes[map[key]].is_a?(Array)
303
+ transformed_hash["#{key}"] = attributes[map[key]].map { |v| _deserialize($1, v) }
282
304
  end
283
- elsif !attributes[attribute_map[key]].nil?
284
- transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
305
+ elsif !attributes[map[key]].nil?
306
+ transformed_hash["#{key}"] = _deserialize(type, attributes[map[key]])
285
307
  end
286
308
  end
287
309
  new(transformed_hash)
@@ -291,10 +313,11 @@ module YNAB
291
313
  # @return [Hash] Returns the object in the form of hash
292
314
  def to_hash
293
315
  hash = {}
294
- self.class.attribute_map.each_pair do |attr, param|
316
+ # include attributes inherited from allOf parents (the nearest declaration wins)
317
+ self.class.acceptable_attribute_map.each_pair do |attr, param|
295
318
  value = self.send(attr)
296
319
  if value.nil?
297
- is_nullable = self.class.openapi_nullable.include?(attr)
320
+ is_nullable = self.class.acceptable_openapi_nullable.include?(attr)
298
321
  next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
299
322
  end
300
323
 
@@ -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
 
@@ -38,7 +38,7 @@ module YNAB
38
38
 
39
39
  attr_accessor :flag_color
40
40
 
41
- # An array of subtransactions to configure a transaction as a split. Updating `subtransactions` on an existing split transaction is not supported.
41
+ # An array of subtransactions to configure a transaction as a split. Updating `subtransactions` on an existing split transaction is not supported and will return an error. Splits are not allowed on tracking accounts or on transfers between on-budget accounts; a transfer to a tracking account can be a split.
42
42
  attr_accessor :subtransactions
43
43
 
44
44
  class EnumAttributeValidator
@@ -80,9 +80,14 @@ module YNAB
80
80
  }
81
81
  end
82
82
 
83
+ # Returns attribute mapping this model knows about
84
+ def self.acceptable_attribute_map
85
+ attribute_map
86
+ end
87
+
83
88
  # Returns all the JSON keys this model knows about
84
89
  def self.acceptable_attributes
85
- attribute_map.values
90
+ acceptable_attribute_map.values
86
91
  end
87
92
 
88
93
  # Attribute type mapping.
@@ -113,6 +118,16 @@ module YNAB
113
118
  ])
114
119
  end
115
120
 
121
+ # Returns attribute type mapping
122
+ def self.acceptable_openapi_types
123
+ openapi_types
124
+ end
125
+
126
+ # Returns the nullable attributes
127
+ def self.acceptable_openapi_nullable
128
+ openapi_nullable
129
+ end
130
+
116
131
  # Initializes the object
117
132
  # @param [Hash] attributes Model attributes in the form of hash
118
133
  def initialize(attributes = {})
@@ -121,9 +136,10 @@ module YNAB
121
136
  end
122
137
 
123
138
  # check to see if the attribute exists and convert string to symbol for hash key
139
+ acceptable_attribute_map = self.class.acceptable_attribute_map
124
140
  attributes = attributes.each_with_object({}) { |(k, v), h|
125
- if (!self.class.attribute_map.key?(k.to_sym))
126
- fail ArgumentError, "`#{k}` is not a valid attribute in `YNAB::SaveTransactionWithOptionalFields`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
141
+ if (!acceptable_attribute_map.key?(k.to_sym))
142
+ fail ArgumentError, "`#{k}` is not a valid attribute in `YNAB::SaveTransactionWithOptionalFields`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
127
143
  end
128
144
  h[k.to_sym] = v
129
145
  }
@@ -238,18 +254,20 @@ module YNAB
238
254
  def self.build_from_hash(attributes)
239
255
  return nil unless attributes.is_a?(Hash)
240
256
  attributes = attributes.transform_keys(&:to_sym)
257
+ # include attributes inherited from allOf parents (the nearest declaration wins)
258
+ map = acceptable_attribute_map
241
259
  transformed_hash = {}
242
- openapi_types.each_pair do |key, type|
243
- if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
260
+ acceptable_openapi_types.each_pair do |key, type|
261
+ if attributes.key?(map[key]) && attributes[map[key]].nil?
244
262
  transformed_hash["#{key}"] = nil
245
263
  elsif type =~ /\AArray<(.*)>/i
246
264
  # check to ensure the input is an array given that the attribute
247
265
  # is documented as an array but the input is not
248
- if attributes[attribute_map[key]].is_a?(Array)
249
- transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
266
+ if attributes[map[key]].is_a?(Array)
267
+ transformed_hash["#{key}"] = attributes[map[key]].map { |v| _deserialize($1, v) }
250
268
  end
251
- elsif !attributes[attribute_map[key]].nil?
252
- transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
269
+ elsif !attributes[map[key]].nil?
270
+ transformed_hash["#{key}"] = _deserialize(type, attributes[map[key]])
253
271
  end
254
272
  end
255
273
  new(transformed_hash)
@@ -259,10 +277,11 @@ module YNAB
259
277
  # @return [Hash] Returns the object in the form of hash
260
278
  def to_hash
261
279
  hash = {}
262
- self.class.attribute_map.each_pair do |attr, param|
280
+ # include attributes inherited from allOf parents (the nearest declaration wins)
281
+ self.class.acceptable_attribute_map.each_pair do |attr, param|
263
282
  value = self.send(attr)
264
283
  if value.nil?
265
- is_nullable = self.class.openapi_nullable.include?(attr)
284
+ is_nullable = self.class.acceptable_openapi_nullable.include?(attr)
266
285
  next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
267
286
  end
268
287
 
@@ -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::SaveTransactionsResponse`. 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::SaveTransactionsResponse`. 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