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
 
@@ -36,9 +36,14 @@ module YNAB
36
36
  }
37
37
  end
38
38
 
39
+ # Returns attribute mapping this model knows about
40
+ def self.acceptable_attribute_map
41
+ attribute_map
42
+ end
43
+
39
44
  # Returns all the JSON keys this model knows about
40
45
  def self.acceptable_attributes
41
- attribute_map.values
46
+ acceptable_attribute_map.values
42
47
  end
43
48
 
44
49
  # Attribute type mapping.
@@ -58,6 +63,16 @@ module YNAB
58
63
  ])
59
64
  end
60
65
 
66
+ # Returns attribute type mapping
67
+ def self.acceptable_openapi_types
68
+ openapi_types
69
+ end
70
+
71
+ # Returns the nullable attributes
72
+ def self.acceptable_openapi_nullable
73
+ openapi_nullable
74
+ end
75
+
61
76
  # Initializes the object
62
77
  # @param [Hash] attributes Model attributes in the form of hash
63
78
  def initialize(attributes = {})
@@ -66,9 +81,10 @@ module YNAB
66
81
  end
67
82
 
68
83
  # check to see if the attribute exists and convert string to symbol for hash key
84
+ acceptable_attribute_map = self.class.acceptable_attribute_map
69
85
  attributes = attributes.each_with_object({}) { |(k, v), h|
70
- if (!self.class.attribute_map.key?(k.to_sym))
71
- fail ArgumentError, "`#{k}` is not a valid attribute in `YNAB::CategoryGroup`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
86
+ if (!acceptable_attribute_map.key?(k.to_sym))
87
+ fail ArgumentError, "`#{k}` is not a valid attribute in `YNAB::CategoryGroup`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
72
88
  end
73
89
  h[k.to_sym] = v
74
90
  }
@@ -142,18 +158,20 @@ module YNAB
142
158
  def self.build_from_hash(attributes)
143
159
  return nil unless attributes.is_a?(Hash)
144
160
  attributes = attributes.transform_keys(&:to_sym)
161
+ # include attributes inherited from allOf parents (the nearest declaration wins)
162
+ map = acceptable_attribute_map
145
163
  transformed_hash = {}
146
- openapi_types.each_pair do |key, type|
147
- if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
164
+ acceptable_openapi_types.each_pair do |key, type|
165
+ if attributes.key?(map[key]) && attributes[map[key]].nil?
148
166
  transformed_hash["#{key}"] = nil
149
167
  elsif type =~ /\AArray<(.*)>/i
150
168
  # check to ensure the input is an array given that the attribute
151
169
  # is documented as an array but the input is not
152
- if attributes[attribute_map[key]].is_a?(Array)
153
- transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
170
+ if attributes[map[key]].is_a?(Array)
171
+ transformed_hash["#{key}"] = attributes[map[key]].map { |v| _deserialize($1, v) }
154
172
  end
155
- elsif !attributes[attribute_map[key]].nil?
156
- transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
173
+ elsif !attributes[map[key]].nil?
174
+ transformed_hash["#{key}"] = _deserialize(type, attributes[map[key]])
157
175
  end
158
176
  end
159
177
  new(transformed_hash)
@@ -163,10 +181,11 @@ module YNAB
163
181
  # @return [Hash] Returns the object in the form of hash
164
182
  def to_hash
165
183
  hash = {}
166
- self.class.attribute_map.each_pair do |attr, param|
184
+ # include attributes inherited from allOf parents (the nearest declaration wins)
185
+ self.class.acceptable_attribute_map.each_pair do |attr, param|
167
186
  value = self.send(attr)
168
187
  if value.nil?
169
- is_nullable = self.class.openapi_nullable.include?(attr)
188
+ is_nullable = self.class.acceptable_openapi_nullable.include?(attr)
170
189
  next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
171
190
  end
172
191
 
@@ -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
 
@@ -40,9 +40,14 @@ module YNAB
40
40
  }
41
41
  end
42
42
 
43
+ # Returns attribute mapping this model knows about
44
+ def self.acceptable_attribute_map
45
+ attribute_map
46
+ end
47
+
43
48
  # Returns all the JSON keys this model knows about
44
49
  def self.acceptable_attributes
45
- attribute_map.values
50
+ acceptable_attribute_map.values
46
51
  end
47
52
 
48
53
  # 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
  # List of class defined in allOf (OpenAPI v3)
67
82
  def self.openapi_all_of
