From ea29d42d864fd93bd3aebd5af8ca96f318bf3b88 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Mon, 6 Oct 2025 14:04:28 +0000 Subject: [PATCH] Update SDK to version v1.99.0 - Generated from OpenAPI spec version v1.99.0 - Auto-generated by GitHub Actions --- .sdk-version | 2 +- README.md | 9 +- build.gradle | 4 +- build.sbt | 2 +- ...itySchemaANNFunction.md => ANNFunction.md} | 2 +- docs/AnalysesCoreApi.md | 79 +-- docs/AppApiRestV1AnnSchemaANNFunction.md | 31 - docs/AppApiRestV2FunctionsTypesFunction.md | 3 +- docs/FunctionBatchAnn.md | 15 - pom.xml | 2 +- .../java/ai/reveng/api/AnalysesCoreApi.java | 169 +----- .../java/ai/reveng/invoker/ApiClient.java | 2 +- .../java/ai/reveng/invoker/Configuration.java | 2 +- src/main/java/ai/reveng/invoker/JSON.java | 4 +- ...chemaANNFunction.java => ANNFunction.java} | 86 +-- .../AppApiRestV1AnnSchemaANNFunction.java | 562 ------------------ .../AppApiRestV2FunctionsTypesFunction.java | 37 +- .../ai/reveng/model/FunctionBatchAnn.java | 274 --------- .../ai/reveng/api/AnalysesCoreApiTest.java | 22 +- ...FunctionTest.java => ANNFunctionTest.java} | 12 +- .../AppApiRestV1AnnSchemaANNFunctionTest.java | 115 ---- ...ppApiRestV2FunctionsTypesFunctionTest.java | 8 + .../ai/reveng/model/FunctionBatchAnnTest.java | 64 -- 23 files changed, 129 insertions(+), 1377 deletions(-) rename docs/{AppApiRestV2SimilaritySchemaANNFunction.md => ANNFunction.md} (94%) delete mode 100644 docs/AppApiRestV1AnnSchemaANNFunction.md delete mode 100644 docs/FunctionBatchAnn.md rename src/main/java/ai/reveng/model/{AppApiRestV2SimilaritySchemaANNFunction.java => ANNFunction.java} (79%) delete mode 100644 src/main/java/ai/reveng/model/AppApiRestV1AnnSchemaANNFunction.java delete mode 100644 src/main/java/ai/reveng/model/FunctionBatchAnn.java rename src/test/java/ai/reveng/model/{AppApiRestV2SimilaritySchemaANNFunctionTest.java => ANNFunctionTest.java} (81%) delete mode 100644 src/test/java/ai/reveng/model/AppApiRestV1AnnSchemaANNFunctionTest.java delete mode 100644 src/test/java/ai/reveng/model/FunctionBatchAnnTest.java diff --git a/.sdk-version b/.sdk-version index b3e49df..5cd610c 100644 --- a/.sdk-version +++ b/.sdk-version @@ -1 +1 @@ -v1.98.1 +v1.99.0 diff --git a/README.md b/README.md index 8465eb9..97447c8 100644 --- a/README.md +++ b/README.md @@ -16,7 +16,7 @@ Add this dependency to your project's POM: ai.reveng sdk - 1.98.1 + 1.99.0 compile ``` @@ -31,7 +31,7 @@ repositories { } dependencies { - implementation "ai.reveng:sdk:1.98.1" + implementation "ai.reveng:sdk:1.99.0" } ``` @@ -80,7 +80,6 @@ Class | Method | HTTP request | Description *AnalysesCommentsApi* | [**deleteAnalysisComment**](docs/AnalysesCommentsApi.md#deleteAnalysisComment) | **DELETE** /v2/analyses/{analysis_id}/comments/{comment_id} | Delete a comment *AnalysesCommentsApi* | [**getAnalysisComments**](docs/AnalysesCommentsApi.md#getAnalysisComments) | **GET** /v2/analyses/{analysis_id}/comments | Get comments for this analysis *AnalysesCommentsApi* | [**updateAnalysisComment**](docs/AnalysesCommentsApi.md#updateAnalysisComment) | **PATCH** /v2/analyses/{analysis_id}/comments/{comment_id} | Update a comment -*AnalysesCoreApi* | [**batchSymbolAnn**](docs/AnalysesCoreApi.md#batchSymbolAnn) | **POST** /v1/ann/symbol/batch | Batch Symbol ANN using function IDs *AnalysesCoreApi* | [**createAnalysis**](docs/AnalysesCoreApi.md#createAnalysis) | **POST** /v2/analyses | Create Analysis *AnalysesCoreApi* | [**deleteAnalysis**](docs/AnalysesCoreApi.md#deleteAnalysis) | **DELETE** /v2/analyses/{analysis_id} | Delete Analysis *AnalysesCoreApi* | [**findSimilarFunctionsBatch**](docs/AnalysesCoreApi.md#findSimilarFunctionsBatch) | **POST** /v2/analyses/{analysis_id}/similarity/functions | Batch Symbol ANN using Analysis ID @@ -194,6 +193,7 @@ Class | Method | HTTP request | Description ## Documentation for Models + - [ANNFunction](docs/ANNFunction.md) - [Addr](docs/Addr.md) - [AiDecompilationRating](docs/AiDecompilationRating.md) - [AiUnstripRequest](docs/AiUnstripRequest.md) @@ -212,14 +212,12 @@ Class | Method | HTTP request | Description - [AnalysisUpdateRequest](docs/AnalysisUpdateRequest.md) - [AnalysisUpdateTagsRequest](docs/AnalysisUpdateTagsRequest.md) - [AnalysisUpdateTagsResponse](docs/AnalysisUpdateTagsResponse.md) - - [AppApiRestV1AnnSchemaANNFunction](docs/AppApiRestV1AnnSchemaANNFunction.md) - [AppApiRestV2AnalysesEnumsDynamicExecutionStatus](docs/AppApiRestV2AnalysesEnumsDynamicExecutionStatus.md) - [AppApiRestV2AnalysesEnumsOrderBy](docs/AppApiRestV2AnalysesEnumsOrderBy.md) - [AppApiRestV2AnalysesResponsesTagItem](docs/AppApiRestV2AnalysesResponsesTagItem.md) - [AppApiRestV2CollectionsEnumsOrderBy](docs/AppApiRestV2CollectionsEnumsOrderBy.md) - [AppApiRestV2FunctionsResponsesFunction](docs/AppApiRestV2FunctionsResponsesFunction.md) - [AppApiRestV2FunctionsTypesFunction](docs/AppApiRestV2FunctionsTypesFunction.md) - - [AppApiRestV2SimilaritySchemaANNFunction](docs/AppApiRestV2SimilaritySchemaANNFunction.md) - [AppServicesBinaryAnnSchemaTagItem](docs/AppServicesBinaryAnnSchemaTagItem.md) - [AppServicesDynamicExecutionSchemasDynamicExecutionStatus](docs/AppServicesDynamicExecutionSchemasDynamicExecutionStatus.md) - [Argument](docs/Argument.md) @@ -365,7 +363,6 @@ Class | Method | HTTP request | Description - [FileHashes](docs/FileHashes.md) - [FileMetadata](docs/FileMetadata.md) - [Filters](docs/Filters.md) - - [FunctionBatchAnn](docs/FunctionBatchAnn.md) - [FunctionBlockDestinationResponse](docs/FunctionBlockDestinationResponse.md) - [FunctionBlockResponse](docs/FunctionBlockResponse.md) - [FunctionBlocksResponse](docs/FunctionBlocksResponse.md) diff --git a/build.gradle b/build.gradle index 5fa5efb..c7113da 100644 --- a/build.gradle +++ b/build.gradle @@ -19,7 +19,7 @@ apply plugin: 'java' apply plugin: 'com.diffplug.spotless' group = 'ai.reveng' -version = '1.98.1' +version = '1.99.0' @@ -171,7 +171,7 @@ mavenPublishing { publishToMavenCentral(true) signAllPublications() - coordinates("ai.reveng", "sdk", "1.98.1") + coordinates("ai.reveng", "sdk", "1.99.0") pom { name = "sdk" diff --git a/build.sbt b/build.sbt index d438911..95e8469 100644 --- a/build.sbt +++ b/build.sbt @@ -2,7 +2,7 @@ lazy val root = (project in file(".")). settings( organization := "ai.reveng", name := "sdk", - version := "1.98.1", + version := "1.99.0", scalaVersion := "2.11.12", scalacOptions ++= Seq("-feature"), compile / javacOptions ++= Seq("-Xlint:deprecation"), diff --git a/docs/AppApiRestV2SimilaritySchemaANNFunction.md b/docs/ANNFunction.md similarity index 94% rename from docs/AppApiRestV2SimilaritySchemaANNFunction.md rename to docs/ANNFunction.md index a9404a0..a5bcb18 100644 --- a/docs/AppApiRestV2SimilaritySchemaANNFunction.md +++ b/docs/ANNFunction.md @@ -1,6 +1,6 @@ -# AppApiRestV2SimilaritySchemaANNFunction +# ANNFunction ## Properties diff --git a/docs/AnalysesCoreApi.md b/docs/AnalysesCoreApi.md index 5f9c864..51a3f51 100644 --- a/docs/AnalysesCoreApi.md +++ b/docs/AnalysesCoreApi.md @@ -4,7 +4,6 @@ All URIs are relative to *https://api.reveng.ai* | Method | HTTP request | Description | |------------- | ------------- | -------------| -| [**batchSymbolAnn**](AnalysesCoreApi.md#batchSymbolAnn) | **POST** /v1/ann/symbol/batch | Batch Symbol ANN using function IDs | | [**createAnalysis**](AnalysesCoreApi.md#createAnalysis) | **POST** /v2/analyses | Create Analysis | | [**deleteAnalysis**](AnalysesCoreApi.md#deleteAnalysis) | **DELETE** /v2/analyses/{analysis_id} | Delete Analysis | | [**findSimilarFunctionsBatch**](AnalysesCoreApi.md#findSimilarFunctionsBatch) | **POST** /v2/analyses/{analysis_id}/similarity/functions | Batch Symbol ANN using Analysis ID | @@ -22,76 +21,6 @@ All URIs are relative to *https://api.reveng.ai* | [**uploadFile**](AnalysesCoreApi.md#uploadFile) | **POST** /v2/upload | Upload File | - -# **batchSymbolAnn** -> FunctionBatchAnn batchSymbolAnn(appApiRestV1AnnSchemaANNFunction) - -Batch Symbol ANN using function IDs - -Takes in an input of functions ID's and settings and finds the nearest functions for each function that's within the database - -### 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.AnalysesCoreApi; - -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"); - - AnalysesCoreApi apiInstance = new AnalysesCoreApi(defaultClient); - AppApiRestV1AnnSchemaANNFunction appApiRestV1AnnSchemaANNFunction = new AppApiRestV1AnnSchemaANNFunction(); // AppApiRestV1AnnSchemaANNFunction | - try { - FunctionBatchAnn result = apiInstance.batchSymbolAnn(appApiRestV1AnnSchemaANNFunction); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling AnalysesCoreApi#batchSymbolAnn"); - 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 | -|------------- | ------------- | ------------- | -------------| -| **appApiRestV1AnnSchemaANNFunction** | [**AppApiRestV1AnnSchemaANNFunction**](AppApiRestV1AnnSchemaANNFunction.md)| | | - -### Return type - -[**FunctionBatchAnn**](FunctionBatchAnn.md) - -### Authorization - -[APIKey](../README.md#APIKey) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -| **200** | Successful Response | - | -| **422** | Invalid request parameters | - | - # **createAnalysis** > BaseResponseAnalysisCreateResponse createAnalysis(analysisCreateRequest) @@ -238,7 +167,7 @@ public class Example { # **findSimilarFunctionsBatch** -> BaseResponseNearestNeighborAnalysis findSimilarFunctionsBatch(analysisId, appApiRestV2SimilaritySchemaANNFunction) +> BaseResponseNearestNeighborAnalysis findSimilarFunctionsBatch(analysisId, anNFunction) Batch Symbol ANN using Analysis ID @@ -267,9 +196,9 @@ public class Example { AnalysesCoreApi apiInstance = new AnalysesCoreApi(defaultClient); Integer analysisId = 56; // Integer | - AppApiRestV2SimilaritySchemaANNFunction appApiRestV2SimilaritySchemaANNFunction = new AppApiRestV2SimilaritySchemaANNFunction(); // AppApiRestV2SimilaritySchemaANNFunction | + ANNFunction anNFunction = new ANNFunction(); // ANNFunction | try { - BaseResponseNearestNeighborAnalysis result = apiInstance.findSimilarFunctionsBatch(analysisId, appApiRestV2SimilaritySchemaANNFunction); + BaseResponseNearestNeighborAnalysis result = apiInstance.findSimilarFunctionsBatch(analysisId, anNFunction); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling AnalysesCoreApi#findSimilarFunctionsBatch"); @@ -287,7 +216,7 @@ public class Example { | Name | Type | Description | Notes | |------------- | ------------- | ------------- | -------------| | **analysisId** | **Integer**| | | -| **appApiRestV2SimilaritySchemaANNFunction** | [**AppApiRestV2SimilaritySchemaANNFunction**](AppApiRestV2SimilaritySchemaANNFunction.md)| | | +| **anNFunction** | [**ANNFunction**](ANNFunction.md)| | | ### Return type diff --git a/docs/AppApiRestV1AnnSchemaANNFunction.md b/docs/AppApiRestV1AnnSchemaANNFunction.md deleted file mode 100644 index e7bec48..0000000 --- a/docs/AppApiRestV1AnnSchemaANNFunction.md +++ /dev/null @@ -1,31 +0,0 @@ - - -# AppApiRestV1AnnSchemaANNFunction - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**resultPerFunction** | **Integer** | | [optional] | -|**distance** | **BigDecimal** | | [optional] | -|**functionIdList** | **List<Integer>** | List of function ids to compare | | -|**speculativeFunctionIds** | **List<Object>** | | [optional] | -|**collection** | **List<String>** | Perform a search on functions within a list of collections | [optional] | -|**collectionSearchList** | **List<Integer>** | Perform a search on functions within a list of collections | [optional] | -|**debugMode** | **Boolean** | | [optional] | -|**debugTypes** | [**List<DebugTypesEnum>**](#List<DebugTypesEnum>) | If limiting results to functions with debug names, which type of debug names to include? | [optional] | -|**binariesSearchList** | **List<Integer>** | Perform a search on functions within a list of analyses | [optional] | - - - -## Enum: List<DebugTypesEnum> - -| Name | Value | -|---- | -----| -| USER | "USER" | -| SYSTEM | "SYSTEM" | -| EXTERNAL | "EXTERNAL" | - - - diff --git a/docs/AppApiRestV2FunctionsTypesFunction.md b/docs/AppApiRestV2FunctionsTypesFunction.md index 98a278d..f4b93f9 100644 --- a/docs/AppApiRestV2FunctionsTypesFunction.md +++ b/docs/AppApiRestV2FunctionsTypesFunction.md @@ -8,7 +8,8 @@ | Name | Type | Description | Notes | |------------ | ------------- | ------------- | -------------| |**functionId** | **Integer** | Function id | | -|**functionName** | **String** | Function name | | +|**functionName** | **String** | Demangled name of the function | | +|**functionMangledName** | **String** | Mangled name of the function | | |**functionVaddr** | **Integer** | Function virtual address | | |**functionSize** | **Integer** | Function size | | |**debug** | **Boolean** | Whether the function is debug | | diff --git a/docs/FunctionBatchAnn.md b/docs/FunctionBatchAnn.md deleted file mode 100644 index 5656ce2..0000000 --- a/docs/FunctionBatchAnn.md +++ /dev/null @@ -1,15 +0,0 @@ - - -# FunctionBatchAnn - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**success** | **Object** | | [optional] | -|**settings** | **Object** | | | -|**functionMatches** | **Object** | | | - - - diff --git a/pom.xml b/pom.xml index b15c517..56b9731 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ sdk jar sdk - 1.98.1 + 1.99.0 https://github.com/RevEngAI/sdk-java Java SDK for the RevEng.AI API diff --git a/src/main/java/ai/reveng/api/AnalysesCoreApi.java b/src/main/java/ai/reveng/api/AnalysesCoreApi.java index 604ac15..bc3477e 100644 --- a/src/main/java/ai/reveng/api/AnalysesCoreApi.java +++ b/src/main/java/ai/reveng/api/AnalysesCoreApi.java @@ -26,12 +26,11 @@ import java.io.IOException; +import ai.reveng.model.ANNFunction; import ai.reveng.model.AnalysisCreateRequest; import ai.reveng.model.AnalysisUpdateRequest; import ai.reveng.model.AnalysisUpdateTagsRequest; -import ai.reveng.model.AppApiRestV1AnnSchemaANNFunction; import ai.reveng.model.AppApiRestV2AnalysesEnumsOrderBy; -import ai.reveng.model.AppApiRestV2SimilaritySchemaANNFunction; import ai.reveng.model.BaseResponse; import ai.reveng.model.BaseResponseAnalysisCreateResponse; import ai.reveng.model.BaseResponseAnalysisDetailResponse; @@ -50,7 +49,6 @@ import ai.reveng.model.BinaryAnnForm; import ai.reveng.model.DynamicExecutionStatusInput; import java.io.File; -import ai.reveng.model.FunctionBatchAnn; import ai.reveng.model.ModelName; import ai.reveng.model.Order; import ai.reveng.model.ReAnalysisForm; @@ -101,137 +99,6 @@ public void setCustomBaseUrl(String customBaseUrl) { this.localCustomBaseUrl = customBaseUrl; } - /** - * Build call for batchSymbolAnn - * @param appApiRestV1AnnSchemaANNFunction (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 batchSymbolAnnCall(@javax.annotation.Nonnull AppApiRestV1AnnSchemaANNFunction appApiRestV1AnnSchemaANNFunction, 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 = appApiRestV1AnnSchemaANNFunction; - - // create path and map variables - String localVarPath = "/v1/ann/symbol/batch"; - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = { - "application/json" - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - - String[] localVarAuthNames = new String[] { "APIKey" }; - return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call batchSymbolAnnValidateBeforeCall(@javax.annotation.Nonnull AppApiRestV1AnnSchemaANNFunction appApiRestV1AnnSchemaANNFunction, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'appApiRestV1AnnSchemaANNFunction' is set - if (appApiRestV1AnnSchemaANNFunction == null) { - throw new ApiException("Missing the required parameter 'appApiRestV1AnnSchemaANNFunction' when calling batchSymbolAnn(Async)"); - } - - return batchSymbolAnnCall(appApiRestV1AnnSchemaANNFunction, _callback); - - } - - /** - * Batch Symbol ANN using function IDs - * Takes in an input of functions ID's and settings and finds the nearest functions for each function that's within the database - * @param appApiRestV1AnnSchemaANNFunction (required) - * @return FunctionBatchAnn - * @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 FunctionBatchAnn batchSymbolAnn(@javax.annotation.Nonnull AppApiRestV1AnnSchemaANNFunction appApiRestV1AnnSchemaANNFunction) throws ApiException { - ApiResponse localVarResp = batchSymbolAnnWithHttpInfo(appApiRestV1AnnSchemaANNFunction); - return localVarResp.getData(); - } - - /** - * Batch Symbol ANN using function IDs - * Takes in an input of functions ID's and settings and finds the nearest functions for each function that's within the database - * @param appApiRestV1AnnSchemaANNFunction (required) - * @return ApiResponse<FunctionBatchAnn> - * @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 batchSymbolAnnWithHttpInfo(@javax.annotation.Nonnull AppApiRestV1AnnSchemaANNFunction appApiRestV1AnnSchemaANNFunction) throws ApiException { - okhttp3.Call localVarCall = batchSymbolAnnValidateBeforeCall(appApiRestV1AnnSchemaANNFunction, null); - Type localVarReturnType = new TypeToken(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * Batch Symbol ANN using function IDs (asynchronously) - * Takes in an input of functions ID's and settings and finds the nearest functions for each function that's within the database - * @param appApiRestV1AnnSchemaANNFunction (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 batchSymbolAnnAsync(@javax.annotation.Nonnull AppApiRestV1AnnSchemaANNFunction appApiRestV1AnnSchemaANNFunction, final ApiCallback _callback) throws ApiException { - - okhttp3.Call localVarCall = batchSymbolAnnValidateBeforeCall(appApiRestV1AnnSchemaANNFunction, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); - return localVarCall; - } /** * Build call for createAnalysis * @param analysisCreateRequest (required) @@ -513,7 +380,7 @@ public okhttp3.Call deleteAnalysisAsync(@javax.annotation.Nonnull Integer analys /** * Build call for findSimilarFunctionsBatch * @param analysisId (required) - * @param appApiRestV2SimilaritySchemaANNFunction (required) + * @param anNFunction (required) * @param _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object @@ -525,7 +392,7 @@ public okhttp3.Call deleteAnalysisAsync(@javax.annotation.Nonnull Integer analys 422 Invalid request parameters - */ - public okhttp3.Call findSimilarFunctionsBatchCall(@javax.annotation.Nonnull Integer analysisId, @javax.annotation.Nonnull AppApiRestV2SimilaritySchemaANNFunction appApiRestV2SimilaritySchemaANNFunction, final ApiCallback _callback) throws ApiException { + public okhttp3.Call findSimilarFunctionsBatchCall(@javax.annotation.Nonnull Integer analysisId, @javax.annotation.Nonnull ANNFunction anNFunction, final ApiCallback _callback) throws ApiException { String basePath = null; // Operation Servers String[] localBasePaths = new String[] { }; @@ -539,7 +406,7 @@ public okhttp3.Call findSimilarFunctionsBatchCall(@javax.annotation.Nonnull Inte basePath = null; } - Object localVarPostBody = appApiRestV2SimilaritySchemaANNFunction; + Object localVarPostBody = anNFunction; // create path and map variables String localVarPath = "/v2/analyses/{analysis_id}/similarity/functions" @@ -572,18 +439,18 @@ public okhttp3.Call findSimilarFunctionsBatchCall(@javax.annotation.Nonnull Inte } @SuppressWarnings("rawtypes") - private okhttp3.Call findSimilarFunctionsBatchValidateBeforeCall(@javax.annotation.Nonnull Integer analysisId, @javax.annotation.Nonnull AppApiRestV2SimilaritySchemaANNFunction appApiRestV2SimilaritySchemaANNFunction, final ApiCallback _callback) throws ApiException { + private okhttp3.Call findSimilarFunctionsBatchValidateBeforeCall(@javax.annotation.Nonnull Integer analysisId, @javax.annotation.Nonnull ANNFunction anNFunction, final ApiCallback _callback) throws ApiException { // verify the required parameter 'analysisId' is set if (analysisId == null) { throw new ApiException("Missing the required parameter 'analysisId' when calling findSimilarFunctionsBatch(Async)"); } - // verify the required parameter 'appApiRestV2SimilaritySchemaANNFunction' is set - if (appApiRestV2SimilaritySchemaANNFunction == null) { - throw new ApiException("Missing the required parameter 'appApiRestV2SimilaritySchemaANNFunction' when calling findSimilarFunctionsBatch(Async)"); + // verify the required parameter 'anNFunction' is set + if (anNFunction == null) { + throw new ApiException("Missing the required parameter 'anNFunction' when calling findSimilarFunctionsBatch(Async)"); } - return findSimilarFunctionsBatchCall(analysisId, appApiRestV2SimilaritySchemaANNFunction, _callback); + return findSimilarFunctionsBatchCall(analysisId, anNFunction, _callback); } @@ -591,7 +458,7 @@ private okhttp3.Call findSimilarFunctionsBatchValidateBeforeCall(@javax.annotati * Batch Symbol ANN using Analysis ID * Takes a analysis ID and returns the nearest functions within the database that match those functions * @param analysisId (required) - * @param appApiRestV2SimilaritySchemaANNFunction (required) + * @param anNFunction (required) * @return BaseResponseNearestNeighborAnalysis * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details @@ -602,8 +469,8 @@ private okhttp3.Call findSimilarFunctionsBatchValidateBeforeCall(@javax.annotati 422 Invalid request parameters - */ - public BaseResponseNearestNeighborAnalysis findSimilarFunctionsBatch(@javax.annotation.Nonnull Integer analysisId, @javax.annotation.Nonnull AppApiRestV2SimilaritySchemaANNFunction appApiRestV2SimilaritySchemaANNFunction) throws ApiException { - ApiResponse localVarResp = findSimilarFunctionsBatchWithHttpInfo(analysisId, appApiRestV2SimilaritySchemaANNFunction); + public BaseResponseNearestNeighborAnalysis findSimilarFunctionsBatch(@javax.annotation.Nonnull Integer analysisId, @javax.annotation.Nonnull ANNFunction anNFunction) throws ApiException { + ApiResponse localVarResp = findSimilarFunctionsBatchWithHttpInfo(analysisId, anNFunction); return localVarResp.getData(); } @@ -611,7 +478,7 @@ public BaseResponseNearestNeighborAnalysis findSimilarFunctionsBatch(@javax.anno * Batch Symbol ANN using Analysis ID * Takes a analysis ID and returns the nearest functions within the database that match those functions * @param analysisId (required) - * @param appApiRestV2SimilaritySchemaANNFunction (required) + * @param anNFunction (required) * @return ApiResponse<BaseResponseNearestNeighborAnalysis> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details @@ -622,8 +489,8 @@ public BaseResponseNearestNeighborAnalysis findSimilarFunctionsBatch(@javax.anno 422 Invalid request parameters - */ - public ApiResponse findSimilarFunctionsBatchWithHttpInfo(@javax.annotation.Nonnull Integer analysisId, @javax.annotation.Nonnull AppApiRestV2SimilaritySchemaANNFunction appApiRestV2SimilaritySchemaANNFunction) throws ApiException { - okhttp3.Call localVarCall = findSimilarFunctionsBatchValidateBeforeCall(analysisId, appApiRestV2SimilaritySchemaANNFunction, null); + public ApiResponse findSimilarFunctionsBatchWithHttpInfo(@javax.annotation.Nonnull Integer analysisId, @javax.annotation.Nonnull ANNFunction anNFunction) throws ApiException { + okhttp3.Call localVarCall = findSimilarFunctionsBatchValidateBeforeCall(analysisId, anNFunction, null); Type localVarReturnType = new TypeToken(){}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } @@ -632,7 +499,7 @@ public ApiResponse findSimilarFunctionsBatc * Batch Symbol ANN using Analysis ID (asynchronously) * Takes a analysis ID and returns the nearest functions within the database that match those functions * @param analysisId (required) - * @param appApiRestV2SimilaritySchemaANNFunction (required) + * @param anNFunction (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 @@ -644,9 +511,9 @@ public ApiResponse findSimilarFunctionsBatc 422 Invalid request parameters - */ - public okhttp3.Call findSimilarFunctionsBatchAsync(@javax.annotation.Nonnull Integer analysisId, @javax.annotation.Nonnull AppApiRestV2SimilaritySchemaANNFunction appApiRestV2SimilaritySchemaANNFunction, final ApiCallback _callback) throws ApiException { + public okhttp3.Call findSimilarFunctionsBatchAsync(@javax.annotation.Nonnull Integer analysisId, @javax.annotation.Nonnull ANNFunction anNFunction, final ApiCallback _callback) throws ApiException { - okhttp3.Call localVarCall = findSimilarFunctionsBatchValidateBeforeCall(analysisId, appApiRestV2SimilaritySchemaANNFunction, _callback); + okhttp3.Call localVarCall = findSimilarFunctionsBatchValidateBeforeCall(analysisId, anNFunction, _callback); Type localVarReturnType = new TypeToken(){}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; diff --git a/src/main/java/ai/reveng/invoker/ApiClient.java b/src/main/java/ai/reveng/invoker/ApiClient.java index d4a7787..388b894 100644 --- a/src/main/java/ai/reveng/invoker/ApiClient.java +++ b/src/main/java/ai/reveng/invoker/ApiClient.java @@ -140,7 +140,7 @@ protected void init() { json = new JSON(); // Set default User-Agent. - setUserAgent("OpenAPI-Generator/1.98.1/java"); + setUserAgent("OpenAPI-Generator/1.99.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 fe631ae..c111c04 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 = "1.98.1"; + public static final String VERSION = "1.99.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 7547e9c..10c8f10 100644 --- a/src/main/java/ai/reveng/invoker/JSON.java +++ b/src/main/java/ai/reveng/invoker/JSON.java @@ -98,6 +98,7 @@ private static Class getClassByDiscriminator(Map classByDiscriminatorValue, Stri gsonBuilder.registerTypeAdapter(OffsetDateTime.class, offsetDateTimeTypeAdapter); gsonBuilder.registerTypeAdapter(LocalDate.class, localDateTypeAdapter); gsonBuilder.registerTypeAdapter(byte[].class, byteArrayAdapter); + gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.ANNFunction.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.Addr.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.AiUnstripRequest.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.AnalysisAccessInfo.CustomTypeAdapterFactory()); @@ -114,11 +115,9 @@ private static Class getClassByDiscriminator(Map classByDiscriminatorValue, Stri gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.AnalysisUpdateRequest.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.AnalysisUpdateTagsRequest.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.AnalysisUpdateTagsResponse.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.AppApiRestV1AnnSchemaANNFunction.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.AppApiRestV2AnalysesResponsesTagItem.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.AppApiRestV2FunctionsResponsesFunction.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.AppApiRestV2FunctionsTypesFunction.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.AppApiRestV2SimilaritySchemaANNFunction.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.AppServicesBinaryAnnSchemaTagItem.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.AppServicesDynamicExecutionSchemasDynamicExecutionStatus.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.Argument.CustomTypeAdapterFactory()); @@ -258,7 +257,6 @@ private static Class getClassByDiscriminator(Map classByDiscriminatorValue, Stri gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.ExternalResponse.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.FileHashes.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.FileMetadata.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.FunctionBatchAnn.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.FunctionBlockDestinationResponse.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.FunctionBlockResponse.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.FunctionBlocksResponse.CustomTypeAdapterFactory()); diff --git a/src/main/java/ai/reveng/model/AppApiRestV2SimilaritySchemaANNFunction.java b/src/main/java/ai/reveng/model/ANNFunction.java similarity index 79% rename from src/main/java/ai/reveng/model/AppApiRestV2SimilaritySchemaANNFunction.java rename to src/main/java/ai/reveng/model/ANNFunction.java index e2e0d28..903adbc 100644 --- a/src/main/java/ai/reveng/model/AppApiRestV2SimilaritySchemaANNFunction.java +++ b/src/main/java/ai/reveng/model/ANNFunction.java @@ -51,10 +51,10 @@ import ai.reveng.invoker.JSON; /** - * AppApiRestV2SimilaritySchemaANNFunction + * ANNFunction */ @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class AppApiRestV2SimilaritySchemaANNFunction { +public class ANNFunction { public static final String SERIALIZED_NAME_LIMIT = "limit"; @SerializedName(SERIALIZED_NAME_LIMIT) @javax.annotation.Nullable @@ -90,10 +90,10 @@ public class AppApiRestV2SimilaritySchemaANNFunction { @javax.annotation.Nullable private Boolean debugOnly = false; - public AppApiRestV2SimilaritySchemaANNFunction() { + public ANNFunction() { } - public AppApiRestV2SimilaritySchemaANNFunction limit(@javax.annotation.Nullable Integer limit) { + public ANNFunction limit(@javax.annotation.Nullable Integer limit) { this.limit = limit; return this; } @@ -112,7 +112,7 @@ public void setLimit(@javax.annotation.Nullable Integer limit) { } - public AppApiRestV2SimilaritySchemaANNFunction distance(@javax.annotation.Nullable BigDecimal distance) { + public ANNFunction distance(@javax.annotation.Nullable BigDecimal distance) { this.distance = distance; return this; } @@ -131,12 +131,12 @@ public void setDistance(@javax.annotation.Nullable BigDecimal distance) { } - public AppApiRestV2SimilaritySchemaANNFunction analysisSearchIds(@javax.annotation.Nullable List analysisSearchIds) { + public ANNFunction analysisSearchIds(@javax.annotation.Nullable List analysisSearchIds) { this.analysisSearchIds = analysisSearchIds; return this; } - public AppApiRestV2SimilaritySchemaANNFunction addAnalysisSearchIdsItem(Integer analysisSearchIdsItem) { + public ANNFunction addAnalysisSearchIdsItem(Integer analysisSearchIdsItem) { if (this.analysisSearchIds == null) { this.analysisSearchIds = new ArrayList<>(); } @@ -158,12 +158,12 @@ public void setAnalysisSearchIds(@javax.annotation.Nullable List analys } - public AppApiRestV2SimilaritySchemaANNFunction collectionSearchIds(@javax.annotation.Nullable List collectionSearchIds) { + public ANNFunction collectionSearchIds(@javax.annotation.Nullable List collectionSearchIds) { this.collectionSearchIds = collectionSearchIds; return this; } - public AppApiRestV2SimilaritySchemaANNFunction addCollectionSearchIdsItem(Integer collectionSearchIdsItem) { + public ANNFunction addCollectionSearchIdsItem(Integer collectionSearchIdsItem) { if (this.collectionSearchIds == null) { this.collectionSearchIds = new ArrayList<>(); } @@ -185,12 +185,12 @@ public void setCollectionSearchIds(@javax.annotation.Nullable List coll } - public AppApiRestV2SimilaritySchemaANNFunction searchBinaryIds(@javax.annotation.Nullable List searchBinaryIds) { + public ANNFunction searchBinaryIds(@javax.annotation.Nullable List searchBinaryIds) { this.searchBinaryIds = searchBinaryIds; return this; } - public AppApiRestV2SimilaritySchemaANNFunction addSearchBinaryIdsItem(Integer searchBinaryIdsItem) { + public ANNFunction addSearchBinaryIdsItem(Integer searchBinaryIdsItem) { if (this.searchBinaryIds == null) { this.searchBinaryIds = new ArrayList<>(); } @@ -212,12 +212,12 @@ public void setSearchBinaryIds(@javax.annotation.Nullable List searchBi } - public AppApiRestV2SimilaritySchemaANNFunction searchFunctionIds(@javax.annotation.Nullable List searchFunctionIds) { + public ANNFunction searchFunctionIds(@javax.annotation.Nullable List searchFunctionIds) { this.searchFunctionIds = searchFunctionIds; return this; } - public AppApiRestV2SimilaritySchemaANNFunction addSearchFunctionIdsItem(Integer searchFunctionIdsItem) { + public ANNFunction addSearchFunctionIdsItem(Integer searchFunctionIdsItem) { if (this.searchFunctionIds == null) { this.searchFunctionIds = new ArrayList<>(); } @@ -239,7 +239,7 @@ public void setSearchFunctionIds(@javax.annotation.Nullable List search } - public AppApiRestV2SimilaritySchemaANNFunction debugOnly(@javax.annotation.Nullable Boolean debugOnly) { + public ANNFunction debugOnly(@javax.annotation.Nullable Boolean debugOnly) { this.debugOnly = debugOnly; return this; } @@ -270,9 +270,9 @@ public void setDebugOnly(@javax.annotation.Nullable Boolean debugOnly) { * * @param key name of the property * @param value value of the property - * @return the AppApiRestV2SimilaritySchemaANNFunction instance itself + * @return the ANNFunction instance itself */ - public AppApiRestV2SimilaritySchemaANNFunction putAdditionalProperty(String key, Object value) { + public ANNFunction putAdditionalProperty(String key, Object value) { if (this.additionalProperties == null) { this.additionalProperties = new HashMap(); } @@ -311,15 +311,15 @@ public boolean equals(Object o) { if (o == null || getClass() != o.getClass()) { return false; } - AppApiRestV2SimilaritySchemaANNFunction appApiRestV2SimilaritySchemaANNFunction = (AppApiRestV2SimilaritySchemaANNFunction) o; - return Objects.equals(this.limit, appApiRestV2SimilaritySchemaANNFunction.limit) && - Objects.equals(this.distance, appApiRestV2SimilaritySchemaANNFunction.distance) && - Objects.equals(this.analysisSearchIds, appApiRestV2SimilaritySchemaANNFunction.analysisSearchIds) && - Objects.equals(this.collectionSearchIds, appApiRestV2SimilaritySchemaANNFunction.collectionSearchIds) && - Objects.equals(this.searchBinaryIds, appApiRestV2SimilaritySchemaANNFunction.searchBinaryIds) && - Objects.equals(this.searchFunctionIds, appApiRestV2SimilaritySchemaANNFunction.searchFunctionIds) && - Objects.equals(this.debugOnly, appApiRestV2SimilaritySchemaANNFunction.debugOnly)&& - Objects.equals(this.additionalProperties, appApiRestV2SimilaritySchemaANNFunction.additionalProperties); + ANNFunction anNFunction = (ANNFunction) o; + return Objects.equals(this.limit, anNFunction.limit) && + Objects.equals(this.distance, anNFunction.distance) && + Objects.equals(this.analysisSearchIds, anNFunction.analysisSearchIds) && + Objects.equals(this.collectionSearchIds, anNFunction.collectionSearchIds) && + Objects.equals(this.searchBinaryIds, anNFunction.searchBinaryIds) && + Objects.equals(this.searchFunctionIds, anNFunction.searchFunctionIds) && + Objects.equals(this.debugOnly, anNFunction.debugOnly)&& + Objects.equals(this.additionalProperties, anNFunction.additionalProperties); } private static boolean equalsNullable(JsonNullable a, JsonNullable b) { @@ -341,7 +341,7 @@ private static int hashCodeNullable(JsonNullable a) { @Override public String toString() { StringBuilder sb = new StringBuilder(); - sb.append("class AppApiRestV2SimilaritySchemaANNFunction {\n"); + sb.append("class ANNFunction {\n"); sb.append(" limit: ").append(toIndentedString(limit)).append("\n"); sb.append(" distance: ").append(toIndentedString(distance)).append("\n"); sb.append(" analysisSearchIds: ").append(toIndentedString(analysisSearchIds)).append("\n"); @@ -381,12 +381,12 @@ private String toIndentedString(Object o) { * 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 AppApiRestV2SimilaritySchemaANNFunction + * @throws IOException if the JSON Element is invalid with respect to ANNFunction */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (jsonElement == null) { - if (!AppApiRestV2SimilaritySchemaANNFunction.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format(Locale.ROOT, "The required field(s) %s in AppApiRestV2SimilaritySchemaANNFunction is not found in the empty JSON string", AppApiRestV2SimilaritySchemaANNFunction.openapiRequiredFields.toString())); + if (!ANNFunction.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format(Locale.ROOT, "The required field(s) %s in ANNFunction is not found in the empty JSON string", ANNFunction.openapiRequiredFields.toString())); } } JsonObject jsonObj = jsonElement.getAsJsonObject(); @@ -412,16 +412,16 @@ public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @SuppressWarnings("unchecked") @Override public TypeAdapter create(Gson gson, TypeToken type) { - if (!AppApiRestV2SimilaritySchemaANNFunction.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'AppApiRestV2SimilaritySchemaANNFunction' and its subtypes + if (!ANNFunction.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ANNFunction' and its subtypes } final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(AppApiRestV2SimilaritySchemaANNFunction.class)); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ANNFunction.class)); - return (TypeAdapter) new TypeAdapter() { + return (TypeAdapter) new TypeAdapter() { @Override - public void write(JsonWriter out, AppApiRestV2SimilaritySchemaANNFunction value) throws IOException { + public void write(JsonWriter out, ANNFunction value) throws IOException { JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); obj.remove("additionalProperties"); // serialize additional properties @@ -449,12 +449,12 @@ else if (entry.getValue() instanceof Character) } @Override - public AppApiRestV2SimilaritySchemaANNFunction read(JsonReader in) throws IOException { + public ANNFunction read(JsonReader in) throws IOException { JsonElement jsonElement = elementAdapter.read(in); validateJsonElement(jsonElement); JsonObject jsonObj = jsonElement.getAsJsonObject(); // store additional fields in the deserialized instance - AppApiRestV2SimilaritySchemaANNFunction instance = thisAdapter.fromJsonTree(jsonObj); + ANNFunction instance = thisAdapter.fromJsonTree(jsonObj); for (Map.Entry entry : jsonObj.entrySet()) { if (!openapiFields.contains(entry.getKey())) { if (entry.getValue().isJsonPrimitive()) { // primitive type @@ -481,18 +481,18 @@ else if (entry.getValue().getAsJsonPrimitive().isBoolean()) } /** - * Create an instance of AppApiRestV2SimilaritySchemaANNFunction given an JSON string + * Create an instance of ANNFunction given an JSON string * * @param jsonString JSON string - * @return An instance of AppApiRestV2SimilaritySchemaANNFunction - * @throws IOException if the JSON string is invalid with respect to AppApiRestV2SimilaritySchemaANNFunction + * @return An instance of ANNFunction + * @throws IOException if the JSON string is invalid with respect to ANNFunction */ - public static AppApiRestV2SimilaritySchemaANNFunction fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, AppApiRestV2SimilaritySchemaANNFunction.class); + public static ANNFunction fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ANNFunction.class); } /** - * Convert an instance of AppApiRestV2SimilaritySchemaANNFunction to an JSON string + * Convert an instance of ANNFunction to an JSON string * * @return JSON string */ diff --git a/src/main/java/ai/reveng/model/AppApiRestV1AnnSchemaANNFunction.java b/src/main/java/ai/reveng/model/AppApiRestV1AnnSchemaANNFunction.java deleted file mode 100644 index 59ff382..0000000 --- a/src/main/java/ai/reveng/model/AppApiRestV1AnnSchemaANNFunction.java +++ /dev/null @@ -1,562 +0,0 @@ -/* - * 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 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.math.BigDecimal; -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; - -/** - * AppApiRestV1AnnSchemaANNFunction - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class AppApiRestV1AnnSchemaANNFunction { - public static final String SERIALIZED_NAME_RESULT_PER_FUNCTION = "result_per_function"; - @SerializedName(SERIALIZED_NAME_RESULT_PER_FUNCTION) - @javax.annotation.Nullable - private Integer resultPerFunction; - - public static final String SERIALIZED_NAME_DISTANCE = "distance"; - @SerializedName(SERIALIZED_NAME_DISTANCE) - @javax.annotation.Nullable - private BigDecimal distance; - - public static final String SERIALIZED_NAME_FUNCTION_ID_LIST = "function_id_list"; - @SerializedName(SERIALIZED_NAME_FUNCTION_ID_LIST) - @javax.annotation.Nonnull - private List functionIdList = new ArrayList<>(); - - public static final String SERIALIZED_NAME_SPECULATIVE_FUNCTION_IDS = "speculative_function_ids"; - @SerializedName(SERIALIZED_NAME_SPECULATIVE_FUNCTION_IDS) - @javax.annotation.Nullable - private List speculativeFunctionIds; - - public static final String SERIALIZED_NAME_COLLECTION = "collection"; - @SerializedName(SERIALIZED_NAME_COLLECTION) - @javax.annotation.Nullable - private List collection = new ArrayList<>(); - - public static final String SERIALIZED_NAME_COLLECTION_SEARCH_LIST = "collection_search_list"; - @SerializedName(SERIALIZED_NAME_COLLECTION_SEARCH_LIST) - @javax.annotation.Nullable - private List collectionSearchList = new ArrayList<>(); - - public static final String SERIALIZED_NAME_DEBUG_MODE = "debug_mode"; - @SerializedName(SERIALIZED_NAME_DEBUG_MODE) - @javax.annotation.Nullable - private Boolean debugMode; - - /** - * Gets or Sets debugTypes - */ - @JsonAdapter(DebugTypesEnum.Adapter.class) - public enum DebugTypesEnum { - USER("USER"), - - SYSTEM("SYSTEM"), - - EXTERNAL("EXTERNAL"); - - private String value; - - DebugTypesEnum(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - public static DebugTypesEnum fromValue(String value) { - for (DebugTypesEnum b : DebugTypesEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - - public static class Adapter extends TypeAdapter { - @Override - public void write(final JsonWriter jsonWriter, final DebugTypesEnum enumeration) throws IOException { - jsonWriter.value(enumeration.getValue()); - } - - @Override - public DebugTypesEnum read(final JsonReader jsonReader) throws IOException { - String value = jsonReader.nextString(); - return DebugTypesEnum.fromValue(value); - } - } - - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - String value = jsonElement.getAsString(); - DebugTypesEnum.fromValue(value); - } - } - - public static final String SERIALIZED_NAME_DEBUG_TYPES = "debug_types"; - @SerializedName(SERIALIZED_NAME_DEBUG_TYPES) - @javax.annotation.Nullable - private List debugTypes = new ArrayList<>(Arrays.asList(DebugTypesEnum.SYSTEM)); - - public static final String SERIALIZED_NAME_BINARIES_SEARCH_LIST = "binaries_search_list"; - @SerializedName(SERIALIZED_NAME_BINARIES_SEARCH_LIST) - @javax.annotation.Nullable - private List binariesSearchList = new ArrayList<>(); - - public AppApiRestV1AnnSchemaANNFunction() { - } - - public AppApiRestV1AnnSchemaANNFunction resultPerFunction(@javax.annotation.Nullable Integer resultPerFunction) { - this.resultPerFunction = resultPerFunction; - return this; - } - - /** - * Get resultPerFunction - * maximum: 20 - * @return resultPerFunction - */ - @javax.annotation.Nullable - public Integer getResultPerFunction() { - return resultPerFunction; - } - - public void setResultPerFunction(@javax.annotation.Nullable Integer resultPerFunction) { - this.resultPerFunction = resultPerFunction; - } - - - public AppApiRestV1AnnSchemaANNFunction distance(@javax.annotation.Nullable BigDecimal distance) { - this.distance = distance; - return this; - } - - /** - * Get distance - * @return distance - */ - @javax.annotation.Nullable - public BigDecimal getDistance() { - return distance; - } - - public void setDistance(@javax.annotation.Nullable BigDecimal distance) { - this.distance = distance; - } - - - public AppApiRestV1AnnSchemaANNFunction functionIdList(@javax.annotation.Nonnull List functionIdList) { - this.functionIdList = functionIdList; - return this; - } - - public AppApiRestV1AnnSchemaANNFunction addFunctionIdListItem(Integer functionIdListItem) { - if (this.functionIdList == null) { - this.functionIdList = new ArrayList<>(); - } - this.functionIdList.add(functionIdListItem); - return this; - } - - /** - * List of function ids to compare - * @return functionIdList - */ - @javax.annotation.Nonnull - public List getFunctionIdList() { - return functionIdList; - } - - public void setFunctionIdList(@javax.annotation.Nonnull List functionIdList) { - this.functionIdList = functionIdList; - } - - - public AppApiRestV1AnnSchemaANNFunction speculativeFunctionIds(@javax.annotation.Nullable List speculativeFunctionIds) { - this.speculativeFunctionIds = speculativeFunctionIds; - return this; - } - - public AppApiRestV1AnnSchemaANNFunction addSpeculativeFunctionIdsItem(Object speculativeFunctionIdsItem) { - if (this.speculativeFunctionIds == null) { - this.speculativeFunctionIds = new ArrayList<>(); - } - this.speculativeFunctionIds.add(speculativeFunctionIdsItem); - return this; - } - - /** - * Get speculativeFunctionIds - * @return speculativeFunctionIds - */ - @javax.annotation.Nullable - public List getSpeculativeFunctionIds() { - return speculativeFunctionIds; - } - - public void setSpeculativeFunctionIds(@javax.annotation.Nullable List speculativeFunctionIds) { - this.speculativeFunctionIds = speculativeFunctionIds; - } - - - public AppApiRestV1AnnSchemaANNFunction collection(@javax.annotation.Nullable List collection) { - this.collection = collection; - return this; - } - - public AppApiRestV1AnnSchemaANNFunction addCollectionItem(String collectionItem) { - if (this.collection == null) { - this.collection = new ArrayList<>(); - } - this.collection.add(collectionItem); - return this; - } - - /** - * Perform a search on functions within a list of collections - * @return collection - */ - @javax.annotation.Nullable - public List getCollection() { - return collection; - } - - public void setCollection(@javax.annotation.Nullable List collection) { - this.collection = collection; - } - - - public AppApiRestV1AnnSchemaANNFunction collectionSearchList(@javax.annotation.Nullable List collectionSearchList) { - this.collectionSearchList = collectionSearchList; - return this; - } - - public AppApiRestV1AnnSchemaANNFunction addCollectionSearchListItem(Integer collectionSearchListItem) { - if (this.collectionSearchList == null) { - this.collectionSearchList = new ArrayList<>(); - } - this.collectionSearchList.add(collectionSearchListItem); - return this; - } - - /** - * Perform a search on functions within a list of collections - * @return collectionSearchList - */ - @javax.annotation.Nullable - public List getCollectionSearchList() { - return collectionSearchList; - } - - public void setCollectionSearchList(@javax.annotation.Nullable List collectionSearchList) { - this.collectionSearchList = collectionSearchList; - } - - - public AppApiRestV1AnnSchemaANNFunction debugMode(@javax.annotation.Nullable Boolean debugMode) { - this.debugMode = debugMode; - return this; - } - - /** - * Get debugMode - * @return debugMode - */ - @javax.annotation.Nullable - public Boolean getDebugMode() { - return debugMode; - } - - public void setDebugMode(@javax.annotation.Nullable Boolean debugMode) { - this.debugMode = debugMode; - } - - - public AppApiRestV1AnnSchemaANNFunction debugTypes(@javax.annotation.Nullable List debugTypes) { - this.debugTypes = debugTypes; - return this; - } - - public AppApiRestV1AnnSchemaANNFunction addDebugTypesItem(DebugTypesEnum debugTypesItem) { - if (this.debugTypes == null) { - this.debugTypes = new ArrayList<>(Arrays.asList(DebugTypesEnum.SYSTEM)); - } - this.debugTypes.add(debugTypesItem); - return this; - } - - /** - * If limiting results to functions with debug names, which type of debug names to include? - * @return debugTypes - */ - @javax.annotation.Nullable - public List getDebugTypes() { - return debugTypes; - } - - public void setDebugTypes(@javax.annotation.Nullable List debugTypes) { - this.debugTypes = debugTypes; - } - - - public AppApiRestV1AnnSchemaANNFunction binariesSearchList(@javax.annotation.Nullable List binariesSearchList) { - this.binariesSearchList = binariesSearchList; - return this; - } - - public AppApiRestV1AnnSchemaANNFunction addBinariesSearchListItem(Integer binariesSearchListItem) { - if (this.binariesSearchList == null) { - this.binariesSearchList = new ArrayList<>(); - } - this.binariesSearchList.add(binariesSearchListItem); - return this; - } - - /** - * Perform a search on functions within a list of analyses - * @return binariesSearchList - */ - @javax.annotation.Nullable - public List getBinariesSearchList() { - return binariesSearchList; - } - - public void setBinariesSearchList(@javax.annotation.Nullable List binariesSearchList) { - this.binariesSearchList = binariesSearchList; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - AppApiRestV1AnnSchemaANNFunction appApiRestV1AnnSchemaANNFunction = (AppApiRestV1AnnSchemaANNFunction) o; - return Objects.equals(this.resultPerFunction, appApiRestV1AnnSchemaANNFunction.resultPerFunction) && - Objects.equals(this.distance, appApiRestV1AnnSchemaANNFunction.distance) && - Objects.equals(this.functionIdList, appApiRestV1AnnSchemaANNFunction.functionIdList) && - Objects.equals(this.speculativeFunctionIds, appApiRestV1AnnSchemaANNFunction.speculativeFunctionIds) && - Objects.equals(this.collection, appApiRestV1AnnSchemaANNFunction.collection) && - Objects.equals(this.collectionSearchList, appApiRestV1AnnSchemaANNFunction.collectionSearchList) && - Objects.equals(this.debugMode, appApiRestV1AnnSchemaANNFunction.debugMode) && - Objects.equals(this.debugTypes, appApiRestV1AnnSchemaANNFunction.debugTypes) && - Objects.equals(this.binariesSearchList, appApiRestV1AnnSchemaANNFunction.binariesSearchList); - } - - 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(resultPerFunction, distance, functionIdList, speculativeFunctionIds, collection, collectionSearchList, debugMode, debugTypes, binariesSearchList); - } - - 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 AppApiRestV1AnnSchemaANNFunction {\n"); - sb.append(" resultPerFunction: ").append(toIndentedString(resultPerFunction)).append("\n"); - sb.append(" distance: ").append(toIndentedString(distance)).append("\n"); - sb.append(" functionIdList: ").append(toIndentedString(functionIdList)).append("\n"); - sb.append(" speculativeFunctionIds: ").append(toIndentedString(speculativeFunctionIds)).append("\n"); - sb.append(" collection: ").append(toIndentedString(collection)).append("\n"); - sb.append(" collectionSearchList: ").append(toIndentedString(collectionSearchList)).append("\n"); - sb.append(" debugMode: ").append(toIndentedString(debugMode)).append("\n"); - sb.append(" debugTypes: ").append(toIndentedString(debugTypes)).append("\n"); - sb.append(" binariesSearchList: ").append(toIndentedString(binariesSearchList)).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("result_per_function", "distance", "function_id_list", "speculative_function_ids", "collection", "collection_search_list", "debug_mode", "debug_types", "binaries_search_list")); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(Arrays.asList("function_id_list")); - } - - /** - * 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 AppApiRestV1AnnSchemaANNFunction - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!AppApiRestV1AnnSchemaANNFunction.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format(Locale.ROOT, "The required field(s) %s in AppApiRestV1AnnSchemaANNFunction is not found in the empty JSON string", AppApiRestV1AnnSchemaANNFunction.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!AppApiRestV1AnnSchemaANNFunction.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format(Locale.ROOT, "The field `%s` in the JSON string is not defined in the `AppApiRestV1AnnSchemaANNFunction` properties. JSON: %s", entry.getKey(), jsonElement.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : AppApiRestV1AnnSchemaANNFunction.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException(String.format(Locale.ROOT, "The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // ensure the required json array is present - if (jsonObj.get("function_id_list") == null) { - throw new IllegalArgumentException("Expected the field `linkedContent` to be an array in the JSON string but got `null`"); - } else if (!jsonObj.get("function_id_list").isJsonArray()) { - throw new IllegalArgumentException(String.format(Locale.ROOT, "Expected the field `function_id_list` to be an array in the JSON string but got `%s`", jsonObj.get("function_id_list").toString())); - } - // ensure the optional json data is an array if present - if (jsonObj.get("speculative_function_ids") != null && !jsonObj.get("speculative_function_ids").isJsonNull() && !jsonObj.get("speculative_function_ids").isJsonArray()) { - throw new IllegalArgumentException(String.format(Locale.ROOT, "Expected the field `speculative_function_ids` to be an array in the JSON string but got `%s`", jsonObj.get("speculative_function_ids").toString())); - } - // ensure the optional json data is an array if present - if (jsonObj.get("collection") != null && !jsonObj.get("collection").isJsonNull() && !jsonObj.get("collection").isJsonArray()) { - throw new IllegalArgumentException(String.format(Locale.ROOT, "Expected the field `collection` to be an array in the JSON string but got `%s`", jsonObj.get("collection").toString())); - } - // ensure the optional json data is an array if present - if (jsonObj.get("collection_search_list") != null && !jsonObj.get("collection_search_list").isJsonNull() && !jsonObj.get("collection_search_list").isJsonArray()) { - throw new IllegalArgumentException(String.format(Locale.ROOT, "Expected the field `collection_search_list` to be an array in the JSON string but got `%s`", jsonObj.get("collection_search_list").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())); - } - // ensure the optional json data is an array if present - if (jsonObj.get("binaries_search_list") != null && !jsonObj.get("binaries_search_list").isJsonNull() && !jsonObj.get("binaries_search_list").isJsonArray()) { - throw new IllegalArgumentException(String.format(Locale.ROOT, "Expected the field `binaries_search_list` to be an array in the JSON string but got `%s`", jsonObj.get("binaries_search_list").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!AppApiRestV1AnnSchemaANNFunction.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'AppApiRestV1AnnSchemaANNFunction' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(AppApiRestV1AnnSchemaANNFunction.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, AppApiRestV1AnnSchemaANNFunction value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public AppApiRestV1AnnSchemaANNFunction read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of AppApiRestV1AnnSchemaANNFunction given an JSON string - * - * @param jsonString JSON string - * @return An instance of AppApiRestV1AnnSchemaANNFunction - * @throws IOException if the JSON string is invalid with respect to AppApiRestV1AnnSchemaANNFunction - */ - public static AppApiRestV1AnnSchemaANNFunction fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, AppApiRestV1AnnSchemaANNFunction.class); - } - - /** - * Convert an instance of AppApiRestV1AnnSchemaANNFunction to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/ai/reveng/model/AppApiRestV2FunctionsTypesFunction.java b/src/main/java/ai/reveng/model/AppApiRestV2FunctionsTypesFunction.java index b9db6ad..b5566ac 100644 --- a/src/main/java/ai/reveng/model/AppApiRestV2FunctionsTypesFunction.java +++ b/src/main/java/ai/reveng/model/AppApiRestV2FunctionsTypesFunction.java @@ -64,6 +64,11 @@ public class AppApiRestV2FunctionsTypesFunction { @javax.annotation.Nonnull private String functionName; + public static final String SERIALIZED_NAME_FUNCTION_MANGLED_NAME = "function_mangled_name"; + @SerializedName(SERIALIZED_NAME_FUNCTION_MANGLED_NAME) + @javax.annotation.Nonnull + private String functionMangledName; + public static final String SERIALIZED_NAME_FUNCTION_VADDR = "function_vaddr"; @SerializedName(SERIALIZED_NAME_FUNCTION_VADDR) @javax.annotation.Nonnull @@ -117,7 +122,7 @@ public AppApiRestV2FunctionsTypesFunction functionName(@javax.annotation.Nonnull } /** - * Function name + * Demangled name of the function * @return functionName */ @javax.annotation.Nonnull @@ -130,6 +135,25 @@ public void setFunctionName(@javax.annotation.Nonnull String functionName) { } + public AppApiRestV2FunctionsTypesFunction functionMangledName(@javax.annotation.Nonnull String functionMangledName) { + this.functionMangledName = functionMangledName; + return this; + } + + /** + * Mangled name of the function + * @return functionMangledName + */ + @javax.annotation.Nonnull + public String getFunctionMangledName() { + return functionMangledName; + } + + public void setFunctionMangledName(@javax.annotation.Nonnull String functionMangledName) { + this.functionMangledName = functionMangledName; + } + + public AppApiRestV2FunctionsTypesFunction functionVaddr(@javax.annotation.Nonnull Integer functionVaddr) { this.functionVaddr = functionVaddr; return this; @@ -253,6 +277,7 @@ public boolean equals(Object o) { AppApiRestV2FunctionsTypesFunction appApiRestV2FunctionsTypesFunction = (AppApiRestV2FunctionsTypesFunction) o; return Objects.equals(this.functionId, appApiRestV2FunctionsTypesFunction.functionId) && Objects.equals(this.functionName, appApiRestV2FunctionsTypesFunction.functionName) && + Objects.equals(this.functionMangledName, appApiRestV2FunctionsTypesFunction.functionMangledName) && Objects.equals(this.functionVaddr, appApiRestV2FunctionsTypesFunction.functionVaddr) && Objects.equals(this.functionSize, appApiRestV2FunctionsTypesFunction.functionSize) && Objects.equals(this.debug, appApiRestV2FunctionsTypesFunction.debug) && @@ -262,7 +287,7 @@ public boolean equals(Object o) { @Override public int hashCode() { - return Objects.hash(functionId, functionName, functionVaddr, functionSize, debug, embedding3d, embedding1d); + return Objects.hash(functionId, functionName, functionMangledName, functionVaddr, functionSize, debug, embedding3d, embedding1d); } @Override @@ -271,6 +296,7 @@ public String toString() { sb.append("class AppApiRestV2FunctionsTypesFunction {\n"); sb.append(" functionId: ").append(toIndentedString(functionId)).append("\n"); sb.append(" functionName: ").append(toIndentedString(functionName)).append("\n"); + sb.append(" functionMangledName: ").append(toIndentedString(functionMangledName)).append("\n"); sb.append(" functionVaddr: ").append(toIndentedString(functionVaddr)).append("\n"); sb.append(" functionSize: ").append(toIndentedString(functionSize)).append("\n"); sb.append(" debug: ").append(toIndentedString(debug)).append("\n"); @@ -297,10 +323,10 @@ private String toIndentedString(Object o) { static { // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(Arrays.asList("function_id", "function_name", "function_vaddr", "function_size", "debug", "embedding_3d", "embedding_1d")); + openapiFields = new HashSet(Arrays.asList("function_id", "function_name", "function_mangled_name", "function_vaddr", "function_size", "debug", "embedding_3d", "embedding_1d")); // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(Arrays.asList("function_id", "function_name", "function_vaddr", "function_size", "debug", "embedding_3d", "embedding_1d")); + openapiRequiredFields = new HashSet(Arrays.asList("function_id", "function_name", "function_mangled_name", "function_vaddr", "function_size", "debug", "embedding_3d", "embedding_1d")); } /** @@ -334,6 +360,9 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti if (!jsonObj.get("function_name").isJsonPrimitive()) { throw new IllegalArgumentException(String.format(Locale.ROOT, "Expected the field `function_name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("function_name").toString())); } + if (!jsonObj.get("function_mangled_name").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(Locale.ROOT, "Expected the field `function_mangled_name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("function_mangled_name").toString())); + } // ensure the required json array is present if (jsonObj.get("embedding_3d") == null) { throw new IllegalArgumentException("Expected the field `linkedContent` to be an array in the JSON string but got `null`"); diff --git a/src/main/java/ai/reveng/model/FunctionBatchAnn.java b/src/main/java/ai/reveng/model/FunctionBatchAnn.java deleted file mode 100644 index 41713f8..0000000 --- a/src/main/java/ai/reveng/model/FunctionBatchAnn.java +++ /dev/null @@ -1,274 +0,0 @@ -/* - * 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 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.Arrays; -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; - -/** - * FunctionBatchAnn - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class FunctionBatchAnn { - public static final String SERIALIZED_NAME_SUCCESS = "success"; - @SerializedName(SERIALIZED_NAME_SUCCESS) - @javax.annotation.Nullable - private Object success = true; - - public static final String SERIALIZED_NAME_SETTINGS = "settings"; - @SerializedName(SERIALIZED_NAME_SETTINGS) - @javax.annotation.Nullable - private Object settings = null; - - public static final String SERIALIZED_NAME_FUNCTION_MATCHES = "function_matches"; - @SerializedName(SERIALIZED_NAME_FUNCTION_MATCHES) - @javax.annotation.Nullable - private Object functionMatches = null; - - public FunctionBatchAnn() { - } - - public FunctionBatchAnn success(@javax.annotation.Nullable Object success) { - this.success = success; - return this; - } - - /** - * Get success - * @return success - */ - @javax.annotation.Nullable - public Object getSuccess() { - return success; - } - - public void setSuccess(@javax.annotation.Nullable Object success) { - this.success = success; - } - - - public FunctionBatchAnn settings(@javax.annotation.Nullable Object settings) { - this.settings = settings; - return this; - } - - /** - * Get settings - * @return settings - */ - @javax.annotation.Nullable - public Object getSettings() { - return settings; - } - - public void setSettings(@javax.annotation.Nullable Object settings) { - this.settings = settings; - } - - - public FunctionBatchAnn functionMatches(@javax.annotation.Nullable Object functionMatches) { - this.functionMatches = functionMatches; - return this; - } - - /** - * Get functionMatches - * @return functionMatches - */ - @javax.annotation.Nullable - public Object getFunctionMatches() { - return functionMatches; - } - - public void setFunctionMatches(@javax.annotation.Nullable Object functionMatches) { - this.functionMatches = functionMatches; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - FunctionBatchAnn functionBatchAnn = (FunctionBatchAnn) o; - return Objects.equals(this.success, functionBatchAnn.success) && - Objects.equals(this.settings, functionBatchAnn.settings) && - Objects.equals(this.functionMatches, functionBatchAnn.functionMatches); - } - - 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(success, settings, functionMatches); - } - - 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 FunctionBatchAnn {\n"); - sb.append(" success: ").append(toIndentedString(success)).append("\n"); - sb.append(" settings: ").append(toIndentedString(settings)).append("\n"); - sb.append(" functionMatches: ").append(toIndentedString(functionMatches)).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("success", "settings", "function_matches")); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(Arrays.asList("settings", "function_matches")); - } - - /** - * 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 FunctionBatchAnn - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!FunctionBatchAnn.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format(Locale.ROOT, "The required field(s) %s in FunctionBatchAnn is not found in the empty JSON string", FunctionBatchAnn.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!FunctionBatchAnn.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format(Locale.ROOT, "The field `%s` in the JSON string is not defined in the `FunctionBatchAnn` properties. JSON: %s", entry.getKey(), jsonElement.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : FunctionBatchAnn.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException(String.format(Locale.ROOT, "The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!FunctionBatchAnn.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'FunctionBatchAnn' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(FunctionBatchAnn.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, FunctionBatchAnn value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public FunctionBatchAnn read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of FunctionBatchAnn given an JSON string - * - * @param jsonString JSON string - * @return An instance of FunctionBatchAnn - * @throws IOException if the JSON string is invalid with respect to FunctionBatchAnn - */ - public static FunctionBatchAnn fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, FunctionBatchAnn.class); - } - - /** - * Convert an instance of FunctionBatchAnn to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/test/java/ai/reveng/api/AnalysesCoreApiTest.java b/src/test/java/ai/reveng/api/AnalysesCoreApiTest.java index 5a5386f..dcd9f1d 100644 --- a/src/test/java/ai/reveng/api/AnalysesCoreApiTest.java +++ b/src/test/java/ai/reveng/api/AnalysesCoreApiTest.java @@ -13,12 +13,11 @@ package ai.reveng.api; import ai.reveng.invoker.ApiException; +import ai.reveng.model.ANNFunction; import ai.reveng.model.AnalysisCreateRequest; import ai.reveng.model.AnalysisUpdateRequest; import ai.reveng.model.AnalysisUpdateTagsRequest; -import ai.reveng.model.AppApiRestV1AnnSchemaANNFunction; import ai.reveng.model.AppApiRestV2AnalysesEnumsOrderBy; -import ai.reveng.model.AppApiRestV2SimilaritySchemaANNFunction; import ai.reveng.model.BaseResponse; import ai.reveng.model.BaseResponseAnalysisCreateResponse; import ai.reveng.model.BaseResponseAnalysisDetailResponse; @@ -37,7 +36,6 @@ import ai.reveng.model.BinaryAnnForm; import ai.reveng.model.DynamicExecutionStatusInput; import java.io.File; -import ai.reveng.model.FunctionBatchAnn; import ai.reveng.model.ModelName; import ai.reveng.model.Order; import ai.reveng.model.ReAnalysisForm; @@ -60,20 +58,6 @@ public class AnalysesCoreApiTest { private final AnalysesCoreApi api = new AnalysesCoreApi(); - /** - * Batch Symbol ANN using function IDs - * - * Takes in an input of functions ID's and settings and finds the nearest functions for each function that's within the database - * - * @throws ApiException if the Api call fails - */ - @Test - public void batchSymbolAnnTest() throws ApiException { - AppApiRestV1AnnSchemaANNFunction appApiRestV1AnnSchemaANNFunction = null; - FunctionBatchAnn response = api.batchSymbolAnn(appApiRestV1AnnSchemaANNFunction); - // TODO: test validations - } - /** * Create Analysis * @@ -112,8 +96,8 @@ public void deleteAnalysisTest() throws ApiException { @Test public void findSimilarFunctionsBatchTest() throws ApiException { Integer analysisId = null; - AppApiRestV2SimilaritySchemaANNFunction appApiRestV2SimilaritySchemaANNFunction = null; - BaseResponseNearestNeighborAnalysis response = api.findSimilarFunctionsBatch(analysisId, appApiRestV2SimilaritySchemaANNFunction); + ANNFunction anNFunction = null; + BaseResponseNearestNeighborAnalysis response = api.findSimilarFunctionsBatch(analysisId, anNFunction); // TODO: test validations } diff --git a/src/test/java/ai/reveng/model/AppApiRestV2SimilaritySchemaANNFunctionTest.java b/src/test/java/ai/reveng/model/ANNFunctionTest.java similarity index 81% rename from src/test/java/ai/reveng/model/AppApiRestV2SimilaritySchemaANNFunctionTest.java rename to src/test/java/ai/reveng/model/ANNFunctionTest.java index 2db4140..3e7142a 100644 --- a/src/test/java/ai/reveng/model/AppApiRestV2SimilaritySchemaANNFunctionTest.java +++ b/src/test/java/ai/reveng/model/ANNFunctionTest.java @@ -27,17 +27,17 @@ import org.junit.jupiter.api.Test; /** - * Model tests for AppApiRestV2SimilaritySchemaANNFunction + * Model tests for ANNFunction */ -public class AppApiRestV2SimilaritySchemaANNFunctionTest { - private final AppApiRestV2SimilaritySchemaANNFunction model = new AppApiRestV2SimilaritySchemaANNFunction(); +public class ANNFunctionTest { + private final ANNFunction model = new ANNFunction(); /** - * Model tests for AppApiRestV2SimilaritySchemaANNFunction + * Model tests for ANNFunction */ @Test - public void testAppApiRestV2SimilaritySchemaANNFunction() { - // TODO: test AppApiRestV2SimilaritySchemaANNFunction + public void testANNFunction() { + // TODO: test ANNFunction } /** diff --git a/src/test/java/ai/reveng/model/AppApiRestV1AnnSchemaANNFunctionTest.java b/src/test/java/ai/reveng/model/AppApiRestV1AnnSchemaANNFunctionTest.java deleted file mode 100644 index ea49a29..0000000 --- a/src/test/java/ai/reveng/model/AppApiRestV1AnnSchemaANNFunctionTest.java +++ /dev/null @@ -1,115 +0,0 @@ -/* - * 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.math.BigDecimal; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; -import org.openapitools.jackson.nullable.JsonNullable; -import org.junit.jupiter.api.Disabled; -import org.junit.jupiter.api.Test; - -/** - * Model tests for AppApiRestV1AnnSchemaANNFunction - */ -public class AppApiRestV1AnnSchemaANNFunctionTest { - private final AppApiRestV1AnnSchemaANNFunction model = new AppApiRestV1AnnSchemaANNFunction(); - - /** - * Model tests for AppApiRestV1AnnSchemaANNFunction - */ - @Test - public void testAppApiRestV1AnnSchemaANNFunction() { - // TODO: test AppApiRestV1AnnSchemaANNFunction - } - - /** - * Test the property 'resultPerFunction' - */ - @Test - public void resultPerFunctionTest() { - // TODO: test resultPerFunction - } - - /** - * Test the property 'distance' - */ - @Test - public void distanceTest() { - // TODO: test distance - } - - /** - * Test the property 'functionIdList' - */ - @Test - public void functionIdListTest() { - // TODO: test functionIdList - } - - /** - * Test the property 'speculativeFunctionIds' - */ - @Test - public void speculativeFunctionIdsTest() { - // TODO: test speculativeFunctionIds - } - - /** - * Test the property 'collection' - */ - @Test - public void collectionTest() { - // TODO: test collection - } - - /** - * Test the property 'collectionSearchList' - */ - @Test - public void collectionSearchListTest() { - // TODO: test collectionSearchList - } - - /** - * Test the property 'debugMode' - */ - @Test - public void debugModeTest() { - // TODO: test debugMode - } - - /** - * Test the property 'debugTypes' - */ - @Test - public void debugTypesTest() { - // TODO: test debugTypes - } - - /** - * Test the property 'binariesSearchList' - */ - @Test - public void binariesSearchListTest() { - // TODO: test binariesSearchList - } - -} diff --git a/src/test/java/ai/reveng/model/AppApiRestV2FunctionsTypesFunctionTest.java b/src/test/java/ai/reveng/model/AppApiRestV2FunctionsTypesFunctionTest.java index a7a847e..c974532 100644 --- a/src/test/java/ai/reveng/model/AppApiRestV2FunctionsTypesFunctionTest.java +++ b/src/test/java/ai/reveng/model/AppApiRestV2FunctionsTypesFunctionTest.java @@ -55,6 +55,14 @@ public void functionNameTest() { // TODO: test functionName } + /** + * Test the property 'functionMangledName' + */ + @Test + public void functionMangledNameTest() { + // TODO: test functionMangledName + } + /** * Test the property 'functionVaddr' */ diff --git a/src/test/java/ai/reveng/model/FunctionBatchAnnTest.java b/src/test/java/ai/reveng/model/FunctionBatchAnnTest.java deleted file mode 100644 index 2f9f1ff..0000000 --- a/src/test/java/ai/reveng/model/FunctionBatchAnnTest.java +++ /dev/null @@ -1,64 +0,0 @@ -/* - * 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.util.Arrays; -import org.openapitools.jackson.nullable.JsonNullable; -import org.junit.jupiter.api.Disabled; -import org.junit.jupiter.api.Test; - -/** - * Model tests for FunctionBatchAnn - */ -public class FunctionBatchAnnTest { - private final FunctionBatchAnn model = new FunctionBatchAnn(); - - /** - * Model tests for FunctionBatchAnn - */ - @Test - public void testFunctionBatchAnn() { - // TODO: test FunctionBatchAnn - } - - /** - * Test the property 'success' - */ - @Test - public void successTest() { - // TODO: test success - } - - /** - * Test the property 'settings' - */ - @Test - public void settingsTest() { - // TODO: test settings - } - - /** - * Test the property 'functionMatches' - */ - @Test - public void functionMatchesTest() { - // TODO: test functionMatches - } - -}