From 35cfc8e618acc0abc46277041e1c46405b538e0c Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Mon, 15 Jun 2026 16:56:46 +0000 Subject: [PATCH] Update SDK to version v3.93.0 - Generated from OpenAPI spec version v3.93.0 - Auto-generated by GitHub Actions --- .sdk-version | 2 +- README.md | 11 +- build.gradle | 4 +- build.sbt | 2 +- docs/AIDecompFunctionMapping.md | 26 + docs/AIDecompInverseFunctionMapItem.md | 15 + docs/AIDecompInverseStringMapItem.md | 14 + docs/CollectionsApi.md | 150 ++++ docs/PatchCollectionInputBody.md | 15 + docs/PatchCollectionOutputBody.md | 22 + docs/TokenisedData.md | 2 +- pom.xml | 2 +- .../java/ai/reveng/api/CollectionsApi.java | 361 +++++++++ .../java/ai/reveng/invoker/ApiClient.java | 2 +- .../java/ai/reveng/invoker/Configuration.java | 2 +- src/main/java/ai/reveng/invoker/JSON.java | 5 + .../reveng/model/AIDecompFunctionMapping.java | 746 ++++++++++++++++++ .../model/AIDecompInverseFunctionMapItem.java | 347 ++++++++ .../model/AIDecompInverseStringMapItem.java | 321 ++++++++ .../model/PatchCollectionInputBody.java | 345 ++++++++ .../model/PatchCollectionOutputBody.java | 535 +++++++++++++ .../ai/reveng/model/ReplacementValue.java | 10 +- .../java/ai/reveng/model/TokenisedData.java | 14 +- 23 files changed, 2929 insertions(+), 24 deletions(-) create mode 100644 docs/AIDecompFunctionMapping.md create mode 100644 docs/AIDecompInverseFunctionMapItem.md create mode 100644 docs/AIDecompInverseStringMapItem.md create mode 100644 docs/PatchCollectionInputBody.md create mode 100644 docs/PatchCollectionOutputBody.md create mode 100644 src/main/java/ai/reveng/model/AIDecompFunctionMapping.java create mode 100644 src/main/java/ai/reveng/model/AIDecompInverseFunctionMapItem.java create mode 100644 src/main/java/ai/reveng/model/AIDecompInverseStringMapItem.java create mode 100644 src/main/java/ai/reveng/model/PatchCollectionInputBody.java create mode 100644 src/main/java/ai/reveng/model/PatchCollectionOutputBody.java diff --git a/.sdk-version b/.sdk-version index 3a748866..3bab994a 100644 --- a/.sdk-version +++ b/.sdk-version @@ -1 +1 @@ -v3.92.0 +v3.93.0 diff --git a/README.md b/README.md index b5c16e6e..030ed164 100644 --- a/README.md +++ b/README.md @@ -16,7 +16,7 @@ Add this dependency to your project's POM: ai.reveng sdk - 3.92.0 + 3.93.0 compile ``` @@ -31,7 +31,7 @@ repositories { } dependencies { - implementation "ai.reveng:sdk:3.92.0" + implementation "ai.reveng:sdk:3.93.0" } ``` @@ -139,8 +139,10 @@ Class | Method | HTTP request | Description *CollectionsApi* | [**updateCollectionBinaries**](docs/CollectionsApi.md#updateCollectionBinaries) | **PATCH** /v2/collections/{collection_id}/binaries | Updates a collection binaries *CollectionsApi* | [**updateCollectionTags**](docs/CollectionsApi.md#updateCollectionTags) | **PATCH** /v2/collections/{collection_id}/tags | Updates a collection tags *CollectionsApi* | [**v3CreateCollection**](docs/CollectionsApi.md#v3CreateCollection) | **POST** /v3/collections | Create a collection. +*CollectionsApi* | [**v3DeleteCollection**](docs/CollectionsApi.md#v3DeleteCollection) | **DELETE** /v3/collections/{collection_id} | Delete a collection. *CollectionsApi* | [**v3GetCollection**](docs/CollectionsApi.md#v3GetCollection) | **GET** /v3/collections/{collection_id} | Get a collection. *CollectionsApi* | [**v3ListCollections**](docs/CollectionsApi.md#v3ListCollections) | **GET** /v3/collections | List collections. +*CollectionsApi* | [**v3PatchCollection**](docs/CollectionsApi.md#v3PatchCollection) | **PATCH** /v3/collections/{collection_id} | Update a collection. *CollectionsApi* | [**v3PatchCollectionBinaries**](docs/CollectionsApi.md#v3PatchCollectionBinaries) | **PATCH** /v3/collections/{collection_id}/binaries | Replace the binaries in a collection. *CollectionsApi* | [**v3PatchCollectionTags**](docs/CollectionsApi.md#v3PatchCollectionTags) | **PATCH** /v3/collections/{collection_id}/tags | Replace the tags on a collection. *ConfigApi* | [**getConfig**](docs/ConfigApi.md#getConfig) | **GET** /v2/config | Get Config @@ -222,6 +224,9 @@ Class | Method | HTTP request | Description ## Documentation for Models + - [AIDecompFunctionMapping](docs/AIDecompFunctionMapping.md) + - [AIDecompInverseFunctionMapItem](docs/AIDecompInverseFunctionMapItem.md) + - [AIDecompInverseStringMapItem](docs/AIDecompInverseStringMapItem.md) - [APIError](docs/APIError.md) - [AddCalleeInputBody](docs/AddCalleeInputBody.md) - [AddUserStringInputBody](docs/AddUserStringInputBody.md) @@ -537,6 +542,8 @@ Class | Method | HTTP request | Description - [Params](docs/Params.md) - [PatchCollectionBinariesInputBody](docs/PatchCollectionBinariesInputBody.md) - [PatchCollectionBinariesOutputBody](docs/PatchCollectionBinariesOutputBody.md) + - [PatchCollectionInputBody](docs/PatchCollectionInputBody.md) + - [PatchCollectionOutputBody](docs/PatchCollectionOutputBody.md) - [PatchCollectionTagsInputBody](docs/PatchCollectionTagsInputBody.md) - [PatchCollectionTagsOutputBody](docs/PatchCollectionTagsOutputBody.md) - [PatchCommentBody](docs/PatchCommentBody.md) diff --git a/build.gradle b/build.gradle index 140aa138..b8adfe78 100644 --- a/build.gradle +++ b/build.gradle @@ -19,7 +19,7 @@ apply plugin: 'java' apply plugin: 'com.diffplug.spotless' group = 'ai.reveng' -version = '3.92.0' +version = '3.93.0' @@ -171,7 +171,7 @@ mavenPublishing { publishToMavenCentral(true) signAllPublications() - coordinates("ai.reveng", "sdk", "3.92.0") + coordinates("ai.reveng", "sdk", "3.93.0") pom { name = "sdk" diff --git a/build.sbt b/build.sbt index 575e50fa..d47d69dd 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.92.0", + version := "3.93.0", scalaVersion := "2.11.12", scalacOptions ++= Seq("-feature"), compile / javacOptions ++= Seq("-Xlint:deprecation"), diff --git a/docs/AIDecompFunctionMapping.md b/docs/AIDecompFunctionMapping.md new file mode 100644 index 00000000..70a7a793 --- /dev/null +++ b/docs/AIDecompFunctionMapping.md @@ -0,0 +1,26 @@ + + +# AIDecompFunctionMapping + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**fields** | **Map<String, Map<String, ReplacementValue>>** | | | +|**inverseFunctionMap** | **Map<String, AIDecompInverseFunctionMapItem>** | | | +|**inverseStringMap** | **Map<String, AIDecompInverseStringMapItem>** | | | +|**unmatchedCustomFunctionPointers** | **Map<String, ReplacementValue>** | | | +|**unmatchedCustomTypes** | **Map<String, ReplacementValue>** | | | +|**unmatchedEnums** | **Map<String, ReplacementValue>** | | | +|**unmatchedExternalVars** | **Map<String, ReplacementValue>** | | | +|**unmatchedFunctions** | **Map<String, ReplacementValue>** | | | +|**unmatchedGlobalVars** | **Map<String, ReplacementValue>** | | | +|**unmatchedGoToLabels** | **Map<String, ReplacementValue>** | | | +|**unmatchedStrings** | **Map<String, ReplacementValue>** | | | +|**unmatchedVariadicLists** | **Map<String, ReplacementValue>** | | | +|**unmatchedVars** | **Map<String, ReplacementValue>** | | | +|**userOverrideMappings** | **Map<String, String>** | | | + + + diff --git a/docs/AIDecompInverseFunctionMapItem.md b/docs/AIDecompInverseFunctionMapItem.md new file mode 100644 index 00000000..a0f35b9b --- /dev/null +++ b/docs/AIDecompInverseFunctionMapItem.md @@ -0,0 +1,15 @@ + + +# AIDecompInverseFunctionMapItem + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**addr** | **NumericAddr** | | | +|**isExternal** | **Boolean** | | | +|**name** | **String** | | | + + + diff --git a/docs/AIDecompInverseStringMapItem.md b/docs/AIDecompInverseStringMapItem.md new file mode 100644 index 00000000..c9e41c04 --- /dev/null +++ b/docs/AIDecompInverseStringMapItem.md @@ -0,0 +1,14 @@ + + +# AIDecompInverseStringMapItem + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**addr** | **NumericAddr** | | | +|**string** | **String** | | | + + + diff --git a/docs/CollectionsApi.md b/docs/CollectionsApi.md index abebfe9e..b38f6434 100644 --- a/docs/CollectionsApi.md +++ b/docs/CollectionsApi.md @@ -12,8 +12,10 @@ All URIs are relative to *https://api.reveng.ai* | [**updateCollectionBinaries**](CollectionsApi.md#updateCollectionBinaries) | **PATCH** /v2/collections/{collection_id}/binaries | Updates a collection binaries | | [**updateCollectionTags**](CollectionsApi.md#updateCollectionTags) | **PATCH** /v2/collections/{collection_id}/tags | Updates a collection tags | | [**v3CreateCollection**](CollectionsApi.md#v3CreateCollection) | **POST** /v3/collections | Create a collection. | +| [**v3DeleteCollection**](CollectionsApi.md#v3DeleteCollection) | **DELETE** /v3/collections/{collection_id} | Delete a collection. | | [**v3GetCollection**](CollectionsApi.md#v3GetCollection) | **GET** /v3/collections/{collection_id} | Get a collection. | | [**v3ListCollections**](CollectionsApi.md#v3ListCollections) | **GET** /v3/collections | List collections. | +| [**v3PatchCollection**](CollectionsApi.md#v3PatchCollection) | **PATCH** /v3/collections/{collection_id} | Update a collection. | | [**v3PatchCollectionBinaries**](CollectionsApi.md#v3PatchCollectionBinaries) | **PATCH** /v3/collections/{collection_id}/binaries | Replace the binaries in a collection. | | [**v3PatchCollectionTags**](CollectionsApi.md#v3PatchCollectionTags) | **PATCH** /v3/collections/{collection_id}/tags | Replace the tags on a collection. | @@ -606,6 +608,79 @@ public class Example { | **422** | Unprocessable Entity | - | | **500** | Internal Server Error | - | + +# **v3DeleteCollection** +> v3DeleteCollection(collectionId) + +Delete a collection. + +Deletes a collection. The collection must not have any linked binaries (call PATCH /v3/collections/{collection_id}/binaries with an empty list first). **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `409` [`CONFLICT`](/errors/CONFLICT) — Conflict + +### 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.CollectionsApi; + +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"); + + CollectionsApi apiInstance = new CollectionsApi(defaultClient); + Long collectionId = 56L; // Long | + try { + apiInstance.v3DeleteCollection(collectionId); + } catch (ApiException e) { + System.err.println("Exception when calling CollectionsApi#v3DeleteCollection"); + 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 | +|------------- | ------------- | ------------- | -------------| +| **collectionId** | **Long**| | | + +### Return type + +null (empty response body) + +### Authorization + +[APIKey](../README.md#APIKey) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **204** | No Content | - | +| **403** | Forbidden | - | +| **404** | Not Found | - | +| **409** | Conflict | - | +| **422** | Unprocessable Entity | - | +| **500** | Internal Server Error | - | + # **v3GetCollection** > GetCollectionOutputBody v3GetCollection(collectionId, includeTags, includeBinaries, pageSize, pageNumber, binarySearchStr) @@ -769,6 +844,81 @@ public class Example { | **422** | Unprocessable Entity | - | | **500** | Internal Server Error | - | + +# **v3PatchCollection** +> PatchCollectionOutputBody v3PatchCollection(collectionId, patchCollectionInputBody) + +Update a collection. + +Updates a collection's name, description, and/or scope. Omitted fields keep their existing values. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `422` [`VALIDATION_FAILED`](/errors/VALIDATION_FAILED) — Validation Failed + +### 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.CollectionsApi; + +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"); + + CollectionsApi apiInstance = new CollectionsApi(defaultClient); + Long collectionId = 56L; // Long | + PatchCollectionInputBody patchCollectionInputBody = new PatchCollectionInputBody(); // PatchCollectionInputBody | + try { + PatchCollectionOutputBody result = apiInstance.v3PatchCollection(collectionId, patchCollectionInputBody); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling CollectionsApi#v3PatchCollection"); + 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 | +|------------- | ------------- | ------------- | -------------| +| **collectionId** | **Long**| | | +| **patchCollectionInputBody** | [**PatchCollectionInputBody**](PatchCollectionInputBody.md)| | | + +### Return type + +[**PatchCollectionOutputBody**](PatchCollectionOutputBody.md) + +### Authorization + +[APIKey](../README.md#APIKey) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | OK | - | +| **403** | Forbidden | - | +| **404** | Not Found | - | +| **422** | Unprocessable Entity | - | +| **500** | Internal Server Error | - | + # **v3PatchCollectionBinaries** > PatchCollectionBinariesOutputBody v3PatchCollectionBinaries(collectionId, patchCollectionBinariesInputBody) diff --git a/docs/PatchCollectionInputBody.md b/docs/PatchCollectionInputBody.md new file mode 100644 index 00000000..541d86df --- /dev/null +++ b/docs/PatchCollectionInputBody.md @@ -0,0 +1,15 @@ + + +# PatchCollectionInputBody + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**collectionName** | **String** | New collection name. Omit, null, or empty string to keep existing. | [optional] | +|**collectionScope** | **String** | New scope (PUBLIC, PRIVATE, PROTECTED, TEAM). Omit or send null to keep existing. Empty string returns 422 UNPROCESSABLE ENTITY. | [optional] | +|**description** | **String** | New description. Omit, null, or empty string to keep existing. | [optional] | + + + diff --git a/docs/PatchCollectionOutputBody.md b/docs/PatchCollectionOutputBody.md new file mode 100644 index 00000000..32c2f6af --- /dev/null +++ b/docs/PatchCollectionOutputBody.md @@ -0,0 +1,22 @@ + + +# PatchCollectionOutputBody + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**binaryCount** | **Long** | | | +|**collectionId** | **Long** | | | +|**collectionName** | **String** | | | +|**collectionScope** | **String** | | | +|**createdAt** | **OffsetDateTime** | | | +|**description** | **String** | | | +|**modelId** | **Long** | | | +|**teamId** | **Long** | | | +|**updatedAt** | **OffsetDateTime** | | | +|**userId** | **Long** | | | + + + diff --git a/docs/TokenisedData.md b/docs/TokenisedData.md index b1eee434..fefb4d51 100644 --- a/docs/TokenisedData.md +++ b/docs/TokenisedData.md @@ -7,7 +7,7 @@ | Name | Type | Description | Notes | |------------ | ------------- | ------------- | -------------| -|**functionMapping** | [**FunctionMapping**](FunctionMapping.md) | Complete mapping data for token resolution | [optional] | +|**functionMapping** | **AIDecompFunctionMapping** | Complete mapping data for token resolution | [optional] | |**predictedFunctionName** | **String** | Predicted function name from the AI model | [optional] | |**status** | [**StatusEnum**](#StatusEnum) | Task status | | |**tokenisedDecompilation** | **String** | Source code with placeholder tokens | [optional] | diff --git a/pom.xml b/pom.xml index 4a4e6d6b..f4cc859c 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ sdk jar sdk - 3.92.0 + 3.93.0 https://github.com/RevEngAI/sdk-java Java SDK for the RevEng.AI API diff --git a/src/main/java/ai/reveng/api/CollectionsApi.java b/src/main/java/ai/reveng/api/CollectionsApi.java index 6052b274..87eb72e8 100644 --- a/src/main/java/ai/reveng/api/CollectionsApi.java +++ b/src/main/java/ai/reveng/api/CollectionsApi.java @@ -46,6 +46,8 @@ import ai.reveng.model.Order; import ai.reveng.model.PatchCollectionBinariesInputBody; import ai.reveng.model.PatchCollectionBinariesOutputBody; +import ai.reveng.model.PatchCollectionInputBody; +import ai.reveng.model.PatchCollectionOutputBody; import ai.reveng.model.PatchCollectionTagsInputBody; import ai.reveng.model.PatchCollectionTagsOutputBody; @@ -105,7 +107,9 @@ public void setCustomBaseUrl(String customBaseUrl) { 200 Successful Response - 422 Invalid request parameters - + * @deprecated */ + @Deprecated public okhttp3.Call createCollectionCall(@javax.annotation.Nonnull CollectionCreateRequest collectionCreateRequest, final ApiCallback _callback) throws ApiException { String basePath = null; // Operation Servers @@ -151,6 +155,7 @@ public okhttp3.Call createCollectionCall(@javax.annotation.Nonnull CollectionCre return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } + @Deprecated @SuppressWarnings("rawtypes") private okhttp3.Call createCollectionValidateBeforeCall(@javax.annotation.Nonnull CollectionCreateRequest collectionCreateRequest, final ApiCallback _callback) throws ApiException { // verify the required parameter 'collectionCreateRequest' is set @@ -175,7 +180,9 @@ private okhttp3.Call createCollectionValidateBeforeCall(@javax.annotation.Nonnul 200 Successful Response - 422 Invalid request parameters - + * @deprecated */ + @Deprecated public BaseResponseCollectionResponse createCollection(@javax.annotation.Nonnull CollectionCreateRequest collectionCreateRequest) throws ApiException { ApiResponse localVarResp = createCollectionWithHttpInfo(collectionCreateRequest); return localVarResp.getData(); @@ -194,7 +201,9 @@ public BaseResponseCollectionResponse createCollection(@javax.annotation.Nonnull 200 Successful Response - 422 Invalid request parameters - + * @deprecated */ + @Deprecated public ApiResponse createCollectionWithHttpInfo(@javax.annotation.Nonnull CollectionCreateRequest collectionCreateRequest) throws ApiException { okhttp3.Call localVarCall = createCollectionValidateBeforeCall(collectionCreateRequest, null); Type localVarReturnType = new TypeToken(){}.getType(); @@ -215,7 +224,9 @@ public ApiResponse createCollectionWithHttpInfo( 200 Successful Response - 422 Invalid request parameters - + * @deprecated */ + @Deprecated public okhttp3.Call createCollectionAsync(@javax.annotation.Nonnull CollectionCreateRequest collectionCreateRequest, final ApiCallback _callback) throws ApiException { okhttp3.Call localVarCall = createCollectionValidateBeforeCall(collectionCreateRequest, _callback); @@ -236,7 +247,9 @@ public okhttp3.Call createCollectionAsync(@javax.annotation.Nonnull CollectionCr 200 Successful Response - 422 Invalid request parameters - + * @deprecated */ + @Deprecated public okhttp3.Call deleteCollectionCall(@javax.annotation.Nonnull Integer collectionId, final ApiCallback _callback) throws ApiException { String basePath = null; // Operation Servers @@ -282,6 +295,7 @@ public okhttp3.Call deleteCollectionCall(@javax.annotation.Nonnull Integer colle return localVarApiClient.buildCall(basePath, localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } + @Deprecated @SuppressWarnings("rawtypes") private okhttp3.Call deleteCollectionValidateBeforeCall(@javax.annotation.Nonnull Integer collectionId, final ApiCallback _callback) throws ApiException { // verify the required parameter 'collectionId' is set @@ -306,7 +320,9 @@ private okhttp3.Call deleteCollectionValidateBeforeCall(@javax.annotation.Nonnul 200 Successful Response - 422 Invalid request parameters - + * @deprecated */ + @Deprecated public BaseResponseBool deleteCollection(@javax.annotation.Nonnull Integer collectionId) throws ApiException { ApiResponse localVarResp = deleteCollectionWithHttpInfo(collectionId); return localVarResp.getData(); @@ -325,7 +341,9 @@ public BaseResponseBool deleteCollection(@javax.annotation.Nonnull Integer colle 200 Successful Response - 422 Invalid request parameters - + * @deprecated */ + @Deprecated public ApiResponse deleteCollectionWithHttpInfo(@javax.annotation.Nonnull Integer collectionId) throws ApiException { okhttp3.Call localVarCall = deleteCollectionValidateBeforeCall(collectionId, null); Type localVarReturnType = new TypeToken(){}.getType(); @@ -346,7 +364,9 @@ public ApiResponse deleteCollectionWithHttpInfo(@javax.annotat 200 Successful Response - 422 Invalid request parameters - + * @deprecated */ + @Deprecated public okhttp3.Call deleteCollectionAsync(@javax.annotation.Nonnull Integer collectionId, final ApiCallback _callback) throws ApiException { okhttp3.Call localVarCall = deleteCollectionValidateBeforeCall(collectionId, _callback); @@ -372,7 +392,9 @@ public okhttp3.Call deleteCollectionAsync(@javax.annotation.Nonnull Integer coll 200 Successful Response - 422 Invalid request parameters - + * @deprecated */ + @Deprecated public okhttp3.Call getCollectionCall(@javax.annotation.Nonnull Integer collectionId, @javax.annotation.Nullable Boolean includeTags, @javax.annotation.Nullable Boolean includeBinaries, @javax.annotation.Nullable Integer pageSize, @javax.annotation.Nullable Integer pageNumber, @javax.annotation.Nullable String binarySearchStr, final ApiCallback _callback) throws ApiException { String basePath = null; // Operation Servers @@ -438,6 +460,7 @@ public okhttp3.Call getCollectionCall(@javax.annotation.Nonnull Integer collecti return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } + @Deprecated @SuppressWarnings("rawtypes") private okhttp3.Call getCollectionValidateBeforeCall(@javax.annotation.Nonnull Integer collectionId, @javax.annotation.Nullable Boolean includeTags, @javax.annotation.Nullable Boolean includeBinaries, @javax.annotation.Nullable Integer pageSize, @javax.annotation.Nullable Integer pageNumber, @javax.annotation.Nullable String binarySearchStr, final ApiCallback _callback) throws ApiException { // verify the required parameter 'collectionId' is set @@ -467,7 +490,9 @@ private okhttp3.Call getCollectionValidateBeforeCall(@javax.annotation.Nonnull I 200 Successful Response - 422 Invalid request parameters - + * @deprecated */ + @Deprecated public BaseResponseCollectionResponse getCollection(@javax.annotation.Nonnull Integer collectionId, @javax.annotation.Nullable Boolean includeTags, @javax.annotation.Nullable Boolean includeBinaries, @javax.annotation.Nullable Integer pageSize, @javax.annotation.Nullable Integer pageNumber, @javax.annotation.Nullable String binarySearchStr) throws ApiException { ApiResponse localVarResp = getCollectionWithHttpInfo(collectionId, includeTags, includeBinaries, pageSize, pageNumber, binarySearchStr); return localVarResp.getData(); @@ -491,7 +516,9 @@ public BaseResponseCollectionResponse getCollection(@javax.annotation.Nonnull In 200 Successful Response - 422 Invalid request parameters - + * @deprecated */ + @Deprecated public ApiResponse getCollectionWithHttpInfo(@javax.annotation.Nonnull Integer collectionId, @javax.annotation.Nullable Boolean includeTags, @javax.annotation.Nullable Boolean includeBinaries, @javax.annotation.Nullable Integer pageSize, @javax.annotation.Nullable Integer pageNumber, @javax.annotation.Nullable String binarySearchStr) throws ApiException { okhttp3.Call localVarCall = getCollectionValidateBeforeCall(collectionId, includeTags, includeBinaries, pageSize, pageNumber, binarySearchStr, null); Type localVarReturnType = new TypeToken(){}.getType(); @@ -517,7 +544,9 @@ public ApiResponse getCollectionWithHttpInfo(@ja 200 Successful Response - 422 Invalid request parameters - + * @deprecated */ + @Deprecated public okhttp3.Call getCollectionAsync(@javax.annotation.Nonnull Integer collectionId, @javax.annotation.Nullable Boolean includeTags, @javax.annotation.Nullable Boolean includeBinaries, @javax.annotation.Nullable Integer pageSize, @javax.annotation.Nullable Integer pageNumber, @javax.annotation.Nullable String binarySearchStr, final ApiCallback _callback) throws ApiException { okhttp3.Call localVarCall = getCollectionValidateBeforeCall(collectionId, includeTags, includeBinaries, pageSize, pageNumber, binarySearchStr, _callback); @@ -543,7 +572,9 @@ public okhttp3.Call getCollectionAsync(@javax.annotation.Nonnull Integer collect 200 Successful Response - 422 Invalid request parameters - + * @deprecated */ + @Deprecated public okhttp3.Call listCollectionsCall(@javax.annotation.Nullable String searchTerm, @javax.annotation.Nullable List filters, @javax.annotation.Nullable Integer limit, @javax.annotation.Nullable Integer offset, @javax.annotation.Nullable AppApiRestV2CollectionsEnumsOrderBy orderBy, @javax.annotation.Nullable Order order, final ApiCallback _callback) throws ApiException { String basePath = null; // Operation Servers @@ -612,6 +643,7 @@ public okhttp3.Call listCollectionsCall(@javax.annotation.Nullable String search return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } + @Deprecated @SuppressWarnings("rawtypes") private okhttp3.Call listCollectionsValidateBeforeCall(@javax.annotation.Nullable String searchTerm, @javax.annotation.Nullable List filters, @javax.annotation.Nullable Integer limit, @javax.annotation.Nullable Integer offset, @javax.annotation.Nullable AppApiRestV2CollectionsEnumsOrderBy orderBy, @javax.annotation.Nullable Order order, final ApiCallback _callback) throws ApiException { return listCollectionsCall(searchTerm, filters, limit, offset, orderBy, order, _callback); @@ -636,7 +668,9 @@ private okhttp3.Call listCollectionsValidateBeforeCall(@javax.annotation.Nullabl 200 Successful Response - 422 Invalid request parameters - + * @deprecated */ + @Deprecated public BaseResponseListCollectionResults listCollections(@javax.annotation.Nullable String searchTerm, @javax.annotation.Nullable List filters, @javax.annotation.Nullable Integer limit, @javax.annotation.Nullable Integer offset, @javax.annotation.Nullable AppApiRestV2CollectionsEnumsOrderBy orderBy, @javax.annotation.Nullable Order order) throws ApiException { ApiResponse localVarResp = listCollectionsWithHttpInfo(searchTerm, filters, limit, offset, orderBy, order); return localVarResp.getData(); @@ -660,7 +694,9 @@ public BaseResponseListCollectionResults listCollections(@javax.annotation.Nulla 200 Successful Response - 422 Invalid request parameters - + * @deprecated */ + @Deprecated public ApiResponse listCollectionsWithHttpInfo(@javax.annotation.Nullable String searchTerm, @javax.annotation.Nullable List filters, @javax.annotation.Nullable Integer limit, @javax.annotation.Nullable Integer offset, @javax.annotation.Nullable AppApiRestV2CollectionsEnumsOrderBy orderBy, @javax.annotation.Nullable Order order) throws ApiException { okhttp3.Call localVarCall = listCollectionsValidateBeforeCall(searchTerm, filters, limit, offset, orderBy, order, null); Type localVarReturnType = new TypeToken(){}.getType(); @@ -686,7 +722,9 @@ public ApiResponse listCollectionsWithHttpInf 200 Successful Response - 422 Invalid request parameters - + * @deprecated */ + @Deprecated public okhttp3.Call listCollectionsAsync(@javax.annotation.Nullable String searchTerm, @javax.annotation.Nullable List filters, @javax.annotation.Nullable Integer limit, @javax.annotation.Nullable Integer offset, @javax.annotation.Nullable AppApiRestV2CollectionsEnumsOrderBy orderBy, @javax.annotation.Nullable Order order, final ApiCallback _callback) throws ApiException { okhttp3.Call localVarCall = listCollectionsValidateBeforeCall(searchTerm, filters, limit, offset, orderBy, order, _callback); @@ -708,7 +746,9 @@ public okhttp3.Call listCollectionsAsync(@javax.annotation.Nullable String searc 200 Successful Response - 422 Invalid request parameters - + * @deprecated */ + @Deprecated public okhttp3.Call updateCollectionCall(@javax.annotation.Nonnull Integer collectionId, @javax.annotation.Nonnull CollectionUpdateRequest collectionUpdateRequest, final ApiCallback _callback) throws ApiException { String basePath = null; // Operation Servers @@ -755,6 +795,7 @@ public okhttp3.Call updateCollectionCall(@javax.annotation.Nonnull Integer colle return localVarApiClient.buildCall(basePath, localVarPath, "PATCH", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } + @Deprecated @SuppressWarnings("rawtypes") private okhttp3.Call updateCollectionValidateBeforeCall(@javax.annotation.Nonnull Integer collectionId, @javax.annotation.Nonnull CollectionUpdateRequest collectionUpdateRequest, final ApiCallback _callback) throws ApiException { // verify the required parameter 'collectionId' is set @@ -785,7 +826,9 @@ private okhttp3.Call updateCollectionValidateBeforeCall(@javax.annotation.Nonnul 200 Successful Response - 422 Invalid request parameters - + * @deprecated */ + @Deprecated public BaseResponseCollectionResponse updateCollection(@javax.annotation.Nonnull Integer collectionId, @javax.annotation.Nonnull CollectionUpdateRequest collectionUpdateRequest) throws ApiException { ApiResponse localVarResp = updateCollectionWithHttpInfo(collectionId, collectionUpdateRequest); return localVarResp.getData(); @@ -805,7 +848,9 @@ public BaseResponseCollectionResponse updateCollection(@javax.annotation.Nonnull 200 Successful Response - 422 Invalid request parameters - + * @deprecated */ + @Deprecated public ApiResponse updateCollectionWithHttpInfo(@javax.annotation.Nonnull Integer collectionId, @javax.annotation.Nonnull CollectionUpdateRequest collectionUpdateRequest) throws ApiException { okhttp3.Call localVarCall = updateCollectionValidateBeforeCall(collectionId, collectionUpdateRequest, null); Type localVarReturnType = new TypeToken(){}.getType(); @@ -827,7 +872,9 @@ public ApiResponse updateCollectionWithHttpInfo( 200 Successful Response - 422 Invalid request parameters - + * @deprecated */ + @Deprecated public okhttp3.Call updateCollectionAsync(@javax.annotation.Nonnull Integer collectionId, @javax.annotation.Nonnull CollectionUpdateRequest collectionUpdateRequest, final ApiCallback _callback) throws ApiException { okhttp3.Call localVarCall = updateCollectionValidateBeforeCall(collectionId, collectionUpdateRequest, _callback); @@ -849,7 +896,9 @@ public okhttp3.Call updateCollectionAsync(@javax.annotation.Nonnull Integer coll 200 Successful Response - 422 Invalid request parameters - + * @deprecated */ + @Deprecated public okhttp3.Call updateCollectionBinariesCall(@javax.annotation.Nonnull Integer collectionId, @javax.annotation.Nonnull CollectionBinariesUpdateRequest collectionBinariesUpdateRequest, final ApiCallback _callback) throws ApiException { String basePath = null; // Operation Servers @@ -896,6 +945,7 @@ public okhttp3.Call updateCollectionBinariesCall(@javax.annotation.Nonnull Integ return localVarApiClient.buildCall(basePath, localVarPath, "PATCH", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } + @Deprecated @SuppressWarnings("rawtypes") private okhttp3.Call updateCollectionBinariesValidateBeforeCall(@javax.annotation.Nonnull Integer collectionId, @javax.annotation.Nonnull CollectionBinariesUpdateRequest collectionBinariesUpdateRequest, final ApiCallback _callback) throws ApiException { // verify the required parameter 'collectionId' is set @@ -926,7 +976,9 @@ private okhttp3.Call updateCollectionBinariesValidateBeforeCall(@javax.annotatio 200 Successful Response - 422 Invalid request parameters - + * @deprecated */ + @Deprecated public BaseResponseCollectionBinariesUpdateResponse updateCollectionBinaries(@javax.annotation.Nonnull Integer collectionId, @javax.annotation.Nonnull CollectionBinariesUpdateRequest collectionBinariesUpdateRequest) throws ApiException { ApiResponse localVarResp = updateCollectionBinariesWithHttpInfo(collectionId, collectionBinariesUpdateRequest); return localVarResp.getData(); @@ -946,7 +998,9 @@ public BaseResponseCollectionBinariesUpdateResponse updateCollectionBinaries(@ja 200 Successful Response - 422 Invalid request parameters - + * @deprecated */ + @Deprecated public ApiResponse updateCollectionBinariesWithHttpInfo(@javax.annotation.Nonnull Integer collectionId, @javax.annotation.Nonnull CollectionBinariesUpdateRequest collectionBinariesUpdateRequest) throws ApiException { okhttp3.Call localVarCall = updateCollectionBinariesValidateBeforeCall(collectionId, collectionBinariesUpdateRequest, null); Type localVarReturnType = new TypeToken(){}.getType(); @@ -968,7 +1022,9 @@ public ApiResponse updateCollectio 200 Successful Response - 422 Invalid request parameters - + * @deprecated */ + @Deprecated public okhttp3.Call updateCollectionBinariesAsync(@javax.annotation.Nonnull Integer collectionId, @javax.annotation.Nonnull CollectionBinariesUpdateRequest collectionBinariesUpdateRequest, final ApiCallback _callback) throws ApiException { okhttp3.Call localVarCall = updateCollectionBinariesValidateBeforeCall(collectionId, collectionBinariesUpdateRequest, _callback); @@ -990,7 +1046,9 @@ public okhttp3.Call updateCollectionBinariesAsync(@javax.annotation.Nonnull Inte 200 Successful Response - 422 Invalid request parameters - + * @deprecated */ + @Deprecated public okhttp3.Call updateCollectionTagsCall(@javax.annotation.Nonnull Integer collectionId, @javax.annotation.Nonnull CollectionTagsUpdateRequest collectionTagsUpdateRequest, final ApiCallback _callback) throws ApiException { String basePath = null; // Operation Servers @@ -1037,6 +1095,7 @@ public okhttp3.Call updateCollectionTagsCall(@javax.annotation.Nonnull Integer c return localVarApiClient.buildCall(basePath, localVarPath, "PATCH", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } + @Deprecated @SuppressWarnings("rawtypes") private okhttp3.Call updateCollectionTagsValidateBeforeCall(@javax.annotation.Nonnull Integer collectionId, @javax.annotation.Nonnull CollectionTagsUpdateRequest collectionTagsUpdateRequest, final ApiCallback _callback) throws ApiException { // verify the required parameter 'collectionId' is set @@ -1067,7 +1126,9 @@ private okhttp3.Call updateCollectionTagsValidateBeforeCall(@javax.annotation.No 200 Successful Response - 422 Invalid request parameters - + * @deprecated */ + @Deprecated public BaseResponseCollectionTagsUpdateResponse updateCollectionTags(@javax.annotation.Nonnull Integer collectionId, @javax.annotation.Nonnull CollectionTagsUpdateRequest collectionTagsUpdateRequest) throws ApiException { ApiResponse localVarResp = updateCollectionTagsWithHttpInfo(collectionId, collectionTagsUpdateRequest); return localVarResp.getData(); @@ -1087,7 +1148,9 @@ public BaseResponseCollectionTagsUpdateResponse updateCollectionTags(@javax.anno 200 Successful Response - 422 Invalid request parameters - + * @deprecated */ + @Deprecated public ApiResponse updateCollectionTagsWithHttpInfo(@javax.annotation.Nonnull Integer collectionId, @javax.annotation.Nonnull CollectionTagsUpdateRequest collectionTagsUpdateRequest) throws ApiException { okhttp3.Call localVarCall = updateCollectionTagsValidateBeforeCall(collectionId, collectionTagsUpdateRequest, null); Type localVarReturnType = new TypeToken(){}.getType(); @@ -1109,7 +1172,9 @@ public ApiResponse updateCollectionTag 200 Successful Response - 422 Invalid request parameters - + * @deprecated */ + @Deprecated public okhttp3.Call updateCollectionTagsAsync(@javax.annotation.Nonnull Integer collectionId, @javax.annotation.Nonnull CollectionTagsUpdateRequest collectionTagsUpdateRequest, final ApiCallback _callback) throws ApiException { okhttp3.Call localVarCall = updateCollectionTagsValidateBeforeCall(collectionId, collectionTagsUpdateRequest, _callback); @@ -1256,6 +1321,149 @@ public okhttp3.Call v3CreateCollectionAsync(@javax.annotation.Nonnull CreateColl localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } + /** + * Build call for v3DeleteCollection + * @param collectionId (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
204 No Content -
403 Forbidden -
404 Not Found -
409 Conflict -
422 Unprocessable Entity -
500 Internal Server Error -
+ */ + public okhttp3.Call v3DeleteCollectionCall(@javax.annotation.Nonnull Long collectionId, 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 = "/v3/collections/{collection_id}" + .replace("{" + "collection_id" + "}", localVarApiClient.escapeString(collectionId.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, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call v3DeleteCollectionValidateBeforeCall(@javax.annotation.Nonnull Long collectionId, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'collectionId' is set + if (collectionId == null) { + throw new ApiException("Missing the required parameter 'collectionId' when calling v3DeleteCollection(Async)"); + } + + return v3DeleteCollectionCall(collectionId, _callback); + + } + + /** + * Delete a collection. + * Deletes a collection. The collection must not have any linked binaries (call PATCH /v3/collections/{collection_id}/binaries with an empty list first). **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `409` [`CONFLICT`](/errors/CONFLICT) — Conflict + * @param collectionId (required) + * @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
204 No Content -
403 Forbidden -
404 Not Found -
409 Conflict -
422 Unprocessable Entity -
500 Internal Server Error -
+ */ + public void v3DeleteCollection(@javax.annotation.Nonnull Long collectionId) throws ApiException { + v3DeleteCollectionWithHttpInfo(collectionId); + } + + /** + * Delete a collection. + * Deletes a collection. The collection must not have any linked binaries (call PATCH /v3/collections/{collection_id}/binaries with an empty list first). **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `409` [`CONFLICT`](/errors/CONFLICT) — Conflict + * @param collectionId (required) + * @return ApiResponse<Void> + * @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
204 No Content -
403 Forbidden -
404 Not Found -
409 Conflict -
422 Unprocessable Entity -
500 Internal Server Error -
+ */ + public ApiResponse v3DeleteCollectionWithHttpInfo(@javax.annotation.Nonnull Long collectionId) throws ApiException { + okhttp3.Call localVarCall = v3DeleteCollectionValidateBeforeCall(collectionId, null); + return localVarApiClient.execute(localVarCall); + } + + /** + * Delete a collection. (asynchronously) + * Deletes a collection. The collection must not have any linked binaries (call PATCH /v3/collections/{collection_id}/binaries with an empty list first). **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `409` [`CONFLICT`](/errors/CONFLICT) — Conflict + * @param collectionId (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
204 No Content -
403 Forbidden -
404 Not Found -
409 Conflict -
422 Unprocessable Entity -
500 Internal Server Error -
+ */ + public okhttp3.Call v3DeleteCollectionAsync(@javax.annotation.Nonnull Long collectionId, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = v3DeleteCollectionValidateBeforeCall(collectionId, _callback); + localVarApiClient.executeAsync(localVarCall, _callback); + return localVarCall; + } /** * Build call for v3GetCollection * @param collectionId (required) @@ -1608,6 +1816,159 @@ public okhttp3.Call v3ListCollectionsAsync(@javax.annotation.Nullable String sea localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } + /** + * Build call for v3PatchCollection + * @param collectionId (required) + * @param patchCollectionInputBody (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 OK -
403 Forbidden -
404 Not Found -
422 Unprocessable Entity -
500 Internal Server Error -
+ */ + public okhttp3.Call v3PatchCollectionCall(@javax.annotation.Nonnull Long collectionId, @javax.annotation.Nonnull PatchCollectionInputBody patchCollectionInputBody, 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 = patchCollectionInputBody; + + // create path and map variables + String localVarPath = "/v3/collections/{collection_id}" + .replace("{" + "collection_id" + "}", localVarApiClient.escapeString(collectionId.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 = { + "application/json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "APIKey" }; + return localVarApiClient.buildCall(basePath, localVarPath, "PATCH", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call v3PatchCollectionValidateBeforeCall(@javax.annotation.Nonnull Long collectionId, @javax.annotation.Nonnull PatchCollectionInputBody patchCollectionInputBody, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'collectionId' is set + if (collectionId == null) { + throw new ApiException("Missing the required parameter 'collectionId' when calling v3PatchCollection(Async)"); + } + + // verify the required parameter 'patchCollectionInputBody' is set + if (patchCollectionInputBody == null) { + throw new ApiException("Missing the required parameter 'patchCollectionInputBody' when calling v3PatchCollection(Async)"); + } + + return v3PatchCollectionCall(collectionId, patchCollectionInputBody, _callback); + + } + + /** + * Update a collection. + * Updates a collection's name, description, and/or scope. Omitted fields keep their existing values. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `422` [`VALIDATION_FAILED`](/errors/VALIDATION_FAILED) — Validation Failed + * @param collectionId (required) + * @param patchCollectionInputBody (required) + * @return PatchCollectionOutputBody + * @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 OK -
403 Forbidden -
404 Not Found -
422 Unprocessable Entity -
500 Internal Server Error -
+ */ + public PatchCollectionOutputBody v3PatchCollection(@javax.annotation.Nonnull Long collectionId, @javax.annotation.Nonnull PatchCollectionInputBody patchCollectionInputBody) throws ApiException { + ApiResponse localVarResp = v3PatchCollectionWithHttpInfo(collectionId, patchCollectionInputBody); + return localVarResp.getData(); + } + + /** + * Update a collection. + * Updates a collection's name, description, and/or scope. Omitted fields keep their existing values. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `422` [`VALIDATION_FAILED`](/errors/VALIDATION_FAILED) — Validation Failed + * @param collectionId (required) + * @param patchCollectionInputBody (required) + * @return ApiResponse<PatchCollectionOutputBody> + * @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 OK -
403 Forbidden -
404 Not Found -
422 Unprocessable Entity -
500 Internal Server Error -
+ */ + public ApiResponse v3PatchCollectionWithHttpInfo(@javax.annotation.Nonnull Long collectionId, @javax.annotation.Nonnull PatchCollectionInputBody patchCollectionInputBody) throws ApiException { + okhttp3.Call localVarCall = v3PatchCollectionValidateBeforeCall(collectionId, patchCollectionInputBody, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Update a collection. (asynchronously) + * Updates a collection's name, description, and/or scope. Omitted fields keep their existing values. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `422` [`VALIDATION_FAILED`](/errors/VALIDATION_FAILED) — Validation Failed + * @param collectionId (required) + * @param patchCollectionInputBody (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 OK -
403 Forbidden -
404 Not Found -
422 Unprocessable Entity -
500 Internal Server Error -
+ */ + public okhttp3.Call v3PatchCollectionAsync(@javax.annotation.Nonnull Long collectionId, @javax.annotation.Nonnull PatchCollectionInputBody patchCollectionInputBody, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = v3PatchCollectionValidateBeforeCall(collectionId, patchCollectionInputBody, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } /** * Build call for v3PatchCollectionBinaries * @param collectionId (required) diff --git a/src/main/java/ai/reveng/invoker/ApiClient.java b/src/main/java/ai/reveng/invoker/ApiClient.java index d34ad86e..8d12ce30 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.92.0/java"); + setUserAgent("OpenAPI-Generator/3.93.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 989cbc27..b3020f40 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.92.0"; + public static final String VERSION = "3.93.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 41b56dee..f8ccb79e 100644 --- a/src/main/java/ai/reveng/invoker/JSON.java +++ b/src/main/java/ai/reveng/invoker/JSON.java @@ -98,6 +98,9 @@ private static Class getClassByDiscriminator(Map classByDiscriminatorValue, Stri gsonBuilder.registerTypeAdapter(OffsetDateTime.class, offsetDateTimeTypeAdapter); gsonBuilder.registerTypeAdapter(LocalDate.class, localDateTypeAdapter); gsonBuilder.registerTypeAdapter(byte[].class, byteArrayAdapter); + gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.AIDecompFunctionMapping.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.AIDecompInverseFunctionMapItem.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.AIDecompInverseStringMapItem.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.APIError.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.AddCalleeInputBody.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.AddUserStringInputBody.CustomTypeAdapterFactory()); @@ -397,6 +400,8 @@ private static Class getClassByDiscriminator(Map classByDiscriminatorValue, Stri gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.Params.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.PatchCollectionBinariesInputBody.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.PatchCollectionBinariesOutputBody.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.PatchCollectionInputBody.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.PatchCollectionOutputBody.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.PatchCollectionTagsInputBody.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.PatchCollectionTagsOutputBody.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.PatchCommentBody.CustomTypeAdapterFactory()); diff --git a/src/main/java/ai/reveng/model/AIDecompFunctionMapping.java b/src/main/java/ai/reveng/model/AIDecompFunctionMapping.java new file mode 100644 index 00000000..1640a597 --- /dev/null +++ b/src/main/java/ai/reveng/model/AIDecompFunctionMapping.java @@ -0,0 +1,746 @@ +/* + * 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.AIDecompInverseFunctionMapItem; +import ai.reveng.model.AIDecompInverseStringMapItem; +import ai.reveng.model.ReplacementValue; +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 java.util.HashMap; +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; + +/** + * AIDecompFunctionMapping + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class AIDecompFunctionMapping { + public static final String SERIALIZED_NAME_FIELDS = "fields"; + @SerializedName(SERIALIZED_NAME_FIELDS) + @javax.annotation.Nonnull + private Map> fields = new HashMap<>(); + + public static final String SERIALIZED_NAME_INVERSE_FUNCTION_MAP = "inverse_function_map"; + @SerializedName(SERIALIZED_NAME_INVERSE_FUNCTION_MAP) + @javax.annotation.Nonnull + private Map inverseFunctionMap = new HashMap<>(); + + public static final String SERIALIZED_NAME_INVERSE_STRING_MAP = "inverse_string_map"; + @SerializedName(SERIALIZED_NAME_INVERSE_STRING_MAP) + @javax.annotation.Nonnull + private Map inverseStringMap = new HashMap<>(); + + public static final String SERIALIZED_NAME_UNMATCHED_CUSTOM_FUNCTION_POINTERS = "unmatched_custom_function_pointers"; + @SerializedName(SERIALIZED_NAME_UNMATCHED_CUSTOM_FUNCTION_POINTERS) + @javax.annotation.Nonnull + private Map unmatchedCustomFunctionPointers = new HashMap<>(); + + public static final String SERIALIZED_NAME_UNMATCHED_CUSTOM_TYPES = "unmatched_custom_types"; + @SerializedName(SERIALIZED_NAME_UNMATCHED_CUSTOM_TYPES) + @javax.annotation.Nonnull + private Map unmatchedCustomTypes = new HashMap<>(); + + public static final String SERIALIZED_NAME_UNMATCHED_ENUMS = "unmatched_enums"; + @SerializedName(SERIALIZED_NAME_UNMATCHED_ENUMS) + @javax.annotation.Nonnull + private Map unmatchedEnums = new HashMap<>(); + + public static final String SERIALIZED_NAME_UNMATCHED_EXTERNAL_VARS = "unmatched_external_vars"; + @SerializedName(SERIALIZED_NAME_UNMATCHED_EXTERNAL_VARS) + @javax.annotation.Nonnull + private Map unmatchedExternalVars = new HashMap<>(); + + public static final String SERIALIZED_NAME_UNMATCHED_FUNCTIONS = "unmatched_functions"; + @SerializedName(SERIALIZED_NAME_UNMATCHED_FUNCTIONS) + @javax.annotation.Nonnull + private Map unmatchedFunctions = new HashMap<>(); + + public static final String SERIALIZED_NAME_UNMATCHED_GLOBAL_VARS = "unmatched_global_vars"; + @SerializedName(SERIALIZED_NAME_UNMATCHED_GLOBAL_VARS) + @javax.annotation.Nonnull + private Map unmatchedGlobalVars = new HashMap<>(); + + public static final String SERIALIZED_NAME_UNMATCHED_GO_TO_LABELS = "unmatched_go_to_labels"; + @SerializedName(SERIALIZED_NAME_UNMATCHED_GO_TO_LABELS) + @javax.annotation.Nonnull + private Map unmatchedGoToLabels = new HashMap<>(); + + public static final String SERIALIZED_NAME_UNMATCHED_STRINGS = "unmatched_strings"; + @SerializedName(SERIALIZED_NAME_UNMATCHED_STRINGS) + @javax.annotation.Nonnull + private Map unmatchedStrings = new HashMap<>(); + + public static final String SERIALIZED_NAME_UNMATCHED_VARIADIC_LISTS = "unmatched_variadic_lists"; + @SerializedName(SERIALIZED_NAME_UNMATCHED_VARIADIC_LISTS) + @javax.annotation.Nonnull + private Map unmatchedVariadicLists = new HashMap<>(); + + public static final String SERIALIZED_NAME_UNMATCHED_VARS = "unmatched_vars"; + @SerializedName(SERIALIZED_NAME_UNMATCHED_VARS) + @javax.annotation.Nonnull + private Map unmatchedVars = new HashMap<>(); + + public static final String SERIALIZED_NAME_USER_OVERRIDE_MAPPINGS = "user_override_mappings"; + @SerializedName(SERIALIZED_NAME_USER_OVERRIDE_MAPPINGS) + @javax.annotation.Nonnull + private Map userOverrideMappings = new HashMap<>(); + + public AIDecompFunctionMapping() { + } + + public AIDecompFunctionMapping fields(@javax.annotation.Nonnull Map> fields) { + this.fields = fields; + return this; + } + + public AIDecompFunctionMapping putFieldsItem(String key, Map fieldsItem) { + if (this.fields == null) { + this.fields = new HashMap<>(); + } + this.fields.put(key, fieldsItem); + return this; + } + + /** + * Get fields + * @return fields + */ + @javax.annotation.Nonnull + public Map> getFields() { + return fields; + } + + public void setFields(@javax.annotation.Nonnull Map> fields) { + this.fields = fields; + } + + + public AIDecompFunctionMapping inverseFunctionMap(@javax.annotation.Nonnull Map inverseFunctionMap) { + this.inverseFunctionMap = inverseFunctionMap; + return this; + } + + public AIDecompFunctionMapping putInverseFunctionMapItem(String key, AIDecompInverseFunctionMapItem inverseFunctionMapItem) { + if (this.inverseFunctionMap == null) { + this.inverseFunctionMap = new HashMap<>(); + } + this.inverseFunctionMap.put(key, inverseFunctionMapItem); + return this; + } + + /** + * Get inverseFunctionMap + * @return inverseFunctionMap + */ + @javax.annotation.Nonnull + public Map getInverseFunctionMap() { + return inverseFunctionMap; + } + + public void setInverseFunctionMap(@javax.annotation.Nonnull Map inverseFunctionMap) { + this.inverseFunctionMap = inverseFunctionMap; + } + + + public AIDecompFunctionMapping inverseStringMap(@javax.annotation.Nonnull Map inverseStringMap) { + this.inverseStringMap = inverseStringMap; + return this; + } + + public AIDecompFunctionMapping putInverseStringMapItem(String key, AIDecompInverseStringMapItem inverseStringMapItem) { + if (this.inverseStringMap == null) { + this.inverseStringMap = new HashMap<>(); + } + this.inverseStringMap.put(key, inverseStringMapItem); + return this; + } + + /** + * Get inverseStringMap + * @return inverseStringMap + */ + @javax.annotation.Nonnull + public Map getInverseStringMap() { + return inverseStringMap; + } + + public void setInverseStringMap(@javax.annotation.Nonnull Map inverseStringMap) { + this.inverseStringMap = inverseStringMap; + } + + + public AIDecompFunctionMapping unmatchedCustomFunctionPointers(@javax.annotation.Nonnull Map unmatchedCustomFunctionPointers) { + this.unmatchedCustomFunctionPointers = unmatchedCustomFunctionPointers; + return this; + } + + public AIDecompFunctionMapping putUnmatchedCustomFunctionPointersItem(String key, ReplacementValue unmatchedCustomFunctionPointersItem) { + if (this.unmatchedCustomFunctionPointers == null) { + this.unmatchedCustomFunctionPointers = new HashMap<>(); + } + this.unmatchedCustomFunctionPointers.put(key, unmatchedCustomFunctionPointersItem); + return this; + } + + /** + * Get unmatchedCustomFunctionPointers + * @return unmatchedCustomFunctionPointers + */ + @javax.annotation.Nonnull + public Map getUnmatchedCustomFunctionPointers() { + return unmatchedCustomFunctionPointers; + } + + public void setUnmatchedCustomFunctionPointers(@javax.annotation.Nonnull Map unmatchedCustomFunctionPointers) { + this.unmatchedCustomFunctionPointers = unmatchedCustomFunctionPointers; + } + + + public AIDecompFunctionMapping unmatchedCustomTypes(@javax.annotation.Nonnull Map unmatchedCustomTypes) { + this.unmatchedCustomTypes = unmatchedCustomTypes; + return this; + } + + public AIDecompFunctionMapping putUnmatchedCustomTypesItem(String key, ReplacementValue unmatchedCustomTypesItem) { + if (this.unmatchedCustomTypes == null) { + this.unmatchedCustomTypes = new HashMap<>(); + } + this.unmatchedCustomTypes.put(key, unmatchedCustomTypesItem); + return this; + } + + /** + * Get unmatchedCustomTypes + * @return unmatchedCustomTypes + */ + @javax.annotation.Nonnull + public Map getUnmatchedCustomTypes() { + return unmatchedCustomTypes; + } + + public void setUnmatchedCustomTypes(@javax.annotation.Nonnull Map unmatchedCustomTypes) { + this.unmatchedCustomTypes = unmatchedCustomTypes; + } + + + public AIDecompFunctionMapping unmatchedEnums(@javax.annotation.Nonnull Map unmatchedEnums) { + this.unmatchedEnums = unmatchedEnums; + return this; + } + + public AIDecompFunctionMapping putUnmatchedEnumsItem(String key, ReplacementValue unmatchedEnumsItem) { + if (this.unmatchedEnums == null) { + this.unmatchedEnums = new HashMap<>(); + } + this.unmatchedEnums.put(key, unmatchedEnumsItem); + return this; + } + + /** + * Get unmatchedEnums + * @return unmatchedEnums + */ + @javax.annotation.Nonnull + public Map getUnmatchedEnums() { + return unmatchedEnums; + } + + public void setUnmatchedEnums(@javax.annotation.Nonnull Map unmatchedEnums) { + this.unmatchedEnums = unmatchedEnums; + } + + + public AIDecompFunctionMapping unmatchedExternalVars(@javax.annotation.Nonnull Map unmatchedExternalVars) { + this.unmatchedExternalVars = unmatchedExternalVars; + return this; + } + + public AIDecompFunctionMapping putUnmatchedExternalVarsItem(String key, ReplacementValue unmatchedExternalVarsItem) { + if (this.unmatchedExternalVars == null) { + this.unmatchedExternalVars = new HashMap<>(); + } + this.unmatchedExternalVars.put(key, unmatchedExternalVarsItem); + return this; + } + + /** + * Get unmatchedExternalVars + * @return unmatchedExternalVars + */ + @javax.annotation.Nonnull + public Map getUnmatchedExternalVars() { + return unmatchedExternalVars; + } + + public void setUnmatchedExternalVars(@javax.annotation.Nonnull Map unmatchedExternalVars) { + this.unmatchedExternalVars = unmatchedExternalVars; + } + + + public AIDecompFunctionMapping unmatchedFunctions(@javax.annotation.Nonnull Map unmatchedFunctions) { + this.unmatchedFunctions = unmatchedFunctions; + return this; + } + + public AIDecompFunctionMapping putUnmatchedFunctionsItem(String key, ReplacementValue unmatchedFunctionsItem) { + if (this.unmatchedFunctions == null) { + this.unmatchedFunctions = new HashMap<>(); + } + this.unmatchedFunctions.put(key, unmatchedFunctionsItem); + return this; + } + + /** + * Get unmatchedFunctions + * @return unmatchedFunctions + */ + @javax.annotation.Nonnull + public Map getUnmatchedFunctions() { + return unmatchedFunctions; + } + + public void setUnmatchedFunctions(@javax.annotation.Nonnull Map unmatchedFunctions) { + this.unmatchedFunctions = unmatchedFunctions; + } + + + public AIDecompFunctionMapping unmatchedGlobalVars(@javax.annotation.Nonnull Map unmatchedGlobalVars) { + this.unmatchedGlobalVars = unmatchedGlobalVars; + return this; + } + + public AIDecompFunctionMapping putUnmatchedGlobalVarsItem(String key, ReplacementValue unmatchedGlobalVarsItem) { + if (this.unmatchedGlobalVars == null) { + this.unmatchedGlobalVars = new HashMap<>(); + } + this.unmatchedGlobalVars.put(key, unmatchedGlobalVarsItem); + return this; + } + + /** + * Get unmatchedGlobalVars + * @return unmatchedGlobalVars + */ + @javax.annotation.Nonnull + public Map getUnmatchedGlobalVars() { + return unmatchedGlobalVars; + } + + public void setUnmatchedGlobalVars(@javax.annotation.Nonnull Map unmatchedGlobalVars) { + this.unmatchedGlobalVars = unmatchedGlobalVars; + } + + + public AIDecompFunctionMapping unmatchedGoToLabels(@javax.annotation.Nonnull Map unmatchedGoToLabels) { + this.unmatchedGoToLabels = unmatchedGoToLabels; + return this; + } + + public AIDecompFunctionMapping putUnmatchedGoToLabelsItem(String key, ReplacementValue unmatchedGoToLabelsItem) { + if (this.unmatchedGoToLabels == null) { + this.unmatchedGoToLabels = new HashMap<>(); + } + this.unmatchedGoToLabels.put(key, unmatchedGoToLabelsItem); + return this; + } + + /** + * Get unmatchedGoToLabels + * @return unmatchedGoToLabels + */ + @javax.annotation.Nonnull + public Map getUnmatchedGoToLabels() { + return unmatchedGoToLabels; + } + + public void setUnmatchedGoToLabels(@javax.annotation.Nonnull Map unmatchedGoToLabels) { + this.unmatchedGoToLabels = unmatchedGoToLabels; + } + + + public AIDecompFunctionMapping unmatchedStrings(@javax.annotation.Nonnull Map unmatchedStrings) { + this.unmatchedStrings = unmatchedStrings; + return this; + } + + public AIDecompFunctionMapping putUnmatchedStringsItem(String key, ReplacementValue unmatchedStringsItem) { + if (this.unmatchedStrings == null) { + this.unmatchedStrings = new HashMap<>(); + } + this.unmatchedStrings.put(key, unmatchedStringsItem); + return this; + } + + /** + * Get unmatchedStrings + * @return unmatchedStrings + */ + @javax.annotation.Nonnull + public Map getUnmatchedStrings() { + return unmatchedStrings; + } + + public void setUnmatchedStrings(@javax.annotation.Nonnull Map unmatchedStrings) { + this.unmatchedStrings = unmatchedStrings; + } + + + public AIDecompFunctionMapping unmatchedVariadicLists(@javax.annotation.Nonnull Map unmatchedVariadicLists) { + this.unmatchedVariadicLists = unmatchedVariadicLists; + return this; + } + + public AIDecompFunctionMapping putUnmatchedVariadicListsItem(String key, ReplacementValue unmatchedVariadicListsItem) { + if (this.unmatchedVariadicLists == null) { + this.unmatchedVariadicLists = new HashMap<>(); + } + this.unmatchedVariadicLists.put(key, unmatchedVariadicListsItem); + return this; + } + + /** + * Get unmatchedVariadicLists + * @return unmatchedVariadicLists + */ + @javax.annotation.Nonnull + public Map getUnmatchedVariadicLists() { + return unmatchedVariadicLists; + } + + public void setUnmatchedVariadicLists(@javax.annotation.Nonnull Map unmatchedVariadicLists) { + this.unmatchedVariadicLists = unmatchedVariadicLists; + } + + + public AIDecompFunctionMapping unmatchedVars(@javax.annotation.Nonnull Map unmatchedVars) { + this.unmatchedVars = unmatchedVars; + return this; + } + + public AIDecompFunctionMapping putUnmatchedVarsItem(String key, ReplacementValue unmatchedVarsItem) { + if (this.unmatchedVars == null) { + this.unmatchedVars = new HashMap<>(); + } + this.unmatchedVars.put(key, unmatchedVarsItem); + return this; + } + + /** + * Get unmatchedVars + * @return unmatchedVars + */ + @javax.annotation.Nonnull + public Map getUnmatchedVars() { + return unmatchedVars; + } + + public void setUnmatchedVars(@javax.annotation.Nonnull Map unmatchedVars) { + this.unmatchedVars = unmatchedVars; + } + + + public AIDecompFunctionMapping userOverrideMappings(@javax.annotation.Nonnull Map userOverrideMappings) { + this.userOverrideMappings = userOverrideMappings; + return this; + } + + public AIDecompFunctionMapping putUserOverrideMappingsItem(String key, String userOverrideMappingsItem) { + if (this.userOverrideMappings == null) { + this.userOverrideMappings = new HashMap<>(); + } + this.userOverrideMappings.put(key, userOverrideMappingsItem); + return this; + } + + /** + * Get userOverrideMappings + * @return userOverrideMappings + */ + @javax.annotation.Nonnull + public Map getUserOverrideMappings() { + return userOverrideMappings; + } + + public void setUserOverrideMappings(@javax.annotation.Nonnull Map userOverrideMappings) { + this.userOverrideMappings = userOverrideMappings; + } + + /** + * 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 AIDecompFunctionMapping instance itself + */ + public AIDecompFunctionMapping 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; + } + AIDecompFunctionMapping aiDecompFunctionMapping = (AIDecompFunctionMapping) o; + return Objects.equals(this.fields, aiDecompFunctionMapping.fields) && + Objects.equals(this.inverseFunctionMap, aiDecompFunctionMapping.inverseFunctionMap) && + Objects.equals(this.inverseStringMap, aiDecompFunctionMapping.inverseStringMap) && + Objects.equals(this.unmatchedCustomFunctionPointers, aiDecompFunctionMapping.unmatchedCustomFunctionPointers) && + Objects.equals(this.unmatchedCustomTypes, aiDecompFunctionMapping.unmatchedCustomTypes) && + Objects.equals(this.unmatchedEnums, aiDecompFunctionMapping.unmatchedEnums) && + Objects.equals(this.unmatchedExternalVars, aiDecompFunctionMapping.unmatchedExternalVars) && + Objects.equals(this.unmatchedFunctions, aiDecompFunctionMapping.unmatchedFunctions) && + Objects.equals(this.unmatchedGlobalVars, aiDecompFunctionMapping.unmatchedGlobalVars) && + Objects.equals(this.unmatchedGoToLabels, aiDecompFunctionMapping.unmatchedGoToLabels) && + Objects.equals(this.unmatchedStrings, aiDecompFunctionMapping.unmatchedStrings) && + Objects.equals(this.unmatchedVariadicLists, aiDecompFunctionMapping.unmatchedVariadicLists) && + Objects.equals(this.unmatchedVars, aiDecompFunctionMapping.unmatchedVars) && + Objects.equals(this.userOverrideMappings, aiDecompFunctionMapping.userOverrideMappings)&& + Objects.equals(this.additionalProperties, aiDecompFunctionMapping.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(fields, inverseFunctionMap, inverseStringMap, unmatchedCustomFunctionPointers, unmatchedCustomTypes, unmatchedEnums, unmatchedExternalVars, unmatchedFunctions, unmatchedGlobalVars, unmatchedGoToLabels, unmatchedStrings, unmatchedVariadicLists, unmatchedVars, userOverrideMappings, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AIDecompFunctionMapping {\n"); + sb.append(" fields: ").append(toIndentedString(fields)).append("\n"); + sb.append(" inverseFunctionMap: ").append(toIndentedString(inverseFunctionMap)).append("\n"); + sb.append(" inverseStringMap: ").append(toIndentedString(inverseStringMap)).append("\n"); + sb.append(" unmatchedCustomFunctionPointers: ").append(toIndentedString(unmatchedCustomFunctionPointers)).append("\n"); + sb.append(" unmatchedCustomTypes: ").append(toIndentedString(unmatchedCustomTypes)).append("\n"); + sb.append(" unmatchedEnums: ").append(toIndentedString(unmatchedEnums)).append("\n"); + sb.append(" unmatchedExternalVars: ").append(toIndentedString(unmatchedExternalVars)).append("\n"); + sb.append(" unmatchedFunctions: ").append(toIndentedString(unmatchedFunctions)).append("\n"); + sb.append(" unmatchedGlobalVars: ").append(toIndentedString(unmatchedGlobalVars)).append("\n"); + sb.append(" unmatchedGoToLabels: ").append(toIndentedString(unmatchedGoToLabels)).append("\n"); + sb.append(" unmatchedStrings: ").append(toIndentedString(unmatchedStrings)).append("\n"); + sb.append(" unmatchedVariadicLists: ").append(toIndentedString(unmatchedVariadicLists)).append("\n"); + sb.append(" unmatchedVars: ").append(toIndentedString(unmatchedVars)).append("\n"); + sb.append(" userOverrideMappings: ").append(toIndentedString(userOverrideMappings)).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("fields", "inverse_function_map", "inverse_string_map", "unmatched_custom_function_pointers", "unmatched_custom_types", "unmatched_enums", "unmatched_external_vars", "unmatched_functions", "unmatched_global_vars", "unmatched_go_to_labels", "unmatched_strings", "unmatched_variadic_lists", "unmatched_vars", "user_override_mappings")); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(Arrays.asList("fields", "inverse_function_map", "inverse_string_map", "unmatched_custom_function_pointers", "unmatched_custom_types", "unmatched_enums", "unmatched_external_vars", "unmatched_functions", "unmatched_global_vars", "unmatched_go_to_labels", "unmatched_strings", "unmatched_variadic_lists", "unmatched_vars", "user_override_mappings")); + } + + /** + * 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 AIDecompFunctionMapping + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!AIDecompFunctionMapping.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format(Locale.ROOT, "The required field(s) %s in AIDecompFunctionMapping is not found in the empty JSON string", AIDecompFunctionMapping.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : AIDecompFunctionMapping.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format(Locale.ROOT, "The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!AIDecompFunctionMapping.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'AIDecompFunctionMapping' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(AIDecompFunctionMapping.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, AIDecompFunctionMapping 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 AIDecompFunctionMapping read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + AIDecompFunctionMapping 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 AIDecompFunctionMapping given an JSON string + * + * @param jsonString JSON string + * @return An instance of AIDecompFunctionMapping + * @throws IOException if the JSON string is invalid with respect to AIDecompFunctionMapping + */ + public static AIDecompFunctionMapping fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, AIDecompFunctionMapping.class); + } + + /** + * Convert an instance of AIDecompFunctionMapping to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/ai/reveng/model/AIDecompInverseFunctionMapItem.java b/src/main/java/ai/reveng/model/AIDecompInverseFunctionMapItem.java new file mode 100644 index 00000000..5ca4821c --- /dev/null +++ b/src/main/java/ai/reveng/model/AIDecompInverseFunctionMapItem.java @@ -0,0 +1,347 @@ +/* + * 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.NumericAddr; +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; + +/** + * AIDecompInverseFunctionMapItem + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class AIDecompInverseFunctionMapItem { + public static final String SERIALIZED_NAME_ADDR = "addr"; + @SerializedName(SERIALIZED_NAME_ADDR) + @javax.annotation.Nonnull + private NumericAddr addr; + + public static final String SERIALIZED_NAME_IS_EXTERNAL = "is_external"; + @SerializedName(SERIALIZED_NAME_IS_EXTERNAL) + @javax.annotation.Nonnull + private Boolean isExternal; + + public static final String SERIALIZED_NAME_NAME = "name"; + @SerializedName(SERIALIZED_NAME_NAME) + @javax.annotation.Nonnull + private String name; + + public AIDecompInverseFunctionMapItem() { + } + + public AIDecompInverseFunctionMapItem addr(@javax.annotation.Nonnull NumericAddr addr) { + this.addr = addr; + return this; + } + + /** + * Get addr + * @return addr + */ + @javax.annotation.Nonnull + public NumericAddr getAddr() { + return addr; + } + + public void setAddr(@javax.annotation.Nonnull NumericAddr addr) { + this.addr = addr; + } + + + public AIDecompInverseFunctionMapItem isExternal(@javax.annotation.Nonnull Boolean isExternal) { + this.isExternal = isExternal; + return this; + } + + /** + * Get isExternal + * @return isExternal + */ + @javax.annotation.Nonnull + public Boolean getIsExternal() { + return isExternal; + } + + public void setIsExternal(@javax.annotation.Nonnull Boolean isExternal) { + this.isExternal = isExternal; + } + + + public AIDecompInverseFunctionMapItem name(@javax.annotation.Nonnull String name) { + this.name = name; + return this; + } + + /** + * Get name + * @return name + */ + @javax.annotation.Nonnull + public String getName() { + return name; + } + + public void setName(@javax.annotation.Nonnull String name) { + this.name = name; + } + + /** + * 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 AIDecompInverseFunctionMapItem instance itself + */ + public AIDecompInverseFunctionMapItem 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; + } + AIDecompInverseFunctionMapItem aiDecompInverseFunctionMapItem = (AIDecompInverseFunctionMapItem) o; + return Objects.equals(this.addr, aiDecompInverseFunctionMapItem.addr) && + Objects.equals(this.isExternal, aiDecompInverseFunctionMapItem.isExternal) && + Objects.equals(this.name, aiDecompInverseFunctionMapItem.name)&& + Objects.equals(this.additionalProperties, aiDecompInverseFunctionMapItem.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(addr, isExternal, name, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AIDecompInverseFunctionMapItem {\n"); + sb.append(" addr: ").append(toIndentedString(addr)).append("\n"); + sb.append(" isExternal: ").append(toIndentedString(isExternal)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).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("addr", "is_external", "name")); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(Arrays.asList("addr", "is_external", "name")); + } + + /** + * 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 AIDecompInverseFunctionMapItem + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!AIDecompInverseFunctionMapItem.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format(Locale.ROOT, "The required field(s) %s in AIDecompInverseFunctionMapItem is not found in the empty JSON string", AIDecompInverseFunctionMapItem.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : AIDecompInverseFunctionMapItem.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("name").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(Locale.ROOT, "Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!AIDecompInverseFunctionMapItem.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'AIDecompInverseFunctionMapItem' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(AIDecompInverseFunctionMapItem.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, AIDecompInverseFunctionMapItem 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 AIDecompInverseFunctionMapItem read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + AIDecompInverseFunctionMapItem 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 AIDecompInverseFunctionMapItem given an JSON string + * + * @param jsonString JSON string + * @return An instance of AIDecompInverseFunctionMapItem + * @throws IOException if the JSON string is invalid with respect to AIDecompInverseFunctionMapItem + */ + public static AIDecompInverseFunctionMapItem fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, AIDecompInverseFunctionMapItem.class); + } + + /** + * Convert an instance of AIDecompInverseFunctionMapItem to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/ai/reveng/model/AIDecompInverseStringMapItem.java b/src/main/java/ai/reveng/model/AIDecompInverseStringMapItem.java new file mode 100644 index 00000000..88e57966 --- /dev/null +++ b/src/main/java/ai/reveng/model/AIDecompInverseStringMapItem.java @@ -0,0 +1,321 @@ +/* + * 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.NumericAddr; +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; + +/** + * AIDecompInverseStringMapItem + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class AIDecompInverseStringMapItem { + public static final String SERIALIZED_NAME_ADDR = "addr"; + @SerializedName(SERIALIZED_NAME_ADDR) + @javax.annotation.Nonnull + private NumericAddr addr; + + public static final String SERIALIZED_NAME_STRING = "string"; + @SerializedName(SERIALIZED_NAME_STRING) + @javax.annotation.Nonnull + private String string; + + public AIDecompInverseStringMapItem() { + } + + public AIDecompInverseStringMapItem addr(@javax.annotation.Nonnull NumericAddr addr) { + this.addr = addr; + return this; + } + + /** + * Get addr + * @return addr + */ + @javax.annotation.Nonnull + public NumericAddr getAddr() { + return addr; + } + + public void setAddr(@javax.annotation.Nonnull NumericAddr addr) { + this.addr = addr; + } + + + public AIDecompInverseStringMapItem string(@javax.annotation.Nonnull String string) { + this.string = string; + return this; + } + + /** + * Get string + * @return string + */ + @javax.annotation.Nonnull + public String getString() { + return string; + } + + public void setString(@javax.annotation.Nonnull String string) { + this.string = string; + } + + /** + * 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 AIDecompInverseStringMapItem instance itself + */ + public AIDecompInverseStringMapItem 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; + } + AIDecompInverseStringMapItem aiDecompInverseStringMapItem = (AIDecompInverseStringMapItem) o; + return Objects.equals(this.addr, aiDecompInverseStringMapItem.addr) && + Objects.equals(this.string, aiDecompInverseStringMapItem.string)&& + Objects.equals(this.additionalProperties, aiDecompInverseStringMapItem.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(addr, string, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AIDecompInverseStringMapItem {\n"); + sb.append(" addr: ").append(toIndentedString(addr)).append("\n"); + sb.append(" string: ").append(toIndentedString(string)).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("addr", "string")); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(Arrays.asList("addr", "string")); + } + + /** + * 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 AIDecompInverseStringMapItem + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!AIDecompInverseStringMapItem.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format(Locale.ROOT, "The required field(s) %s in AIDecompInverseStringMapItem is not found in the empty JSON string", AIDecompInverseStringMapItem.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : AIDecompInverseStringMapItem.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("string").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(Locale.ROOT, "Expected the field `string` to be a primitive type in the JSON string but got `%s`", jsonObj.get("string").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!AIDecompInverseStringMapItem.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'AIDecompInverseStringMapItem' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(AIDecompInverseStringMapItem.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, AIDecompInverseStringMapItem 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 AIDecompInverseStringMapItem read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + AIDecompInverseStringMapItem 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 AIDecompInverseStringMapItem given an JSON string + * + * @param jsonString JSON string + * @return An instance of AIDecompInverseStringMapItem + * @throws IOException if the JSON string is invalid with respect to AIDecompInverseStringMapItem + */ + public static AIDecompInverseStringMapItem fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, AIDecompInverseStringMapItem.class); + } + + /** + * Convert an instance of AIDecompInverseStringMapItem to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/ai/reveng/model/PatchCollectionInputBody.java b/src/main/java/ai/reveng/model/PatchCollectionInputBody.java new file mode 100644 index 00000000..8eafb5d5 --- /dev/null +++ b/src/main/java/ai/reveng/model/PatchCollectionInputBody.java @@ -0,0 +1,345 @@ +/* + * 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.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; + +/** + * PatchCollectionInputBody + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class PatchCollectionInputBody { + public static final String SERIALIZED_NAME_COLLECTION_NAME = "collection_name"; + @SerializedName(SERIALIZED_NAME_COLLECTION_NAME) + @javax.annotation.Nullable + private String collectionName; + + public static final String SERIALIZED_NAME_COLLECTION_SCOPE = "collection_scope"; + @SerializedName(SERIALIZED_NAME_COLLECTION_SCOPE) + @javax.annotation.Nullable + private String collectionScope; + + public static final String SERIALIZED_NAME_DESCRIPTION = "description"; + @SerializedName(SERIALIZED_NAME_DESCRIPTION) + @javax.annotation.Nullable + private String description; + + public PatchCollectionInputBody() { + } + + public PatchCollectionInputBody collectionName(@javax.annotation.Nullable String collectionName) { + this.collectionName = collectionName; + return this; + } + + /** + * New collection name. Omit, null, or empty string to keep existing. + * @return collectionName + */ + @javax.annotation.Nullable + public String getCollectionName() { + return collectionName; + } + + public void setCollectionName(@javax.annotation.Nullable String collectionName) { + this.collectionName = collectionName; + } + + + public PatchCollectionInputBody collectionScope(@javax.annotation.Nullable String collectionScope) { + this.collectionScope = collectionScope; + return this; + } + + /** + * New scope (PUBLIC, PRIVATE, PROTECTED, TEAM). Omit or send null to keep existing. Empty string returns 422 UNPROCESSABLE ENTITY. + * @return collectionScope + */ + @javax.annotation.Nullable + public String getCollectionScope() { + return collectionScope; + } + + public void setCollectionScope(@javax.annotation.Nullable String collectionScope) { + this.collectionScope = collectionScope; + } + + + public PatchCollectionInputBody description(@javax.annotation.Nullable String description) { + this.description = description; + return this; + } + + /** + * New description. Omit, null, or empty string to keep existing. + * @return description + */ + @javax.annotation.Nullable + public String getDescription() { + return description; + } + + public void setDescription(@javax.annotation.Nullable String description) { + this.description = description; + } + + /** + * 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 PatchCollectionInputBody instance itself + */ + public PatchCollectionInputBody 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; + } + PatchCollectionInputBody patchCollectionInputBody = (PatchCollectionInputBody) o; + return Objects.equals(this.collectionName, patchCollectionInputBody.collectionName) && + Objects.equals(this.collectionScope, patchCollectionInputBody.collectionScope) && + Objects.equals(this.description, patchCollectionInputBody.description)&& + Objects.equals(this.additionalProperties, patchCollectionInputBody.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(collectionName, collectionScope, description, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class PatchCollectionInputBody {\n"); + sb.append(" collectionName: ").append(toIndentedString(collectionName)).append("\n"); + sb.append(" collectionScope: ").append(toIndentedString(collectionScope)).append("\n"); + sb.append(" description: ").append(toIndentedString(description)).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("collection_name", "collection_scope", "description")); + + // 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 PatchCollectionInputBody + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!PatchCollectionInputBody.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format(Locale.ROOT, "The required field(s) %s in PatchCollectionInputBody is not found in the empty JSON string", PatchCollectionInputBody.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("collection_name") != null && !jsonObj.get("collection_name").isJsonNull()) && !jsonObj.get("collection_name").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(Locale.ROOT, "Expected the field `collection_name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("collection_name").toString())); + } + if ((jsonObj.get("collection_scope") != null && !jsonObj.get("collection_scope").isJsonNull()) && !jsonObj.get("collection_scope").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(Locale.ROOT, "Expected the field `collection_scope` to be a primitive type in the JSON string but got `%s`", jsonObj.get("collection_scope").toString())); + } + if ((jsonObj.get("description") != null && !jsonObj.get("description").isJsonNull()) && !jsonObj.get("description").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(Locale.ROOT, "Expected the field `description` to be a primitive type in the JSON string but got `%s`", jsonObj.get("description").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!PatchCollectionInputBody.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'PatchCollectionInputBody' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(PatchCollectionInputBody.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, PatchCollectionInputBody 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 PatchCollectionInputBody read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + PatchCollectionInputBody 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 PatchCollectionInputBody given an JSON string + * + * @param jsonString JSON string + * @return An instance of PatchCollectionInputBody + * @throws IOException if the JSON string is invalid with respect to PatchCollectionInputBody + */ + public static PatchCollectionInputBody fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, PatchCollectionInputBody.class); + } + + /** + * Convert an instance of PatchCollectionInputBody to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/ai/reveng/model/PatchCollectionOutputBody.java b/src/main/java/ai/reveng/model/PatchCollectionOutputBody.java new file mode 100644 index 00000000..1a66bb4e --- /dev/null +++ b/src/main/java/ai/reveng/model/PatchCollectionOutputBody.java @@ -0,0 +1,535 @@ +/* + * 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.time.OffsetDateTime; +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; + +/** + * PatchCollectionOutputBody + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class PatchCollectionOutputBody { + public static final String SERIALIZED_NAME_BINARY_COUNT = "binary_count"; + @SerializedName(SERIALIZED_NAME_BINARY_COUNT) + @javax.annotation.Nonnull + private Long binaryCount; + + public static final String SERIALIZED_NAME_COLLECTION_ID = "collection_id"; + @SerializedName(SERIALIZED_NAME_COLLECTION_ID) + @javax.annotation.Nonnull + private Long collectionId; + + public static final String SERIALIZED_NAME_COLLECTION_NAME = "collection_name"; + @SerializedName(SERIALIZED_NAME_COLLECTION_NAME) + @javax.annotation.Nonnull + private String collectionName; + + public static final String SERIALIZED_NAME_COLLECTION_SCOPE = "collection_scope"; + @SerializedName(SERIALIZED_NAME_COLLECTION_SCOPE) + @javax.annotation.Nonnull + private String collectionScope; + + public static final String SERIALIZED_NAME_CREATED_AT = "created_at"; + @SerializedName(SERIALIZED_NAME_CREATED_AT) + @javax.annotation.Nonnull + private OffsetDateTime createdAt; + + public static final String SERIALIZED_NAME_DESCRIPTION = "description"; + @SerializedName(SERIALIZED_NAME_DESCRIPTION) + @javax.annotation.Nonnull + private String description; + + public static final String SERIALIZED_NAME_MODEL_ID = "model_id"; + @SerializedName(SERIALIZED_NAME_MODEL_ID) + @javax.annotation.Nonnull + private Long modelId; + + public static final String SERIALIZED_NAME_TEAM_ID = "team_id"; + @SerializedName(SERIALIZED_NAME_TEAM_ID) + @javax.annotation.Nonnull + private Long teamId; + + public static final String SERIALIZED_NAME_UPDATED_AT = "updated_at"; + @SerializedName(SERIALIZED_NAME_UPDATED_AT) + @javax.annotation.Nonnull + private OffsetDateTime updatedAt; + + public static final String SERIALIZED_NAME_USER_ID = "user_id"; + @SerializedName(SERIALIZED_NAME_USER_ID) + @javax.annotation.Nonnull + private Long userId; + + public PatchCollectionOutputBody() { + } + + public PatchCollectionOutputBody binaryCount(@javax.annotation.Nonnull Long binaryCount) { + this.binaryCount = binaryCount; + return this; + } + + /** + * Get binaryCount + * @return binaryCount + */ + @javax.annotation.Nonnull + public Long getBinaryCount() { + return binaryCount; + } + + public void setBinaryCount(@javax.annotation.Nonnull Long binaryCount) { + this.binaryCount = binaryCount; + } + + + public PatchCollectionOutputBody collectionId(@javax.annotation.Nonnull Long collectionId) { + this.collectionId = collectionId; + return this; + } + + /** + * Get collectionId + * @return collectionId + */ + @javax.annotation.Nonnull + public Long getCollectionId() { + return collectionId; + } + + public void setCollectionId(@javax.annotation.Nonnull Long collectionId) { + this.collectionId = collectionId; + } + + + public PatchCollectionOutputBody collectionName(@javax.annotation.Nonnull String collectionName) { + this.collectionName = collectionName; + return this; + } + + /** + * Get collectionName + * @return collectionName + */ + @javax.annotation.Nonnull + public String getCollectionName() { + return collectionName; + } + + public void setCollectionName(@javax.annotation.Nonnull String collectionName) { + this.collectionName = collectionName; + } + + + public PatchCollectionOutputBody collectionScope(@javax.annotation.Nonnull String collectionScope) { + this.collectionScope = collectionScope; + return this; + } + + /** + * Get collectionScope + * @return collectionScope + */ + @javax.annotation.Nonnull + public String getCollectionScope() { + return collectionScope; + } + + public void setCollectionScope(@javax.annotation.Nonnull String collectionScope) { + this.collectionScope = collectionScope; + } + + + public PatchCollectionOutputBody createdAt(@javax.annotation.Nonnull OffsetDateTime createdAt) { + this.createdAt = createdAt; + return this; + } + + /** + * Get createdAt + * @return createdAt + */ + @javax.annotation.Nonnull + public OffsetDateTime getCreatedAt() { + return createdAt; + } + + public void setCreatedAt(@javax.annotation.Nonnull OffsetDateTime createdAt) { + this.createdAt = createdAt; + } + + + public PatchCollectionOutputBody description(@javax.annotation.Nonnull String description) { + this.description = description; + return this; + } + + /** + * Get description + * @return description + */ + @javax.annotation.Nonnull + public String getDescription() { + return description; + } + + public void setDescription(@javax.annotation.Nonnull String description) { + this.description = description; + } + + + public PatchCollectionOutputBody modelId(@javax.annotation.Nonnull Long modelId) { + this.modelId = modelId; + return this; + } + + /** + * Get modelId + * @return modelId + */ + @javax.annotation.Nonnull + public Long getModelId() { + return modelId; + } + + public void setModelId(@javax.annotation.Nonnull Long modelId) { + this.modelId = modelId; + } + + + public PatchCollectionOutputBody teamId(@javax.annotation.Nonnull Long teamId) { + this.teamId = teamId; + return this; + } + + /** + * Get teamId + * @return teamId + */ + @javax.annotation.Nonnull + public Long getTeamId() { + return teamId; + } + + public void setTeamId(@javax.annotation.Nonnull Long teamId) { + this.teamId = teamId; + } + + + public PatchCollectionOutputBody updatedAt(@javax.annotation.Nonnull OffsetDateTime updatedAt) { + this.updatedAt = updatedAt; + return this; + } + + /** + * Get updatedAt + * @return updatedAt + */ + @javax.annotation.Nonnull + public OffsetDateTime getUpdatedAt() { + return updatedAt; + } + + public void setUpdatedAt(@javax.annotation.Nonnull OffsetDateTime updatedAt) { + this.updatedAt = updatedAt; + } + + + public PatchCollectionOutputBody userId(@javax.annotation.Nonnull Long userId) { + this.userId = userId; + return this; + } + + /** + * Get userId + * @return userId + */ + @javax.annotation.Nonnull + public Long getUserId() { + return userId; + } + + public void setUserId(@javax.annotation.Nonnull Long userId) { + this.userId = userId; + } + + /** + * 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 PatchCollectionOutputBody instance itself + */ + public PatchCollectionOutputBody 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; + } + PatchCollectionOutputBody patchCollectionOutputBody = (PatchCollectionOutputBody) o; + return Objects.equals(this.binaryCount, patchCollectionOutputBody.binaryCount) && + Objects.equals(this.collectionId, patchCollectionOutputBody.collectionId) && + Objects.equals(this.collectionName, patchCollectionOutputBody.collectionName) && + Objects.equals(this.collectionScope, patchCollectionOutputBody.collectionScope) && + Objects.equals(this.createdAt, patchCollectionOutputBody.createdAt) && + Objects.equals(this.description, patchCollectionOutputBody.description) && + Objects.equals(this.modelId, patchCollectionOutputBody.modelId) && + Objects.equals(this.teamId, patchCollectionOutputBody.teamId) && + Objects.equals(this.updatedAt, patchCollectionOutputBody.updatedAt) && + Objects.equals(this.userId, patchCollectionOutputBody.userId)&& + Objects.equals(this.additionalProperties, patchCollectionOutputBody.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(binaryCount, collectionId, collectionName, collectionScope, createdAt, description, modelId, teamId, updatedAt, userId, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class PatchCollectionOutputBody {\n"); + sb.append(" binaryCount: ").append(toIndentedString(binaryCount)).append("\n"); + sb.append(" collectionId: ").append(toIndentedString(collectionId)).append("\n"); + sb.append(" collectionName: ").append(toIndentedString(collectionName)).append("\n"); + sb.append(" collectionScope: ").append(toIndentedString(collectionScope)).append("\n"); + sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); + sb.append(" description: ").append(toIndentedString(description)).append("\n"); + sb.append(" modelId: ").append(toIndentedString(modelId)).append("\n"); + sb.append(" teamId: ").append(toIndentedString(teamId)).append("\n"); + sb.append(" updatedAt: ").append(toIndentedString(updatedAt)).append("\n"); + sb.append(" userId: ").append(toIndentedString(userId)).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_count", "collection_id", "collection_name", "collection_scope", "created_at", "description", "model_id", "team_id", "updated_at", "user_id")); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(Arrays.asList("binary_count", "collection_id", "collection_name", "collection_scope", "created_at", "description", "model_id", "team_id", "updated_at", "user_id")); + } + + /** + * 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 PatchCollectionOutputBody + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!PatchCollectionOutputBody.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format(Locale.ROOT, "The required field(s) %s in PatchCollectionOutputBody is not found in the empty JSON string", PatchCollectionOutputBody.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : PatchCollectionOutputBody.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("collection_name").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(Locale.ROOT, "Expected the field `collection_name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("collection_name").toString())); + } + if (!jsonObj.get("collection_scope").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(Locale.ROOT, "Expected the field `collection_scope` to be a primitive type in the JSON string but got `%s`", jsonObj.get("collection_scope").toString())); + } + if (!jsonObj.get("description").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(Locale.ROOT, "Expected the field `description` to be a primitive type in the JSON string but got `%s`", jsonObj.get("description").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!PatchCollectionOutputBody.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'PatchCollectionOutputBody' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(PatchCollectionOutputBody.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, PatchCollectionOutputBody 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 PatchCollectionOutputBody read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + PatchCollectionOutputBody 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 PatchCollectionOutputBody given an JSON string + * + * @param jsonString JSON string + * @return An instance of PatchCollectionOutputBody + * @throws IOException if the JSON string is invalid with respect to PatchCollectionOutputBody + */ + public static PatchCollectionOutputBody fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, PatchCollectionOutputBody.class); + } + + /** + * Convert an instance of PatchCollectionOutputBody to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/ai/reveng/model/ReplacementValue.java b/src/main/java/ai/reveng/model/ReplacementValue.java index fb016cdc..9cb4954c 100644 --- a/src/main/java/ai/reveng/model/ReplacementValue.java +++ b/src/main/java/ai/reveng/model/ReplacementValue.java @@ -53,13 +53,13 @@ public class ReplacementValue { public static final String SERIALIZED_NAME_VALUE = "value"; @SerializedName(SERIALIZED_NAME_VALUE) - @javax.annotation.Nullable + @javax.annotation.Nonnull private String value; public ReplacementValue() { } - public ReplacementValue value(@javax.annotation.Nullable String value) { + public ReplacementValue value(@javax.annotation.Nonnull String value) { this.value = value; return this; } @@ -68,12 +68,12 @@ public ReplacementValue value(@javax.annotation.Nullable String value) { * Get value * @return value */ - @javax.annotation.Nullable + @javax.annotation.Nonnull public String getValue() { return value; } - public void setValue(@javax.annotation.Nullable String value) { + public void setValue(@javax.annotation.Nonnull String value) { this.value = value; } @@ -194,7 +194,7 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti } } JsonObject jsonObj = jsonElement.getAsJsonObject(); - if ((jsonObj.get("value") != null && !jsonObj.get("value").isJsonNull()) && !jsonObj.get("value").isJsonPrimitive()) { + if (!jsonObj.get("value").isJsonPrimitive()) { throw new IllegalArgumentException(String.format(Locale.ROOT, "Expected the field `value` to be a primitive type in the JSON string but got `%s`", jsonObj.get("value").toString())); } } diff --git a/src/main/java/ai/reveng/model/TokenisedData.java b/src/main/java/ai/reveng/model/TokenisedData.java index 246eebc7..2df1bd86 100644 --- a/src/main/java/ai/reveng/model/TokenisedData.java +++ b/src/main/java/ai/reveng/model/TokenisedData.java @@ -14,7 +14,7 @@ import java.util.Objects; import java.util.Locale; -import ai.reveng.model.FunctionMapping; +import ai.reveng.model.AIDecompFunctionMapping; import com.google.gson.TypeAdapter; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; @@ -55,7 +55,7 @@ public class TokenisedData { public static final String SERIALIZED_NAME_FUNCTION_MAPPING = "function_mapping"; @SerializedName(SERIALIZED_NAME_FUNCTION_MAPPING) @javax.annotation.Nullable - private FunctionMapping functionMapping; + private AIDecompFunctionMapping functionMapping; public static final String SERIALIZED_NAME_PREDICTED_FUNCTION_NAME = "predicted_function_name"; @SerializedName(SERIALIZED_NAME_PREDICTED_FUNCTION_NAME) @@ -135,7 +135,7 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti public TokenisedData() { } - public TokenisedData functionMapping(@javax.annotation.Nullable FunctionMapping functionMapping) { + public TokenisedData functionMapping(@javax.annotation.Nullable AIDecompFunctionMapping functionMapping) { this.functionMapping = functionMapping; return this; } @@ -145,11 +145,11 @@ public TokenisedData functionMapping(@javax.annotation.Nullable FunctionMapping * @return functionMapping */ @javax.annotation.Nullable - public FunctionMapping getFunctionMapping() { + public AIDecompFunctionMapping getFunctionMapping() { return functionMapping; } - public void setFunctionMapping(@javax.annotation.Nullable FunctionMapping functionMapping) { + public void setFunctionMapping(@javax.annotation.Nullable AIDecompFunctionMapping functionMapping) { this.functionMapping = functionMapping; } @@ -333,10 +333,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti } } JsonObject jsonObj = jsonElement.getAsJsonObject(); - // validate the optional field `function_mapping` - if (jsonObj.get("function_mapping") != null && !jsonObj.get("function_mapping").isJsonNull()) { - FunctionMapping.validateJsonElement(jsonObj.get("function_mapping")); - } if ((jsonObj.get("predicted_function_name") != null && !jsonObj.get("predicted_function_name").isJsonNull()) && !jsonObj.get("predicted_function_name").isJsonPrimitive()) { throw new IllegalArgumentException(String.format(Locale.ROOT, "Expected the field `predicted_function_name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("predicted_function_name").toString())); }