68
83
  [
@@ -78,9 +93,10 @@ module YNAB
78
93
  end
79
94
 
80
95
  # check to see if the attribute exists and convert string to symbol for hash key
96
+ acceptable_attribute_map = self.class.acceptable_attribute_map
81
97
  attributes = attributes.each_with_object({}) { |(k, v), h|
82
- if (!self.class.attribute_map.key?(k.to_sym))
83
- fail ArgumentError, "`#{k}` is not a valid attribute in `YNAB::CategoryGroupWithCategories`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
98
+ if (!acceptable_attribute_map.key?(k.to_sym))
99
+ fail ArgumentError, "`#{k}` is not a valid attribute in `YNAB::CategoryGroupWithCategories`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
84
100
  end
85
101
  h[k.to_sym] = v
86
102
  }
@@ -162,18 +178,20 @@ module YNAB
162
178
  def self.build_from_hash(attributes)
163
179
  return nil unless attributes.is_a?(Hash)
164
180
  attributes = attributes.transform_keys(&:to_sym)
181
+ # include attributes inherited from allOf parents (the nearest declaration wins)
182
+ map = acceptable_attribute_map
165
183
  transformed_hash = {}
166
- openapi_types.each_pair do |key, type|
167
- if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
184
+ acceptable_openapi_types.each_pair do |key, type|
185
+ if attributes.key?(map[key]) && attributes[map[key]].nil?
168
186
  transformed_hash["#{key}"] = nil
169
187
  elsif type =~ /\AArray<(.*)>/i
170
188
  # check to ensure the input is an array given that the attribute
171
189
  # is documented as an array but the input is not
172
- if attributes[attribute_map[key]].is_a?(Array)
173
- transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
190
+ if attributes[map[key]].is_a?(Array)
191
+ transformed_hash["#{key}"] = attributes[map[key]].map { |v| _deserialize($1, v) }
174
192
  end
175
- elsif !attributes[attribute_map[key]].nil?
176
- transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
193
+ elsif !attributes[map[key]].nil?
194
+ transformed_hash["#{key}"] = _deserialize(type, attributes[map[key]])
177
195
  end
178
196
  end
179
197
  new(transformed_hash)
@@ -183,10 +201,11 @@ module YNAB
183
201
  # @return [Hash] Returns the object in the form of hash
184
202
  def to_hash
185
203
  hash = {}
186
- self.class.attribute_map.each_pair do |attr, param|
204
+ # include attributes inherited from allOf parents (the nearest declaration wins)
205
+ self.class.acceptable_attribute_map.each_pair do |attr, param|
187
206
  value = self.send(attr)
188
207
  if value.nil?
189
- is_nullable = self.class.openapi_nullable.include?(attr)
208
+ is_nullable = self.class.acceptable_openapi_nullable.include?(attr)
190
209
  next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
191
210
  end
192
211
 
@@ -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::CategoryResponse`. 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::CategoryResponse`. 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::CategoryResponseData`. 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::CategoryResponseData`. 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
 
@@ -43,9 +43,14 @@ module YNAB
43
43
  }
44
44
  end
45
45
 
46
+ # Returns attribute mapping this model knows about
47
+ def self.acceptable_attribute_map
48
+ attribute_map
49
+ end
50
+
46
51
  # Returns all the JSON keys this model knows about
47
52
  def self.acceptable_attributes
48
- attribute_map.values
53
+ acceptable_attribute_map.values
49
54
  end
50
55
 
51
56
  # Attribute type mapping.
@@ -68,6 +73,16 @@ module YNAB
68
73
  ])
69
74
  end
70
75
 
76
+ # Returns attribute type mapping
77
+ def self.acceptable_openapi_types
78
+ openapi_types
79
+ end
80
+
81
+ # Returns the nullable attributes
82
+ def self.acceptable_openapi_nullable
83
+ openapi_nullable
84
+ end
85
+
71
86
  # Initializes the object
72
87
  # @param [Hash] attributes Model attributes in the form of hash
73
88
  def initialize(attributes = {})
@@ -76,9 +91,10 @@ module YNAB
76
91
  end
77
92
 
78
93
  # check to see if the attribute exists and convert string to symbol for hash key
94
+ acceptable_attribute_map = self.class.acceptable_attribute_map
79
95
  attributes = attributes.each_with_object({}) { |(k, v), h|
80
- if (!self.class.attribute_map.key?(k.to_sym))
81
- fail ArgumentError, "`#{k}` is not a valid attribute in `YNAB::CurrencyFormat`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
96
+ if (!acceptable_attribute_map.key?(k.to_sym))
97
+ fail ArgumentError, "`#{k}` is not a valid attribute in `YNAB::CurrencyFormat`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
82
98
  end
83
99
  h[k.to_sym] = v
84
100
  }
@@ -170,18 +186,20 @@ module YNAB
170
186
  def self.build_from_hash(attributes)
171
187
  return nil unless attributes.is_a?(Hash)
172
188
  attributes = attributes.transform_keys(&:to_sym)
