|
14 | 14 |
|
15 | 15 | import java.util.Objects; |
16 | 16 | import java.util.Locale; |
17 | | -import ai.reveng.model.SearchBinaryIds; |
18 | | -import ai.reveng.model.SearchFunctionIds; |
19 | 17 | import com.google.gson.TypeAdapter; |
20 | 18 | import com.google.gson.annotations.JsonAdapter; |
21 | 19 | import com.google.gson.annotations.SerializedName; |
|
26 | 24 | import java.util.ArrayList; |
27 | 25 | import java.util.Arrays; |
28 | 26 | import java.util.List; |
| 27 | +import org.openapitools.jackson.nullable.JsonNullable; |
29 | 28 |
|
30 | 29 | import com.google.gson.Gson; |
31 | 30 | import com.google.gson.GsonBuilder; |
@@ -79,12 +78,12 @@ public class AppApiRestV2SimilaritySchemaANNFunction { |
79 | 78 | public static final String SERIALIZED_NAME_SEARCH_BINARY_IDS = "search_binary_ids"; |
80 | 79 | @SerializedName(SERIALIZED_NAME_SEARCH_BINARY_IDS) |
81 | 80 | @javax.annotation.Nullable |
82 | | - private SearchBinaryIds searchBinaryIds; |
| 81 | + private List<Integer> searchBinaryIds; |
83 | 82 |
|
84 | 83 | public static final String SERIALIZED_NAME_SEARCH_FUNCTION_IDS = "search_function_ids"; |
85 | 84 | @SerializedName(SERIALIZED_NAME_SEARCH_FUNCTION_IDS) |
86 | 85 | @javax.annotation.Nullable |
87 | | - private SearchFunctionIds searchFunctionIds; |
| 86 | + private List<Integer> searchFunctionIds; |
88 | 87 |
|
89 | 88 | public static final String SERIALIZED_NAME_DEBUG_ONLY = "debug_only"; |
90 | 89 | @SerializedName(SERIALIZED_NAME_DEBUG_ONLY) |
@@ -186,40 +185,56 @@ public void setCollectionSearchIds(@javax.annotation.Nullable List<Integer> coll |
186 | 185 | } |
187 | 186 |
|
188 | 187 |
|
189 | | - public AppApiRestV2SimilaritySchemaANNFunction searchBinaryIds(@javax.annotation.Nullable SearchBinaryIds searchBinaryIds) { |
| 188 | + public AppApiRestV2SimilaritySchemaANNFunction searchBinaryIds(@javax.annotation.Nullable List<Integer> searchBinaryIds) { |
190 | 189 | this.searchBinaryIds = searchBinaryIds; |
191 | 190 | return this; |
192 | 191 | } |
193 | 192 |
|
| 193 | + public AppApiRestV2SimilaritySchemaANNFunction addSearchBinaryIdsItem(Integer searchBinaryIdsItem) { |
| 194 | + if (this.searchBinaryIds == null) { |
| 195 | + this.searchBinaryIds = new ArrayList<>(); |
| 196 | + } |
| 197 | + this.searchBinaryIds.add(searchBinaryIdsItem); |
| 198 | + return this; |
| 199 | + } |
| 200 | + |
194 | 201 | /** |
195 | 202 | * Get searchBinaryIds |
196 | 203 | * @return searchBinaryIds |
197 | 204 | */ |
198 | 205 | @javax.annotation.Nullable |
199 | | - public SearchBinaryIds getSearchBinaryIds() { |
| 206 | + public List<Integer> getSearchBinaryIds() { |
200 | 207 | return searchBinaryIds; |
201 | 208 | } |
202 | 209 |
|
203 | | - public void setSearchBinaryIds(@javax.annotation.Nullable SearchBinaryIds searchBinaryIds) { |
| 210 | + public void setSearchBinaryIds(@javax.annotation.Nullable List<Integer> searchBinaryIds) { |
204 | 211 | this.searchBinaryIds = searchBinaryIds; |
205 | 212 | } |
206 | 213 |
|
207 | 214 |
|
208 | | - public AppApiRestV2SimilaritySchemaANNFunction searchFunctionIds(@javax.annotation.Nullable SearchFunctionIds searchFunctionIds) { |
| 215 | + public AppApiRestV2SimilaritySchemaANNFunction searchFunctionIds(@javax.annotation.Nullable List<Integer> searchFunctionIds) { |
209 | 216 | this.searchFunctionIds = searchFunctionIds; |
210 | 217 | return this; |
211 | 218 | } |
212 | 219 |
|
| 220 | + public AppApiRestV2SimilaritySchemaANNFunction addSearchFunctionIdsItem(Integer searchFunctionIdsItem) { |
| 221 | + if (this.searchFunctionIds == null) { |
| 222 | + this.searchFunctionIds = new ArrayList<>(); |
| 223 | + } |
| 224 | + this.searchFunctionIds.add(searchFunctionIdsItem); |
| 225 | + return this; |
| 226 | + } |
| 227 | + |
213 | 228 | /** |
214 | 229 | * Get searchFunctionIds |
215 | 230 | * @return searchFunctionIds |
216 | 231 | */ |
217 | 232 | @javax.annotation.Nullable |
218 | | - public SearchFunctionIds getSearchFunctionIds() { |
| 233 | + public List<Integer> getSearchFunctionIds() { |
219 | 234 | return searchFunctionIds; |
220 | 235 | } |
221 | 236 |
|
222 | | - public void setSearchFunctionIds(@javax.annotation.Nullable SearchFunctionIds searchFunctionIds) { |
| 237 | + public void setSearchFunctionIds(@javax.annotation.Nullable List<Integer> searchFunctionIds) { |
223 | 238 | this.searchFunctionIds = searchFunctionIds; |
224 | 239 | } |
225 | 240 |
|
@@ -307,11 +322,22 @@ public boolean equals(Object o) { |
307 | 322 | Objects.equals(this.additionalProperties, appApiRestV2SimilaritySchemaANNFunction.additionalProperties); |
308 | 323 | } |
309 | 324 |
|
| 325 | + private static <T> boolean equalsNullable(JsonNullable<T> a, JsonNullable<T> b) { |
| 326 | + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); |
| 327 | + } |
| 328 | + |
310 | 329 | @Override |
311 | 330 | public int hashCode() { |
312 | 331 | return Objects.hash(limit, distance, analysisSearchIds, collectionSearchIds, searchBinaryIds, searchFunctionIds, debugOnly, additionalProperties); |
313 | 332 | } |
314 | 333 |
|
| 334 | + private static <T> int hashCodeNullable(JsonNullable<T> a) { |
| 335 | + if (a == null) { |
| 336 | + return 1; |
| 337 | + } |
| 338 | + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; |
| 339 | + } |
| 340 | + |
315 | 341 | @Override |
316 | 342 | public String toString() { |
317 | 343 | StringBuilder sb = new StringBuilder(); |
@@ -372,13 +398,13 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti |
372 | 398 | if (jsonObj.get("collection_search_ids") != null && !jsonObj.get("collection_search_ids").isJsonNull() && !jsonObj.get("collection_search_ids").isJsonArray()) { |
373 | 399 | throw new IllegalArgumentException(String.format(Locale.ROOT, "Expected the field `collection_search_ids` to be an array in the JSON string but got `%s`", jsonObj.get("collection_search_ids").toString())); |
374 | 400 | } |
375 | | - // validate the optional field `search_binary_ids` |
376 | | - if (jsonObj.get("search_binary_ids") != null && !jsonObj.get("search_binary_ids").isJsonNull()) { |
377 | | - SearchBinaryIds.validateJsonElement(jsonObj.get("search_binary_ids")); |
| 401 | + // ensure the optional json data is an array if present |
| 402 | + if (jsonObj.get("search_binary_ids") != null && !jsonObj.get("search_binary_ids").isJsonNull() && !jsonObj.get("search_binary_ids").isJsonArray()) { |
| 403 | + throw new IllegalArgumentException(String.format(Locale.ROOT, "Expected the field `search_binary_ids` to be an array in the JSON string but got `%s`", jsonObj.get("search_binary_ids").toString())); |
378 | 404 | } |
379 | | - // validate the optional field `search_function_ids` |
380 | | - if (jsonObj.get("search_function_ids") != null && !jsonObj.get("search_function_ids").isJsonNull()) { |
381 | | - SearchFunctionIds.validateJsonElement(jsonObj.get("search_function_ids")); |
| 405 | + // ensure the optional json data is an array if present |
| 406 | + if (jsonObj.get("search_function_ids") != null && !jsonObj.get("search_function_ids").isJsonNull() && !jsonObj.get("search_function_ids").isJsonArray()) { |
| 407 | + throw new IllegalArgumentException(String.format(Locale.ROOT, "Expected the field `search_function_ids` to be an array in the JSON string but got `%s`", jsonObj.get("search_function_ids").toString())); |
382 | 408 | } |
383 | 409 | } |
384 | 410 |
|
|
0 commit comments