ynab 2.0.0 → 3.0.0

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