189
+ # include attributes inherited from allOf parents (the nearest declaration wins)
190
+ map = acceptable_attribute_map
173
191
  transformed_hash = {}
174
- openapi_types.each_pair do |key, type|
175
- if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
192
+ acceptable_openapi_types.each_pair do |key, type|
193
+ if attributes.key?(map[key]) && attributes[map[key]].nil?
176
194
  transformed_hash["#{key}"] = nil
177
195
  elsif type =~ /\AArray<(.*)>/i
178
196
  # check to ensure the input is an array given that the attribute
179
197
  # is documented as an array but the input is not
180
- if attributes[attribute_map[key]].is_a?(Array)
181
- transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
198
+ if attributes[map[key]].is_a?(Array)
199
+ transformed_hash["#{key}"] = attributes[map[key]].map { |v| _deserialize($1, v) }
182
200
  end
183
- elsif !attributes[attribute_map[key]].nil?
184
- transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
201
+ elsif !attributes[map[key]].nil?
202
+ transformed_hash["#{key}"] = _deserialize(type, attributes[map[key]])
185
203
  end
186
204
  end
187
205
  new(transformed_hash)
@@ -191,10 +209,11 @@ module YNAB
191
209
  # @return [Hash] Returns the object in the form of hash
192
210
  def to_hash
193
211
  hash = {}
194
- self.class.attribute_map.each_pair do |attr, param|
212
+ # include attributes inherited from allOf parents (the nearest declaration wins)
213
+ self.class.acceptable_attribute_map.each_pair do |attr, param|
195
214
  value = self.send(attr)
196
215
  if value.nil?
197
- is_nullable = self.class.openapi_nullable.include?(attr)
216
+ is_nullable = self.class.acceptable_openapi_nullable.include?(attr)
198
217
  next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
199
218
  end
200
219
 
@@ -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
 
@@ -22,9 +22,14 @@ module YNAB
22
22
  }
23
23
  end
24
24
 
25
+ # Returns attribute mapping this model knows about
26
+ def self.acceptable_attribute_map
27
+ attribute_map
28
+ end
29
+
25
30
  # Returns all the JSON keys this model knows about
26
31
  def self.acceptable_attributes
27
- attribute_map.values
32
+ acceptable_attribute_map.values
28
33
  end
29
34
 
30
35
  # Attribute type mapping.
@@ -40,6 +45,16 @@ module YNAB
40
45
  ])
41
46
  end
42
47
 
48
+ # Returns attribute type mapping
49
+ def self.acceptable_openapi_types
50
+ openapi_types
51
+ end
52
+
53
+ # Returns the nullable attributes
54
+ def self.acceptable_openapi_nullable
55
+ openapi_nullable
56
+ end
57
+
43
58
  # Initializes the object
44
59
  # @param [Hash] attributes Model attributes in the form of hash
45
60
  def initialize(attributes = {})
@@ -48,9 +63,10 @@ module YNAB
48
63
  end
49
64
 
50
65
  # check to see if the attribute exists and convert string to symbol for hash key
66
+ acceptable_attribute_map = self.class.acceptable_attribute_map
51
67
  attributes = attributes.each_with_object({}) { |(k, v), h|
52
- if (!self.class.attribute_map.key?(k.to_sym))
53
- fail ArgumentError, "`#{k}` is not a valid attribute in `YNAB::DateFormat`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
68
+ if (!acceptable_attribute_map.key?(k.to_sym))
69
+ fail ArgumentError, "`#{k}` is not a valid attribute in `YNAB::DateFormat`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
54
70
  end
55
71
  h[k.to_sym] = v
56
72
  }
@@ -100,18 +116,20 @@ module YNAB
100
116
  def self.build_from_hash(attributes)
101
117
  return nil unless attributes.is_a?(Hash)
102
118
  attributes = attributes.transform_keys(&:to_sym)
119
+ # include attributes inherited from allOf parents (the nearest declaration wins)
120
+ map = acceptable_attribute_map
103
121
  transformed_hash = {}
104
- openapi_types.each_pair do |key, type|
105
- if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
122
+ acceptable_openapi_types.each_pair do |key, type|
123
+ if attributes.key?(map[key]) && attributes[map[key]].nil?
106
124
  transformed_hash["#{key}"] = nil
107
125
  elsif type =~ /\AArray<(.*)>/i
108
126
  # check to ensure the input is an array given that the attribute
109
127
  # is documented as an array but the input is not
110
- if attributes[attribute_map[key]].is_a?(Array)
111
- transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
128
+ if attributes[map[key]].is_a?(Array)
129
+ transformed_hash["#{key}"] = attributes[map[key]].map { |v| _deserialize($1, v) }
112
130
  end
