From 959379dcdf01b05130873005d7fd150ff422eb52 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Fri, 16 Jan 2026 07:05:28 +0000 Subject: [PATCH] Update SDK to version v2.84.0 - Generated from OpenAPI spec version v2.84.0 - Auto-generated by GitHub Actions --- .sdk-version | 2 +- README.md | 8 +- build.gradle | 4 +- build.sbt | 2 +- docs/AnalysisStringsStatusResponse.md | 13 + ...seResponseAnalysisStringsStatusResponse.md | 17 + docs/BinariesTaskStatus.md | 19 + docs/FunctionsCoreApi.md | 71 +++ pom.xml | 2 +- .../java/ai/reveng/api/FunctionsCoreApi.java | 132 ++++++ .../java/ai/reveng/invoker/ApiClient.java | 2 +- .../java/ai/reveng/invoker/Configuration.java | 2 +- src/main/java/ai/reveng/invoker/JSON.java | 2 + .../model/AnalysisStringsStatusResponse.java | 294 ++++++++++++ ...ResponseAnalysisStringsStatusResponse.java | 438 ++++++++++++++++++ .../ai/reveng/model/BinariesTaskStatus.java | 85 ++++ .../ai/reveng/api/FunctionsCoreApiTest.java | 15 + .../AnalysisStringsStatusResponseTest.java | 48 ++ ...onseAnalysisStringsStatusResponseTest.java | 85 ++++ .../reveng/model/BinariesTaskStatusTest.java | 31 ++ 20 files changed, 1263 insertions(+), 9 deletions(-) create mode 100644 docs/AnalysisStringsStatusResponse.md create mode 100644 docs/BaseResponseAnalysisStringsStatusResponse.md create mode 100644 docs/BinariesTaskStatus.md create mode 100644 src/main/java/ai/reveng/model/AnalysisStringsStatusResponse.java create mode 100644 src/main/java/ai/reveng/model/BaseResponseAnalysisStringsStatusResponse.java create mode 100644 src/main/java/ai/reveng/model/BinariesTaskStatus.java create mode 100644 src/test/java/ai/reveng/model/AnalysisStringsStatusResponseTest.java create mode 100644 src/test/java/ai/reveng/model/BaseResponseAnalysisStringsStatusResponseTest.java create mode 100644 src/test/java/ai/reveng/model/BinariesTaskStatusTest.java diff --git a/.sdk-version b/.sdk-version index d08ce66..769b20e 100644 --- a/.sdk-version +++ b/.sdk-version @@ -1 +1 @@ -v2.83.0 +v2.84.0 diff --git a/README.md b/README.md index 3d5ef06..216991e 100644 --- a/README.md +++ b/README.md @@ -16,7 +16,7 @@ Add this dependency to your project's POM: ai.reveng sdk - 2.83.0 + 2.84.0 compile ``` @@ -31,7 +31,7 @@ repositories { } dependencies { - implementation "ai.reveng:sdk:2.83.0" + implementation "ai.reveng:sdk:2.84.0" } ``` @@ -153,6 +153,7 @@ Class | Method | HTTP request | Description *FunctionsCoreApi* | [**cancelAiUnstrip**](docs/FunctionsCoreApi.md#cancelAiUnstrip) | **DELETE** /v2/analyses/{analysis_id}/functions/ai-unstrip/cancel | Cancels a running ai-unstrip *FunctionsCoreApi* | [**cancelAutoUnstrip**](docs/FunctionsCoreApi.md#cancelAutoUnstrip) | **DELETE** /v2/analyses/{analysis_id}/functions/unstrip/cancel | Cancels a running auto-unstrip *FunctionsCoreApi* | [**getAnalysisStrings**](docs/FunctionsCoreApi.md#getAnalysisStrings) | **GET** /v2/analyses/{analysis_id}/functions/strings | Get string information found in the Analysis +*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* | [**getFunctionCapabilities**](docs/FunctionsCoreApi.md#getFunctionCapabilities) | **GET** /v2/functions/{function_id}/capabilities | Retrieve a functions capabilities @@ -196,6 +197,7 @@ Class | Method | HTTP request | Description - [AnalysisRecord](docs/AnalysisRecord.md) - [AnalysisScope](docs/AnalysisScope.md) - [AnalysisStringsResponse](docs/AnalysisStringsResponse.md) + - [AnalysisStringsStatusResponse](docs/AnalysisStringsStatusResponse.md) - [AnalysisTags](docs/AnalysisTags.md) - [AnalysisUpdateRequest](docs/AnalysisUpdateRequest.md) - [AnalysisUpdateTagsRequest](docs/AnalysisUpdateTagsRequest.md) @@ -216,6 +218,7 @@ Class | Method | HTTP request | Description - [BaseResponseAnalysisFunctions](docs/BaseResponseAnalysisFunctions.md) - [BaseResponseAnalysisFunctionsList](docs/BaseResponseAnalysisFunctionsList.md) - [BaseResponseAnalysisStringsResponse](docs/BaseResponseAnalysisStringsResponse.md) + - [BaseResponseAnalysisStringsStatusResponse](docs/BaseResponseAnalysisStringsStatusResponse.md) - [BaseResponseAnalysisTags](docs/BaseResponseAnalysisTags.md) - [BaseResponseAnalysisUpdateTagsResponse](docs/BaseResponseAnalysisUpdateTagsResponse.md) - [BaseResponseBasic](docs/BaseResponseBasic.md) @@ -279,6 +282,7 @@ Class | Method | HTTP request | Description - [BaseResponseUploadResponse](docs/BaseResponseUploadResponse.md) - [BaseResponseVulnerabilities](docs/BaseResponseVulnerabilities.md) - [Basic](docs/Basic.md) + - [BinariesTaskStatus](docs/BinariesTaskStatus.md) - [BinaryAdditionalDetailsDataResponse](docs/BinaryAdditionalDetailsDataResponse.md) - [BinaryAdditionalResponse](docs/BinaryAdditionalResponse.md) - [BinaryConfig](docs/BinaryConfig.md) diff --git a/build.gradle b/build.gradle index f3ce225..8b6ccd5 100644 --- a/build.gradle +++ b/build.gradle @@ -19,7 +19,7 @@ apply plugin: 'java' apply plugin: 'com.diffplug.spotless' group = 'ai.reveng' -version = '2.83.0' +version = '2.84.0' @@ -171,7 +171,7 @@ mavenPublishing { publishToMavenCentral(true) signAllPublications() - coordinates("ai.reveng", "sdk", "2.83.0") + coordinates("ai.reveng", "sdk", "2.84.0") pom { name = "sdk" diff --git a/build.sbt b/build.sbt index fc11ae6..8d4e0a2 100644 --- a/build.sbt +++ b/build.sbt @@ -2,7 +2,7 @@ lazy val root = (project in file(".")). settings( organization := "ai.reveng", name := "sdk", - version := "2.83.0", + version := "2.84.0", scalaVersion := "2.11.12", scalacOptions ++= Seq("-feature"), compile / javacOptions ++= Seq("-Xlint:deprecation"), diff --git a/docs/AnalysisStringsStatusResponse.md b/docs/AnalysisStringsStatusResponse.md new file mode 100644 index 0000000..6cfea76 --- /dev/null +++ b/docs/AnalysisStringsStatusResponse.md @@ -0,0 +1,13 @@ + + +# AnalysisStringsStatusResponse + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**status** | **BinariesTaskStatus** | The current status of the strings extraction task | | + + + diff --git a/docs/BaseResponseAnalysisStringsStatusResponse.md b/docs/BaseResponseAnalysisStringsStatusResponse.md new file mode 100644 index 0000000..71f0679 --- /dev/null +++ b/docs/BaseResponseAnalysisStringsStatusResponse.md @@ -0,0 +1,17 @@ + + +# BaseResponseAnalysisStringsStatusResponse + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**status** | **Boolean** | Response status on whether the request succeeded | [optional] | +|**data** | [**AnalysisStringsStatusResponse**](AnalysisStringsStatusResponse.md) | | [optional] | +|**message** | **String** | | [optional] | +|**errors** | [**List<ErrorModel>**](ErrorModel.md) | | [optional] | +|**meta** | [**MetaModel**](MetaModel.md) | Metadata | [optional] | + + + diff --git a/docs/BinariesTaskStatus.md b/docs/BinariesTaskStatus.md new file mode 100644 index 0000000..09f2174 --- /dev/null +++ b/docs/BinariesTaskStatus.md @@ -0,0 +1,19 @@ + + +# BinariesTaskStatus + +## Enum + + +* `UNINITIALISED` (value: `"UNINITIALISED"`) + +* `PENDING` (value: `"PENDING"`) + +* `RUNNING` (value: `"RUNNING"`) + +* `COMPLETED` (value: `"COMPLETED"`) + +* `FAILED` (value: `"FAILED"`) + + + diff --git a/docs/FunctionsCoreApi.md b/docs/FunctionsCoreApi.md index 980ead1..cd9c8e8 100644 --- a/docs/FunctionsCoreApi.md +++ b/docs/FunctionsCoreApi.md @@ -11,6 +11,7 @@ All URIs are relative to *https://api.reveng.ai* | [**cancelAiUnstrip**](FunctionsCoreApi.md#cancelAiUnstrip) | **DELETE** /v2/analyses/{analysis_id}/functions/ai-unstrip/cancel | Cancels a running ai-unstrip | | [**cancelAutoUnstrip**](FunctionsCoreApi.md#cancelAutoUnstrip) | **DELETE** /v2/analyses/{analysis_id}/functions/unstrip/cancel | Cancels a running auto-unstrip | | [**getAnalysisStrings**](FunctionsCoreApi.md#getAnalysisStrings) | **GET** /v2/analyses/{analysis_id}/functions/strings | Get string information found in the Analysis | +| [**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 | | [**getFunctionCapabilities**](FunctionsCoreApi.md#getFunctionCapabilities) | **GET** /v2/functions/{function_id}/capabilities | Retrieve a functions capabilities | @@ -522,6 +523,76 @@ public class Example { | **200** | Successful Response | - | | **422** | Invalid request parameters | - | + +# **getAnalysisStringsStatus** +> BaseResponseAnalysisStringsStatusResponse getAnalysisStringsStatus(analysisId) + +Get string processing state for the Analysis + +Get string processing state for the Analysis + +### 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); + Integer analysisId = 56; // Integer | + try { + BaseResponseAnalysisStringsStatusResponse result = apiInstance.getAnalysisStringsStatus(analysisId); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling FunctionsCoreApi#getAnalysisStringsStatus"); + 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 | +|------------- | ------------- | ------------- | -------------| +| **analysisId** | **Integer**| | | + +### Return type + +[**BaseResponseAnalysisStringsStatusResponse**](BaseResponseAnalysisStringsStatusResponse.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 | - | + # **getFunctionBlocks** > BaseResponseFunctionBlocksResponse getFunctionBlocks(functionId) diff --git a/pom.xml b/pom.xml index a96bd15..709ece1 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ sdk jar sdk - 2.83.0 + 2.84.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 0ea16af..0ea1849 100644 --- a/src/main/java/ai/reveng/api/FunctionsCoreApi.java +++ b/src/main/java/ai/reveng/api/FunctionsCoreApi.java @@ -32,6 +32,7 @@ import ai.reveng.model.AutoUnstripResponse; import ai.reveng.model.BaseResponse; import ai.reveng.model.BaseResponseAnalysisStringsResponse; +import ai.reveng.model.BaseResponseAnalysisStringsStatusResponse; import ai.reveng.model.BaseResponseCalleesCallerFunctionsResponse; import ai.reveng.model.BaseResponseFunctionBlocksResponse; import ai.reveng.model.BaseResponseFunctionCapabilityResponse; @@ -1062,6 +1063,137 @@ public okhttp3.Call getAnalysisStringsAsync(@javax.annotation.Nonnull Integer an localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } + /** + * Build call for getAnalysisStringsStatus + * @param analysisId (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 getAnalysisStringsStatusCall(@javax.annotation.Nonnull Integer analysisId, 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/analyses/{analysis_id}/functions/strings/status" + .replace("{" + "analysis_id" + "}", localVarApiClient.escapeString(analysisId.toString())); + + 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 = { + }; + 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 getAnalysisStringsStatusValidateBeforeCall(@javax.annotation.Nonnull Integer analysisId, 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 getAnalysisStringsStatus(Async)"); + } + + return getAnalysisStringsStatusCall(analysisId, _callback); + + } + + /** + * Get string processing state for the Analysis + * Get string processing state for the Analysis + * @param analysisId (required) + * @return BaseResponseAnalysisStringsStatusResponse + * @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 BaseResponseAnalysisStringsStatusResponse getAnalysisStringsStatus(@javax.annotation.Nonnull Integer analysisId) throws ApiException { + ApiResponse localVarResp = getAnalysisStringsStatusWithHttpInfo(analysisId); + return localVarResp.getData(); + } + + /** + * Get string processing state for the Analysis + * Get string processing state for the Analysis + * @param analysisId (required) + * @return ApiResponse<BaseResponseAnalysisStringsStatusResponse> + * @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 getAnalysisStringsStatusWithHttpInfo(@javax.annotation.Nonnull Integer analysisId) throws ApiException { + okhttp3.Call localVarCall = getAnalysisStringsStatusValidateBeforeCall(analysisId, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Get string processing state for the Analysis (asynchronously) + * Get string processing state for the Analysis + * @param analysisId (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 getAnalysisStringsStatusAsync(@javax.annotation.Nonnull Integer analysisId, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = getAnalysisStringsStatusValidateBeforeCall(analysisId, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } /** * Build call for getFunctionBlocks * @param functionId (required) diff --git a/src/main/java/ai/reveng/invoker/ApiClient.java b/src/main/java/ai/reveng/invoker/ApiClient.java index a1a0614..16959f7 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/2.83.0/java"); + setUserAgent("OpenAPI-Generator/2.84.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 c99806e..1f149db 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 = "2.83.0"; + public static final String VERSION = "2.84.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 0bdc64f..760d8e0 100644 --- a/src/main/java/ai/reveng/invoker/JSON.java +++ b/src/main/java/ai/reveng/invoker/JSON.java @@ -111,6 +111,7 @@ private static Class getClassByDiscriminator(Map classByDiscriminatorValue, Stri gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.AnalysisFunctionsList.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.AnalysisRecord.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.AnalysisStringsResponse.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.AnalysisStringsStatusResponse.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.AnalysisTags.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.AnalysisUpdateRequest.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.AnalysisUpdateTagsRequest.CustomTypeAdapterFactory()); @@ -128,6 +129,7 @@ private static Class getClassByDiscriminator(Map classByDiscriminatorValue, Stri gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.BaseResponseAnalysisFunctions.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.BaseResponseAnalysisFunctionsList.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.BaseResponseAnalysisStringsResponse.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.BaseResponseAnalysisStringsStatusResponse.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.BaseResponseAnalysisTags.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.BaseResponseAnalysisUpdateTagsResponse.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.BaseResponseBasic.CustomTypeAdapterFactory()); diff --git a/src/main/java/ai/reveng/model/AnalysisStringsStatusResponse.java b/src/main/java/ai/reveng/model/AnalysisStringsStatusResponse.java new file mode 100644 index 0000000..5a81506 --- /dev/null +++ b/src/main/java/ai/reveng/model/AnalysisStringsStatusResponse.java @@ -0,0 +1,294 @@ +/* + * 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.BinariesTaskStatus; +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 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; + +/** + * AnalysisStringsStatusResponse + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class AnalysisStringsStatusResponse { + public static final String SERIALIZED_NAME_STATUS = "status"; + @SerializedName(SERIALIZED_NAME_STATUS) + @javax.annotation.Nonnull + private BinariesTaskStatus status; + + public AnalysisStringsStatusResponse() { + } + + public AnalysisStringsStatusResponse status(@javax.annotation.Nonnull BinariesTaskStatus status) { + this.status = status; + return this; + } + + /** + * The current status of the strings extraction task + * @return status + */ + @javax.annotation.Nonnull + public BinariesTaskStatus getStatus() { + return status; + } + + public void setStatus(@javax.annotation.Nonnull BinariesTaskStatus status) { + this.status = status; + } + + /** + * 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 AnalysisStringsStatusResponse instance itself + */ + public AnalysisStringsStatusResponse 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; + } + AnalysisStringsStatusResponse analysisStringsStatusResponse = (AnalysisStringsStatusResponse) o; + return Objects.equals(this.status, analysisStringsStatusResponse.status)&& + Objects.equals(this.additionalProperties, analysisStringsStatusResponse.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(status, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AnalysisStringsStatusResponse {\n"); + sb.append(" status: ").append(toIndentedString(status)).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")); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(Arrays.asList("status")); + } + + /** + * 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 AnalysisStringsStatusResponse + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!AnalysisStringsStatusResponse.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format(Locale.ROOT, "The required field(s) %s in AnalysisStringsStatusResponse is not found in the empty JSON string", AnalysisStringsStatusResponse.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : AnalysisStringsStatusResponse.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(); + // validate the required field `status` + BinariesTaskStatus.validateJsonElement(jsonObj.get("status")); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!AnalysisStringsStatusResponse.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'AnalysisStringsStatusResponse' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(AnalysisStringsStatusResponse.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, AnalysisStringsStatusResponse 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 AnalysisStringsStatusResponse read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + AnalysisStringsStatusResponse 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 AnalysisStringsStatusResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of AnalysisStringsStatusResponse + * @throws IOException if the JSON string is invalid with respect to AnalysisStringsStatusResponse + */ + public static AnalysisStringsStatusResponse fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, AnalysisStringsStatusResponse.class); + } + + /** + * Convert an instance of AnalysisStringsStatusResponse to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/ai/reveng/model/BaseResponseAnalysisStringsStatusResponse.java b/src/main/java/ai/reveng/model/BaseResponseAnalysisStringsStatusResponse.java new file mode 100644 index 0000000..f973cd5 --- /dev/null +++ b/src/main/java/ai/reveng/model/BaseResponseAnalysisStringsStatusResponse.java @@ -0,0 +1,438 @@ +/* + * 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.AnalysisStringsStatusResponse; +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; + +/** + * BaseResponseAnalysisStringsStatusResponse + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class BaseResponseAnalysisStringsStatusResponse { + 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 AnalysisStringsStatusResponse 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 BaseResponseAnalysisStringsStatusResponse() { + } + + public BaseResponseAnalysisStringsStatusResponse 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 BaseResponseAnalysisStringsStatusResponse data(@javax.annotation.Nullable AnalysisStringsStatusResponse data) { + this.data = data; + return this; + } + + /** + * Get data + * @return data + */ + @javax.annotation.Nullable + public AnalysisStringsStatusResponse getData() { + return data; + } + + public void setData(@javax.annotation.Nullable AnalysisStringsStatusResponse data) { + this.data = data; + } + + + public BaseResponseAnalysisStringsStatusResponse 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 BaseResponseAnalysisStringsStatusResponse errors(@javax.annotation.Nullable List errors) { + this.errors = errors; + return this; + } + + public BaseResponseAnalysisStringsStatusResponse 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 BaseResponseAnalysisStringsStatusResponse 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 BaseResponseAnalysisStringsStatusResponse instance itself + */ + public BaseResponseAnalysisStringsStatusResponse 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; + } + BaseResponseAnalysisStringsStatusResponse baseResponseAnalysisStringsStatusResponse = (BaseResponseAnalysisStringsStatusResponse) o; + return Objects.equals(this.status, baseResponseAnalysisStringsStatusResponse.status) && + Objects.equals(this.data, baseResponseAnalysisStringsStatusResponse.data) && + Objects.equals(this.message, baseResponseAnalysisStringsStatusResponse.message) && + Objects.equals(this.errors, baseResponseAnalysisStringsStatusResponse.errors) && + Objects.equals(this.meta, baseResponseAnalysisStringsStatusResponse.meta)&& + Objects.equals(this.additionalProperties, baseResponseAnalysisStringsStatusResponse.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 BaseResponseAnalysisStringsStatusResponse {\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 BaseResponseAnalysisStringsStatusResponse + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!BaseResponseAnalysisStringsStatusResponse.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format(Locale.ROOT, "The required field(s) %s in BaseResponseAnalysisStringsStatusResponse is not found in the empty JSON string", BaseResponseAnalysisStringsStatusResponse.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the optional field `data` + if (jsonObj.get("data") != null && !jsonObj.get("data").isJsonNull()) { + AnalysisStringsStatusResponse.validateJsonElement(jsonObj.get("data")); + } + 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 (!BaseResponseAnalysisStringsStatusResponse.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'BaseResponseAnalysisStringsStatusResponse' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(BaseResponseAnalysisStringsStatusResponse.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, BaseResponseAnalysisStringsStatusResponse 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 BaseResponseAnalysisStringsStatusResponse read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + BaseResponseAnalysisStringsStatusResponse 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 BaseResponseAnalysisStringsStatusResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of BaseResponseAnalysisStringsStatusResponse + * @throws IOException if the JSON string is invalid with respect to BaseResponseAnalysisStringsStatusResponse + */ + public static BaseResponseAnalysisStringsStatusResponse fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, BaseResponseAnalysisStringsStatusResponse.class); + } + + /** + * Convert an instance of BaseResponseAnalysisStringsStatusResponse to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/ai/reveng/model/BinariesTaskStatus.java b/src/main/java/ai/reveng/model/BinariesTaskStatus.java new file mode 100644 index 0000000..7c62712 --- /dev/null +++ b/src/main/java/ai/reveng/model/BinariesTaskStatus.java @@ -0,0 +1,85 @@ +/* + * 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.annotations.SerializedName; + +import java.io.IOException; +import java.util.Locale; +import com.google.gson.TypeAdapter; +import com.google.gson.JsonElement; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; + +/** + * Gets or Sets BinariesTaskStatus + */ +@JsonAdapter(BinariesTaskStatus.Adapter.class) +public enum BinariesTaskStatus { + + UNINITIALISED("UNINITIALISED"), + + PENDING("PENDING"), + + RUNNING("RUNNING"), + + COMPLETED("COMPLETED"), + + FAILED("FAILED"); + + private String value; + + BinariesTaskStatus(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static BinariesTaskStatus fromValue(String value) { + for (BinariesTaskStatus b : BinariesTaskStatus.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 BinariesTaskStatus enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public BinariesTaskStatus read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return BinariesTaskStatus.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + BinariesTaskStatus.fromValue(value); + } +} + diff --git a/src/test/java/ai/reveng/api/FunctionsCoreApiTest.java b/src/test/java/ai/reveng/api/FunctionsCoreApiTest.java index 7fbe7be..7ae33fd 100644 --- a/src/test/java/ai/reveng/api/FunctionsCoreApiTest.java +++ b/src/test/java/ai/reveng/api/FunctionsCoreApiTest.java @@ -19,6 +19,7 @@ import ai.reveng.model.AutoUnstripResponse; import ai.reveng.model.BaseResponse; import ai.reveng.model.BaseResponseAnalysisStringsResponse; +import ai.reveng.model.BaseResponseAnalysisStringsStatusResponse; import ai.reveng.model.BaseResponseCalleesCallerFunctionsResponse; import ai.reveng.model.BaseResponseFunctionBlocksResponse; import ai.reveng.model.BaseResponseFunctionCapabilityResponse; @@ -147,6 +148,20 @@ public void getAnalysisStringsTest() throws ApiException { // TODO: test validations } + /** + * Get string processing state for the Analysis + * + * Get string processing state for the Analysis + * + * @throws ApiException if the Api call fails + */ + @Test + public void getAnalysisStringsStatusTest() throws ApiException { + Integer analysisId = null; + BaseResponseAnalysisStringsStatusResponse response = api.getAnalysisStringsStatus(analysisId); + // TODO: test validations + } + /** * Get disassembly blocks related to the function * diff --git a/src/test/java/ai/reveng/model/AnalysisStringsStatusResponseTest.java b/src/test/java/ai/reveng/model/AnalysisStringsStatusResponseTest.java new file mode 100644 index 0000000..755c069 --- /dev/null +++ b/src/test/java/ai/reveng/model/AnalysisStringsStatusResponseTest.java @@ -0,0 +1,48 @@ +/* + * 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 ai.reveng.model.BinariesTaskStatus; +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.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for AnalysisStringsStatusResponse + */ +public class AnalysisStringsStatusResponseTest { + private final AnalysisStringsStatusResponse model = new AnalysisStringsStatusResponse(); + + /** + * Model tests for AnalysisStringsStatusResponse + */ + @Test + public void testAnalysisStringsStatusResponse() { + // TODO: test AnalysisStringsStatusResponse + } + + /** + * Test the property 'status' + */ + @Test + public void statusTest() { + // TODO: test status + } + +} diff --git a/src/test/java/ai/reveng/model/BaseResponseAnalysisStringsStatusResponseTest.java b/src/test/java/ai/reveng/model/BaseResponseAnalysisStringsStatusResponseTest.java new file mode 100644 index 0000000..2639bb0 --- /dev/null +++ b/src/test/java/ai/reveng/model/BaseResponseAnalysisStringsStatusResponseTest.java @@ -0,0 +1,85 @@ +/* + * 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 ai.reveng.model.AnalysisStringsStatusResponse; +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 org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for BaseResponseAnalysisStringsStatusResponse + */ +public class BaseResponseAnalysisStringsStatusResponseTest { + private final BaseResponseAnalysisStringsStatusResponse model = new BaseResponseAnalysisStringsStatusResponse(); + + /** + * Model tests for BaseResponseAnalysisStringsStatusResponse + */ + @Test + public void testBaseResponseAnalysisStringsStatusResponse() { + // TODO: test BaseResponseAnalysisStringsStatusResponse + } + + /** + * Test the property 'status' + */ + @Test + public void statusTest() { + // TODO: test status + } + + /** + * Test the property 'data' + */ + @Test + public void dataTest() { + // TODO: test data + } + + /** + * Test the property 'message' + */ + @Test + public void messageTest() { + // TODO: test message + } + + /** + * Test the property 'errors' + */ + @Test + public void errorsTest() { + // TODO: test errors + } + + /** + * Test the property 'meta' + */ + @Test + public void metaTest() { + // TODO: test meta + } + +} diff --git a/src/test/java/ai/reveng/model/BinariesTaskStatusTest.java b/src/test/java/ai/reveng/model/BinariesTaskStatusTest.java new file mode 100644 index 0000000..e48750c --- /dev/null +++ b/src/test/java/ai/reveng/model/BinariesTaskStatusTest.java @@ -0,0 +1,31 @@ +/* + * 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.annotations.SerializedName; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for BinariesTaskStatus + */ +public class BinariesTaskStatusTest { + /** + * Model tests for BinariesTaskStatus + */ + @Test + public void testBinariesTaskStatus() { + // TODO: test BinariesTaskStatus + } + +}