diff --git a/.sdk-version b/.sdk-version index 304e303..f22d573 100644 --- a/.sdk-version +++ b/.sdk-version @@ -1 +1 @@ -v3.55.0 +v3.55.2 diff --git a/README.md b/README.md index fad1208..159784e 100644 --- a/README.md +++ b/README.md @@ -16,7 +16,7 @@ Add this dependency to your project's POM: ai.reveng sdk - 3.55.0 + 3.55.2 compile ``` @@ -31,7 +31,7 @@ repositories { } dependencies { - implementation "ai.reveng:sdk:3.55.0" + implementation "ai.reveng:sdk:3.55.2" } ``` @@ -105,7 +105,6 @@ Class | Method | HTTP request | Description *AnalysesDynamicExecutionApi* | [**getTtps**](docs/AnalysesDynamicExecutionApi.md#getTtps) | **GET** /v2/analyses/{analysis_id}/dynamic-execution/ttps | Get the dynamic execution results for ttps *AnalysesResultsMetadataApi* | [**getAnalysisFunctionsPaginated**](docs/AnalysesResultsMetadataApi.md#getAnalysisFunctionsPaginated) | **GET** /v2/analyses/{analysis_id}/functions | Get functions from analysis *AnalysesResultsMetadataApi* | [**getCapabilities**](docs/AnalysesResultsMetadataApi.md#getCapabilities) | **GET** /v2/analyses/{analysis_id}/capabilities | Gets the capabilities from the analysis -*AnalysesResultsMetadataApi* | [**getCommunities**](docs/AnalysesResultsMetadataApi.md#getCommunities) | **GET** /v2/analyses/{analysis_id}/communities | Gets the communities found in the analysis *AnalysesResultsMetadataApi* | [**getFunctionsList**](docs/AnalysesResultsMetadataApi.md#getFunctionsList) | **GET** /v2/analyses/{analysis_id}/functions/list | Gets functions from analysis *AnalysesResultsMetadataApi* | [**getPdf**](docs/AnalysesResultsMetadataApi.md#getPdf) | **GET** /v2/analyses/{analysis_id}/pdf | Gets the PDF found in the analysis *AnalysesResultsMetadataApi* | [**getSbom**](docs/AnalysesResultsMetadataApi.md#getSbom) | **GET** /v2/analyses/{analysis_id}/sbom | Gets the software-bill-of-materials (SBOM) found in the analysis @@ -262,7 +261,6 @@ Class | Method | HTTP request | Description - [BaseResponseCollectionSearchResponse](docs/BaseResponseCollectionSearchResponse.md) - [BaseResponseCollectionTagsUpdateResponse](docs/BaseResponseCollectionTagsUpdateResponse.md) - [BaseResponseCommentResponse](docs/BaseResponseCommentResponse.md) - - [BaseResponseCommunities](docs/BaseResponseCommunities.md) - [BaseResponseConfigResponse](docs/BaseResponseConfigResponse.md) - [BaseResponseCreated](docs/BaseResponseCreated.md) - [BaseResponseDict](docs/BaseResponseDict.md) @@ -346,8 +344,6 @@ Class | Method | HTTP request | Description - [CommentBase](docs/CommentBase.md) - [CommentResponse](docs/CommentResponse.md) - [CommentUpdateRequest](docs/CommentUpdateRequest.md) - - [Communities](docs/Communities.md) - - [CommunityMatchPercentages](docs/CommunityMatchPercentages.md) - [ConfidenceType](docs/ConfidenceType.md) - [ConfigResponse](docs/ConfigResponse.md) - [Context](docs/Context.md) diff --git a/build.gradle b/build.gradle index 8f4b502..b88dade 100644 --- a/build.gradle +++ b/build.gradle @@ -19,7 +19,7 @@ apply plugin: 'java' apply plugin: 'com.diffplug.spotless' group = 'ai.reveng' -version = '3.55.0' +version = '3.55.2' @@ -171,7 +171,7 @@ mavenPublishing { publishToMavenCentral(true) signAllPublications() - coordinates("ai.reveng", "sdk", "3.55.0") + coordinates("ai.reveng", "sdk", "3.55.2") pom { name = "sdk" diff --git a/build.sbt b/build.sbt index 35c733d..fe0d8ab 100644 --- a/build.sbt +++ b/build.sbt @@ -2,7 +2,7 @@ lazy val root = (project in file(".")). settings( organization := "ai.reveng", name := "sdk", - version := "3.55.0", + version := "3.55.2", scalaVersion := "2.11.12", scalacOptions ++= Seq("-feature"), compile / javacOptions ++= Seq("-Xlint:deprecation"), diff --git a/docs/AnalysesResultsMetadataApi.md b/docs/AnalysesResultsMetadataApi.md index 79e8809..562ad35 100644 --- a/docs/AnalysesResultsMetadataApi.md +++ b/docs/AnalysesResultsMetadataApi.md @@ -6,7 +6,6 @@ All URIs are relative to *https://api.reveng.ai* |------------- | ------------- | -------------| | [**getAnalysisFunctionsPaginated**](AnalysesResultsMetadataApi.md#getAnalysisFunctionsPaginated) | **GET** /v2/analyses/{analysis_id}/functions | Get functions from analysis | | [**getCapabilities**](AnalysesResultsMetadataApi.md#getCapabilities) | **GET** /v2/analyses/{analysis_id}/capabilities | Gets the capabilities from the analysis | -| [**getCommunities**](AnalysesResultsMetadataApi.md#getCommunities) | **GET** /v2/analyses/{analysis_id}/communities | Gets the communities found in the analysis | | [**getFunctionsList**](AnalysesResultsMetadataApi.md#getFunctionsList) | **GET** /v2/analyses/{analysis_id}/functions/list | Gets functions from analysis | | [**getPdf**](AnalysesResultsMetadataApi.md#getPdf) | **GET** /v2/analyses/{analysis_id}/pdf | Gets the PDF found in the analysis | | [**getSbom**](AnalysesResultsMetadataApi.md#getSbom) | **GET** /v2/analyses/{analysis_id}/sbom | Gets the software-bill-of-materials (SBOM) found in the analysis | @@ -156,76 +155,6 @@ public class Example { | **200** | Successful Response | - | | **422** | Invalid request parameters | - | - -# **getCommunities** -> BaseResponseCommunities getCommunities(analysisId, userName) - -Gets the communities found in 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.AnalysesResultsMetadataApi; - -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"); - - AnalysesResultsMetadataApi apiInstance = new AnalysesResultsMetadataApi(defaultClient); - Integer analysisId = 56; // Integer | - String userName = "userName_example"; // String | The user name to limit communities to - try { - BaseResponseCommunities result = apiInstance.getCommunities(analysisId, userName); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling AnalysesResultsMetadataApi#getCommunities"); - 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**| | | -| **userName** | **String**| The user name to limit communities to | [optional] | - -### Return type - -[**BaseResponseCommunities**](BaseResponseCommunities.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 | - | - # **getFunctionsList** > BaseResponseAnalysisFunctions getFunctionsList(analysisId, searchTerm, minVAddr, maxVAddr, includeEmbeddings, page, pageSize) diff --git a/docs/AnalysisFunctionMatchingRequest.md b/docs/AnalysisFunctionMatchingRequest.md index 33fd715..8fbc438 100644 --- a/docs/AnalysisFunctionMatchingRequest.md +++ b/docs/AnalysisFunctionMatchingRequest.md @@ -9,7 +9,7 @@ |------------ | ------------- | ------------- | -------------| |**minSimilarity** | **BigDecimal** | Minimum similarity expected for a match as a percentage, default is 90 | [optional] | |**filters** | [**FunctionMatchingFilters**](FunctionMatchingFilters.md) | | [optional] | -|**resultsPerFunction** | **Integer** | Maximum number of matches to return per function, default is 1, max is 10 | [optional] | +|**resultsPerFunction** | **Integer** | Maximum number of matches to return per function, default is 1, max is 30 | [optional] | |**page** | **Integer** | Page number for paginated results, default is 1 (first page) | [optional] | |**pageSize** | **Integer** | Number of functions to return per page, default is 0 (all functions), max is 1000 | [optional] | |**statusOnly** | **Boolean** | If set to true, only returns the status of the matching operation without the actual results | [optional] | diff --git a/docs/BaseResponseCommunities.md b/docs/BaseResponseCommunities.md deleted file mode 100644 index 6f545a6..0000000 --- a/docs/BaseResponseCommunities.md +++ /dev/null @@ -1,17 +0,0 @@ - - -# BaseResponseCommunities - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**status** | **Boolean** | Response status on whether the request succeeded | [optional] | -|**data** | [**Communities**](Communities.md) | | [optional] | -|**message** | **String** | | [optional] | -|**errors** | [**List<ErrorModel>**](ErrorModel.md) | | [optional] | -|**meta** | [**MetaModel**](MetaModel.md) | Metadata | [optional] | - - - diff --git a/docs/Communities.md b/docs/Communities.md deleted file mode 100644 index ede810c..0000000 --- a/docs/Communities.md +++ /dev/null @@ -1,16 +0,0 @@ - - -# Communities - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**totalFunctions** | **Integer** | The total number of matched community functions | | -|**totalMatchedFunctions** | **Integer** | The total number of functions in the binary | | -|**directCommunityMatchPercentages** | [**List<CommunityMatchPercentages>**](CommunityMatchPercentages.md) | The list of directly matched communities | | -|**topComponents** | **List<Map<String, Object>>** | The top components of the binary | | - - - diff --git a/docs/CommunityMatchPercentages.md b/docs/CommunityMatchPercentages.md deleted file mode 100644 index dd796b2..0000000 --- a/docs/CommunityMatchPercentages.md +++ /dev/null @@ -1,16 +0,0 @@ - - -# CommunityMatchPercentages - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**binaryName** | **String** | | | -|**binaryId** | **Integer** | | | -|**matchedCommunitiesPercent** | **BigDecimal** | | | -|**unmatchedCommunitiesPercent** | **BigDecimal** | | | - - - diff --git a/pom.xml b/pom.xml index 63aed7c..60c4289 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ sdk jar sdk - 3.55.0 + 3.55.2 https://github.com/RevEngAI/sdk-java Java SDK for the RevEng.AI API diff --git a/src/main/java/ai/reveng/api/AnalysesResultsMetadataApi.java b/src/main/java/ai/reveng/api/AnalysesResultsMetadataApi.java index 686838f..ca6f385 100644 --- a/src/main/java/ai/reveng/api/AnalysesResultsMetadataApi.java +++ b/src/main/java/ai/reveng/api/AnalysesResultsMetadataApi.java @@ -31,7 +31,6 @@ import ai.reveng.model.BaseResponseAnalysisFunctionsList; import ai.reveng.model.BaseResponseAnalysisTags; import ai.reveng.model.BaseResponseCapabilities; -import ai.reveng.model.BaseResponseCommunities; import ai.reveng.model.BaseResponseListSBOM; import ai.reveng.model.BaseResponseVulnerabilities; @@ -356,145 +355,6 @@ public okhttp3.Call getCapabilitiesAsync(@javax.annotation.Nonnull Integer analy localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } - /** - * Build call for getCommunities - * @param analysisId (required) - * @param userName The user name to limit communities to (optional) - * @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 getCommunitiesCall(@javax.annotation.Nonnull Integer analysisId, @javax.annotation.Nullable String userName, 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}/communities" - .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(); - - if (userName != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("user_name", userName)); - } - - 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 getCommunitiesValidateBeforeCall(@javax.annotation.Nonnull Integer analysisId, @javax.annotation.Nullable String userName, 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 getCommunities(Async)"); - } - - return getCommunitiesCall(analysisId, userName, _callback); - - } - - /** - * Gets the communities found in the analysis - * - * @param analysisId (required) - * @param userName The user name to limit communities to (optional) - * @return BaseResponseCommunities - * @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 BaseResponseCommunities getCommunities(@javax.annotation.Nonnull Integer analysisId, @javax.annotation.Nullable String userName) throws ApiException { - ApiResponse localVarResp = getCommunitiesWithHttpInfo(analysisId, userName); - return localVarResp.getData(); - } - - /** - * Gets the communities found in the analysis - * - * @param analysisId (required) - * @param userName The user name to limit communities to (optional) - * @return ApiResponse<BaseResponseCommunities> - * @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 getCommunitiesWithHttpInfo(@javax.annotation.Nonnull Integer analysisId, @javax.annotation.Nullable String userName) throws ApiException { - okhttp3.Call localVarCall = getCommunitiesValidateBeforeCall(analysisId, userName, null); - Type localVarReturnType = new TypeToken(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * Gets the communities found in the analysis (asynchronously) - * - * @param analysisId (required) - * @param userName The user name to limit communities to (optional) - * @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 getCommunitiesAsync(@javax.annotation.Nonnull Integer analysisId, @javax.annotation.Nullable String userName, final ApiCallback _callback) throws ApiException { - - okhttp3.Call localVarCall = getCommunitiesValidateBeforeCall(analysisId, userName, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); - return localVarCall; - } /** * Build call for getFunctionsList * @param analysisId (required) diff --git a/src/main/java/ai/reveng/invoker/ApiClient.java b/src/main/java/ai/reveng/invoker/ApiClient.java index 517beb4..270ee6b 100644 --- a/src/main/java/ai/reveng/invoker/ApiClient.java +++ b/src/main/java/ai/reveng/invoker/ApiClient.java @@ -146,7 +146,7 @@ protected void init() { json = new JSON(); // Set default User-Agent. - setUserAgent("OpenAPI-Generator/3.55.0/java"); + setUserAgent("OpenAPI-Generator/3.55.2/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 b8b1385..08b863c 100644 --- a/src/main/java/ai/reveng/invoker/Configuration.java +++ b/src/main/java/ai/reveng/invoker/Configuration.java @@ -18,7 +18,7 @@ @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class Configuration { - public static final String VERSION = "3.55.0"; + public static final String VERSION = "3.55.2"; 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 04c71dd..7dadd65 100644 --- a/src/main/java/ai/reveng/invoker/JSON.java +++ b/src/main/java/ai/reveng/invoker/JSON.java @@ -160,7 +160,6 @@ private static Class getClassByDiscriminator(Map classByDiscriminatorValue, Stri gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.BaseResponseCollectionSearchResponse.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.BaseResponseCollectionTagsUpdateResponse.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.BaseResponseCommentResponse.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.BaseResponseCommunities.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.BaseResponseConfigResponse.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.BaseResponseCreated.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.BaseResponseDict.CustomTypeAdapterFactory()); @@ -241,8 +240,6 @@ private static Class getClassByDiscriminator(Map classByDiscriminatorValue, Stri gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.CommentBase.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.CommentResponse.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.CommentUpdateRequest.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.Communities.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.CommunityMatchPercentages.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.ConfigResponse.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.Context.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.Created.CustomTypeAdapterFactory()); diff --git a/src/main/java/ai/reveng/model/AnalysisFunctionMatchingRequest.java b/src/main/java/ai/reveng/model/AnalysisFunctionMatchingRequest.java index c2d1fd5..c6955c8 100644 --- a/src/main/java/ai/reveng/model/AnalysisFunctionMatchingRequest.java +++ b/src/main/java/ai/reveng/model/AnalysisFunctionMatchingRequest.java @@ -146,9 +146,9 @@ public AnalysisFunctionMatchingRequest resultsPerFunction(@javax.annotation.Null } /** - * Maximum number of matches to return per function, default is 1, max is 10 + * Maximum number of matches to return per function, default is 1, max is 30 * minimum: 1 - * maximum: 10 + * maximum: 30 * @return resultsPerFunction */ @javax.annotation.Nullable diff --git a/src/main/java/ai/reveng/model/BaseResponseCommunities.java b/src/main/java/ai/reveng/model/BaseResponseCommunities.java deleted file mode 100644 index cbcd8b3..0000000 --- a/src/main/java/ai/reveng/model/BaseResponseCommunities.java +++ /dev/null @@ -1,438 +0,0 @@ -/* - * RevEng.AI API - * RevEng.AI is an AI-powered binary analysis platform for reverse engineering and malware analysis. It provides similarity search across executable binaries and functions, AI-driven decompilation, dynamic execution analysis, firmware unpacking, and integration with external threat intelligence sources like VirusTotal. - * - * - * - * 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.Communities; -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; - -/** - * BaseResponseCommunities - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class BaseResponseCommunities { - 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 Communities 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 BaseResponseCommunities() { - } - - public BaseResponseCommunities 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 BaseResponseCommunities data(@javax.annotation.Nullable Communities data) { - this.data = data; - return this; - } - - /** - * Get data - * @return data - */ - @javax.annotation.Nullable - public Communities getData() { - return data; - } - - public void setData(@javax.annotation.Nullable Communities data) { - this.data = data; - } - - - public BaseResponseCommunities 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 BaseResponseCommunities errors(@javax.annotation.Nullable List errors) { - this.errors = errors; - return this; - } - - public BaseResponseCommunities 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 BaseResponseCommunities 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 BaseResponseCommunities instance itself - */ - public BaseResponseCommunities 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; - } - BaseResponseCommunities baseResponseCommunities = (BaseResponseCommunities) o; - return Objects.equals(this.status, baseResponseCommunities.status) && - Objects.equals(this.data, baseResponseCommunities.data) && - Objects.equals(this.message, baseResponseCommunities.message) && - Objects.equals(this.errors, baseResponseCommunities.errors) && - Objects.equals(this.meta, baseResponseCommunities.meta)&& - Objects.equals(this.additionalProperties, baseResponseCommunities.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 BaseResponseCommunities {\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 BaseResponseCommunities - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!BaseResponseCommunities.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format(Locale.ROOT, "The required field(s) %s in BaseResponseCommunities is not found in the empty JSON string", BaseResponseCommunities.openapiRequiredFields.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // validate the optional field `data` - if (jsonObj.get("data") != null && !jsonObj.get("data").isJsonNull()) { - Communities.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 (!BaseResponseCommunities.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'BaseResponseCommunities' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(BaseResponseCommunities.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, BaseResponseCommunities 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 BaseResponseCommunities read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // store additional fields in the deserialized instance - BaseResponseCommunities 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 BaseResponseCommunities given an JSON string - * - * @param jsonString JSON string - * @return An instance of BaseResponseCommunities - * @throws IOException if the JSON string is invalid with respect to BaseResponseCommunities - */ - public static BaseResponseCommunities fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, BaseResponseCommunities.class); - } - - /** - * Convert an instance of BaseResponseCommunities to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/ai/reveng/model/Communities.java b/src/main/java/ai/reveng/model/Communities.java deleted file mode 100644 index 8da5653..0000000 --- a/src/main/java/ai/reveng/model/Communities.java +++ /dev/null @@ -1,405 +0,0 @@ -/* - * RevEng.AI API - * RevEng.AI is an AI-powered binary analysis platform for reverse engineering and malware analysis. It provides similarity search across executable binaries and functions, AI-driven decompilation, dynamic execution analysis, firmware unpacking, and integration with external threat intelligence sources like VirusTotal. - * - * - * - * 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.CommunityMatchPercentages; -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 java.util.Map; - -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; - -/** - * Communities - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class Communities { - public static final String SERIALIZED_NAME_TOTAL_FUNCTIONS = "total_functions"; - @SerializedName(SERIALIZED_NAME_TOTAL_FUNCTIONS) - @javax.annotation.Nonnull - private Integer totalFunctions; - - public static final String SERIALIZED_NAME_TOTAL_MATCHED_FUNCTIONS = "total_matched_functions"; - @SerializedName(SERIALIZED_NAME_TOTAL_MATCHED_FUNCTIONS) - @javax.annotation.Nonnull - private Integer totalMatchedFunctions; - - public static final String SERIALIZED_NAME_DIRECT_COMMUNITY_MATCH_PERCENTAGES = "direct_community_match_percentages"; - @SerializedName(SERIALIZED_NAME_DIRECT_COMMUNITY_MATCH_PERCENTAGES) - @javax.annotation.Nonnull - private List directCommunityMatchPercentages = new ArrayList<>(); - - public static final String SERIALIZED_NAME_TOP_COMPONENTS = "top_components"; - @SerializedName(SERIALIZED_NAME_TOP_COMPONENTS) - @javax.annotation.Nonnull - private List> topComponents = new ArrayList<>(); - - public Communities() { - } - - public Communities totalFunctions(@javax.annotation.Nonnull Integer totalFunctions) { - this.totalFunctions = totalFunctions; - return this; - } - - /** - * The total number of matched community functions - * @return totalFunctions - */ - @javax.annotation.Nonnull - public Integer getTotalFunctions() { - return totalFunctions; - } - - public void setTotalFunctions(@javax.annotation.Nonnull Integer totalFunctions) { - this.totalFunctions = totalFunctions; - } - - - public Communities totalMatchedFunctions(@javax.annotation.Nonnull Integer totalMatchedFunctions) { - this.totalMatchedFunctions = totalMatchedFunctions; - return this; - } - - /** - * The total number of functions in the binary - * @return totalMatchedFunctions - */ - @javax.annotation.Nonnull - public Integer getTotalMatchedFunctions() { - return totalMatchedFunctions; - } - - public void setTotalMatchedFunctions(@javax.annotation.Nonnull Integer totalMatchedFunctions) { - this.totalMatchedFunctions = totalMatchedFunctions; - } - - - public Communities directCommunityMatchPercentages(@javax.annotation.Nonnull List directCommunityMatchPercentages) { - this.directCommunityMatchPercentages = directCommunityMatchPercentages; - return this; - } - - public Communities addDirectCommunityMatchPercentagesItem(CommunityMatchPercentages directCommunityMatchPercentagesItem) { - if (this.directCommunityMatchPercentages == null) { - this.directCommunityMatchPercentages = new ArrayList<>(); - } - this.directCommunityMatchPercentages.add(directCommunityMatchPercentagesItem); - return this; - } - - /** - * The list of directly matched communities - * @return directCommunityMatchPercentages - */ - @javax.annotation.Nonnull - public List getDirectCommunityMatchPercentages() { - return directCommunityMatchPercentages; - } - - public void setDirectCommunityMatchPercentages(@javax.annotation.Nonnull List directCommunityMatchPercentages) { - this.directCommunityMatchPercentages = directCommunityMatchPercentages; - } - - - public Communities topComponents(@javax.annotation.Nonnull List> topComponents) { - this.topComponents = topComponents; - return this; - } - - public Communities addTopComponentsItem(Map topComponentsItem) { - if (this.topComponents == null) { - this.topComponents = new ArrayList<>(); - } - this.topComponents.add(topComponentsItem); - return this; - } - - /** - * The top components of the binary - * @return topComponents - */ - @javax.annotation.Nonnull - public List> getTopComponents() { - return topComponents; - } - - public void setTopComponents(@javax.annotation.Nonnull List> topComponents) { - this.topComponents = topComponents; - } - - /** - * 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 Communities instance itself - */ - public Communities 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; - } - Communities communities = (Communities) o; - return Objects.equals(this.totalFunctions, communities.totalFunctions) && - Objects.equals(this.totalMatchedFunctions, communities.totalMatchedFunctions) && - Objects.equals(this.directCommunityMatchPercentages, communities.directCommunityMatchPercentages) && - Objects.equals(this.topComponents, communities.topComponents)&& - Objects.equals(this.additionalProperties, communities.additionalProperties); - } - - @Override - public int hashCode() { - return Objects.hash(totalFunctions, totalMatchedFunctions, directCommunityMatchPercentages, topComponents, additionalProperties); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class Communities {\n"); - sb.append(" totalFunctions: ").append(toIndentedString(totalFunctions)).append("\n"); - sb.append(" totalMatchedFunctions: ").append(toIndentedString(totalMatchedFunctions)).append("\n"); - sb.append(" directCommunityMatchPercentages: ").append(toIndentedString(directCommunityMatchPercentages)).append("\n"); - sb.append(" topComponents: ").append(toIndentedString(topComponents)).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("total_functions", "total_matched_functions", "direct_community_match_percentages", "top_components")); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(Arrays.asList("total_functions", "total_matched_functions", "direct_community_match_percentages", "top_components")); - } - - /** - * 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 Communities - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!Communities.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format(Locale.ROOT, "The required field(s) %s in Communities is not found in the empty JSON string", Communities.openapiRequiredFields.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : Communities.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 json data is an array - if (!jsonObj.get("direct_community_match_percentages").isJsonArray()) { - throw new IllegalArgumentException(String.format(Locale.ROOT, "Expected the field `direct_community_match_percentages` to be an array in the JSON string but got `%s`", jsonObj.get("direct_community_match_percentages").toString())); - } - - JsonArray jsonArraydirectCommunityMatchPercentages = jsonObj.getAsJsonArray("direct_community_match_percentages"); - // validate the required field `direct_community_match_percentages` (array) - for (int i = 0; i < jsonArraydirectCommunityMatchPercentages.size(); i++) { - CommunityMatchPercentages.validateJsonElement(jsonArraydirectCommunityMatchPercentages.get(i)); - }; - // ensure the required json array is present - if (jsonObj.get("top_components") == null) { - throw new IllegalArgumentException("Expected the field `linkedContent` to be an array in the JSON string but got `null`"); - } else if (!jsonObj.get("top_components").isJsonArray()) { - throw new IllegalArgumentException(String.format(Locale.ROOT, "Expected the field `top_components` to be an array in the JSON string but got `%s`", jsonObj.get("top_components").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!Communities.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'Communities' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(Communities.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, Communities 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 Communities read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // store additional fields in the deserialized instance - Communities 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 Communities given an JSON string - * - * @param jsonString JSON string - * @return An instance of Communities - * @throws IOException if the JSON string is invalid with respect to Communities - */ - public static Communities fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, Communities.class); - } - - /** - * Convert an instance of Communities to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/ai/reveng/model/CommunityMatchPercentages.java b/src/main/java/ai/reveng/model/CommunityMatchPercentages.java deleted file mode 100644 index 1cc77b3..0000000 --- a/src/main/java/ai/reveng/model/CommunityMatchPercentages.java +++ /dev/null @@ -1,373 +0,0 @@ -/* - * RevEng.AI API - * RevEng.AI is an AI-powered binary analysis platform for reverse engineering and malware analysis. It provides similarity search across executable binaries and functions, AI-driven decompilation, dynamic execution analysis, firmware unpacking, and integration with external threat intelligence sources like VirusTotal. - * - * - * - * 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.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; - -/** - * CommunityMatchPercentages - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class CommunityMatchPercentages { - public static final String SERIALIZED_NAME_BINARY_NAME = "binary_name"; - @SerializedName(SERIALIZED_NAME_BINARY_NAME) - @javax.annotation.Nonnull - private String binaryName; - - public static final String SERIALIZED_NAME_BINARY_ID = "binary_id"; - @SerializedName(SERIALIZED_NAME_BINARY_ID) - @javax.annotation.Nonnull - private Integer binaryId; - - public static final String SERIALIZED_NAME_MATCHED_COMMUNITIES_PERCENT = "matched_communities_percent"; - @SerializedName(SERIALIZED_NAME_MATCHED_COMMUNITIES_PERCENT) - @javax.annotation.Nonnull - private BigDecimal matchedCommunitiesPercent; - - public static final String SERIALIZED_NAME_UNMATCHED_COMMUNITIES_PERCENT = "unmatched_communities_percent"; - @SerializedName(SERIALIZED_NAME_UNMATCHED_COMMUNITIES_PERCENT) - @javax.annotation.Nonnull - private BigDecimal unmatchedCommunitiesPercent; - - public CommunityMatchPercentages() { - } - - public CommunityMatchPercentages binaryName(@javax.annotation.Nonnull String binaryName) { - this.binaryName = binaryName; - return this; - } - - /** - * Get binaryName - * @return binaryName - */ - @javax.annotation.Nonnull - public String getBinaryName() { - return binaryName; - } - - public void setBinaryName(@javax.annotation.Nonnull String binaryName) { - this.binaryName = binaryName; - } - - - public CommunityMatchPercentages binaryId(@javax.annotation.Nonnull Integer binaryId) { - this.binaryId = binaryId; - return this; - } - - /** - * Get binaryId - * @return binaryId - */ - @javax.annotation.Nonnull - public Integer getBinaryId() { - return binaryId; - } - - public void setBinaryId(@javax.annotation.Nonnull Integer binaryId) { - this.binaryId = binaryId; - } - - - public CommunityMatchPercentages matchedCommunitiesPercent(@javax.annotation.Nonnull BigDecimal matchedCommunitiesPercent) { - this.matchedCommunitiesPercent = matchedCommunitiesPercent; - return this; - } - - /** - * Get matchedCommunitiesPercent - * @return matchedCommunitiesPercent - */ - @javax.annotation.Nonnull - public BigDecimal getMatchedCommunitiesPercent() { - return matchedCommunitiesPercent; - } - - public void setMatchedCommunitiesPercent(@javax.annotation.Nonnull BigDecimal matchedCommunitiesPercent) { - this.matchedCommunitiesPercent = matchedCommunitiesPercent; - } - - - public CommunityMatchPercentages unmatchedCommunitiesPercent(@javax.annotation.Nonnull BigDecimal unmatchedCommunitiesPercent) { - this.unmatchedCommunitiesPercent = unmatchedCommunitiesPercent; - return this; - } - - /** - * Get unmatchedCommunitiesPercent - * @return unmatchedCommunitiesPercent - */ - @javax.annotation.Nonnull - public BigDecimal getUnmatchedCommunitiesPercent() { - return unmatchedCommunitiesPercent; - } - - public void setUnmatchedCommunitiesPercent(@javax.annotation.Nonnull BigDecimal unmatchedCommunitiesPercent) { - this.unmatchedCommunitiesPercent = unmatchedCommunitiesPercent; - } - - /** - * 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 CommunityMatchPercentages instance itself - */ - public CommunityMatchPercentages 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; - } - CommunityMatchPercentages communityMatchPercentages = (CommunityMatchPercentages) o; - return Objects.equals(this.binaryName, communityMatchPercentages.binaryName) && - Objects.equals(this.binaryId, communityMatchPercentages.binaryId) && - Objects.equals(this.matchedCommunitiesPercent, communityMatchPercentages.matchedCommunitiesPercent) && - Objects.equals(this.unmatchedCommunitiesPercent, communityMatchPercentages.unmatchedCommunitiesPercent)&& - Objects.equals(this.additionalProperties, communityMatchPercentages.additionalProperties); - } - - @Override - public int hashCode() { - return Objects.hash(binaryName, binaryId, matchedCommunitiesPercent, unmatchedCommunitiesPercent, additionalProperties); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class CommunityMatchPercentages {\n"); - sb.append(" binaryName: ").append(toIndentedString(binaryName)).append("\n"); - sb.append(" binaryId: ").append(toIndentedString(binaryId)).append("\n"); - sb.append(" matchedCommunitiesPercent: ").append(toIndentedString(matchedCommunitiesPercent)).append("\n"); - sb.append(" unmatchedCommunitiesPercent: ").append(toIndentedString(unmatchedCommunitiesPercent)).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("binary_name", "binary_id", "matched_communities_percent", "unmatched_communities_percent")); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(Arrays.asList("binary_name", "binary_id", "matched_communities_percent", "unmatched_communities_percent")); - } - - /** - * 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 CommunityMatchPercentages - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!CommunityMatchPercentages.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format(Locale.ROOT, "The required field(s) %s in CommunityMatchPercentages is not found in the empty JSON string", CommunityMatchPercentages.openapiRequiredFields.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : CommunityMatchPercentages.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(); - if (!jsonObj.get("binary_name").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format(Locale.ROOT, "Expected the field `binary_name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("binary_name").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!CommunityMatchPercentages.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'CommunityMatchPercentages' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(CommunityMatchPercentages.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, CommunityMatchPercentages 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 CommunityMatchPercentages read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // store additional fields in the deserialized instance - CommunityMatchPercentages 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 CommunityMatchPercentages given an JSON string - * - * @param jsonString JSON string - * @return An instance of CommunityMatchPercentages - * @throws IOException if the JSON string is invalid with respect to CommunityMatchPercentages - */ - public static CommunityMatchPercentages fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, CommunityMatchPercentages.class); - } - - /** - * Convert an instance of CommunityMatchPercentages to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} -