113
- elsif !attributes[attribute_map[key]].nil?
114
- transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
131
+ elsif !attributes[map[key]].nil?
132
+ transformed_hash["#{key}"] = _deserialize(type, attributes[map[key]])
115
133
  end
116
134
  end
117
135
  new(transformed_hash)
@@ -121,10 +139,11 @@ module YNAB
121
139
  # @return [Hash] Returns the object in the form of hash
122
140
  def to_hash
123
141
  hash = {}
124
- self.class.attribute_map.each_pair do |attr, param|
142
+ # include attributes inherited from allOf parents (the nearest declaration wins)
143
+ self.class.acceptable_attribute_map.each_pair do |attr, param|
125
144
  value = self.send(attr)
126
145
  if value.nil?
127
- is_nullable = self.class.openapi_nullable.include?(attr)
146
+ is_nullable = self.class.acceptable_openapi_nullable.include?(attr)
128
147
  next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
129
148
  end
130
149
 
@@ -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
 
@@ -27,9 +27,14 @@ module YNAB
27
27
  }
28
28
  end
29
29
 
30
+ # Returns attribute mapping this model knows about
31
+ def self.acceptable_attribute_map
32
+ attribute_map
33
+ end
34
+
30
35
  # Returns all the JSON keys this model knows about
31
36
  def self.acceptable_attributes
32
- attribute_map.values
37
+ acceptable_attribute_map.values
33
38
  end
34
39
 
35
40
  # Attribute type mapping.
@@ -47,6 +52,16 @@ module YNAB
47
52
  ])
48
53
  end
49
54
 
55
+ # Returns attribute type mapping
56
+ def self.acceptable_openapi_types
57
+ openapi_types
58
+ end
59
+
60
+ # Returns the nullable attributes
61
+ def self.acceptable_openapi_nullable
62
+ openapi_nullable
63
+ end
64
+
50
65
  # Initializes the object
51
66
  # @param [Hash] attributes Model attributes in the form of hash
52
67
  def initialize(attributes = {})
@@ -55,9 +70,10 @@ module YNAB
55
70
  end
56
71
 
57
72
  # check to see if the attribute exists and convert string to symbol for hash key
73
+ acceptable_attribute_map = self.class.acceptable_attribute_map
58
74
  attributes = attributes.each_with_object({}) { |(k, v), h|
59
- if (!self.class.attribute_map.key?(k.to_sym))
60
- fail ArgumentError, "`#{k}` is not a valid attribute in `YNAB::ErrorDetail`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
75
+ if (!acceptable_attribute_map.key?(k.to_sym))
76
+ fail ArgumentError, "`#{k}` is not a valid attribute in `YNAB::ErrorDetail`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
61
77
  end
62
78
  h[k.to_sym] = v
63
79
  }
@@ -119,18 +135,20 @@ module YNAB
119
135
  def self.build_from_hash(attributes)
120
136
  return nil unless attributes.is_a?(Hash)
121
137
  attributes = attributes.transform_keys(&:to_sym)
138
+ # include attributes inherited from allOf parents (the nearest declaration wins)
139
+ map = acceptable_attribute_map
122
140
  transformed_hash = {}
123
- openapi_types.each_pair do |key, type|
124
- if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
141
+ acceptable_openapi_types.each_pair do |key, type|
142
+ if attributes.key?(map[key]) && attributes[map[key]].nil?
125
143
  transformed_hash["#{key}"] = nil
126
144
  elsif type =~ /\AArray<(.*)>/i
127
145
  # check to ensure the input is an array given that the attribute
128
146
  # is documented as an array but the input is not
129
- if attributes[attribute_map[key]].is_a?(Array)
130
- transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
147
+ if attributes[map[key]].is_a?(Array)
148
+ transformed_hash["#{key}"] = attributes[map[key]].map { |v| _deserialize($1, v) }
131
149
  end
132
- elsif !attributes[attribute_map[key]].nil?
133
- transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
150
+ elsif !attributes[map[key]].nil?
151
+ transformed_hash["#{key}"] = _deserialize(type, attributes[map[key]])
134
152
  end
135
153
  end
136
154
  new(transformed_hash)
@@ -140,10 +158,11 @@ module YNAB
140
158
  # @return [Hash] Returns the object in the form of hash
141
159
  def to_hash
142
160
  hash = {}
143
- self.class.attribute_map.each_pair do |attr, param|
161
+ # include attributes inherited from allOf parents (the nearest declaration wins)
162
+ self.class.acceptable_attribute_map.each_pair do |attr, param|
144
163
  value = self.send(attr)
145
164
  if value.nil?
146
- is_nullable = self.class.openapi_nullable.include?(attr)
165
+ is_nullable = self.class.acceptable_openapi_nullable.include?(attr)
147
166
  next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
148
167
  end
149
168