From 438c7539e696fd1db1e93cecf26b8a7c4dd8731e Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Wed, 11 Mar 2026 07:16:51 +0000 Subject: [PATCH 1/2] Update SDK to version v3.34.0 - Generated from OpenAPI spec version v3.34.0 - Auto-generated by GitHub Actions --- .sdk-version | 2 +- README.md | 6 +- build.gradle | 4 +- build.sbt | 2 +- ...ponseListCalleesCallerFunctionsResponse.md | 17 + docs/FunctionMatchingFilters.md | 1 + docs/FunctionsCoreApi.md | 69 +++ pom.xml | 2 +- .../java/ai/reveng/api/FunctionsCoreApi.java | 135 ++++++ .../java/ai/reveng/invoker/ApiClient.java | 2 +- .../java/ai/reveng/invoker/Configuration.java | 2 +- src/main/java/ai/reveng/invoker/JSON.java | 1 + ...nseListCalleesCallerFunctionsResponse.java | 456 ++++++++++++++++++ .../reveng/model/FunctionMatchingFilters.java | 42 +- .../ai/reveng/model/GetMeResponseTest.java | 126 ----- 15 files changed, 730 insertions(+), 137 deletions(-) create mode 100644 docs/BaseResponseListCalleesCallerFunctionsResponse.md create mode 100644 src/main/java/ai/reveng/model/BaseResponseListCalleesCallerFunctionsResponse.java delete mode 100644 src/test/java/ai/reveng/model/GetMeResponseTest.java diff --git a/.sdk-version b/.sdk-version index 8204501..5ed1458 100644 --- a/.sdk-version +++ b/.sdk-version @@ -1 +1 @@ -v3.32.0 +v3.34.0 diff --git a/README.md b/README.md index 3b6c8b7..0a3f605 100644 --- a/README.md +++ b/README.md @@ -16,7 +16,7 @@ Add this dependency to your project's POM: ai.reveng sdk - 3.32.0 + 3.34.0 compile ``` @@ -31,7 +31,7 @@ repositories { } dependencies { - implementation "ai.reveng:sdk:3.32.0" + implementation "ai.reveng:sdk:3.34.0" } ``` @@ -161,6 +161,7 @@ Class | Method | HTTP request | Description *FunctionsCoreApi* | [**getAnalysisStringsStatus**](docs/FunctionsCoreApi.md#getAnalysisStringsStatus) | **GET** /v2/analyses/{analysis_id}/functions/strings/status | Get string processing state for the Analysis *FunctionsCoreApi* | [**getFunctionBlocks**](docs/FunctionsCoreApi.md#getFunctionBlocks) | **GET** /v2/functions/{function_id}/blocks | Get disassembly blocks related to the function *FunctionsCoreApi* | [**getFunctionCalleesCallers**](docs/FunctionsCoreApi.md#getFunctionCalleesCallers) | **GET** /v2/functions/{function_id}/callees_callers | Get list of functions that call or are called by the specified function +*FunctionsCoreApi* | [**getFunctionCalleesCallersBulk**](docs/FunctionsCoreApi.md#getFunctionCalleesCallersBulk) | **GET** /v2/functions/callees_callers | Get list of functions that call or are called for a list of functions *FunctionsCoreApi* | [**getFunctionCapabilities**](docs/FunctionsCoreApi.md#getFunctionCapabilities) | **GET** /v2/functions/{function_id}/capabilities | Retrieve a functions capabilities *FunctionsCoreApi* | [**getFunctionDetails**](docs/FunctionsCoreApi.md#getFunctionDetails) | **GET** /v2/functions/{function_id} | Get function details *FunctionsCoreApi* | [**getFunctionStrings**](docs/FunctionsCoreApi.md#getFunctionStrings) | **GET** /v2/functions/{function_id}/strings | Get string information found in the function @@ -272,6 +273,7 @@ Class | Method | HTTP request | Description - [BaseResponseGetAiDecompilationTask](docs/BaseResponseGetAiDecompilationTask.md) - [BaseResponseGetMeResponse](docs/BaseResponseGetMeResponse.md) - [BaseResponseGetPublicUserResponse](docs/BaseResponseGetPublicUserResponse.md) + - [BaseResponseListCalleesCallerFunctionsResponse](docs/BaseResponseListCalleesCallerFunctionsResponse.md) - [BaseResponseListCollectionResults](docs/BaseResponseListCollectionResults.md) - [BaseResponseListCommentResponse](docs/BaseResponseListCommentResponse.md) - [BaseResponseListDieMatch](docs/BaseResponseListDieMatch.md) diff --git a/build.gradle b/build.gradle index d86bfb3..00d8cfd 100644 --- a/build.gradle +++ b/build.gradle @@ -19,7 +19,7 @@ apply plugin: 'java' apply plugin: 'com.diffplug.spotless' group = 'ai.reveng' -version = '3.32.0' +version = '3.34.0' @@ -171,7 +171,7 @@ mavenPublishing { publishToMavenCentral(true) signAllPublications() - coordinates("ai.reveng", "sdk", "3.32.0") + coordinates("ai.reveng", "sdk", "3.34.0") pom { name = "sdk" diff --git a/build.sbt b/build.sbt index 3f4ef92..9fb5153 100644 --- a/build.sbt +++ b/build.sbt @@ -2,7 +2,7 @@ lazy val root = (project in file(".")). settings( organization := "ai.reveng", name := "sdk", - version := "3.32.0", + version := "3.34.0", scalaVersion := "2.11.12", scalacOptions ++= Seq("-feature"), compile / javacOptions ++= Seq("-Xlint:deprecation"), diff --git a/docs/BaseResponseListCalleesCallerFunctionsResponse.md b/docs/BaseResponseListCalleesCallerFunctionsResponse.md new file mode 100644 index 0000000..a110c40 --- /dev/null +++ b/docs/BaseResponseListCalleesCallerFunctionsResponse.md @@ -0,0 +1,17 @@ + + +# BaseResponseListCalleesCallerFunctionsResponse + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**status** | **Boolean** | Response status on whether the request succeeded | [optional] | +|**data** | [**List<CalleesCallerFunctionsResponse>**](CalleesCallerFunctionsResponse.md) | | [optional] | +|**message** | **String** | | [optional] | +|**errors** | [**List<ErrorModel>**](ErrorModel.md) | | [optional] | +|**meta** | [**MetaModel**](MetaModel.md) | Metadata | [optional] | + + + diff --git a/docs/FunctionMatchingFilters.md b/docs/FunctionMatchingFilters.md index 91466f5..f737acf 100644 --- a/docs/FunctionMatchingFilters.md +++ b/docs/FunctionMatchingFilters.md @@ -10,6 +10,7 @@ |**binaryIds** | **List<Integer>** | ID's of binaries to limit the search to, if empty, search all scoped binaries | [optional] | |**collectionIds** | **List<Integer>** | ID's of collections to limit the search to, if empty, search all scoped collections | [optional] | |**functionIds** | **List<Long>** | ID's of functions to limit the search to, if empty, search all scoped functions | [optional] | +|**userIds** | **List<Integer>** | ID's of users to limit the search to, if empty, search all scoped users | [optional] | |**debugTypes** | [**List<DebugTypesEnum>**](#List<DebugTypesEnum>) | Limit the search to specific debug types, if empty, search all scoped debug & non-debug functions | [optional] | diff --git a/docs/FunctionsCoreApi.md b/docs/FunctionsCoreApi.md index fada39c..0efafc7 100644 --- a/docs/FunctionsCoreApi.md +++ b/docs/FunctionsCoreApi.md @@ -14,6 +14,7 @@ All URIs are relative to *https://api.reveng.ai* | [**getAnalysisStringsStatus**](FunctionsCoreApi.md#getAnalysisStringsStatus) | **GET** /v2/analyses/{analysis_id}/functions/strings/status | Get string processing state for the Analysis | | [**getFunctionBlocks**](FunctionsCoreApi.md#getFunctionBlocks) | **GET** /v2/functions/{function_id}/blocks | Get disassembly blocks related to the function | | [**getFunctionCalleesCallers**](FunctionsCoreApi.md#getFunctionCalleesCallers) | **GET** /v2/functions/{function_id}/callees_callers | Get list of functions that call or are called by the specified function | +| [**getFunctionCalleesCallersBulk**](FunctionsCoreApi.md#getFunctionCalleesCallersBulk) | **GET** /v2/functions/callees_callers | Get list of functions that call or are called for a list of functions | | [**getFunctionCapabilities**](FunctionsCoreApi.md#getFunctionCapabilities) | **GET** /v2/functions/{function_id}/capabilities | Retrieve a functions capabilities | | [**getFunctionDetails**](FunctionsCoreApi.md#getFunctionDetails) | **GET** /v2/functions/{function_id} | Get function details | | [**getFunctionStrings**](FunctionsCoreApi.md#getFunctionStrings) | **GET** /v2/functions/{function_id}/strings | Get string information found in the function | @@ -736,6 +737,74 @@ public class Example { | **200** | Successful Response | - | | **422** | Invalid request parameters | - | + +# **getFunctionCalleesCallersBulk** +> BaseResponseListCalleesCallerFunctionsResponse getFunctionCalleesCallersBulk(functionIds) + +Get list of functions that call or are called for a list of functions + +### Example +```java +// Import classes: +import ai.reveng.invoker.ApiClient; +import ai.reveng.invoker.ApiException; +import ai.reveng.invoker.Configuration; +import ai.reveng.invoker.auth.*; +import ai.reveng.invoker.models.*; +import ai.reveng.api.FunctionsCoreApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("https://api.reveng.ai"); + + // Configure API key authorization: APIKey + ApiKeyAuth APIKey = (ApiKeyAuth) defaultClient.getAuthentication("APIKey"); + APIKey.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //APIKey.setApiKeyPrefix("Token"); + + FunctionsCoreApi apiInstance = new FunctionsCoreApi(defaultClient); + List functionIds = Arrays.asList(); // List | + try { + BaseResponseListCalleesCallerFunctionsResponse result = apiInstance.getFunctionCalleesCallersBulk(functionIds); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling FunctionsCoreApi#getFunctionCalleesCallersBulk"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **functionIds** | [**List<Integer>**](Integer.md)| | | + +### Return type + +[**BaseResponseListCalleesCallerFunctionsResponse**](BaseResponseListCalleesCallerFunctionsResponse.md) + +### Authorization + +[APIKey](../README.md#APIKey) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Successful Response | - | +| **422** | Invalid request parameters | - | + # **getFunctionCapabilities** > BaseResponseFunctionCapabilityResponse getFunctionCapabilities(functionId) diff --git a/pom.xml b/pom.xml index 3b7838e..c74a4d9 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ sdk jar sdk - 3.32.0 + 3.34.0 https://github.com/RevEngAI/sdk-java Java SDK for the RevEng.AI API diff --git a/src/main/java/ai/reveng/api/FunctionsCoreApi.java b/src/main/java/ai/reveng/api/FunctionsCoreApi.java index be77486..5a457fe 100644 --- a/src/main/java/ai/reveng/api/FunctionsCoreApi.java +++ b/src/main/java/ai/reveng/api/FunctionsCoreApi.java @@ -38,6 +38,7 @@ import ai.reveng.model.BaseResponseFunctionCapabilityResponse; import ai.reveng.model.BaseResponseFunctionStringsResponse; import ai.reveng.model.BaseResponseFunctionsDetailResponse; +import ai.reveng.model.BaseResponseListCalleesCallerFunctionsResponse; import ai.reveng.model.FunctionMatchingRequest; import ai.reveng.model.FunctionMatchingResponse; @@ -1476,6 +1477,140 @@ public okhttp3.Call getFunctionCalleesCallersAsync(@javax.annotation.Nonnull Int localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } + /** + * Build call for getFunctionCalleesCallersBulk + * @param functionIds (required) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + +
Response Details
Status Code Description Response Headers
200 Successful Response -
422 Invalid request parameters -
+ */ + public okhttp3.Call getFunctionCalleesCallersBulkCall(@javax.annotation.Nonnull List functionIds, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/v2/functions/callees_callers"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + if (functionIds != null) { + localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "function_ids", functionIds)); + } + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "APIKey" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getFunctionCalleesCallersBulkValidateBeforeCall(@javax.annotation.Nonnull List functionIds, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'functionIds' is set + if (functionIds == null) { + throw new ApiException("Missing the required parameter 'functionIds' when calling getFunctionCalleesCallersBulk(Async)"); + } + + return getFunctionCalleesCallersBulkCall(functionIds, _callback); + + } + + /** + * Get list of functions that call or are called for a list of functions + * + * @param functionIds (required) + * @return BaseResponseListCalleesCallerFunctionsResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + +
Response Details
Status Code Description Response Headers
200 Successful Response -
422 Invalid request parameters -
+ */ + public BaseResponseListCalleesCallerFunctionsResponse getFunctionCalleesCallersBulk(@javax.annotation.Nonnull List functionIds) throws ApiException { + ApiResponse localVarResp = getFunctionCalleesCallersBulkWithHttpInfo(functionIds); + return localVarResp.getData(); + } + + /** + * Get list of functions that call or are called for a list of functions + * + * @param functionIds (required) + * @return ApiResponse<BaseResponseListCalleesCallerFunctionsResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + +
Response Details
Status Code Description Response Headers
200 Successful Response -
422 Invalid request parameters -
+ */ + public ApiResponse getFunctionCalleesCallersBulkWithHttpInfo(@javax.annotation.Nonnull List functionIds) throws ApiException { + okhttp3.Call localVarCall = getFunctionCalleesCallersBulkValidateBeforeCall(functionIds, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Get list of functions that call or are called for a list of functions (asynchronously) + * + * @param functionIds (required) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + + +
Response Details
Status Code Description Response Headers
200 Successful Response -
422 Invalid request parameters -
+ */ + public okhttp3.Call getFunctionCalleesCallersBulkAsync(@javax.annotation.Nonnull List functionIds, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = getFunctionCalleesCallersBulkValidateBeforeCall(functionIds, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } /** * Build call for getFunctionCapabilities * @param functionId (required) diff --git a/src/main/java/ai/reveng/invoker/ApiClient.java b/src/main/java/ai/reveng/invoker/ApiClient.java index c127fb4..55498aa 100644 --- a/src/main/java/ai/reveng/invoker/ApiClient.java +++ b/src/main/java/ai/reveng/invoker/ApiClient.java @@ -146,7 +146,7 @@ protected void init() { json = new JSON(); // Set default User-Agent. - setUserAgent("OpenAPI-Generator/3.32.0/java"); + setUserAgent("OpenAPI-Generator/3.34.0/java"); authentications = new HashMap(); } diff --git a/src/main/java/ai/reveng/invoker/Configuration.java b/src/main/java/ai/reveng/invoker/Configuration.java index 23e3070..e17cde5 100644 --- a/src/main/java/ai/reveng/invoker/Configuration.java +++ b/src/main/java/ai/reveng/invoker/Configuration.java @@ -18,7 +18,7 @@ @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class Configuration { - public static final String VERSION = "3.32.0"; + public static final String VERSION = "3.34.0"; private static final AtomicReference defaultApiClient = new AtomicReference<>(); private static volatile Supplier apiClientFactory = ApiClient::new; diff --git a/src/main/java/ai/reveng/invoker/JSON.java b/src/main/java/ai/reveng/invoker/JSON.java index 12f7deb..5b18fee 100644 --- a/src/main/java/ai/reveng/invoker/JSON.java +++ b/src/main/java/ai/reveng/invoker/JSON.java @@ -177,6 +177,7 @@ private static Class getClassByDiscriminator(Map classByDiscriminatorValue, Stri gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.BaseResponseGetAiDecompilationTask.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.BaseResponseGetMeResponse.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.BaseResponseGetPublicUserResponse.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.BaseResponseListCalleesCallerFunctionsResponse.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.BaseResponseListCollectionResults.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.BaseResponseListCommentResponse.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.BaseResponseListDieMatch.CustomTypeAdapterFactory()); diff --git a/src/main/java/ai/reveng/model/BaseResponseListCalleesCallerFunctionsResponse.java b/src/main/java/ai/reveng/model/BaseResponseListCalleesCallerFunctionsResponse.java new file mode 100644 index 0000000..3c1cbae --- /dev/null +++ b/src/main/java/ai/reveng/model/BaseResponseListCalleesCallerFunctionsResponse.java @@ -0,0 +1,456 @@ +/* + * RevEng.AI API + * RevEng.AI is Similarity Search Engine for executable binaries + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package ai.reveng.model; + +import java.util.Objects; +import java.util.Locale; +import ai.reveng.model.CalleesCallerFunctionsResponse; +import ai.reveng.model.ErrorModel; +import ai.reveng.model.MetaModel; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import org.openapitools.jackson.nullable.JsonNullable; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; +import java.util.Locale; + +import ai.reveng.invoker.JSON; + +/** + * BaseResponseListCalleesCallerFunctionsResponse + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class BaseResponseListCalleesCallerFunctionsResponse { + public static final String SERIALIZED_NAME_STATUS = "status"; + @SerializedName(SERIALIZED_NAME_STATUS) + @javax.annotation.Nullable + private Boolean status = true; + + public static final String SERIALIZED_NAME_DATA = "data"; + @SerializedName(SERIALIZED_NAME_DATA) + @javax.annotation.Nullable + private List data; + + public static final String SERIALIZED_NAME_MESSAGE = "message"; + @SerializedName(SERIALIZED_NAME_MESSAGE) + @javax.annotation.Nullable + private String message; + + public static final String SERIALIZED_NAME_ERRORS = "errors"; + @SerializedName(SERIALIZED_NAME_ERRORS) + @javax.annotation.Nullable + private List errors; + + public static final String SERIALIZED_NAME_META = "meta"; + @SerializedName(SERIALIZED_NAME_META) + @javax.annotation.Nullable + private MetaModel meta; + + public BaseResponseListCalleesCallerFunctionsResponse() { + } + + public BaseResponseListCalleesCallerFunctionsResponse status(@javax.annotation.Nullable Boolean status) { + this.status = status; + return this; + } + + /** + * Response status on whether the request succeeded + * @return status + */ + @javax.annotation.Nullable + public Boolean getStatus() { + return status; + } + + public void setStatus(@javax.annotation.Nullable Boolean status) { + this.status = status; + } + + + public BaseResponseListCalleesCallerFunctionsResponse data(@javax.annotation.Nullable List data) { + this.data = data; + return this; + } + + public BaseResponseListCalleesCallerFunctionsResponse addDataItem(CalleesCallerFunctionsResponse dataItem) { + if (this.data == null) { + this.data = new ArrayList<>(); + } + this.data.add(dataItem); + return this; + } + + /** + * Get data + * @return data + */ + @javax.annotation.Nullable + public List getData() { + return data; + } + + public void setData(@javax.annotation.Nullable List data) { + this.data = data; + } + + + public BaseResponseListCalleesCallerFunctionsResponse message(@javax.annotation.Nullable String message) { + this.message = message; + return this; + } + + /** + * Get message + * @return message + */ + @javax.annotation.Nullable + public String getMessage() { + return message; + } + + public void setMessage(@javax.annotation.Nullable String message) { + this.message = message; + } + + + public BaseResponseListCalleesCallerFunctionsResponse errors(@javax.annotation.Nullable List errors) { + this.errors = errors; + return this; + } + + public BaseResponseListCalleesCallerFunctionsResponse addErrorsItem(ErrorModel errorsItem) { + if (this.errors == null) { + this.errors = new ArrayList<>(); + } + this.errors.add(errorsItem); + return this; + } + + /** + * Get errors + * @return errors + */ + @javax.annotation.Nullable + public List getErrors() { + return errors; + } + + public void setErrors(@javax.annotation.Nullable List errors) { + this.errors = errors; + } + + + public BaseResponseListCalleesCallerFunctionsResponse meta(@javax.annotation.Nullable MetaModel meta) { + this.meta = meta; + return this; + } + + /** + * Metadata + * @return meta + */ + @javax.annotation.Nullable + public MetaModel getMeta() { + return meta; + } + + public void setMeta(@javax.annotation.Nullable MetaModel meta) { + this.meta = meta; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the BaseResponseListCalleesCallerFunctionsResponse instance itself + */ + public BaseResponseListCalleesCallerFunctionsResponse putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + BaseResponseListCalleesCallerFunctionsResponse baseResponseListCalleesCallerFunctionsResponse = (BaseResponseListCalleesCallerFunctionsResponse) o; + return Objects.equals(this.status, baseResponseListCalleesCallerFunctionsResponse.status) && + Objects.equals(this.data, baseResponseListCalleesCallerFunctionsResponse.data) && + Objects.equals(this.message, baseResponseListCalleesCallerFunctionsResponse.message) && + Objects.equals(this.errors, baseResponseListCalleesCallerFunctionsResponse.errors) && + Objects.equals(this.meta, baseResponseListCalleesCallerFunctionsResponse.meta)&& + Objects.equals(this.additionalProperties, baseResponseListCalleesCallerFunctionsResponse.additionalProperties); + } + + private static boolean equalsNullable(JsonNullable a, JsonNullable b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + + @Override + public int hashCode() { + return Objects.hash(status, data, message, errors, meta, additionalProperties); + } + + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class BaseResponseListCalleesCallerFunctionsResponse {\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" message: ").append(toIndentedString(message)).append("\n"); + sb.append(" errors: ").append(toIndentedString(errors)).append("\n"); + sb.append(" meta: ").append(toIndentedString(meta)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(Arrays.asList("status", "data", "message", "errors", "meta")); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(0); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to BaseResponseListCalleesCallerFunctionsResponse + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!BaseResponseListCalleesCallerFunctionsResponse.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format(Locale.ROOT, "The required field(s) %s in BaseResponseListCalleesCallerFunctionsResponse is not found in the empty JSON string", BaseResponseListCalleesCallerFunctionsResponse.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (jsonObj.get("data") != null && !jsonObj.get("data").isJsonNull()) { + JsonArray jsonArraydata = jsonObj.getAsJsonArray("data"); + if (jsonArraydata != null) { + // ensure the json data is an array + if (!jsonObj.get("data").isJsonArray()) { + throw new IllegalArgumentException(String.format(Locale.ROOT, "Expected the field `data` to be an array in the JSON string but got `%s`", jsonObj.get("data").toString())); + } + + // validate the optional field `data` (array) + for (int i = 0; i < jsonArraydata.size(); i++) { + CalleesCallerFunctionsResponse.validateJsonElement(jsonArraydata.get(i)); + }; + } + } + if ((jsonObj.get("message") != null && !jsonObj.get("message").isJsonNull()) && !jsonObj.get("message").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(Locale.ROOT, "Expected the field `message` to be a primitive type in the JSON string but got `%s`", jsonObj.get("message").toString())); + } + if (jsonObj.get("errors") != null && !jsonObj.get("errors").isJsonNull()) { + JsonArray jsonArrayerrors = jsonObj.getAsJsonArray("errors"); + if (jsonArrayerrors != null) { + // ensure the json data is an array + if (!jsonObj.get("errors").isJsonArray()) { + throw new IllegalArgumentException(String.format(Locale.ROOT, "Expected the field `errors` to be an array in the JSON string but got `%s`", jsonObj.get("errors").toString())); + } + + // validate the optional field `errors` (array) + for (int i = 0; i < jsonArrayerrors.size(); i++) { + ErrorModel.validateJsonElement(jsonArrayerrors.get(i)); + }; + } + } + // validate the optional field `meta` + if (jsonObj.get("meta") != null && !jsonObj.get("meta").isJsonNull()) { + MetaModel.validateJsonElement(jsonObj.get("meta")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!BaseResponseListCalleesCallerFunctionsResponse.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'BaseResponseListCalleesCallerFunctionsResponse' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(BaseResponseListCalleesCallerFunctionsResponse.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, BaseResponseListCalleesCallerFunctionsResponse value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public BaseResponseListCalleesCallerFunctionsResponse read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + BaseResponseListCalleesCallerFunctionsResponse instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format(Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of BaseResponseListCalleesCallerFunctionsResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of BaseResponseListCalleesCallerFunctionsResponse + * @throws IOException if the JSON string is invalid with respect to BaseResponseListCalleesCallerFunctionsResponse + */ + public static BaseResponseListCalleesCallerFunctionsResponse fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, BaseResponseListCalleesCallerFunctionsResponse.class); + } + + /** + * Convert an instance of BaseResponseListCalleesCallerFunctionsResponse to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/ai/reveng/model/FunctionMatchingFilters.java b/src/main/java/ai/reveng/model/FunctionMatchingFilters.java index 50bdbcc..81814de 100644 --- a/src/main/java/ai/reveng/model/FunctionMatchingFilters.java +++ b/src/main/java/ai/reveng/model/FunctionMatchingFilters.java @@ -68,6 +68,11 @@ public class FunctionMatchingFilters { @javax.annotation.Nullable private List functionIds = new ArrayList<>(); + public static final String SERIALIZED_NAME_USER_IDS = "user_ids"; + @SerializedName(SERIALIZED_NAME_USER_IDS) + @javax.annotation.Nullable + private List userIds = new ArrayList<>(); + /** * Gets or Sets debugTypes */ @@ -211,6 +216,33 @@ public void setFunctionIds(@javax.annotation.Nullable List functionIds) { } + public FunctionMatchingFilters userIds(@javax.annotation.Nullable List userIds) { + this.userIds = userIds; + return this; + } + + public FunctionMatchingFilters addUserIdsItem(Integer userIdsItem) { + if (this.userIds == null) { + this.userIds = new ArrayList<>(); + } + this.userIds.add(userIdsItem); + return this; + } + + /** + * ID's of users to limit the search to, if empty, search all scoped users + * @return userIds + */ + @javax.annotation.Nullable + public List getUserIds() { + return userIds; + } + + public void setUserIds(@javax.annotation.Nullable List userIds) { + this.userIds = userIds; + } + + public FunctionMatchingFilters debugTypes(@javax.annotation.Nullable List debugTypes) { this.debugTypes = debugTypes; return this; @@ -295,13 +327,14 @@ public boolean equals(Object o) { return Objects.equals(this.binaryIds, functionMatchingFilters.binaryIds) && Objects.equals(this.collectionIds, functionMatchingFilters.collectionIds) && Objects.equals(this.functionIds, functionMatchingFilters.functionIds) && + Objects.equals(this.userIds, functionMatchingFilters.userIds) && Objects.equals(this.debugTypes, functionMatchingFilters.debugTypes)&& Objects.equals(this.additionalProperties, functionMatchingFilters.additionalProperties); } @Override public int hashCode() { - return Objects.hash(binaryIds, collectionIds, functionIds, debugTypes, additionalProperties); + return Objects.hash(binaryIds, collectionIds, functionIds, userIds, debugTypes, additionalProperties); } @Override @@ -311,6 +344,7 @@ public String toString() { sb.append(" binaryIds: ").append(toIndentedString(binaryIds)).append("\n"); sb.append(" collectionIds: ").append(toIndentedString(collectionIds)).append("\n"); sb.append(" functionIds: ").append(toIndentedString(functionIds)).append("\n"); + sb.append(" userIds: ").append(toIndentedString(userIds)).append("\n"); sb.append(" debugTypes: ").append(toIndentedString(debugTypes)).append("\n"); sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); sb.append("}"); @@ -334,7 +368,7 @@ private String toIndentedString(Object o) { static { // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(Arrays.asList("binary_ids", "collection_ids", "function_ids", "debug_types")); + openapiFields = new HashSet(Arrays.asList("binary_ids", "collection_ids", "function_ids", "user_ids", "debug_types")); // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(0); @@ -366,6 +400,10 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti throw new IllegalArgumentException(String.format(Locale.ROOT, "Expected the field `function_ids` to be an array in the JSON string but got `%s`", jsonObj.get("function_ids").toString())); } // ensure the optional json data is an array if present + if (jsonObj.get("user_ids") != null && !jsonObj.get("user_ids").isJsonNull() && !jsonObj.get("user_ids").isJsonArray()) { + throw new IllegalArgumentException(String.format(Locale.ROOT, "Expected the field `user_ids` to be an array in the JSON string but got `%s`", jsonObj.get("user_ids").toString())); + } + // ensure the optional json data is an array if present if (jsonObj.get("debug_types") != null && !jsonObj.get("debug_types").isJsonNull() && !jsonObj.get("debug_types").isJsonArray()) { throw new IllegalArgumentException(String.format(Locale.ROOT, "Expected the field `debug_types` to be an array in the JSON string but got `%s`", jsonObj.get("debug_types").toString())); } diff --git a/src/test/java/ai/reveng/model/GetMeResponseTest.java b/src/test/java/ai/reveng/model/GetMeResponseTest.java deleted file mode 100644 index b50d3fe..0000000 --- a/src/test/java/ai/reveng/model/GetMeResponseTest.java +++ /dev/null @@ -1,126 +0,0 @@ -package ai.reveng.model; - -import static org.junit.jupiter.api.Assertions.assertEquals; -import static org.junit.jupiter.api.Assertions.assertNotNull; - -import java.io.IOException; -import java.time.OffsetDateTime; -import java.time.ZoneOffset; - -import org.junit.jupiter.api.Test; - -/** - * Tests for GetMeResponse deserialization. - */ -public class GetMeResponseTest { - - @Test - public void testCreationFieldParsesRfc3339WithTimezone() throws IOException { - String json = "{" - + "\"username\": \"testuser\"," - + "\"user_id\": 1," - + "\"first_name\": \"Test\"," - + "\"last_name\": \"User\"," - + "\"email\": \"test@example.com\"," - + "\"creation\": \"2024-06-15T10:30:00+05:30\"," - + "\"tutorial_seen\": true," - + "\"role\": \"USER\"" - + "}"; - - GetMeResponse response = GetMeResponse.fromJson(json); - - assertNotNull(response.getCreation()); - assertEquals( - OffsetDateTime.of(2024, 6, 15, 10, 30, 0, 0, ZoneOffset.ofHoursMinutes(5, 30)), - response.getCreation() - ); - } - - @Test - public void testCreationFieldParsesRfc3339WithUtcZ() throws IOException { - String json = "{" - + "\"username\": \"testuser\"," - + "\"user_id\": 1," - + "\"first_name\": \"Test\"," - + "\"last_name\": \"User\"," - + "\"email\": \"test@example.com\"," - + "\"creation\": \"2024-06-15T10:30:00Z\"," - + "\"tutorial_seen\": true," - + "\"role\": \"USER\"" - + "}"; - - GetMeResponse response = GetMeResponse.fromJson(json); - - assertNotNull(response.getCreation()); - assertEquals( - OffsetDateTime.of(2024, 6, 15, 10, 30, 0, 0, ZoneOffset.UTC), - response.getCreation() - ); - } - - @Test - public void testCreationFieldParsesRfc3339WithNegativeOffset() throws IOException { - String json = "{" - + "\"username\": \"testuser\"," - + "\"user_id\": 1," - + "\"first_name\": \"Test\"," - + "\"last_name\": \"User\"," - + "\"email\": \"test@example.com\"," - + "\"creation\": \"2024-06-15T10:30:00-04:00\"," - + "\"tutorial_seen\": true," - + "\"role\": \"USER\"" - + "}"; - - GetMeResponse response = GetMeResponse.fromJson(json); - - assertNotNull(response.getCreation()); - assertEquals( - OffsetDateTime.of(2024, 6, 15, 10, 30, 0, 0, ZoneOffset.ofHours(-4)), - response.getCreation() - ); - } - - @Test - public void testCreationFieldParsesRfc3339WithFractionalSecondsAndTimezone() throws IOException { - String json = "{" - + "\"username\": \"testuser\"," - + "\"user_id\": 1," - + "\"first_name\": \"Test\"," - + "\"last_name\": \"User\"," - + "\"email\": \"test@example.com\"," - + "\"creation\": \"2024-06-15T10:30:00.123456+02:00\"," - + "\"tutorial_seen\": true," - + "\"role\": \"USER\"" - + "}"; - - GetMeResponse response = GetMeResponse.fromJson(json); - - assertNotNull(response.getCreation()); - assertEquals( - OffsetDateTime.of(2024, 6, 15, 10, 30, 0, 123456000, ZoneOffset.ofHours(2)), - response.getCreation() - ); - } - - @Test - public void testCreationFieldParsesRfc3339WithNanosecondPrecision() throws IOException { - String json = "{" - + "\"username\": \"testuser\"," - + "\"user_id\": 1," - + "\"first_name\": \"Test\"," - + "\"last_name\": \"User\"," - + "\"email\": \"test@example.com\"," - + "\"creation\": \"2024-06-15T10:30:00.123456789+03:00\"," - + "\"tutorial_seen\": true," - + "\"role\": \"USER\"" - + "}"; - - GetMeResponse response = GetMeResponse.fromJson(json); - - assertNotNull(response.getCreation()); - assertEquals( - OffsetDateTime.of(2024, 6, 15, 10, 30, 0, 123456789, ZoneOffset.ofHours(3)), - response.getCreation() - ); - } -} From b3829dc8117bd008eba35db2883aec1ed9ca31c5 Mon Sep 17 00:00:00 2001 From: Rob Marsal Date: Wed, 11 Mar 2026 11:40:46 +0000 Subject: [PATCH 2/2] fix: keep manually added tests --- .github/workflows/check.yaml | 2 +- .../ai/reveng/model/GetMeResponseTest.java | 104 ++++++++++++++++++ 2 files changed, 105 insertions(+), 1 deletion(-) create mode 100644 src/test/java/ai/reveng/model/GetMeResponseTest.java diff --git a/.github/workflows/check.yaml b/.github/workflows/check.yaml index 22d8319..4bad813 100644 --- a/.github/workflows/check.yaml +++ b/.github/workflows/check.yaml @@ -122,7 +122,7 @@ jobs: # Move generated files to the correct locations and clean up rm -Rf docs && mv java-client/docs . rm -Rf gradle && mv java-client/gradle . - rm -Rf src && mv java-client/src . + rm -Rf src/main && mv java-client/src/main src/ rm -Rf build.gradle && mv java-client/build.gradle . rm -Rf build.sbt && mv java-client/build.sbt . rm -Rf gradle.properties && mv java-client/gradle.properties . diff --git a/src/test/java/ai/reveng/model/GetMeResponseTest.java b/src/test/java/ai/reveng/model/GetMeResponseTest.java new file mode 100644 index 0000000..a33487d --- /dev/null +++ b/src/test/java/ai/reveng/model/GetMeResponseTest.java @@ -0,0 +1,104 @@ +/* + * RevEng.AI API + * RevEng.AI is Similarity Search Engine for executable binaries + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package ai.reveng.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.util.Arrays; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for GetMeResponse + */ +public class GetMeResponseTest { + private final GetMeResponse model = new GetMeResponse(); + + /** + * Model tests for GetMeResponse + */ + @Test + public void testGetMeResponse() { + // TODO: test GetMeResponse + } + + /** + * Test the property 'username' + */ + @Test + public void usernameTest() { + // TODO: test username + } + + /** + * Test the property 'userId' + */ + @Test + public void userIdTest() { + // TODO: test userId + } + + /** + * Test the property 'firstName' + */ + @Test + public void firstNameTest() { + // TODO: test firstName + } + + /** + * Test the property 'lastName' + */ + @Test + public void lastNameTest() { + // TODO: test lastName + } + + /** + * Test the property 'email' + */ + @Test + public void emailTest() { + // TODO: test email + } + + /** + * Test the property 'creation' + */ + @Test + public void creationTest() { + // TODO: test creation + } + + /** + * Test the property 'tutorialSeen' + */ + @Test + public void tutorialSeenTest() { + // TODO: test tutorialSeen + } + + /** + * Test the property 'role' + */ + @Test + public void roleTest() { + // TODO: test role + } + +}