diff --git a/.sdk-version b/.sdk-version index 349a9d4..d66c631 100644 --- a/.sdk-version +++ b/.sdk-version @@ -1 +1 @@ -v3.89.0 +v3.91.0 diff --git a/README.md b/README.md index f0ae181..47a03f5 100644 --- a/README.md +++ b/README.md @@ -16,7 +16,7 @@ Add this dependency to your project's POM: ai.reveng sdk - 3.89.0 + 3.91.0 compile ``` @@ -31,7 +31,7 @@ repositories { } dependencies { - implementation "ai.reveng:sdk:3.89.0" + implementation "ai.reveng:sdk:3.91.0" } ``` @@ -102,8 +102,6 @@ Class | Method | HTTP request | Description *AnalysesCoreApi* | [**getAnalysisParams**](docs/AnalysesCoreApi.md#getAnalysisParams) | **GET** /v2/analyses/{analysis_id}/params | Gets analysis param information *AnalysesCoreApi* | [**getAnalysisQueuePosition**](docs/AnalysesCoreApi.md#getAnalysisQueuePosition) | **GET** /v2/analyses/{analysis_id}/queue-position | Get the queue position of an analysis *AnalysesCoreApi* | [**getAnalysisStatus**](docs/AnalysesCoreApi.md#getAnalysisStatus) | **GET** /v2/analyses/{analysis_id}/status | Gets the status of an analysis -*AnalysesCoreApi* | [**getAnalysisStrings**](docs/AnalysesCoreApi.md#getAnalysisStrings) | **GET** /v3/analyses/{analysis_id}/functions/strings | List strings for an analysis. -*AnalysesCoreApi* | [**getAnalysisStringsStatus**](docs/AnalysesCoreApi.md#getAnalysisStringsStatus) | **GET** /v3/analyses/{analysis_id}/functions/strings/status | Get the string-extraction status for an analysis. *AnalysesCoreApi* | [**insertAnalysisLog**](docs/AnalysesCoreApi.md#insertAnalysisLog) | **POST** /v2/analyses/{analysis_id}/logs | Insert a log entry for an analysis *AnalysesCoreApi* | [**listAnalyses**](docs/AnalysesCoreApi.md#listAnalyses) | **GET** /v2/analyses/list | Gets the most recent analyses *AnalysesCoreApi* | [**lookupBinaryId**](docs/AnalysesCoreApi.md#lookupBinaryId) | **GET** /v2/analyses/lookup/{binary_id} | Gets the analysis ID from binary ID @@ -112,6 +110,8 @@ Class | Method | HTTP request | Description *AnalysesCoreApi* | [**updateAnalysis**](docs/AnalysesCoreApi.md#updateAnalysis) | **PATCH** /v2/analyses/{analysis_id} | Update Analysis *AnalysesCoreApi* | [**updateAnalysisTags**](docs/AnalysesCoreApi.md#updateAnalysisTags) | **PATCH** /v2/analyses/{analysis_id}/tags | Update Analysis Tags *AnalysesCoreApi* | [**uploadFile**](docs/AnalysesCoreApi.md#uploadFile) | **POST** /v2/upload | Upload File +*AnalysesCoreApi* | [**v3GetAnalysisStrings**](docs/AnalysesCoreApi.md#v3GetAnalysisStrings) | **GET** /v3/analyses/{analysis_id}/functions/strings | List strings for an analysis. +*AnalysesCoreApi* | [**v3GetAnalysisStringsStatus**](docs/AnalysesCoreApi.md#v3GetAnalysisStringsStatus) | **GET** /v3/analyses/{analysis_id}/functions/strings/status | Get the string-extraction status for an analysis. *AnalysesResultsMetadataApi* | [**getAnalysisFunctionsPaginated**](docs/AnalysesResultsMetadataApi.md#getAnalysisFunctionsPaginated) | **GET** /v2/analyses/{analysis_id}/functions | Get functions from analysis *AnalysesResultsMetadataApi* | [**getCapabilities**](docs/AnalysesResultsMetadataApi.md#getCapabilities) | **GET** /v2/analyses/{analysis_id}/capabilities | Gets the capabilities from the analysis *AnalysesResultsMetadataApi* | [**getFunctionsList**](docs/AnalysesResultsMetadataApi.md#getFunctionsList) | **GET** /v2/analyses/{analysis_id}/functions/list | Gets functions from analysis @@ -133,6 +133,7 @@ Class | Method | HTTP request | Description *BinariesApi* | [**getBinaryRelatedStatus**](docs/BinariesApi.md#getBinaryRelatedStatus) | **GET** /v2/binaries/{binary_id}/related/status | Gets the status of the unpack binary task for a binary *BinariesApi* | [**getRelatedBinaries**](docs/BinariesApi.md#getRelatedBinaries) | **GET** /v2/binaries/{binary_id}/related | Gets the related binaries of a binary. *CollectionsApi* | [**createCollection**](docs/CollectionsApi.md#createCollection) | **POST** /v2/collections | Creates new collection information +*CollectionsApi* | [**createCollection_0**](docs/CollectionsApi.md#createCollection_0) | **POST** /v3/collections | Create a collection. *CollectionsApi* | [**deleteCollection**](docs/CollectionsApi.md#deleteCollection) | **DELETE** /v2/collections/{collection_id} | Deletes a collection *CollectionsApi* | [**getCollection**](docs/CollectionsApi.md#getCollection) | **GET** /v2/collections/{collection_id} | Returns a collection *CollectionsApi* | [**listCollections**](docs/CollectionsApi.md#listCollections) | **GET** /v2/collections | Gets basic collections information @@ -340,6 +341,7 @@ Class | Method | HTTP request | Description - [BatchRenameOutputBody](docs/BatchRenameOutputBody.md) - [BinariesRelatedStatusResponse](docs/BinariesRelatedStatusResponse.md) - [BinariesTaskStatus](docs/BinariesTaskStatus.md) + - [Binary](docs/Binary.md) - [BinaryAdditionalDetailsDataResponse](docs/BinaryAdditionalDetailsDataResponse.md) - [BinaryAdditionalResponse](docs/BinaryAdditionalResponse.md) - [BinaryConfig](docs/BinaryConfig.md) @@ -382,6 +384,8 @@ Class | Method | HTTP request | Description - [ConversationWithEvents](docs/ConversationWithEvents.md) - [CreateAIDecompOutputBody](docs/CreateAIDecompOutputBody.md) - [CreateCheckoutSessionInputBody](docs/CreateCheckoutSessionInputBody.md) + - [CreateCollectionInputBody](docs/CreateCollectionInputBody.md) + - [CreateCollectionOutputBody](docs/CreateCollectionOutputBody.md) - [CreateConversationRequest](docs/CreateConversationRequest.md) - [CreatePortalSessionInputBody](docs/CreatePortalSessionInputBody.md) - [Created](docs/Created.md) diff --git a/build.gradle b/build.gradle index 18d3476..6a3bd6b 100644 --- a/build.gradle +++ b/build.gradle @@ -19,7 +19,7 @@ apply plugin: 'java' apply plugin: 'com.diffplug.spotless' group = 'ai.reveng' -version = '3.89.0' +version = '3.91.0' @@ -171,7 +171,7 @@ mavenPublishing { publishToMavenCentral(true) signAllPublications() - coordinates("ai.reveng", "sdk", "3.89.0") + coordinates("ai.reveng", "sdk", "3.91.0") pom { name = "sdk" diff --git a/build.sbt b/build.sbt index 06d82b2..3cea353 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.89.0", + version := "3.91.0", scalaVersion := "2.11.12", scalacOptions ++= Seq("-feature"), compile / javacOptions ++= Seq("-Xlint:deprecation"), diff --git a/docs/AnalysesCoreApi.md b/docs/AnalysesCoreApi.md index 8208eeb..230a7f4 100644 --- a/docs/AnalysesCoreApi.md +++ b/docs/AnalysesCoreApi.md @@ -15,8 +15,6 @@ All URIs are relative to *https://api.reveng.ai* | [**getAnalysisParams**](AnalysesCoreApi.md#getAnalysisParams) | **GET** /v2/analyses/{analysis_id}/params | Gets analysis param information | | [**getAnalysisQueuePosition**](AnalysesCoreApi.md#getAnalysisQueuePosition) | **GET** /v2/analyses/{analysis_id}/queue-position | Get the queue position of an analysis | | [**getAnalysisStatus**](AnalysesCoreApi.md#getAnalysisStatus) | **GET** /v2/analyses/{analysis_id}/status | Gets the status of an analysis | -| [**getAnalysisStrings**](AnalysesCoreApi.md#getAnalysisStrings) | **GET** /v3/analyses/{analysis_id}/functions/strings | List strings for an analysis. | -| [**getAnalysisStringsStatus**](AnalysesCoreApi.md#getAnalysisStringsStatus) | **GET** /v3/analyses/{analysis_id}/functions/strings/status | Get the string-extraction status for an analysis. | | [**insertAnalysisLog**](AnalysesCoreApi.md#insertAnalysisLog) | **POST** /v2/analyses/{analysis_id}/logs | Insert a log entry for an analysis | | [**listAnalyses**](AnalysesCoreApi.md#listAnalyses) | **GET** /v2/analyses/list | Gets the most recent analyses | | [**lookupBinaryId**](AnalysesCoreApi.md#lookupBinaryId) | **GET** /v2/analyses/lookup/{binary_id} | Gets the analysis ID from binary ID | @@ -25,6 +23,8 @@ All URIs are relative to *https://api.reveng.ai* | [**updateAnalysis**](AnalysesCoreApi.md#updateAnalysis) | **PATCH** /v2/analyses/{analysis_id} | Update Analysis | | [**updateAnalysisTags**](AnalysesCoreApi.md#updateAnalysisTags) | **PATCH** /v2/analyses/{analysis_id}/tags | Update Analysis Tags | | [**uploadFile**](AnalysesCoreApi.md#uploadFile) | **POST** /v2/upload | Upload File | +| [**v3GetAnalysisStrings**](AnalysesCoreApi.md#v3GetAnalysisStrings) | **GET** /v3/analyses/{analysis_id}/functions/strings | List strings for an analysis. | +| [**v3GetAnalysisStringsStatus**](AnalysesCoreApi.md#v3GetAnalysisStringsStatus) | **GET** /v3/analyses/{analysis_id}/functions/strings/status | Get the string-extraction status for an analysis. | @@ -819,164 +819,6 @@ public class Example { | **200** | Successful Response | - | | **422** | Invalid request parameters | - | - -# **getAnalysisStrings** -> ListAnalysisStringsOutputBody getAnalysisStrings(analysisId, page, pageSize, search, functionSearch, orderBy, sortOrder) - -List strings for an analysis. - -Returns the strings discovered in an analysis, combining function-level and analysis-level strings. Supports value/function-name search, sorting and pagination. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - -### Example -```java -// Import classes: -import ai.reveng.invoker.ApiClient; -import ai.reveng.invoker.ApiException; -import ai.reveng.invoker.Configuration; -import ai.reveng.invoker.auth.*; -import ai.reveng.invoker.models.*; -import ai.reveng.api.AnalysesCoreApi; - -public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("https://api.reveng.ai"); - - // Configure API key authorization: APIKey - ApiKeyAuth APIKey = (ApiKeyAuth) defaultClient.getAuthentication("APIKey"); - APIKey.setApiKey("YOUR API KEY"); - // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) - //APIKey.setApiKeyPrefix("Token"); - - AnalysesCoreApi apiInstance = new AnalysesCoreApi(defaultClient); - Long analysisId = 56L; // Long | Analysis ID - Long page = 1L; // Long | Page number (1-indexed). - Long pageSize = 100L; // Long | Number of results per page. - String search = "search_example"; // String | Filter by string value (case-insensitive substring match). - String functionSearch = "functionSearch_example"; // String | Filter by function name (case-insensitive substring match). - String orderBy = "value"; // String | Field to order results by. - String sortOrder = "ASC"; // String | Sort direction. - try { - ListAnalysisStringsOutputBody result = apiInstance.getAnalysisStrings(analysisId, page, pageSize, search, functionSearch, orderBy, sortOrder); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling AnalysesCoreApi#getAnalysisStrings"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } - } -} -``` - -### Parameters - -| Name | Type | Description | Notes | -|------------- | ------------- | ------------- | -------------| -| **analysisId** | **Long**| Analysis ID | | -| **page** | **Long**| Page number (1-indexed). | [optional] [default to 1] | -| **pageSize** | **Long**| Number of results per page. | [optional] [default to 100] | -| **search** | **String**| Filter by string value (case-insensitive substring match). | [optional] | -| **functionSearch** | **String**| Filter by function name (case-insensitive substring match). | [optional] | -| **orderBy** | **String**| Field to order results by. | [optional] [default to value] [enum: value, length] | -| **sortOrder** | **String**| Sort direction. | [optional] [default to ASC] [enum: ASC, DESC] | - -### Return type - -[**ListAnalysisStringsOutputBody**](ListAnalysisStringsOutputBody.md) - -### Authorization - -[APIKey](../README.md#APIKey) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/json - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -| **200** | OK | - | -| **403** | Forbidden | - | -| **404** | Not Found | - | -| **422** | Unprocessable Entity | - | -| **500** | Internal Server Error | - | - - -# **getAnalysisStringsStatus** -> GetAnalysisStringsStatusOutputBody getAnalysisStringsStatus(analysisId) - -Get the string-extraction status for an analysis. - -Returns the status of the string-extraction task for the binary backing the analysis. One of UNINITIALISED, PENDING, RUNNING, COMPLETED, FAILED. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - -### Example -```java -// Import classes: -import ai.reveng.invoker.ApiClient; -import ai.reveng.invoker.ApiException; -import ai.reveng.invoker.Configuration; -import ai.reveng.invoker.auth.*; -import ai.reveng.invoker.models.*; -import ai.reveng.api.AnalysesCoreApi; - -public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("https://api.reveng.ai"); - - // Configure API key authorization: APIKey - ApiKeyAuth APIKey = (ApiKeyAuth) defaultClient.getAuthentication("APIKey"); - APIKey.setApiKey("YOUR API KEY"); - // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) - //APIKey.setApiKeyPrefix("Token"); - - AnalysesCoreApi apiInstance = new AnalysesCoreApi(defaultClient); - Long analysisId = 56L; // Long | Analysis ID - try { - GetAnalysisStringsStatusOutputBody result = apiInstance.getAnalysisStringsStatus(analysisId); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling AnalysesCoreApi#getAnalysisStringsStatus"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } - } -} -``` - -### Parameters - -| Name | Type | Description | Notes | -|------------- | ------------- | ------------- | -------------| -| **analysisId** | **Long**| Analysis ID | | - -### Return type - -[**GetAnalysisStringsStatusOutputBody**](GetAnalysisStringsStatusOutputBody.md) - -### Authorization - -[APIKey](../README.md#APIKey) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/json - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -| **200** | OK | - | -| **403** | Forbidden | - | -| **404** | Not Found | - | -| **422** | Unprocessable Entity | - | -| **500** | Internal Server Error | - | - # **insertAnalysisLog** > BaseResponse insertAnalysisLog(analysisId, insertAnalysisLogRequest) @@ -1575,3 +1417,161 @@ public class Example { | **200** | Successful Response | - | | **422** | Invalid request parameters | - | + +# **v3GetAnalysisStrings** +> ListAnalysisStringsOutputBody v3GetAnalysisStrings(analysisId, page, pageSize, search, functionSearch, orderBy, sortOrder) + +List strings for an analysis. + +Returns the strings discovered in an analysis, combining function-level and analysis-level strings. Supports value/function-name search, sorting and pagination. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied + +### Example +```java +// Import classes: +import ai.reveng.invoker.ApiClient; +import ai.reveng.invoker.ApiException; +import ai.reveng.invoker.Configuration; +import ai.reveng.invoker.auth.*; +import ai.reveng.invoker.models.*; +import ai.reveng.api.AnalysesCoreApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("https://api.reveng.ai"); + + // Configure API key authorization: APIKey + ApiKeyAuth APIKey = (ApiKeyAuth) defaultClient.getAuthentication("APIKey"); + APIKey.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //APIKey.setApiKeyPrefix("Token"); + + AnalysesCoreApi apiInstance = new AnalysesCoreApi(defaultClient); + Long analysisId = 56L; // Long | Analysis ID + Long page = 1L; // Long | Page number (1-indexed). + Long pageSize = 100L; // Long | Number of results per page. + String search = "search_example"; // String | Filter by string value (case-insensitive substring match). + String functionSearch = "functionSearch_example"; // String | Filter by function name (case-insensitive substring match). + String orderBy = "value"; // String | Field to order results by. + String sortOrder = "ASC"; // String | Sort direction. + try { + ListAnalysisStringsOutputBody result = apiInstance.v3GetAnalysisStrings(analysisId, page, pageSize, search, functionSearch, orderBy, sortOrder); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling AnalysesCoreApi#v3GetAnalysisStrings"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **analysisId** | **Long**| Analysis ID | | +| **page** | **Long**| Page number (1-indexed). | [optional] [default to 1] | +| **pageSize** | **Long**| Number of results per page. | [optional] [default to 100] | +| **search** | **String**| Filter by string value (case-insensitive substring match). | [optional] | +| **functionSearch** | **String**| Filter by function name (case-insensitive substring match). | [optional] | +| **orderBy** | **String**| Field to order results by. | [optional] [default to value] [enum: value, length] | +| **sortOrder** | **String**| Sort direction. | [optional] [default to ASC] [enum: ASC, DESC] | + +### Return type + +[**ListAnalysisStringsOutputBody**](ListAnalysisStringsOutputBody.md) + +### Authorization + +[APIKey](../README.md#APIKey) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | OK | - | +| **403** | Forbidden | - | +| **404** | Not Found | - | +| **422** | Unprocessable Entity | - | +| **500** | Internal Server Error | - | + + +# **v3GetAnalysisStringsStatus** +> GetAnalysisStringsStatusOutputBody v3GetAnalysisStringsStatus(analysisId) + +Get the string-extraction status for an analysis. + +Returns the status of the string-extraction task for the binary backing the analysis. One of UNINITIALISED, PENDING, RUNNING, COMPLETED, FAILED. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied + +### Example +```java +// Import classes: +import ai.reveng.invoker.ApiClient; +import ai.reveng.invoker.ApiException; +import ai.reveng.invoker.Configuration; +import ai.reveng.invoker.auth.*; +import ai.reveng.invoker.models.*; +import ai.reveng.api.AnalysesCoreApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("https://api.reveng.ai"); + + // Configure API key authorization: APIKey + ApiKeyAuth APIKey = (ApiKeyAuth) defaultClient.getAuthentication("APIKey"); + APIKey.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //APIKey.setApiKeyPrefix("Token"); + + AnalysesCoreApi apiInstance = new AnalysesCoreApi(defaultClient); + Long analysisId = 56L; // Long | Analysis ID + try { + GetAnalysisStringsStatusOutputBody result = apiInstance.v3GetAnalysisStringsStatus(analysisId); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling AnalysesCoreApi#v3GetAnalysisStringsStatus"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **analysisId** | **Long**| Analysis ID | | + +### Return type + +[**GetAnalysisStringsStatusOutputBody**](GetAnalysisStringsStatusOutputBody.md) + +### Authorization + +[APIKey](../README.md#APIKey) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | OK | - | +| **403** | Forbidden | - | +| **404** | Not Found | - | +| **422** | Unprocessable Entity | - | +| **500** | Internal Server Error | - | + diff --git a/docs/Binary.md b/docs/Binary.md new file mode 100644 index 0000000..15dc492 --- /dev/null +++ b/docs/Binary.md @@ -0,0 +1,19 @@ + + +# Binary + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**analysisId** | **Long** | | | +|**binaryId** | **Long** | | | +|**binaryName** | **String** | | | +|**createdAt** | **OffsetDateTime** | | | +|**isSystemAnalysis** | **Boolean** | | | +|**ownerId** | **Long** | | | +|**sha256Hash** | **String** | | | + + + diff --git a/docs/CollectionsApi.md b/docs/CollectionsApi.md index 9da65ba..2ec48d9 100644 --- a/docs/CollectionsApi.md +++ b/docs/CollectionsApi.md @@ -5,6 +5,7 @@ All URIs are relative to *https://api.reveng.ai* | Method | HTTP request | Description | |------------- | ------------- | -------------| | [**createCollection**](CollectionsApi.md#createCollection) | **POST** /v2/collections | Creates new collection information | +| [**createCollection_0**](CollectionsApi.md#createCollection_0) | **POST** /v3/collections | Create a collection. | | [**deleteCollection**](CollectionsApi.md#deleteCollection) | **DELETE** /v2/collections/{collection_id} | Deletes a collection | | [**getCollection**](CollectionsApi.md#getCollection) | **GET** /v2/collections/{collection_id} | Returns a collection | | [**listCollections**](CollectionsApi.md#listCollections) | **GET** /v2/collections | Gets basic collections information | @@ -83,6 +84,78 @@ public class Example { | **200** | Successful Response | - | | **422** | Invalid request parameters | - | + +# **createCollection_0** +> CreateCollectionOutputBody createCollection_0(createCollectionInputBody) + +Create a collection. + +Creates a new collection, optionally tagging it and linking binary IDs to it. Tags and binaries are returned in the response only when they were supplied in the request. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `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); + CreateCollectionInputBody createCollectionInputBody = new CreateCollectionInputBody(); // CreateCollectionInputBody | + try { + CreateCollectionOutputBody result = apiInstance.createCollection_0(createCollectionInputBody); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling CollectionsApi#createCollection_0"); + 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 | +|------------- | ------------- | ------------- | -------------| +| **createCollectionInputBody** | [**CreateCollectionInputBody**](CreateCollectionInputBody.md)| | | + +### Return type + +[**CreateCollectionOutputBody**](CreateCollectionOutputBody.md) + +### Authorization + +[APIKey](../README.md#APIKey) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **201** | Created | - | +| **404** | Not Found | - | +| **422** | Unprocessable Entity | - | +| **500** | Internal Server Error | - | + # **deleteCollection** > BaseResponseBool deleteCollection(collectionId) diff --git a/docs/CreateCollectionInputBody.md b/docs/CreateCollectionInputBody.md new file mode 100644 index 0000000..54371eb --- /dev/null +++ b/docs/CreateCollectionInputBody.md @@ -0,0 +1,30 @@ + + +# CreateCollectionInputBody + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**binaries** | **List<Long>** | Optional binary IDs to link to the collection. | [optional] | +|**collectionName** | **String** | Collection name. | | +|**collectionScope** | [**CollectionScopeEnum**](#CollectionScopeEnum) | Visibility scope. | | +|**description** | **String** | Collection description. | | +|**modelId** | **Long** | Model ID the collection is associated with. | | +|**tags** | **List<String>** | Optional tags to attach to the collection. | [optional] | + + + +## Enum: CollectionScopeEnum + +| Name | Value | +|---- | -----| +| PRIVATE | "PRIVATE" | +| PUBLIC | "PUBLIC" | +| PROTECTED | "PROTECTED" | +| TEAM | "TEAM" | +| UNKNOWN_DEFAULT_OPEN_API | "unknown_default_open_api" | + + + diff --git a/docs/CreateCollectionOutputBody.md b/docs/CreateCollectionOutputBody.md new file mode 100644 index 0000000..8c8c77f --- /dev/null +++ b/docs/CreateCollectionOutputBody.md @@ -0,0 +1,23 @@ + + +# CreateCollectionOutputBody + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**binaries** | **List<Binary>** | | [optional] | +|**collectionId** | **Long** | | | +|**collectionName** | **String** | | | +|**collectionScope** | **String** | | | +|**createdAt** | **OffsetDateTime** | | | +|**description** | **String** | | | +|**modelId** | **Long** | | | +|**tags** | **List<String>** | | [optional] | +|**teamId** | **Long** | | | +|**updatedAt** | **OffsetDateTime** | | | +|**userId** | **Long** | | | + + + diff --git a/pom.xml b/pom.xml index 529f2a1..9f9cefd 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ sdk jar sdk - 3.89.0 + 3.91.0 https://github.com/RevEngAI/sdk-java Java SDK for the RevEng.AI API diff --git a/src/main/java/ai/reveng/api/AnalysesCoreApi.java b/src/main/java/ai/reveng/api/AnalysesCoreApi.java index a54bc2c..af806b2 100644 --- a/src/main/java/ai/reveng/api/AnalysesCoreApi.java +++ b/src/main/java/ai/reveng/api/AnalysesCoreApi.java @@ -1645,14 +1645,9 @@ public okhttp3.Call getAnalysisStatusAsync(@javax.annotation.Nonnull Integer ana return localVarCall; } /** - * Build call for getAnalysisStrings - * @param analysisId Analysis ID (required) - * @param page Page number (1-indexed). (optional, default to 1) - * @param pageSize Number of results per page. (optional, default to 100) - * @param search Filter by string value (case-insensitive substring match). (optional) - * @param functionSearch Filter by function name (case-insensitive substring match). (optional) - * @param orderBy Field to order results by. (optional, default to value) - * @param sortOrder Sort direction. (optional, default to ASC) + * Build call for insertAnalysisLog + * @param analysisId (required) + * @param insertAnalysisLogRequest (required) * @param _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object @@ -1660,14 +1655,11 @@ public okhttp3.Call getAnalysisStatusAsync(@javax.annotation.Nonnull Integer ana - - - - - + +
Response Details
Status Code Description Response Headers
200 OK -
403 Forbidden -
404 Not Found -
422 Unprocessable Entity -
500 Internal Server Error -
201 Successful Response -
422 Invalid request parameters -
*/ - public okhttp3.Call getAnalysisStringsCall(@javax.annotation.Nonnull Long analysisId, @javax.annotation.Nullable Long page, @javax.annotation.Nullable Long pageSize, @javax.annotation.Nullable String search, @javax.annotation.Nullable String functionSearch, @javax.annotation.Nullable String orderBy, @javax.annotation.Nullable String sortOrder, final ApiCallback _callback) throws ApiException { + public okhttp3.Call insertAnalysisLogCall(@javax.annotation.Nonnull Integer analysisId, @javax.annotation.Nonnull InsertAnalysisLogRequest insertAnalysisLogRequest, final ApiCallback _callback) throws ApiException { String basePath = null; // Operation Servers String[] localBasePaths = new String[] { }; @@ -1681,10 +1673,10 @@ public okhttp3.Call getAnalysisStringsCall(@javax.annotation.Nonnull Long analys basePath = null; } - Object localVarPostBody = null; + Object localVarPostBody = insertAnalysisLogRequest; // create path and map variables - String localVarPath = "/v3/analyses/{analysis_id}/functions/strings" + String localVarPath = "/v2/analyses/{analysis_id}/logs" .replace("{" + "analysis_id" + "}", localVarApiClient.escapeString(analysisId.toString())); List localVarQueryParams = new ArrayList(); @@ -1693,30 +1685,6 @@ public okhttp3.Call getAnalysisStringsCall(@javax.annotation.Nonnull Long analys Map localVarCookieParams = new HashMap(); Map localVarFormParams = new HashMap(); - if (page != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("page", page)); - } - - if (pageSize != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("page_size", pageSize)); - } - - if (search != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("search", search)); - } - - if (functionSearch != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("function_search", functionSearch)); - } - - if (orderBy != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("order_by", orderBy)); - } - - if (sortOrder != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("sort_order", sortOrder)); - } - final String[] localVarAccepts = { "application/json" }; @@ -1726,6 +1694,7 @@ public okhttp3.Call getAnalysisStringsCall(@javax.annotation.Nonnull Long analys } final String[] localVarContentTypes = { + "application/json" }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { @@ -1733,87 +1702,71 @@ public okhttp3.Call getAnalysisStringsCall(@javax.annotation.Nonnull Long analys } String[] localVarAuthNames = new String[] { "APIKey" }; - return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") - private okhttp3.Call getAnalysisStringsValidateBeforeCall(@javax.annotation.Nonnull Long analysisId, @javax.annotation.Nullable Long page, @javax.annotation.Nullable Long pageSize, @javax.annotation.Nullable String search, @javax.annotation.Nullable String functionSearch, @javax.annotation.Nullable String orderBy, @javax.annotation.Nullable String sortOrder, final ApiCallback _callback) throws ApiException { + private okhttp3.Call insertAnalysisLogValidateBeforeCall(@javax.annotation.Nonnull Integer analysisId, @javax.annotation.Nonnull InsertAnalysisLogRequest insertAnalysisLogRequest, final ApiCallback _callback) throws ApiException { // verify the required parameter 'analysisId' is set if (analysisId == null) { - throw new ApiException("Missing the required parameter 'analysisId' when calling getAnalysisStrings(Async)"); + throw new ApiException("Missing the required parameter 'analysisId' when calling insertAnalysisLog(Async)"); + } + + // verify the required parameter 'insertAnalysisLogRequest' is set + if (insertAnalysisLogRequest == null) { + throw new ApiException("Missing the required parameter 'insertAnalysisLogRequest' when calling insertAnalysisLog(Async)"); } - return getAnalysisStringsCall(analysisId, page, pageSize, search, functionSearch, orderBy, sortOrder, _callback); + return insertAnalysisLogCall(analysisId, insertAnalysisLogRequest, _callback); } /** - * List strings for an analysis. - * Returns the strings discovered in an analysis, combining function-level and analysis-level strings. Supports value/function-name search, sorting and pagination. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - * @param analysisId Analysis ID (required) - * @param page Page number (1-indexed). (optional, default to 1) - * @param pageSize Number of results per page. (optional, default to 100) - * @param search Filter by string value (case-insensitive substring match). (optional) - * @param functionSearch Filter by function name (case-insensitive substring match). (optional) - * @param orderBy Field to order results by. (optional, default to value) - * @param sortOrder Sort direction. (optional, default to ASC) - * @return ListAnalysisStringsOutputBody + * Insert a log entry for an analysis + * Inserts a log record for an analysis. Only the analysis owner can insert logs. + * @param analysisId (required) + * @param insertAnalysisLogRequest (required) + * @return BaseResponse * @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 -
201 Successful Response -
422 Invalid request parameters -
*/ - public ListAnalysisStringsOutputBody getAnalysisStrings(@javax.annotation.Nonnull Long analysisId, @javax.annotation.Nullable Long page, @javax.annotation.Nullable Long pageSize, @javax.annotation.Nullable String search, @javax.annotation.Nullable String functionSearch, @javax.annotation.Nullable String orderBy, @javax.annotation.Nullable String sortOrder) throws ApiException { - ApiResponse localVarResp = getAnalysisStringsWithHttpInfo(analysisId, page, pageSize, search, functionSearch, orderBy, sortOrder); + public BaseResponse insertAnalysisLog(@javax.annotation.Nonnull Integer analysisId, @javax.annotation.Nonnull InsertAnalysisLogRequest insertAnalysisLogRequest) throws ApiException { + ApiResponse localVarResp = insertAnalysisLogWithHttpInfo(analysisId, insertAnalysisLogRequest); return localVarResp.getData(); } /** - * List strings for an analysis. - * Returns the strings discovered in an analysis, combining function-level and analysis-level strings. Supports value/function-name search, sorting and pagination. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - * @param analysisId Analysis ID (required) - * @param page Page number (1-indexed). (optional, default to 1) - * @param pageSize Number of results per page. (optional, default to 100) - * @param search Filter by string value (case-insensitive substring match). (optional) - * @param functionSearch Filter by function name (case-insensitive substring match). (optional) - * @param orderBy Field to order results by. (optional, default to value) - * @param sortOrder Sort direction. (optional, default to ASC) - * @return ApiResponse<ListAnalysisStringsOutputBody> + * Insert a log entry for an analysis + * Inserts a log record for an analysis. Only the analysis owner can insert logs. + * @param analysisId (required) + * @param insertAnalysisLogRequest (required) + * @return ApiResponse<BaseResponse> * @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 -
201 Successful Response -
422 Invalid request parameters -
*/ - public ApiResponse getAnalysisStringsWithHttpInfo(@javax.annotation.Nonnull Long analysisId, @javax.annotation.Nullable Long page, @javax.annotation.Nullable Long pageSize, @javax.annotation.Nullable String search, @javax.annotation.Nullable String functionSearch, @javax.annotation.Nullable String orderBy, @javax.annotation.Nullable String sortOrder) throws ApiException { - okhttp3.Call localVarCall = getAnalysisStringsValidateBeforeCall(analysisId, page, pageSize, search, functionSearch, orderBy, sortOrder, null); - Type localVarReturnType = new TypeToken(){}.getType(); + public ApiResponse insertAnalysisLogWithHttpInfo(@javax.annotation.Nonnull Integer analysisId, @javax.annotation.Nonnull InsertAnalysisLogRequest insertAnalysisLogRequest) throws ApiException { + okhttp3.Call localVarCall = insertAnalysisLogValidateBeforeCall(analysisId, insertAnalysisLogRequest, null); + Type localVarReturnType = new TypeToken(){}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } /** - * List strings for an analysis. (asynchronously) - * Returns the strings discovered in an analysis, combining function-level and analysis-level strings. Supports value/function-name search, sorting and pagination. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - * @param analysisId Analysis ID (required) - * @param page Page number (1-indexed). (optional, default to 1) - * @param pageSize Number of results per page. (optional, default to 100) - * @param search Filter by string value (case-insensitive substring match). (optional) - * @param functionSearch Filter by function name (case-insensitive substring match). (optional) - * @param orderBy Field to order results by. (optional, default to value) - * @param sortOrder Sort direction. (optional, default to ASC) + * Insert a log entry for an analysis (asynchronously) + * Inserts a log record for an analysis. Only the analysis owner can insert logs. + * @param analysisId (required) + * @param insertAnalysisLogRequest (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 @@ -1821,23 +1774,30 @@ public ApiResponse getAnalysisStringsWithHttpInfo - - - - - + +
Response Details
Status Code Description Response Headers
200 OK -
403 Forbidden -
404 Not Found -
422 Unprocessable Entity -
500 Internal Server Error -
201 Successful Response -
422 Invalid request parameters -
*/ - public okhttp3.Call getAnalysisStringsAsync(@javax.annotation.Nonnull Long analysisId, @javax.annotation.Nullable Long page, @javax.annotation.Nullable Long pageSize, @javax.annotation.Nullable String search, @javax.annotation.Nullable String functionSearch, @javax.annotation.Nullable String orderBy, @javax.annotation.Nullable String sortOrder, final ApiCallback _callback) throws ApiException { + public okhttp3.Call insertAnalysisLogAsync(@javax.annotation.Nonnull Integer analysisId, @javax.annotation.Nonnull InsertAnalysisLogRequest insertAnalysisLogRequest, final ApiCallback _callback) throws ApiException { - okhttp3.Call localVarCall = getAnalysisStringsValidateBeforeCall(analysisId, page, pageSize, search, functionSearch, orderBy, sortOrder, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); + okhttp3.Call localVarCall = insertAnalysisLogValidateBeforeCall(analysisId, insertAnalysisLogRequest, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } /** - * Build call for getAnalysisStringsStatus - * @param analysisId Analysis ID (required) + * Build call for listAnalyses + * @param searchTerm (optional, default to ) + * @param workspace The workspace to be viewed (optional) + * @param status The status of the analysis (optional) + * @param modelName Show analysis belonging to the model (optional) + * @param dynamicExecutionStatus Show analysis that have a dynamic execution with the given status (optional) + * @param usernames Show analysis belonging to the user (optional) + * @param sha256Hash (optional) + * @param limit (optional, default to 20) + * @param offset (optional, default to 0) + * @param orderBy (optional) + * @param order (optional) * @param _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object @@ -1845,14 +1805,11 @@ public okhttp3.Call getAnalysisStringsAsync(@javax.annotation.Nonnull Long analy - - - - - + +
Response Details
Status Code Description Response Headers
200 OK -
403 Forbidden -
404 Not Found -
422 Unprocessable Entity -
500 Internal Server Error -
200 Successful Response -
422 Invalid request parameters -
*/ - public okhttp3.Call getAnalysisStringsStatusCall(@javax.annotation.Nonnull Long analysisId, final ApiCallback _callback) throws ApiException { + public okhttp3.Call listAnalysesCall(@javax.annotation.Nullable String searchTerm, @javax.annotation.Nullable List workspace, @javax.annotation.Nullable List status, @javax.annotation.Nullable List modelName, @javax.annotation.Nullable DynamicExecutionStatus dynamicExecutionStatus, @javax.annotation.Nullable List usernames, @javax.annotation.Nullable String sha256Hash, @javax.annotation.Nullable Integer limit, @javax.annotation.Nullable Integer offset, @javax.annotation.Nullable AppApiRestV2AnalysesEnumsOrderBy orderBy, @javax.annotation.Nullable Order order, final ApiCallback _callback) throws ApiException { String basePath = null; // Operation Servers String[] localBasePaths = new String[] { }; @@ -1869,8 +1826,7 @@ public okhttp3.Call getAnalysisStringsStatusCall(@javax.annotation.Nonnull Long Object localVarPostBody = null; // create path and map variables - String localVarPath = "/v3/analyses/{analysis_id}/functions/strings/status" - .replace("{" + "analysis_id" + "}", localVarApiClient.escapeString(analysisId.toString())); + String localVarPath = "/v2/analyses/list"; List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -1878,6 +1834,50 @@ public okhttp3.Call getAnalysisStringsStatusCall(@javax.annotation.Nonnull Long Map localVarCookieParams = new HashMap(); Map localVarFormParams = new HashMap(); + if (searchTerm != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("search_term", searchTerm)); + } + + if (workspace != null) { + localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "workspace", workspace)); + } + + if (status != null) { + localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "status", status)); + } + + if (modelName != null) { + localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "model_name", modelName)); + } + + if (dynamicExecutionStatus != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("dynamic_execution_status", dynamicExecutionStatus)); + } + + if (usernames != null) { + localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "usernames", usernames)); + } + + if (sha256Hash != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("sha256_hash", sha256Hash)); + } + + if (limit != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("limit", limit)); + } + + if (offset != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("offset", offset)); + } + + if (orderBy != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("order_by", orderBy)); + } + + if (order != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("order", order)); + } + final String[] localVarAccepts = { "application/json" }; @@ -1898,65 +1898,84 @@ public okhttp3.Call getAnalysisStringsStatusCall(@javax.annotation.Nonnull Long } @SuppressWarnings("rawtypes") - private okhttp3.Call getAnalysisStringsStatusValidateBeforeCall(@javax.annotation.Nonnull Long analysisId, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'analysisId' is set - if (analysisId == null) { - throw new ApiException("Missing the required parameter 'analysisId' when calling getAnalysisStringsStatus(Async)"); - } - - return getAnalysisStringsStatusCall(analysisId, _callback); + private okhttp3.Call listAnalysesValidateBeforeCall(@javax.annotation.Nullable String searchTerm, @javax.annotation.Nullable List workspace, @javax.annotation.Nullable List status, @javax.annotation.Nullable List modelName, @javax.annotation.Nullable DynamicExecutionStatus dynamicExecutionStatus, @javax.annotation.Nullable List usernames, @javax.annotation.Nullable String sha256Hash, @javax.annotation.Nullable Integer limit, @javax.annotation.Nullable Integer offset, @javax.annotation.Nullable AppApiRestV2AnalysesEnumsOrderBy orderBy, @javax.annotation.Nullable Order order, final ApiCallback _callback) throws ApiException { + return listAnalysesCall(searchTerm, workspace, status, modelName, dynamicExecutionStatus, usernames, sha256Hash, limit, offset, orderBy, order, _callback); } /** - * Get the string-extraction status for an analysis. - * Returns the status of the string-extraction task for the binary backing the analysis. One of UNINITIALISED, PENDING, RUNNING, COMPLETED, FAILED. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - * @param analysisId Analysis ID (required) - * @return GetAnalysisStringsStatusOutputBody + * Gets the most recent analyses + * Gets the most recent analyses provided a scope, this is then paginated, if pages and limit doesnt fit, it increases the limit + * @param searchTerm (optional, default to ) + * @param workspace The workspace to be viewed (optional) + * @param status The status of the analysis (optional) + * @param modelName Show analysis belonging to the model (optional) + * @param dynamicExecutionStatus Show analysis that have a dynamic execution with the given status (optional) + * @param usernames Show analysis belonging to the user (optional) + * @param sha256Hash (optional) + * @param limit (optional, default to 20) + * @param offset (optional, default to 0) + * @param orderBy (optional) + * @param order (optional) + * @return BaseResponseRecent * @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 -
200 Successful Response -
422 Invalid request parameters -
*/ - public GetAnalysisStringsStatusOutputBody getAnalysisStringsStatus(@javax.annotation.Nonnull Long analysisId) throws ApiException { - ApiResponse localVarResp = getAnalysisStringsStatusWithHttpInfo(analysisId); + public BaseResponseRecent listAnalyses(@javax.annotation.Nullable String searchTerm, @javax.annotation.Nullable List workspace, @javax.annotation.Nullable List status, @javax.annotation.Nullable List modelName, @javax.annotation.Nullable DynamicExecutionStatus dynamicExecutionStatus, @javax.annotation.Nullable List usernames, @javax.annotation.Nullable String sha256Hash, @javax.annotation.Nullable Integer limit, @javax.annotation.Nullable Integer offset, @javax.annotation.Nullable AppApiRestV2AnalysesEnumsOrderBy orderBy, @javax.annotation.Nullable Order order) throws ApiException { + ApiResponse localVarResp = listAnalysesWithHttpInfo(searchTerm, workspace, status, modelName, dynamicExecutionStatus, usernames, sha256Hash, limit, offset, orderBy, order); return localVarResp.getData(); } /** - * Get the string-extraction status for an analysis. - * Returns the status of the string-extraction task for the binary backing the analysis. One of UNINITIALISED, PENDING, RUNNING, COMPLETED, FAILED. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - * @param analysisId Analysis ID (required) - * @return ApiResponse<GetAnalysisStringsStatusOutputBody> + * Gets the most recent analyses + * Gets the most recent analyses provided a scope, this is then paginated, if pages and limit doesnt fit, it increases the limit + * @param searchTerm (optional, default to ) + * @param workspace The workspace to be viewed (optional) + * @param status The status of the analysis (optional) + * @param modelName Show analysis belonging to the model (optional) + * @param dynamicExecutionStatus Show analysis that have a dynamic execution with the given status (optional) + * @param usernames Show analysis belonging to the user (optional) + * @param sha256Hash (optional) + * @param limit (optional, default to 20) + * @param offset (optional, default to 0) + * @param orderBy (optional) + * @param order (optional) + * @return ApiResponse<BaseResponseRecent> * @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 -
200 Successful Response -
422 Invalid request parameters -
*/ - public ApiResponse getAnalysisStringsStatusWithHttpInfo(@javax.annotation.Nonnull Long analysisId) throws ApiException { - okhttp3.Call localVarCall = getAnalysisStringsStatusValidateBeforeCall(analysisId, null); - Type localVarReturnType = new TypeToken(){}.getType(); + public ApiResponse listAnalysesWithHttpInfo(@javax.annotation.Nullable String searchTerm, @javax.annotation.Nullable List workspace, @javax.annotation.Nullable List status, @javax.annotation.Nullable List modelName, @javax.annotation.Nullable DynamicExecutionStatus dynamicExecutionStatus, @javax.annotation.Nullable List usernames, @javax.annotation.Nullable String sha256Hash, @javax.annotation.Nullable Integer limit, @javax.annotation.Nullable Integer offset, @javax.annotation.Nullable AppApiRestV2AnalysesEnumsOrderBy orderBy, @javax.annotation.Nullable Order order) throws ApiException { + okhttp3.Call localVarCall = listAnalysesValidateBeforeCall(searchTerm, workspace, status, modelName, dynamicExecutionStatus, usernames, sha256Hash, limit, offset, orderBy, order, null); + Type localVarReturnType = new TypeToken(){}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } /** - * Get the string-extraction status for an analysis. (asynchronously) - * Returns the status of the string-extraction task for the binary backing the analysis. One of UNINITIALISED, PENDING, RUNNING, COMPLETED, FAILED. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - * @param analysisId Analysis ID (required) + * Gets the most recent analyses (asynchronously) + * Gets the most recent analyses provided a scope, this is then paginated, if pages and limit doesnt fit, it increases the limit + * @param searchTerm (optional, default to ) + * @param workspace The workspace to be viewed (optional) + * @param status The status of the analysis (optional) + * @param modelName Show analysis belonging to the model (optional) + * @param dynamicExecutionStatus Show analysis that have a dynamic execution with the given status (optional) + * @param usernames Show analysis belonging to the user (optional) + * @param sha256Hash (optional) + * @param limit (optional, default to 20) + * @param offset (optional, default to 0) + * @param orderBy (optional) + * @param order (optional) * @param _callback The callback to be executed when the API call finishes * @return The request call * @throws ApiException If fail to process the API call, e.g. serializing the request body object @@ -1964,24 +1983,20 @@ public ApiResponse getAnalysisStringsStatusW - - - - - + +
Response Details
Status Code Description Response Headers
200 OK -
403 Forbidden -
404 Not Found -
422 Unprocessable Entity -
500 Internal Server Error -
200 Successful Response -
422 Invalid request parameters -
*/ - public okhttp3.Call getAnalysisStringsStatusAsync(@javax.annotation.Nonnull Long analysisId, final ApiCallback _callback) throws ApiException { + public okhttp3.Call listAnalysesAsync(@javax.annotation.Nullable String searchTerm, @javax.annotation.Nullable List workspace, @javax.annotation.Nullable List status, @javax.annotation.Nullable List modelName, @javax.annotation.Nullable DynamicExecutionStatus dynamicExecutionStatus, @javax.annotation.Nullable List usernames, @javax.annotation.Nullable String sha256Hash, @javax.annotation.Nullable Integer limit, @javax.annotation.Nullable Integer offset, @javax.annotation.Nullable AppApiRestV2AnalysesEnumsOrderBy orderBy, @javax.annotation.Nullable Order order, final ApiCallback _callback) throws ApiException { - okhttp3.Call localVarCall = getAnalysisStringsStatusValidateBeforeCall(analysisId, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); + okhttp3.Call localVarCall = listAnalysesValidateBeforeCall(searchTerm, workspace, status, modelName, dynamicExecutionStatus, usernames, sha256Hash, limit, offset, orderBy, order, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } /** - * Build call for insertAnalysisLog - * @param analysisId (required) - * @param insertAnalysisLogRequest (required) + * Build call for lookupBinaryId + * @param binaryId (required) * @param _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object @@ -1989,11 +2004,11 @@ public okhttp3.Call getAnalysisStringsStatusAsync(@javax.annotation.Nonnull Long - +
Response Details
Status Code Description Response Headers
201 Successful Response -
200 Successful Response -
422 Invalid request parameters -
*/ - public okhttp3.Call insertAnalysisLogCall(@javax.annotation.Nonnull Integer analysisId, @javax.annotation.Nonnull InsertAnalysisLogRequest insertAnalysisLogRequest, final ApiCallback _callback) throws ApiException { + public okhttp3.Call lookupBinaryIdCall(@javax.annotation.Nonnull Integer binaryId, final ApiCallback _callback) throws ApiException { String basePath = null; // Operation Servers String[] localBasePaths = new String[] { }; @@ -2007,11 +2022,11 @@ public okhttp3.Call insertAnalysisLogCall(@javax.annotation.Nonnull Integer anal basePath = null; } - Object localVarPostBody = insertAnalysisLogRequest; + Object localVarPostBody = null; // create path and map variables - String localVarPath = "/v2/analyses/{analysis_id}/logs" - .replace("{" + "analysis_id" + "}", localVarApiClient.escapeString(analysisId.toString())); + String localVarPath = "/v2/analyses/lookup/{binary_id}" + .replace("{" + "binary_id" + "}", localVarApiClient.escapeString(binaryId.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -2028,7 +2043,6 @@ public okhttp3.Call insertAnalysisLogCall(@javax.annotation.Nonnull Integer anal } final String[] localVarContentTypes = { - "application/json" }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { @@ -2036,71 +2050,63 @@ public okhttp3.Call insertAnalysisLogCall(@javax.annotation.Nonnull Integer anal } String[] localVarAuthNames = new String[] { "APIKey" }; - return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") - private okhttp3.Call insertAnalysisLogValidateBeforeCall(@javax.annotation.Nonnull Integer analysisId, @javax.annotation.Nonnull InsertAnalysisLogRequest insertAnalysisLogRequest, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'analysisId' is set - if (analysisId == null) { - throw new ApiException("Missing the required parameter 'analysisId' when calling insertAnalysisLog(Async)"); - } - - // verify the required parameter 'insertAnalysisLogRequest' is set - if (insertAnalysisLogRequest == null) { - throw new ApiException("Missing the required parameter 'insertAnalysisLogRequest' when calling insertAnalysisLog(Async)"); + private okhttp3.Call lookupBinaryIdValidateBeforeCall(@javax.annotation.Nonnull Integer binaryId, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'binaryId' is set + if (binaryId == null) { + throw new ApiException("Missing the required parameter 'binaryId' when calling lookupBinaryId(Async)"); } - return insertAnalysisLogCall(analysisId, insertAnalysisLogRequest, _callback); + return lookupBinaryIdCall(binaryId, _callback); } /** - * Insert a log entry for an analysis - * Inserts a log record for an analysis. Only the analysis owner can insert logs. - * @param analysisId (required) - * @param insertAnalysisLogRequest (required) - * @return BaseResponse + * Gets the analysis ID from binary ID + * Given an binary ID gets the ID of an analysis + * @param binaryId (required) + * @return Object * @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
201 Successful Response -
200 Successful Response -
422 Invalid request parameters -
*/ - public BaseResponse insertAnalysisLog(@javax.annotation.Nonnull Integer analysisId, @javax.annotation.Nonnull InsertAnalysisLogRequest insertAnalysisLogRequest) throws ApiException { - ApiResponse localVarResp = insertAnalysisLogWithHttpInfo(analysisId, insertAnalysisLogRequest); + public Object lookupBinaryId(@javax.annotation.Nonnull Integer binaryId) throws ApiException { + ApiResponse localVarResp = lookupBinaryIdWithHttpInfo(binaryId); return localVarResp.getData(); } /** - * Insert a log entry for an analysis - * Inserts a log record for an analysis. Only the analysis owner can insert logs. - * @param analysisId (required) - * @param insertAnalysisLogRequest (required) - * @return ApiResponse<BaseResponse> + * Gets the analysis ID from binary ID + * Given an binary ID gets the ID of an analysis + * @param binaryId (required) + * @return ApiResponse<Object> * @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
201 Successful Response -
200 Successful Response -
422 Invalid request parameters -
*/ - public ApiResponse insertAnalysisLogWithHttpInfo(@javax.annotation.Nonnull Integer analysisId, @javax.annotation.Nonnull InsertAnalysisLogRequest insertAnalysisLogRequest) throws ApiException { - okhttp3.Call localVarCall = insertAnalysisLogValidateBeforeCall(analysisId, insertAnalysisLogRequest, null); - Type localVarReturnType = new TypeToken(){}.getType(); + public ApiResponse lookupBinaryIdWithHttpInfo(@javax.annotation.Nonnull Integer binaryId) throws ApiException { + okhttp3.Call localVarCall = lookupBinaryIdValidateBeforeCall(binaryId, null); + Type localVarReturnType = new TypeToken(){}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } /** - * Insert a log entry for an analysis (asynchronously) - * Inserts a log record for an analysis. Only the analysis owner can insert logs. - * @param analysisId (required) - * @param insertAnalysisLogRequest (required) + * Gets the analysis ID from binary ID (asynchronously) + * Given an binary ID gets the ID of an analysis + * @param binaryId (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 @@ -2108,30 +2114,21 @@ public ApiResponse insertAnalysisLogWithHttpInfo(@javax.annotation - +
Response Details
Status Code Description Response Headers
201 Successful Response -
200 Successful Response -
422 Invalid request parameters -
*/ - public okhttp3.Call insertAnalysisLogAsync(@javax.annotation.Nonnull Integer analysisId, @javax.annotation.Nonnull InsertAnalysisLogRequest insertAnalysisLogRequest, final ApiCallback _callback) throws ApiException { + public okhttp3.Call lookupBinaryIdAsync(@javax.annotation.Nonnull Integer binaryId, final ApiCallback _callback) throws ApiException { - okhttp3.Call localVarCall = insertAnalysisLogValidateBeforeCall(analysisId, insertAnalysisLogRequest, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); + okhttp3.Call localVarCall = lookupBinaryIdValidateBeforeCall(binaryId, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } /** - * Build call for listAnalyses - * @param searchTerm (optional, default to ) - * @param workspace The workspace to be viewed (optional) - * @param status The status of the analysis (optional) - * @param modelName Show analysis belonging to the model (optional) - * @param dynamicExecutionStatus Show analysis that have a dynamic execution with the given status (optional) - * @param usernames Show analysis belonging to the user (optional) - * @param sha256Hash (optional) - * @param limit (optional, default to 20) - * @param offset (optional, default to 0) - * @param orderBy (optional) - * @param order (optional) + * Build call for putAnalysisStrings + * @param analysisId (required) + * @param putAnalysisStringsRequest (required) * @param _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object @@ -2139,11 +2136,11 @@ public okhttp3.Call insertAnalysisLogAsync(@javax.annotation.Nonnull Integer ana - +
Response Details
Status Code Description Response Headers
200 Successful Response -
201 Successful Response -
422 Invalid request parameters -
*/ - public okhttp3.Call listAnalysesCall(@javax.annotation.Nullable String searchTerm, @javax.annotation.Nullable List workspace, @javax.annotation.Nullable List status, @javax.annotation.Nullable List modelName, @javax.annotation.Nullable DynamicExecutionStatus dynamicExecutionStatus, @javax.annotation.Nullable List usernames, @javax.annotation.Nullable String sha256Hash, @javax.annotation.Nullable Integer limit, @javax.annotation.Nullable Integer offset, @javax.annotation.Nullable AppApiRestV2AnalysesEnumsOrderBy orderBy, @javax.annotation.Nullable Order order, final ApiCallback _callback) throws ApiException { + public okhttp3.Call putAnalysisStringsCall(@javax.annotation.Nonnull Integer analysisId, @javax.annotation.Nonnull PutAnalysisStringsRequest putAnalysisStringsRequest, final ApiCallback _callback) throws ApiException { String basePath = null; // Operation Servers String[] localBasePaths = new String[] { }; @@ -2157,10 +2154,11 @@ public okhttp3.Call listAnalysesCall(@javax.annotation.Nullable String searchTer basePath = null; } - Object localVarPostBody = null; + Object localVarPostBody = putAnalysisStringsRequest; // create path and map variables - String localVarPath = "/v2/analyses/list"; + String localVarPath = "/v2/analyses/{analysis_id}/strings" + .replace("{" + "analysis_id" + "}", localVarApiClient.escapeString(analysisId.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -2168,50 +2166,6 @@ public okhttp3.Call listAnalysesCall(@javax.annotation.Nullable String searchTer Map localVarCookieParams = new HashMap(); Map localVarFormParams = new HashMap(); - if (searchTerm != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("search_term", searchTerm)); - } - - if (workspace != null) { - localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "workspace", workspace)); - } - - if (status != null) { - localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "status", status)); - } - - if (modelName != null) { - localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "model_name", modelName)); - } - - if (dynamicExecutionStatus != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("dynamic_execution_status", dynamicExecutionStatus)); - } - - if (usernames != null) { - localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "usernames", usernames)); - } - - if (sha256Hash != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("sha256_hash", sha256Hash)); - } - - if (limit != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("limit", limit)); - } - - if (offset != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("offset", offset)); - } - - if (orderBy != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("order_by", orderBy)); - } - - if (order != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("order", order)); - } - final String[] localVarAccepts = { "application/json" }; @@ -2221,6 +2175,7 @@ public okhttp3.Call listAnalysesCall(@javax.annotation.Nullable String searchTer } final String[] localVarContentTypes = { + "application/json" }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { @@ -2228,88 +2183,71 @@ public okhttp3.Call listAnalysesCall(@javax.annotation.Nullable String searchTer } String[] localVarAuthNames = new String[] { "APIKey" }; - return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + return localVarApiClient.buildCall(basePath, localVarPath, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") - private okhttp3.Call listAnalysesValidateBeforeCall(@javax.annotation.Nullable String searchTerm, @javax.annotation.Nullable List workspace, @javax.annotation.Nullable List status, @javax.annotation.Nullable List modelName, @javax.annotation.Nullable DynamicExecutionStatus dynamicExecutionStatus, @javax.annotation.Nullable List usernames, @javax.annotation.Nullable String sha256Hash, @javax.annotation.Nullable Integer limit, @javax.annotation.Nullable Integer offset, @javax.annotation.Nullable AppApiRestV2AnalysesEnumsOrderBy orderBy, @javax.annotation.Nullable Order order, final ApiCallback _callback) throws ApiException { - return listAnalysesCall(searchTerm, workspace, status, modelName, dynamicExecutionStatus, usernames, sha256Hash, limit, offset, orderBy, order, _callback); + private okhttp3.Call putAnalysisStringsValidateBeforeCall(@javax.annotation.Nonnull Integer analysisId, @javax.annotation.Nonnull PutAnalysisStringsRequest putAnalysisStringsRequest, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'analysisId' is set + if (analysisId == null) { + throw new ApiException("Missing the required parameter 'analysisId' when calling putAnalysisStrings(Async)"); + } + + // verify the required parameter 'putAnalysisStringsRequest' is set + if (putAnalysisStringsRequest == null) { + throw new ApiException("Missing the required parameter 'putAnalysisStringsRequest' when calling putAnalysisStrings(Async)"); + } + + return putAnalysisStringsCall(analysisId, putAnalysisStringsRequest, _callback); } /** - * Gets the most recent analyses - * Gets the most recent analyses provided a scope, this is then paginated, if pages and limit doesnt fit, it increases the limit - * @param searchTerm (optional, default to ) - * @param workspace The workspace to be viewed (optional) - * @param status The status of the analysis (optional) - * @param modelName Show analysis belonging to the model (optional) - * @param dynamicExecutionStatus Show analysis that have a dynamic execution with the given status (optional) - * @param usernames Show analysis belonging to the user (optional) - * @param sha256Hash (optional) - * @param limit (optional, default to 20) - * @param offset (optional, default to 0) - * @param orderBy (optional) - * @param order (optional) - * @return BaseResponseRecent + * Add strings to the analysis + * Add strings to the analysis. Rejects if any string already exists at the given vaddr. + * @param analysisId (required) + * @param putAnalysisStringsRequest (required) + * @return BaseResponse * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details - +
Response Details
Status Code Description Response Headers
200 Successful Response -
201 Successful Response -
422 Invalid request parameters -
*/ - public BaseResponseRecent listAnalyses(@javax.annotation.Nullable String searchTerm, @javax.annotation.Nullable List workspace, @javax.annotation.Nullable List status, @javax.annotation.Nullable List modelName, @javax.annotation.Nullable DynamicExecutionStatus dynamicExecutionStatus, @javax.annotation.Nullable List usernames, @javax.annotation.Nullable String sha256Hash, @javax.annotation.Nullable Integer limit, @javax.annotation.Nullable Integer offset, @javax.annotation.Nullable AppApiRestV2AnalysesEnumsOrderBy orderBy, @javax.annotation.Nullable Order order) throws ApiException { - ApiResponse localVarResp = listAnalysesWithHttpInfo(searchTerm, workspace, status, modelName, dynamicExecutionStatus, usernames, sha256Hash, limit, offset, orderBy, order); + public BaseResponse putAnalysisStrings(@javax.annotation.Nonnull Integer analysisId, @javax.annotation.Nonnull PutAnalysisStringsRequest putAnalysisStringsRequest) throws ApiException { + ApiResponse localVarResp = putAnalysisStringsWithHttpInfo(analysisId, putAnalysisStringsRequest); return localVarResp.getData(); } /** - * Gets the most recent analyses - * Gets the most recent analyses provided a scope, this is then paginated, if pages and limit doesnt fit, it increases the limit - * @param searchTerm (optional, default to ) - * @param workspace The workspace to be viewed (optional) - * @param status The status of the analysis (optional) - * @param modelName Show analysis belonging to the model (optional) - * @param dynamicExecutionStatus Show analysis that have a dynamic execution with the given status (optional) - * @param usernames Show analysis belonging to the user (optional) - * @param sha256Hash (optional) - * @param limit (optional, default to 20) - * @param offset (optional, default to 0) - * @param orderBy (optional) - * @param order (optional) - * @return ApiResponse<BaseResponseRecent> + * Add strings to the analysis + * Add strings to the analysis. Rejects if any string already exists at the given vaddr. + * @param analysisId (required) + * @param putAnalysisStringsRequest (required) + * @return ApiResponse<BaseResponse> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details - +
Response Details
Status Code Description Response Headers
200 Successful Response -
201 Successful Response -
422 Invalid request parameters -
*/ - public ApiResponse listAnalysesWithHttpInfo(@javax.annotation.Nullable String searchTerm, @javax.annotation.Nullable List workspace, @javax.annotation.Nullable List status, @javax.annotation.Nullable List modelName, @javax.annotation.Nullable DynamicExecutionStatus dynamicExecutionStatus, @javax.annotation.Nullable List usernames, @javax.annotation.Nullable String sha256Hash, @javax.annotation.Nullable Integer limit, @javax.annotation.Nullable Integer offset, @javax.annotation.Nullable AppApiRestV2AnalysesEnumsOrderBy orderBy, @javax.annotation.Nullable Order order) throws ApiException { - okhttp3.Call localVarCall = listAnalysesValidateBeforeCall(searchTerm, workspace, status, modelName, dynamicExecutionStatus, usernames, sha256Hash, limit, offset, orderBy, order, null); - Type localVarReturnType = new TypeToken(){}.getType(); + public ApiResponse putAnalysisStringsWithHttpInfo(@javax.annotation.Nonnull Integer analysisId, @javax.annotation.Nonnull PutAnalysisStringsRequest putAnalysisStringsRequest) throws ApiException { + okhttp3.Call localVarCall = putAnalysisStringsValidateBeforeCall(analysisId, putAnalysisStringsRequest, null); + Type localVarReturnType = new TypeToken(){}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } /** - * Gets the most recent analyses (asynchronously) - * Gets the most recent analyses provided a scope, this is then paginated, if pages and limit doesnt fit, it increases the limit - * @param searchTerm (optional, default to ) - * @param workspace The workspace to be viewed (optional) - * @param status The status of the analysis (optional) - * @param modelName Show analysis belonging to the model (optional) - * @param dynamicExecutionStatus Show analysis that have a dynamic execution with the given status (optional) - * @param usernames Show analysis belonging to the user (optional) - * @param sha256Hash (optional) - * @param limit (optional, default to 20) - * @param offset (optional, default to 0) - * @param orderBy (optional) - * @param order (optional) + * Add strings to the analysis (asynchronously) + * Add strings to the analysis. Rejects if any string already exists at the given vaddr. + * @param analysisId (required) + * @param putAnalysisStringsRequest (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 @@ -2317,20 +2255,22 @@ public ApiResponse listAnalysesWithHttpInfo(@javax.annotatio - +
Response Details
Status Code Description Response Headers
200 Successful Response -
201 Successful Response -
422 Invalid request parameters -
*/ - public okhttp3.Call listAnalysesAsync(@javax.annotation.Nullable String searchTerm, @javax.annotation.Nullable List workspace, @javax.annotation.Nullable List status, @javax.annotation.Nullable List modelName, @javax.annotation.Nullable DynamicExecutionStatus dynamicExecutionStatus, @javax.annotation.Nullable List usernames, @javax.annotation.Nullable String sha256Hash, @javax.annotation.Nullable Integer limit, @javax.annotation.Nullable Integer offset, @javax.annotation.Nullable AppApiRestV2AnalysesEnumsOrderBy orderBy, @javax.annotation.Nullable Order order, final ApiCallback _callback) throws ApiException { + public okhttp3.Call putAnalysisStringsAsync(@javax.annotation.Nonnull Integer analysisId, @javax.annotation.Nonnull PutAnalysisStringsRequest putAnalysisStringsRequest, final ApiCallback _callback) throws ApiException { - okhttp3.Call localVarCall = listAnalysesValidateBeforeCall(searchTerm, workspace, status, modelName, dynamicExecutionStatus, usernames, sha256Hash, limit, offset, orderBy, order, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); + okhttp3.Call localVarCall = putAnalysisStringsValidateBeforeCall(analysisId, putAnalysisStringsRequest, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } /** - * Build call for lookupBinaryId - * @param binaryId (required) + * Build call for requeueAnalysis + * @param analysisId (required) + * @param reAnalysisForm (required) + * @param xRevEngApplication (optional) * @param _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object @@ -2338,11 +2278,13 @@ public okhttp3.Call listAnalysesAsync(@javax.annotation.Nullable String searchTe - + + +
Response Details
Status Code Description Response Headers
200 Successful Response -
201 Successful Response -
422 Invalid request parameters -
404 Not Found -
400 Bad Request -
*/ - public okhttp3.Call lookupBinaryIdCall(@javax.annotation.Nonnull Integer binaryId, final ApiCallback _callback) throws ApiException { + public okhttp3.Call requeueAnalysisCall(@javax.annotation.Nonnull Integer analysisId, @javax.annotation.Nonnull ReAnalysisForm reAnalysisForm, @javax.annotation.Nullable String xRevEngApplication, final ApiCallback _callback) throws ApiException { String basePath = null; // Operation Servers String[] localBasePaths = new String[] { }; @@ -2356,11 +2298,11 @@ public okhttp3.Call lookupBinaryIdCall(@javax.annotation.Nonnull Integer binaryI basePath = null; } - Object localVarPostBody = null; + Object localVarPostBody = reAnalysisForm; // create path and map variables - String localVarPath = "/v2/analyses/lookup/{binary_id}" - .replace("{" + "binary_id" + "}", localVarApiClient.escapeString(binaryId.toString())); + String localVarPath = "/v2/analyses/{analysis_id}/requeue" + .replace("{" + "analysis_id" + "}", localVarApiClient.escapeString(analysisId.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -2377,70 +2319,91 @@ public okhttp3.Call lookupBinaryIdCall(@javax.annotation.Nonnull Integer binaryI } final String[] localVarContentTypes = { + "application/json" }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } + if (xRevEngApplication != null) { + localVarHeaderParams.put("X-RevEng-Application", localVarApiClient.parameterToString(xRevEngApplication)); + } + + String[] localVarAuthNames = new String[] { "APIKey" }; - return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") - private okhttp3.Call lookupBinaryIdValidateBeforeCall(@javax.annotation.Nonnull Integer binaryId, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'binaryId' is set - if (binaryId == null) { - throw new ApiException("Missing the required parameter 'binaryId' when calling lookupBinaryId(Async)"); + private okhttp3.Call requeueAnalysisValidateBeforeCall(@javax.annotation.Nonnull Integer analysisId, @javax.annotation.Nonnull ReAnalysisForm reAnalysisForm, @javax.annotation.Nullable String xRevEngApplication, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'analysisId' is set + if (analysisId == null) { + throw new ApiException("Missing the required parameter 'analysisId' when calling requeueAnalysis(Async)"); } - return lookupBinaryIdCall(binaryId, _callback); + // verify the required parameter 'reAnalysisForm' is set + if (reAnalysisForm == null) { + throw new ApiException("Missing the required parameter 'reAnalysisForm' when calling requeueAnalysis(Async)"); + } + + return requeueAnalysisCall(analysisId, reAnalysisForm, xRevEngApplication, _callback); } /** - * Gets the analysis ID from binary ID - * Given an binary ID gets the ID of an analysis - * @param binaryId (required) - * @return Object + * Requeue Analysis + * Re-queues an already uploaded analysis + * @param analysisId (required) + * @param reAnalysisForm (required) + * @param xRevEngApplication (optional) + * @return BaseResponseCreated * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details - + + +
Response Details
Status Code Description Response Headers
200 Successful Response -
201 Successful Response -
422 Invalid request parameters -
404 Not Found -
400 Bad Request -
*/ - public Object lookupBinaryId(@javax.annotation.Nonnull Integer binaryId) throws ApiException { - ApiResponse localVarResp = lookupBinaryIdWithHttpInfo(binaryId); + public BaseResponseCreated requeueAnalysis(@javax.annotation.Nonnull Integer analysisId, @javax.annotation.Nonnull ReAnalysisForm reAnalysisForm, @javax.annotation.Nullable String xRevEngApplication) throws ApiException { + ApiResponse localVarResp = requeueAnalysisWithHttpInfo(analysisId, reAnalysisForm, xRevEngApplication); return localVarResp.getData(); } /** - * Gets the analysis ID from binary ID - * Given an binary ID gets the ID of an analysis - * @param binaryId (required) - * @return ApiResponse<Object> + * Requeue Analysis + * Re-queues an already uploaded analysis + * @param analysisId (required) + * @param reAnalysisForm (required) + * @param xRevEngApplication (optional) + * @return ApiResponse<BaseResponseCreated> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details - + + +
Response Details
Status Code Description Response Headers
200 Successful Response -
201 Successful Response -
422 Invalid request parameters -
404 Not Found -
400 Bad Request -
*/ - public ApiResponse lookupBinaryIdWithHttpInfo(@javax.annotation.Nonnull Integer binaryId) throws ApiException { - okhttp3.Call localVarCall = lookupBinaryIdValidateBeforeCall(binaryId, null); - Type localVarReturnType = new TypeToken(){}.getType(); + public ApiResponse requeueAnalysisWithHttpInfo(@javax.annotation.Nonnull Integer analysisId, @javax.annotation.Nonnull ReAnalysisForm reAnalysisForm, @javax.annotation.Nullable String xRevEngApplication) throws ApiException { + okhttp3.Call localVarCall = requeueAnalysisValidateBeforeCall(analysisId, reAnalysisForm, xRevEngApplication, null); + Type localVarReturnType = new TypeToken(){}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } /** - * Gets the analysis ID from binary ID (asynchronously) - * Given an binary ID gets the ID of an analysis - * @param binaryId (required) + * Requeue Analysis (asynchronously) + * Re-queues an already uploaded analysis + * @param analysisId (required) + * @param reAnalysisForm (required) + * @param xRevEngApplication (optional) * @param _callback The callback to be executed when the API call finishes * @return The request call * @throws ApiException If fail to process the API call, e.g. serializing the request body object @@ -2448,21 +2411,23 @@ public ApiResponse lookupBinaryIdWithHttpInfo(@javax.annotation.Nonnull - + + +
Response Details
Status Code Description Response Headers
200 Successful Response -
201 Successful Response -
422 Invalid request parameters -
404 Not Found -
400 Bad Request -
*/ - public okhttp3.Call lookupBinaryIdAsync(@javax.annotation.Nonnull Integer binaryId, final ApiCallback _callback) throws ApiException { + public okhttp3.Call requeueAnalysisAsync(@javax.annotation.Nonnull Integer analysisId, @javax.annotation.Nonnull ReAnalysisForm reAnalysisForm, @javax.annotation.Nullable String xRevEngApplication, final ApiCallback _callback) throws ApiException { - okhttp3.Call localVarCall = lookupBinaryIdValidateBeforeCall(binaryId, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); + okhttp3.Call localVarCall = requeueAnalysisValidateBeforeCall(analysisId, reAnalysisForm, xRevEngApplication, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } /** - * Build call for putAnalysisStrings + * Build call for updateAnalysis * @param analysisId (required) - * @param putAnalysisStringsRequest (required) + * @param analysisUpdateRequest (required) * @param _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object @@ -2470,11 +2435,11 @@ public okhttp3.Call lookupBinaryIdAsync(@javax.annotation.Nonnull Integer binary - +
Response Details
Status Code Description Response Headers
201 Successful Response -
200 Successful Response -
422 Invalid request parameters -
*/ - public okhttp3.Call putAnalysisStringsCall(@javax.annotation.Nonnull Integer analysisId, @javax.annotation.Nonnull PutAnalysisStringsRequest putAnalysisStringsRequest, final ApiCallback _callback) throws ApiException { + public okhttp3.Call updateAnalysisCall(@javax.annotation.Nonnull Integer analysisId, @javax.annotation.Nonnull AnalysisUpdateRequest analysisUpdateRequest, final ApiCallback _callback) throws ApiException { String basePath = null; // Operation Servers String[] localBasePaths = new String[] { }; @@ -2488,10 +2453,10 @@ public okhttp3.Call putAnalysisStringsCall(@javax.annotation.Nonnull Integer ana basePath = null; } - Object localVarPostBody = putAnalysisStringsRequest; + Object localVarPostBody = analysisUpdateRequest; // create path and map variables - String localVarPath = "/v2/analyses/{analysis_id}/strings" + String localVarPath = "/v2/analyses/{analysis_id}" .replace("{" + "analysis_id" + "}", localVarApiClient.escapeString(analysisId.toString())); List localVarQueryParams = new ArrayList(); @@ -2517,71 +2482,71 @@ public okhttp3.Call putAnalysisStringsCall(@javax.annotation.Nonnull Integer ana } String[] localVarAuthNames = new String[] { "APIKey" }; - return localVarApiClient.buildCall(basePath, localVarPath, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + return localVarApiClient.buildCall(basePath, localVarPath, "PATCH", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") - private okhttp3.Call putAnalysisStringsValidateBeforeCall(@javax.annotation.Nonnull Integer analysisId, @javax.annotation.Nonnull PutAnalysisStringsRequest putAnalysisStringsRequest, final ApiCallback _callback) throws ApiException { + private okhttp3.Call updateAnalysisValidateBeforeCall(@javax.annotation.Nonnull Integer analysisId, @javax.annotation.Nonnull AnalysisUpdateRequest analysisUpdateRequest, final ApiCallback _callback) throws ApiException { // verify the required parameter 'analysisId' is set if (analysisId == null) { - throw new ApiException("Missing the required parameter 'analysisId' when calling putAnalysisStrings(Async)"); + throw new ApiException("Missing the required parameter 'analysisId' when calling updateAnalysis(Async)"); } - // verify the required parameter 'putAnalysisStringsRequest' is set - if (putAnalysisStringsRequest == null) { - throw new ApiException("Missing the required parameter 'putAnalysisStringsRequest' when calling putAnalysisStrings(Async)"); + // verify the required parameter 'analysisUpdateRequest' is set + if (analysisUpdateRequest == null) { + throw new ApiException("Missing the required parameter 'analysisUpdateRequest' when calling updateAnalysis(Async)"); } - return putAnalysisStringsCall(analysisId, putAnalysisStringsRequest, _callback); + return updateAnalysisCall(analysisId, analysisUpdateRequest, _callback); } /** - * Add strings to the analysis - * Add strings to the analysis. Rejects if any string already exists at the given vaddr. + * Update Analysis + * Updates analysis attributes (binary_name, analysis_scope). User must be the owner. * @param analysisId (required) - * @param putAnalysisStringsRequest (required) - * @return BaseResponse + * @param analysisUpdateRequest (required) + * @return BaseResponseAnalysisDetailResponse * @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
201 Successful Response -
200 Successful Response -
422 Invalid request parameters -
*/ - public BaseResponse putAnalysisStrings(@javax.annotation.Nonnull Integer analysisId, @javax.annotation.Nonnull PutAnalysisStringsRequest putAnalysisStringsRequest) throws ApiException { - ApiResponse localVarResp = putAnalysisStringsWithHttpInfo(analysisId, putAnalysisStringsRequest); + public BaseResponseAnalysisDetailResponse updateAnalysis(@javax.annotation.Nonnull Integer analysisId, @javax.annotation.Nonnull AnalysisUpdateRequest analysisUpdateRequest) throws ApiException { + ApiResponse localVarResp = updateAnalysisWithHttpInfo(analysisId, analysisUpdateRequest); return localVarResp.getData(); } /** - * Add strings to the analysis - * Add strings to the analysis. Rejects if any string already exists at the given vaddr. + * Update Analysis + * Updates analysis attributes (binary_name, analysis_scope). User must be the owner. * @param analysisId (required) - * @param putAnalysisStringsRequest (required) - * @return ApiResponse<BaseResponse> + * @param analysisUpdateRequest (required) + * @return ApiResponse<BaseResponseAnalysisDetailResponse> * @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
201 Successful Response -
200 Successful Response -
422 Invalid request parameters -
*/ - public ApiResponse putAnalysisStringsWithHttpInfo(@javax.annotation.Nonnull Integer analysisId, @javax.annotation.Nonnull PutAnalysisStringsRequest putAnalysisStringsRequest) throws ApiException { - okhttp3.Call localVarCall = putAnalysisStringsValidateBeforeCall(analysisId, putAnalysisStringsRequest, null); - Type localVarReturnType = new TypeToken(){}.getType(); + public ApiResponse updateAnalysisWithHttpInfo(@javax.annotation.Nonnull Integer analysisId, @javax.annotation.Nonnull AnalysisUpdateRequest analysisUpdateRequest) throws ApiException { + okhttp3.Call localVarCall = updateAnalysisValidateBeforeCall(analysisId, analysisUpdateRequest, null); + Type localVarReturnType = new TypeToken(){}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } /** - * Add strings to the analysis (asynchronously) - * Add strings to the analysis. Rejects if any string already exists at the given vaddr. + * Update Analysis (asynchronously) + * Updates analysis attributes (binary_name, analysis_scope). User must be the owner. * @param analysisId (required) - * @param putAnalysisStringsRequest (required) + * @param analysisUpdateRequest (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 @@ -2589,22 +2554,21 @@ public ApiResponse putAnalysisStringsWithHttpInfo(@javax.annotatio - +
Response Details
Status Code Description Response Headers
201 Successful Response -
200 Successful Response -
422 Invalid request parameters -
*/ - public okhttp3.Call putAnalysisStringsAsync(@javax.annotation.Nonnull Integer analysisId, @javax.annotation.Nonnull PutAnalysisStringsRequest putAnalysisStringsRequest, final ApiCallback _callback) throws ApiException { + public okhttp3.Call updateAnalysisAsync(@javax.annotation.Nonnull Integer analysisId, @javax.annotation.Nonnull AnalysisUpdateRequest analysisUpdateRequest, final ApiCallback _callback) throws ApiException { - okhttp3.Call localVarCall = putAnalysisStringsValidateBeforeCall(analysisId, putAnalysisStringsRequest, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); + okhttp3.Call localVarCall = updateAnalysisValidateBeforeCall(analysisId, analysisUpdateRequest, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } /** - * Build call for requeueAnalysis + * Build call for updateAnalysisTags * @param analysisId (required) - * @param reAnalysisForm (required) - * @param xRevEngApplication (optional) + * @param analysisUpdateTagsRequest (required) * @param _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object @@ -2612,13 +2576,11 @@ public okhttp3.Call putAnalysisStringsAsync(@javax.annotation.Nonnull Integer an - + - -
Response Details
Status Code Description Response Headers
201 Successful Response -
200 Successful Response -
422 Invalid request parameters -
404 Not Found -
400 Bad Request -
*/ - public okhttp3.Call requeueAnalysisCall(@javax.annotation.Nonnull Integer analysisId, @javax.annotation.Nonnull ReAnalysisForm reAnalysisForm, @javax.annotation.Nullable String xRevEngApplication, final ApiCallback _callback) throws ApiException { + public okhttp3.Call updateAnalysisTagsCall(@javax.annotation.Nonnull Integer analysisId, @javax.annotation.Nonnull AnalysisUpdateTagsRequest analysisUpdateTagsRequest, final ApiCallback _callback) throws ApiException { String basePath = null; // Operation Servers String[] localBasePaths = new String[] { }; @@ -2632,10 +2594,10 @@ public okhttp3.Call requeueAnalysisCall(@javax.annotation.Nonnull Integer analys basePath = null; } - Object localVarPostBody = reAnalysisForm; + Object localVarPostBody = analysisUpdateTagsRequest; // create path and map variables - String localVarPath = "/v2/analyses/{analysis_id}/requeue" + String localVarPath = "/v2/analyses/{analysis_id}/tags" .replace("{" + "analysis_id" + "}", localVarApiClient.escapeString(analysisId.toString())); List localVarQueryParams = new ArrayList(); @@ -2660,84 +2622,72 @@ public okhttp3.Call requeueAnalysisCall(@javax.annotation.Nonnull Integer analys localVarHeaderParams.put("Content-Type", localVarContentType); } - if (xRevEngApplication != null) { - localVarHeaderParams.put("X-RevEng-Application", localVarApiClient.parameterToString(xRevEngApplication)); - } - - String[] localVarAuthNames = new String[] { "APIKey" }; - return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + return localVarApiClient.buildCall(basePath, localVarPath, "PATCH", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") - private okhttp3.Call requeueAnalysisValidateBeforeCall(@javax.annotation.Nonnull Integer analysisId, @javax.annotation.Nonnull ReAnalysisForm reAnalysisForm, @javax.annotation.Nullable String xRevEngApplication, final ApiCallback _callback) throws ApiException { + private okhttp3.Call updateAnalysisTagsValidateBeforeCall(@javax.annotation.Nonnull Integer analysisId, @javax.annotation.Nonnull AnalysisUpdateTagsRequest analysisUpdateTagsRequest, final ApiCallback _callback) throws ApiException { // verify the required parameter 'analysisId' is set if (analysisId == null) { - throw new ApiException("Missing the required parameter 'analysisId' when calling requeueAnalysis(Async)"); + throw new ApiException("Missing the required parameter 'analysisId' when calling updateAnalysisTags(Async)"); } - // verify the required parameter 'reAnalysisForm' is set - if (reAnalysisForm == null) { - throw new ApiException("Missing the required parameter 'reAnalysisForm' when calling requeueAnalysis(Async)"); + // verify the required parameter 'analysisUpdateTagsRequest' is set + if (analysisUpdateTagsRequest == null) { + throw new ApiException("Missing the required parameter 'analysisUpdateTagsRequest' when calling updateAnalysisTags(Async)"); } - return requeueAnalysisCall(analysisId, reAnalysisForm, xRevEngApplication, _callback); + return updateAnalysisTagsCall(analysisId, analysisUpdateTagsRequest, _callback); } /** - * Requeue Analysis - * Re-queues an already uploaded analysis + * Update Analysis Tags + * Updates analysis tags. User must be the owner. * @param analysisId (required) - * @param reAnalysisForm (required) - * @param xRevEngApplication (optional) - * @return BaseResponseCreated + * @param analysisUpdateTagsRequest (required) + * @return BaseResponseAnalysisUpdateTagsResponse * @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
201 Successful Response -
200 Successful Response -
422 Invalid request parameters -
404 Not Found -
400 Bad Request -
*/ - public BaseResponseCreated requeueAnalysis(@javax.annotation.Nonnull Integer analysisId, @javax.annotation.Nonnull ReAnalysisForm reAnalysisForm, @javax.annotation.Nullable String xRevEngApplication) throws ApiException { - ApiResponse localVarResp = requeueAnalysisWithHttpInfo(analysisId, reAnalysisForm, xRevEngApplication); + public BaseResponseAnalysisUpdateTagsResponse updateAnalysisTags(@javax.annotation.Nonnull Integer analysisId, @javax.annotation.Nonnull AnalysisUpdateTagsRequest analysisUpdateTagsRequest) throws ApiException { + ApiResponse localVarResp = updateAnalysisTagsWithHttpInfo(analysisId, analysisUpdateTagsRequest); return localVarResp.getData(); } /** - * Requeue Analysis - * Re-queues an already uploaded analysis + * Update Analysis Tags + * Updates analysis tags. User must be the owner. * @param analysisId (required) - * @param reAnalysisForm (required) - * @param xRevEngApplication (optional) - * @return ApiResponse<BaseResponseCreated> + * @param analysisUpdateTagsRequest (required) + * @return ApiResponse<BaseResponseAnalysisUpdateTagsResponse> * @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
201 Successful Response -
200 Successful Response -
422 Invalid request parameters -
404 Not Found -
400 Bad Request -
*/ - public ApiResponse requeueAnalysisWithHttpInfo(@javax.annotation.Nonnull Integer analysisId, @javax.annotation.Nonnull ReAnalysisForm reAnalysisForm, @javax.annotation.Nullable String xRevEngApplication) throws ApiException { - okhttp3.Call localVarCall = requeueAnalysisValidateBeforeCall(analysisId, reAnalysisForm, xRevEngApplication, null); - Type localVarReturnType = new TypeToken(){}.getType(); + public ApiResponse updateAnalysisTagsWithHttpInfo(@javax.annotation.Nonnull Integer analysisId, @javax.annotation.Nonnull AnalysisUpdateTagsRequest analysisUpdateTagsRequest) throws ApiException { + okhttp3.Call localVarCall = updateAnalysisTagsValidateBeforeCall(analysisId, analysisUpdateTagsRequest, null); + Type localVarReturnType = new TypeToken(){}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } /** - * Requeue Analysis (asynchronously) - * Re-queues an already uploaded analysis + * Update Analysis Tags (asynchronously) + * Updates analysis tags. User must be the owner. * @param analysisId (required) - * @param reAnalysisForm (required) - * @param xRevEngApplication (optional) + * @param analysisUpdateTagsRequest (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 @@ -2745,23 +2695,23 @@ public ApiResponse requeueAnalysisWithHttpInfo(@javax.annot - + - -
Response Details
Status Code Description Response Headers
201 Successful Response -
200 Successful Response -
422 Invalid request parameters -
404 Not Found -
400 Bad Request -
*/ - public okhttp3.Call requeueAnalysisAsync(@javax.annotation.Nonnull Integer analysisId, @javax.annotation.Nonnull ReAnalysisForm reAnalysisForm, @javax.annotation.Nullable String xRevEngApplication, final ApiCallback _callback) throws ApiException { + public okhttp3.Call updateAnalysisTagsAsync(@javax.annotation.Nonnull Integer analysisId, @javax.annotation.Nonnull AnalysisUpdateTagsRequest analysisUpdateTagsRequest, final ApiCallback _callback) throws ApiException { - okhttp3.Call localVarCall = requeueAnalysisValidateBeforeCall(analysisId, reAnalysisForm, xRevEngApplication, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); + okhttp3.Call localVarCall = updateAnalysisTagsValidateBeforeCall(analysisId, analysisUpdateTagsRequest, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } /** - * Build call for updateAnalysis - * @param analysisId (required) - * @param analysisUpdateRequest (required) + * Build call for uploadFile + * @param uploadFileType (required) + * @param _file (required) + * @param packedPassword (optional) + * @param forceOverwrite (optional, default to false) * @param _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object @@ -2773,7 +2723,7 @@ public okhttp3.Call requeueAnalysisAsync(@javax.annotation.Nonnull Integer analy 422 Invalid request parameters - */ - public okhttp3.Call updateAnalysisCall(@javax.annotation.Nonnull Integer analysisId, @javax.annotation.Nonnull AnalysisUpdateRequest analysisUpdateRequest, final ApiCallback _callback) throws ApiException { + public okhttp3.Call uploadFileCall(@javax.annotation.Nonnull UploadFileType uploadFileType, @javax.annotation.Nonnull File _file, @javax.annotation.Nullable String packedPassword, @javax.annotation.Nullable Boolean forceOverwrite, final ApiCallback _callback) throws ApiException { String basePath = null; // Operation Servers String[] localBasePaths = new String[] { }; @@ -2787,11 +2737,10 @@ public okhttp3.Call updateAnalysisCall(@javax.annotation.Nonnull Integer analysi basePath = null; } - Object localVarPostBody = analysisUpdateRequest; + Object localVarPostBody = null; // create path and map variables - String localVarPath = "/v2/analyses/{analysis_id}" - .replace("{" + "analysis_id" + "}", localVarApiClient.escapeString(analysisId.toString())); + String localVarPath = "/v2/upload"; List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -2799,6 +2748,22 @@ public okhttp3.Call updateAnalysisCall(@javax.annotation.Nonnull Integer analysi Map localVarCookieParams = new HashMap(); Map localVarFormParams = new HashMap(); + if (uploadFileType != null) { + localVarFormParams.put("upload_file_type", uploadFileType); + } + + if (_file != null) { + localVarFormParams.put("file", _file); + } + + if (forceOverwrite != null) { + localVarFormParams.put("force_overwrite", forceOverwrite); + } + + if (packedPassword != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("packed_password", packedPassword)); + } + final String[] localVarAccepts = { "application/json" }; @@ -2808,7 +2773,7 @@ public okhttp3.Call updateAnalysisCall(@javax.annotation.Nonnull Integer analysi } final String[] localVarContentTypes = { - "application/json" + "multipart/form-data" }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { @@ -2816,31 +2781,33 @@ public okhttp3.Call updateAnalysisCall(@javax.annotation.Nonnull Integer analysi } String[] localVarAuthNames = new String[] { "APIKey" }; - return localVarApiClient.buildCall(basePath, localVarPath, "PATCH", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") - private okhttp3.Call updateAnalysisValidateBeforeCall(@javax.annotation.Nonnull Integer analysisId, @javax.annotation.Nonnull AnalysisUpdateRequest analysisUpdateRequest, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'analysisId' is set - if (analysisId == null) { - throw new ApiException("Missing the required parameter 'analysisId' when calling updateAnalysis(Async)"); + private okhttp3.Call uploadFileValidateBeforeCall(@javax.annotation.Nonnull UploadFileType uploadFileType, @javax.annotation.Nonnull File _file, @javax.annotation.Nullable String packedPassword, @javax.annotation.Nullable Boolean forceOverwrite, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'uploadFileType' is set + if (uploadFileType == null) { + throw new ApiException("Missing the required parameter 'uploadFileType' when calling uploadFile(Async)"); } - // verify the required parameter 'analysisUpdateRequest' is set - if (analysisUpdateRequest == null) { - throw new ApiException("Missing the required parameter 'analysisUpdateRequest' when calling updateAnalysis(Async)"); + // verify the required parameter '_file' is set + if (_file == null) { + throw new ApiException("Missing the required parameter '_file' when calling uploadFile(Async)"); } - return updateAnalysisCall(analysisId, analysisUpdateRequest, _callback); + return uploadFileCall(uploadFileType, _file, packedPassword, forceOverwrite, _callback); } /** - * Update Analysis - * Updates analysis attributes (binary_name, analysis_scope). User must be the owner. - * @param analysisId (required) - * @param analysisUpdateRequest (required) - * @return BaseResponseAnalysisDetailResponse + * Upload File + * + * @param uploadFileType (required) + * @param _file (required) + * @param packedPassword (optional) + * @param forceOverwrite (optional, default to false) + * @return BaseResponseUploadResponse * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details @@ -2850,17 +2817,19 @@ private okhttp3.Call updateAnalysisValidateBeforeCall(@javax.annotation.Nonnull
422 Invalid request parameters -
*/ - public BaseResponseAnalysisDetailResponse updateAnalysis(@javax.annotation.Nonnull Integer analysisId, @javax.annotation.Nonnull AnalysisUpdateRequest analysisUpdateRequest) throws ApiException { - ApiResponse localVarResp = updateAnalysisWithHttpInfo(analysisId, analysisUpdateRequest); + public BaseResponseUploadResponse uploadFile(@javax.annotation.Nonnull UploadFileType uploadFileType, @javax.annotation.Nonnull File _file, @javax.annotation.Nullable String packedPassword, @javax.annotation.Nullable Boolean forceOverwrite) throws ApiException { + ApiResponse localVarResp = uploadFileWithHttpInfo(uploadFileType, _file, packedPassword, forceOverwrite); return localVarResp.getData(); } /** - * Update Analysis - * Updates analysis attributes (binary_name, analysis_scope). User must be the owner. - * @param analysisId (required) - * @param analysisUpdateRequest (required) - * @return ApiResponse<BaseResponseAnalysisDetailResponse> + * Upload File + * + * @param uploadFileType (required) + * @param _file (required) + * @param packedPassword (optional) + * @param forceOverwrite (optional, default to false) + * @return ApiResponse<BaseResponseUploadResponse> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details @@ -2870,17 +2839,19 @@ public BaseResponseAnalysisDetailResponse updateAnalysis(@javax.annotation.Nonnu
422 Invalid request parameters -
*/ - public ApiResponse updateAnalysisWithHttpInfo(@javax.annotation.Nonnull Integer analysisId, @javax.annotation.Nonnull AnalysisUpdateRequest analysisUpdateRequest) throws ApiException { - okhttp3.Call localVarCall = updateAnalysisValidateBeforeCall(analysisId, analysisUpdateRequest, null); - Type localVarReturnType = new TypeToken(){}.getType(); + public ApiResponse uploadFileWithHttpInfo(@javax.annotation.Nonnull UploadFileType uploadFileType, @javax.annotation.Nonnull File _file, @javax.annotation.Nullable String packedPassword, @javax.annotation.Nullable Boolean forceOverwrite) throws ApiException { + okhttp3.Call localVarCall = uploadFileValidateBeforeCall(uploadFileType, _file, packedPassword, forceOverwrite, null); + Type localVarReturnType = new TypeToken(){}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * Update Analysis (asynchronously) - * Updates analysis attributes (binary_name, analysis_scope). User must be the owner. - * @param analysisId (required) - * @param analysisUpdateRequest (required) + } + + /** + * Upload File (asynchronously) + * + * @param uploadFileType (required) + * @param _file (required) + * @param packedPassword (optional) + * @param forceOverwrite (optional, default to false) * @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 @@ -2892,17 +2863,22 @@ public ApiResponse updateAnalysisWithHttpInf 422 Invalid request parameters - */ - public okhttp3.Call updateAnalysisAsync(@javax.annotation.Nonnull Integer analysisId, @javax.annotation.Nonnull AnalysisUpdateRequest analysisUpdateRequest, final ApiCallback _callback) throws ApiException { + public okhttp3.Call uploadFileAsync(@javax.annotation.Nonnull UploadFileType uploadFileType, @javax.annotation.Nonnull File _file, @javax.annotation.Nullable String packedPassword, @javax.annotation.Nullable Boolean forceOverwrite, final ApiCallback _callback) throws ApiException { - okhttp3.Call localVarCall = updateAnalysisValidateBeforeCall(analysisId, analysisUpdateRequest, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); + okhttp3.Call localVarCall = uploadFileValidateBeforeCall(uploadFileType, _file, packedPassword, forceOverwrite, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } /** - * Build call for updateAnalysisTags - * @param analysisId (required) - * @param analysisUpdateTagsRequest (required) + * Build call for v3GetAnalysisStrings + * @param analysisId Analysis ID (required) + * @param page Page number (1-indexed). (optional, default to 1) + * @param pageSize Number of results per page. (optional, default to 100) + * @param search Filter by string value (case-insensitive substring match). (optional) + * @param functionSearch Filter by function name (case-insensitive substring match). (optional) + * @param orderBy Field to order results by. (optional, default to value) + * @param sortOrder Sort direction. (optional, default to ASC) * @param _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object @@ -2910,11 +2886,14 @@ public okhttp3.Call updateAnalysisAsync(@javax.annotation.Nonnull Integer analys - - + + + + +
Response Details
Status Code Description Response Headers
200 Successful Response -
422 Invalid request parameters -
200 OK -
403 Forbidden -
404 Not Found -
422 Unprocessable Entity -
500 Internal Server Error -
*/ - public okhttp3.Call updateAnalysisTagsCall(@javax.annotation.Nonnull Integer analysisId, @javax.annotation.Nonnull AnalysisUpdateTagsRequest analysisUpdateTagsRequest, final ApiCallback _callback) throws ApiException { + public okhttp3.Call v3GetAnalysisStringsCall(@javax.annotation.Nonnull Long analysisId, @javax.annotation.Nullable Long page, @javax.annotation.Nullable Long pageSize, @javax.annotation.Nullable String search, @javax.annotation.Nullable String functionSearch, @javax.annotation.Nullable String orderBy, @javax.annotation.Nullable String sortOrder, final ApiCallback _callback) throws ApiException { String basePath = null; // Operation Servers String[] localBasePaths = new String[] { }; @@ -2928,10 +2907,10 @@ public okhttp3.Call updateAnalysisTagsCall(@javax.annotation.Nonnull Integer ana basePath = null; } - Object localVarPostBody = analysisUpdateTagsRequest; + Object localVarPostBody = null; // create path and map variables - String localVarPath = "/v2/analyses/{analysis_id}/tags" + String localVarPath = "/v3/analyses/{analysis_id}/functions/strings" .replace("{" + "analysis_id" + "}", localVarApiClient.escapeString(analysisId.toString())); List localVarQueryParams = new ArrayList(); @@ -2940,6 +2919,30 @@ public okhttp3.Call updateAnalysisTagsCall(@javax.annotation.Nonnull Integer ana Map localVarCookieParams = new HashMap(); Map localVarFormParams = new HashMap(); + if (page != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("page", page)); + } + + if (pageSize != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("page_size", pageSize)); + } + + if (search != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("search", search)); + } + + if (functionSearch != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("function_search", functionSearch)); + } + + if (orderBy != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("order_by", orderBy)); + } + + if (sortOrder != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("sort_order", sortOrder)); + } + final String[] localVarAccepts = { "application/json" }; @@ -2949,7 +2952,6 @@ public okhttp3.Call updateAnalysisTagsCall(@javax.annotation.Nonnull Integer ana } final String[] localVarContentTypes = { - "application/json" }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { @@ -2957,71 +2959,87 @@ public okhttp3.Call updateAnalysisTagsCall(@javax.annotation.Nonnull Integer ana } String[] localVarAuthNames = new String[] { "APIKey" }; - return localVarApiClient.buildCall(basePath, localVarPath, "PATCH", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") - private okhttp3.Call updateAnalysisTagsValidateBeforeCall(@javax.annotation.Nonnull Integer analysisId, @javax.annotation.Nonnull AnalysisUpdateTagsRequest analysisUpdateTagsRequest, final ApiCallback _callback) throws ApiException { + private okhttp3.Call v3GetAnalysisStringsValidateBeforeCall(@javax.annotation.Nonnull Long analysisId, @javax.annotation.Nullable Long page, @javax.annotation.Nullable Long pageSize, @javax.annotation.Nullable String search, @javax.annotation.Nullable String functionSearch, @javax.annotation.Nullable String orderBy, @javax.annotation.Nullable String sortOrder, final ApiCallback _callback) throws ApiException { // verify the required parameter 'analysisId' is set if (analysisId == null) { - throw new ApiException("Missing the required parameter 'analysisId' when calling updateAnalysisTags(Async)"); - } - - // verify the required parameter 'analysisUpdateTagsRequest' is set - if (analysisUpdateTagsRequest == null) { - throw new ApiException("Missing the required parameter 'analysisUpdateTagsRequest' when calling updateAnalysisTags(Async)"); + throw new ApiException("Missing the required parameter 'analysisId' when calling v3GetAnalysisStrings(Async)"); } - return updateAnalysisTagsCall(analysisId, analysisUpdateTagsRequest, _callback); + return v3GetAnalysisStringsCall(analysisId, page, pageSize, search, functionSearch, orderBy, sortOrder, _callback); } /** - * Update Analysis Tags - * Updates analysis tags. User must be the owner. - * @param analysisId (required) - * @param analysisUpdateTagsRequest (required) - * @return BaseResponseAnalysisUpdateTagsResponse + * List strings for an analysis. + * Returns the strings discovered in an analysis, combining function-level and analysis-level strings. Supports value/function-name search, sorting and pagination. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied + * @param analysisId Analysis ID (required) + * @param page Page number (1-indexed). (optional, default to 1) + * @param pageSize Number of results per page. (optional, default to 100) + * @param search Filter by string value (case-insensitive substring match). (optional) + * @param functionSearch Filter by function name (case-insensitive substring match). (optional) + * @param orderBy Field to order results by. (optional, default to value) + * @param sortOrder Sort direction. (optional, default to ASC) + * @return ListAnalysisStringsOutputBody * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details - - + + + + +
Response Details
Status Code Description Response Headers
200 Successful Response -
422 Invalid request parameters -
200 OK -
403 Forbidden -
404 Not Found -
422 Unprocessable Entity -
500 Internal Server Error -
*/ - public BaseResponseAnalysisUpdateTagsResponse updateAnalysisTags(@javax.annotation.Nonnull Integer analysisId, @javax.annotation.Nonnull AnalysisUpdateTagsRequest analysisUpdateTagsRequest) throws ApiException { - ApiResponse localVarResp = updateAnalysisTagsWithHttpInfo(analysisId, analysisUpdateTagsRequest); + public ListAnalysisStringsOutputBody v3GetAnalysisStrings(@javax.annotation.Nonnull Long analysisId, @javax.annotation.Nullable Long page, @javax.annotation.Nullable Long pageSize, @javax.annotation.Nullable String search, @javax.annotation.Nullable String functionSearch, @javax.annotation.Nullable String orderBy, @javax.annotation.Nullable String sortOrder) throws ApiException { + ApiResponse localVarResp = v3GetAnalysisStringsWithHttpInfo(analysisId, page, pageSize, search, functionSearch, orderBy, sortOrder); return localVarResp.getData(); } /** - * Update Analysis Tags - * Updates analysis tags. User must be the owner. - * @param analysisId (required) - * @param analysisUpdateTagsRequest (required) - * @return ApiResponse<BaseResponseAnalysisUpdateTagsResponse> + * List strings for an analysis. + * Returns the strings discovered in an analysis, combining function-level and analysis-level strings. Supports value/function-name search, sorting and pagination. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied + * @param analysisId Analysis ID (required) + * @param page Page number (1-indexed). (optional, default to 1) + * @param pageSize Number of results per page. (optional, default to 100) + * @param search Filter by string value (case-insensitive substring match). (optional) + * @param functionSearch Filter by function name (case-insensitive substring match). (optional) + * @param orderBy Field to order results by. (optional, default to value) + * @param sortOrder Sort direction. (optional, default to ASC) + * @return ApiResponse<ListAnalysisStringsOutputBody> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details - - + + + + +
Response Details
Status Code Description Response Headers
200 Successful Response -
422 Invalid request parameters -
200 OK -
403 Forbidden -
404 Not Found -
422 Unprocessable Entity -
500 Internal Server Error -
*/ - public ApiResponse updateAnalysisTagsWithHttpInfo(@javax.annotation.Nonnull Integer analysisId, @javax.annotation.Nonnull AnalysisUpdateTagsRequest analysisUpdateTagsRequest) throws ApiException { - okhttp3.Call localVarCall = updateAnalysisTagsValidateBeforeCall(analysisId, analysisUpdateTagsRequest, null); - Type localVarReturnType = new TypeToken(){}.getType(); + public ApiResponse v3GetAnalysisStringsWithHttpInfo(@javax.annotation.Nonnull Long analysisId, @javax.annotation.Nullable Long page, @javax.annotation.Nullable Long pageSize, @javax.annotation.Nullable String search, @javax.annotation.Nullable String functionSearch, @javax.annotation.Nullable String orderBy, @javax.annotation.Nullable String sortOrder) throws ApiException { + okhttp3.Call localVarCall = v3GetAnalysisStringsValidateBeforeCall(analysisId, page, pageSize, search, functionSearch, orderBy, sortOrder, null); + Type localVarReturnType = new TypeToken(){}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } /** - * Update Analysis Tags (asynchronously) - * Updates analysis tags. User must be the owner. - * @param analysisId (required) - * @param analysisUpdateTagsRequest (required) + * List strings for an analysis. (asynchronously) + * Returns the strings discovered in an analysis, combining function-level and analysis-level strings. Supports value/function-name search, sorting and pagination. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied + * @param analysisId Analysis ID (required) + * @param page Page number (1-indexed). (optional, default to 1) + * @param pageSize Number of results per page. (optional, default to 100) + * @param search Filter by string value (case-insensitive substring match). (optional) + * @param functionSearch Filter by function name (case-insensitive substring match). (optional) + * @param orderBy Field to order results by. (optional, default to value) + * @param sortOrder Sort direction. (optional, default to ASC) * @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 @@ -3029,23 +3047,23 @@ public ApiResponse updateAnalysisTagsWit - - + + + + +
Response Details
Status Code Description Response Headers
200 Successful Response -
422 Invalid request parameters -
200 OK -
403 Forbidden -
404 Not Found -
422 Unprocessable Entity -
500 Internal Server Error -
*/ - public okhttp3.Call updateAnalysisTagsAsync(@javax.annotation.Nonnull Integer analysisId, @javax.annotation.Nonnull AnalysisUpdateTagsRequest analysisUpdateTagsRequest, final ApiCallback _callback) throws ApiException { + public okhttp3.Call v3GetAnalysisStringsAsync(@javax.annotation.Nonnull Long analysisId, @javax.annotation.Nullable Long page, @javax.annotation.Nullable Long pageSize, @javax.annotation.Nullable String search, @javax.annotation.Nullable String functionSearch, @javax.annotation.Nullable String orderBy, @javax.annotation.Nullable String sortOrder, final ApiCallback _callback) throws ApiException { - okhttp3.Call localVarCall = updateAnalysisTagsValidateBeforeCall(analysisId, analysisUpdateTagsRequest, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); + okhttp3.Call localVarCall = v3GetAnalysisStringsValidateBeforeCall(analysisId, page, pageSize, search, functionSearch, orderBy, sortOrder, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } /** - * Build call for uploadFile - * @param uploadFileType (required) - * @param _file (required) - * @param packedPassword (optional) - * @param forceOverwrite (optional, default to false) + * Build call for v3GetAnalysisStringsStatus + * @param analysisId Analysis ID (required) * @param _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object @@ -3053,11 +3071,14 @@ public okhttp3.Call updateAnalysisTagsAsync(@javax.annotation.Nonnull Integer an - - + + + + +
Response Details
Status Code Description Response Headers
200 Successful Response -
422 Invalid request parameters -
200 OK -
403 Forbidden -
404 Not Found -
422 Unprocessable Entity -
500 Internal Server Error -
*/ - public okhttp3.Call uploadFileCall(@javax.annotation.Nonnull UploadFileType uploadFileType, @javax.annotation.Nonnull File _file, @javax.annotation.Nullable String packedPassword, @javax.annotation.Nullable Boolean forceOverwrite, final ApiCallback _callback) throws ApiException { + public okhttp3.Call v3GetAnalysisStringsStatusCall(@javax.annotation.Nonnull Long analysisId, final ApiCallback _callback) throws ApiException { String basePath = null; // Operation Servers String[] localBasePaths = new String[] { }; @@ -3074,7 +3095,8 @@ public okhttp3.Call uploadFileCall(@javax.annotation.Nonnull UploadFileType uplo Object localVarPostBody = null; // create path and map variables - String localVarPath = "/v2/upload"; + String localVarPath = "/v3/analyses/{analysis_id}/functions/strings/status" + .replace("{" + "analysis_id" + "}", localVarApiClient.escapeString(analysisId.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -3082,22 +3104,6 @@ public okhttp3.Call uploadFileCall(@javax.annotation.Nonnull UploadFileType uplo Map localVarCookieParams = new HashMap(); Map localVarFormParams = new HashMap(); - if (uploadFileType != null) { - localVarFormParams.put("upload_file_type", uploadFileType); - } - - if (_file != null) { - localVarFormParams.put("file", _file); - } - - if (forceOverwrite != null) { - localVarFormParams.put("force_overwrite", forceOverwrite); - } - - if (packedPassword != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("packed_password", packedPassword)); - } - final String[] localVarAccepts = { "application/json" }; @@ -3107,7 +3113,6 @@ public okhttp3.Call uploadFileCall(@javax.annotation.Nonnull UploadFileType uplo } final String[] localVarContentTypes = { - "multipart/form-data" }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { @@ -3115,77 +3120,69 @@ public okhttp3.Call uploadFileCall(@javax.annotation.Nonnull UploadFileType uplo } String[] localVarAuthNames = new String[] { "APIKey" }; - return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") - private okhttp3.Call uploadFileValidateBeforeCall(@javax.annotation.Nonnull UploadFileType uploadFileType, @javax.annotation.Nonnull File _file, @javax.annotation.Nullable String packedPassword, @javax.annotation.Nullable Boolean forceOverwrite, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'uploadFileType' is set - if (uploadFileType == null) { - throw new ApiException("Missing the required parameter 'uploadFileType' when calling uploadFile(Async)"); - } - - // verify the required parameter '_file' is set - if (_file == null) { - throw new ApiException("Missing the required parameter '_file' when calling uploadFile(Async)"); + private okhttp3.Call v3GetAnalysisStringsStatusValidateBeforeCall(@javax.annotation.Nonnull Long analysisId, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'analysisId' is set + if (analysisId == null) { + throw new ApiException("Missing the required parameter 'analysisId' when calling v3GetAnalysisStringsStatus(Async)"); } - return uploadFileCall(uploadFileType, _file, packedPassword, forceOverwrite, _callback); + return v3GetAnalysisStringsStatusCall(analysisId, _callback); } /** - * Upload File - * - * @param uploadFileType (required) - * @param _file (required) - * @param packedPassword (optional) - * @param forceOverwrite (optional, default to false) - * @return BaseResponseUploadResponse + * Get the string-extraction status for an analysis. + * Returns the status of the string-extraction task for the binary backing the analysis. One of UNINITIALISED, PENDING, RUNNING, COMPLETED, FAILED. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied + * @param analysisId Analysis ID (required) + * @return GetAnalysisStringsStatusOutputBody * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details - - + + + + +
Response Details
Status Code Description Response Headers
200 Successful Response -
422 Invalid request parameters -
200 OK -
403 Forbidden -
404 Not Found -
422 Unprocessable Entity -
500 Internal Server Error -
*/ - public BaseResponseUploadResponse uploadFile(@javax.annotation.Nonnull UploadFileType uploadFileType, @javax.annotation.Nonnull File _file, @javax.annotation.Nullable String packedPassword, @javax.annotation.Nullable Boolean forceOverwrite) throws ApiException { - ApiResponse localVarResp = uploadFileWithHttpInfo(uploadFileType, _file, packedPassword, forceOverwrite); + public GetAnalysisStringsStatusOutputBody v3GetAnalysisStringsStatus(@javax.annotation.Nonnull Long analysisId) throws ApiException { + ApiResponse localVarResp = v3GetAnalysisStringsStatusWithHttpInfo(analysisId); return localVarResp.getData(); } /** - * Upload File - * - * @param uploadFileType (required) - * @param _file (required) - * @param packedPassword (optional) - * @param forceOverwrite (optional, default to false) - * @return ApiResponse<BaseResponseUploadResponse> + * Get the string-extraction status for an analysis. + * Returns the status of the string-extraction task for the binary backing the analysis. One of UNINITIALISED, PENDING, RUNNING, COMPLETED, FAILED. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied + * @param analysisId Analysis ID (required) + * @return ApiResponse<GetAnalysisStringsStatusOutputBody> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details - - + + + + +
Response Details
Status Code Description Response Headers
200 Successful Response -
422 Invalid request parameters -
200 OK -
403 Forbidden -
404 Not Found -
422 Unprocessable Entity -
500 Internal Server Error -
*/ - public ApiResponse uploadFileWithHttpInfo(@javax.annotation.Nonnull UploadFileType uploadFileType, @javax.annotation.Nonnull File _file, @javax.annotation.Nullable String packedPassword, @javax.annotation.Nullable Boolean forceOverwrite) throws ApiException { - okhttp3.Call localVarCall = uploadFileValidateBeforeCall(uploadFileType, _file, packedPassword, forceOverwrite, null); - Type localVarReturnType = new TypeToken(){}.getType(); + public ApiResponse v3GetAnalysisStringsStatusWithHttpInfo(@javax.annotation.Nonnull Long analysisId) throws ApiException { + okhttp3.Call localVarCall = v3GetAnalysisStringsStatusValidateBeforeCall(analysisId, null); + Type localVarReturnType = new TypeToken(){}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } /** - * Upload File (asynchronously) - * - * @param uploadFileType (required) - * @param _file (required) - * @param packedPassword (optional) - * @param forceOverwrite (optional, default to false) + * Get the string-extraction status for an analysis. (asynchronously) + * Returns the status of the string-extraction task for the binary backing the analysis. One of UNINITIALISED, PENDING, RUNNING, COMPLETED, FAILED. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied + * @param analysisId Analysis ID (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 @@ -3193,14 +3190,17 @@ public ApiResponse uploadFileWithHttpInfo(@javax.ann - - + + + + +
Response Details
Status Code Description Response Headers
200 Successful Response -
422 Invalid request parameters -
200 OK -
403 Forbidden -
404 Not Found -
422 Unprocessable Entity -
500 Internal Server Error -
*/ - public okhttp3.Call uploadFileAsync(@javax.annotation.Nonnull UploadFileType uploadFileType, @javax.annotation.Nonnull File _file, @javax.annotation.Nullable String packedPassword, @javax.annotation.Nullable Boolean forceOverwrite, final ApiCallback _callback) throws ApiException { + public okhttp3.Call v3GetAnalysisStringsStatusAsync(@javax.annotation.Nonnull Long analysisId, final ApiCallback _callback) throws ApiException { - okhttp3.Call localVarCall = uploadFileValidateBeforeCall(uploadFileType, _file, packedPassword, forceOverwrite, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); + okhttp3.Call localVarCall = v3GetAnalysisStringsStatusValidateBeforeCall(analysisId, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } diff --git a/src/main/java/ai/reveng/api/CollectionsApi.java b/src/main/java/ai/reveng/api/CollectionsApi.java index cebbb94..affcb53 100644 --- a/src/main/java/ai/reveng/api/CollectionsApi.java +++ b/src/main/java/ai/reveng/api/CollectionsApi.java @@ -26,6 +26,7 @@ import java.io.IOException; +import ai.reveng.model.APIError; import ai.reveng.model.AppApiRestV2CollectionsEnumsOrderBy; import ai.reveng.model.BaseResponse; import ai.reveng.model.BaseResponseBool; @@ -37,6 +38,8 @@ import ai.reveng.model.CollectionCreateRequest; import ai.reveng.model.CollectionTagsUpdateRequest; import ai.reveng.model.CollectionUpdateRequest; +import ai.reveng.model.CreateCollectionInputBody; +import ai.reveng.model.CreateCollectionOutputBody; import ai.reveng.model.Filters; import ai.reveng.model.Order; @@ -214,6 +217,145 @@ public okhttp3.Call createCollectionAsync(@javax.annotation.Nonnull CollectionCr localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } + /** + * Build call for createCollection_0 + * @param createCollectionInputBody (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
201 Created -
404 Not Found -
422 Unprocessable Entity -
500 Internal Server Error -
+ */ + public okhttp3.Call createCollection_0Call(@javax.annotation.Nonnull CreateCollectionInputBody createCollectionInputBody, 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 = createCollectionInputBody; + + // create path and map variables + String localVarPath = "/v3/collections"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "APIKey" }; + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call createCollection_0ValidateBeforeCall(@javax.annotation.Nonnull CreateCollectionInputBody createCollectionInputBody, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'createCollectionInputBody' is set + if (createCollectionInputBody == null) { + throw new ApiException("Missing the required parameter 'createCollectionInputBody' when calling createCollection_0(Async)"); + } + + return createCollection_0Call(createCollectionInputBody, _callback); + + } + + /** + * Create a collection. + * Creates a new collection, optionally tagging it and linking binary IDs to it. Tags and binaries are returned in the response only when they were supplied in the request. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `422` [`VALIDATION_FAILED`](/errors/VALIDATION_FAILED) — Validation Failed + * @param createCollectionInputBody (required) + * @return CreateCollectionOutputBody + * @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
201 Created -
404 Not Found -
422 Unprocessable Entity -
500 Internal Server Error -
+ */ + public CreateCollectionOutputBody createCollection_0(@javax.annotation.Nonnull CreateCollectionInputBody createCollectionInputBody) throws ApiException { + ApiResponse localVarResp = createCollection_0WithHttpInfo(createCollectionInputBody); + return localVarResp.getData(); + } + + /** + * Create a collection. + * Creates a new collection, optionally tagging it and linking binary IDs to it. Tags and binaries are returned in the response only when they were supplied in the request. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `422` [`VALIDATION_FAILED`](/errors/VALIDATION_FAILED) — Validation Failed + * @param createCollectionInputBody (required) + * @return ApiResponse<CreateCollectionOutputBody> + * @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
201 Created -
404 Not Found -
422 Unprocessable Entity -
500 Internal Server Error -
+ */ + public ApiResponse createCollection_0WithHttpInfo(@javax.annotation.Nonnull CreateCollectionInputBody createCollectionInputBody) throws ApiException { + okhttp3.Call localVarCall = createCollection_0ValidateBeforeCall(createCollectionInputBody, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Create a collection. (asynchronously) + * Creates a new collection, optionally tagging it and linking binary IDs to it. Tags and binaries are returned in the response only when they were supplied in the request. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `422` [`VALIDATION_FAILED`](/errors/VALIDATION_FAILED) — Validation Failed + * @param createCollectionInputBody (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
201 Created -
404 Not Found -
422 Unprocessable Entity -
500 Internal Server Error -
+ */ + public okhttp3.Call createCollection_0Async(@javax.annotation.Nonnull CreateCollectionInputBody createCollectionInputBody, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = createCollection_0ValidateBeforeCall(createCollectionInputBody, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } /** * Build call for deleteCollection * @param collectionId (required) diff --git a/src/main/java/ai/reveng/invoker/ApiClient.java b/src/main/java/ai/reveng/invoker/ApiClient.java index 2b9649b..4d98f61 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.89.0/java"); + setUserAgent("OpenAPI-Generator/3.91.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 3339afe..7131e44 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.89.0"; + public static final String VERSION = "3.91.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 810a2d2..8d68bf1 100644 --- a/src/main/java/ai/reveng/invoker/JSON.java +++ b/src/main/java/ai/reveng/invoker/JSON.java @@ -214,6 +214,7 @@ private static Class getClassByDiscriminator(Map classByDiscriminatorValue, Stri gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.BatchRenameItem.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.BatchRenameOutputBody.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.BinariesRelatedStatusResponse.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.Binary.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.BinaryAdditionalDetailsDataResponse.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.BinaryAdditionalResponse.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.BinaryConfig.CustomTypeAdapterFactory()); @@ -254,6 +255,8 @@ private static Class getClassByDiscriminator(Map classByDiscriminatorValue, Stri gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.ConversationWithEvents.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.CreateAIDecompOutputBody.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.CreateCheckoutSessionInputBody.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.CreateCollectionInputBody.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.CreateCollectionOutputBody.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.CreateConversationRequest.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.CreatePortalSessionInputBody.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.Created.CustomTypeAdapterFactory()); diff --git a/src/main/java/ai/reveng/model/Binary.java b/src/main/java/ai/reveng/model/Binary.java new file mode 100644 index 0000000..9f53af9 --- /dev/null +++ b/src/main/java/ai/reveng/model/Binary.java @@ -0,0 +1,454 @@ +/* + * 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; + +/** + * Binary + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class Binary { + public static final String SERIALIZED_NAME_ANALYSIS_ID = "analysis_id"; + @SerializedName(SERIALIZED_NAME_ANALYSIS_ID) + @javax.annotation.Nonnull + private Long analysisId; + + public static final String SERIALIZED_NAME_BINARY_ID = "binary_id"; + @SerializedName(SERIALIZED_NAME_BINARY_ID) + @javax.annotation.Nonnull + private Long binaryId; + + public static final String SERIALIZED_NAME_BINARY_NAME = "binary_name"; + @SerializedName(SERIALIZED_NAME_BINARY_NAME) + @javax.annotation.Nonnull + private String binaryName; + + public static final String SERIALIZED_NAME_CREATED_AT = "created_at"; + @SerializedName(SERIALIZED_NAME_CREATED_AT) + @javax.annotation.Nonnull + private OffsetDateTime createdAt; + + public static final String SERIALIZED_NAME_IS_SYSTEM_ANALYSIS = "is_system_analysis"; + @SerializedName(SERIALIZED_NAME_IS_SYSTEM_ANALYSIS) + @javax.annotation.Nonnull + private Boolean isSystemAnalysis; + + public static final String SERIALIZED_NAME_OWNER_ID = "owner_id"; + @SerializedName(SERIALIZED_NAME_OWNER_ID) + @javax.annotation.Nonnull + private Long ownerId; + + public static final String SERIALIZED_NAME_SHA256_HASH = "sha_256_hash"; + @SerializedName(SERIALIZED_NAME_SHA256_HASH) + @javax.annotation.Nonnull + private String sha256Hash; + + public Binary() { + } + + public Binary analysisId(@javax.annotation.Nonnull Long analysisId) { + this.analysisId = analysisId; + return this; + } + + /** + * Get analysisId + * @return analysisId + */ + @javax.annotation.Nonnull + public Long getAnalysisId() { + return analysisId; + } + + public void setAnalysisId(@javax.annotation.Nonnull Long analysisId) { + this.analysisId = analysisId; + } + + + public Binary binaryId(@javax.annotation.Nonnull Long binaryId) { + this.binaryId = binaryId; + return this; + } + + /** + * Get binaryId + * @return binaryId + */ + @javax.annotation.Nonnull + public Long getBinaryId() { + return binaryId; + } + + public void setBinaryId(@javax.annotation.Nonnull Long binaryId) { + this.binaryId = binaryId; + } + + + public Binary binaryName(@javax.annotation.Nonnull String binaryName) { + this.binaryName = binaryName; + return this; + } + + /** + * Get binaryName + * @return binaryName + */ + @javax.annotation.Nonnull + public String getBinaryName() { + return binaryName; + } + + public void setBinaryName(@javax.annotation.Nonnull String binaryName) { + this.binaryName = binaryName; + } + + + public Binary 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 Binary isSystemAnalysis(@javax.annotation.Nonnull Boolean isSystemAnalysis) { + this.isSystemAnalysis = isSystemAnalysis; + return this; + } + + /** + * Get isSystemAnalysis + * @return isSystemAnalysis + */ + @javax.annotation.Nonnull + public Boolean getIsSystemAnalysis() { + return isSystemAnalysis; + } + + public void setIsSystemAnalysis(@javax.annotation.Nonnull Boolean isSystemAnalysis) { + this.isSystemAnalysis = isSystemAnalysis; + } + + + public Binary ownerId(@javax.annotation.Nonnull Long ownerId) { + this.ownerId = ownerId; + return this; + } + + /** + * Get ownerId + * @return ownerId + */ + @javax.annotation.Nonnull + public Long getOwnerId() { + return ownerId; + } + + public void setOwnerId(@javax.annotation.Nonnull Long ownerId) { + this.ownerId = ownerId; + } + + + public Binary sha256Hash(@javax.annotation.Nonnull String sha256Hash) { + this.sha256Hash = sha256Hash; + return this; + } + + /** + * Get sha256Hash + * @return sha256Hash + */ + @javax.annotation.Nonnull + public String getSha256Hash() { + return sha256Hash; + } + + public void setSha256Hash(@javax.annotation.Nonnull String sha256Hash) { + this.sha256Hash = sha256Hash; + } + + /** + * 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 Binary instance itself + */ + public Binary 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; + } + Binary binary = (Binary) o; + return Objects.equals(this.analysisId, binary.analysisId) && + Objects.equals(this.binaryId, binary.binaryId) && + Objects.equals(this.binaryName, binary.binaryName) && + Objects.equals(this.createdAt, binary.createdAt) && + Objects.equals(this.isSystemAnalysis, binary.isSystemAnalysis) && + Objects.equals(this.ownerId, binary.ownerId) && + Objects.equals(this.sha256Hash, binary.sha256Hash)&& + Objects.equals(this.additionalProperties, binary.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(analysisId, binaryId, binaryName, createdAt, isSystemAnalysis, ownerId, sha256Hash, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Binary {\n"); + sb.append(" analysisId: ").append(toIndentedString(analysisId)).append("\n"); + sb.append(" binaryId: ").append(toIndentedString(binaryId)).append("\n"); + sb.append(" binaryName: ").append(toIndentedString(binaryName)).append("\n"); + sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); + sb.append(" isSystemAnalysis: ").append(toIndentedString(isSystemAnalysis)).append("\n"); + sb.append(" ownerId: ").append(toIndentedString(ownerId)).append("\n"); + sb.append(" sha256Hash: ").append(toIndentedString(sha256Hash)).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("analysis_id", "binary_id", "binary_name", "created_at", "is_system_analysis", "owner_id", "sha_256_hash")); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(Arrays.asList("analysis_id", "binary_id", "binary_name", "created_at", "is_system_analysis", "owner_id", "sha_256_hash")); + } + + /** + * 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 Binary + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!Binary.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format(Locale.ROOT, "The required field(s) %s in Binary is not found in the empty JSON string", Binary.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : Binary.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format(Locale.ROOT, "The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("binary_name").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(Locale.ROOT, "Expected the field `binary_name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("binary_name").toString())); + } + if (!jsonObj.get("sha_256_hash").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(Locale.ROOT, "Expected the field `sha_256_hash` to be a primitive type in the JSON string but got `%s`", jsonObj.get("sha_256_hash").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!Binary.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'Binary' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(Binary.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, Binary 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 Binary read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + Binary 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 Binary given an JSON string + * + * @param jsonString JSON string + * @return An instance of Binary + * @throws IOException if the JSON string is invalid with respect to Binary + */ + public static Binary fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, Binary.class); + } + + /** + * Convert an instance of Binary to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/ai/reveng/model/CreateCollectionInputBody.java b/src/main/java/ai/reveng/model/CreateCollectionInputBody.java new file mode 100644 index 0000000..ca3aee5 --- /dev/null +++ b/src/main/java/ai/reveng/model/CreateCollectionInputBody.java @@ -0,0 +1,529 @@ +/* + * 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.ArrayList; +import java.util.Arrays; +import java.util.List; +import org.openapitools.jackson.nullable.JsonNullable; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; +import java.util.Locale; + +import ai.reveng.invoker.JSON; + +/** + * CreateCollectionInputBody + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class CreateCollectionInputBody { + public static final String SERIALIZED_NAME_BINARIES = "binaries"; + @SerializedName(SERIALIZED_NAME_BINARIES) + @javax.annotation.Nullable + private List binaries; + + public static final String SERIALIZED_NAME_COLLECTION_NAME = "collection_name"; + @SerializedName(SERIALIZED_NAME_COLLECTION_NAME) + @javax.annotation.Nonnull + private String collectionName; + + /** + * Visibility scope. + */ + @JsonAdapter(CollectionScopeEnum.Adapter.class) + public enum CollectionScopeEnum { + PRIVATE("PRIVATE"), + + PUBLIC("PUBLIC"), + + PROTECTED("PROTECTED"), + + TEAM("TEAM"), + + UNKNOWN_DEFAULT_OPEN_API("unknown_default_open_api"); + + private String value; + + CollectionScopeEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static CollectionScopeEnum fromValue(String value) { + for (CollectionScopeEnum b : CollectionScopeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + return UNKNOWN_DEFAULT_OPEN_API; + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final CollectionScopeEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public CollectionScopeEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return CollectionScopeEnum.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + CollectionScopeEnum.fromValue(value); + } + } + + public static final String SERIALIZED_NAME_COLLECTION_SCOPE = "collection_scope"; + @SerializedName(SERIALIZED_NAME_COLLECTION_SCOPE) + @javax.annotation.Nonnull + private CollectionScopeEnum collectionScope = CollectionScopeEnum.PRIVATE; + + 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_TAGS = "tags"; + @SerializedName(SERIALIZED_NAME_TAGS) + @javax.annotation.Nullable + private List tags; + + public CreateCollectionInputBody() { + } + + public CreateCollectionInputBody binaries(@javax.annotation.Nullable List binaries) { + this.binaries = binaries; + return this; + } + + public CreateCollectionInputBody addBinariesItem(Long binariesItem) { + if (this.binaries == null) { + this.binaries = new ArrayList<>(); + } + this.binaries.add(binariesItem); + return this; + } + + /** + * Optional binary IDs to link to the collection. + * @return binaries + */ + @javax.annotation.Nullable + public List getBinaries() { + return binaries; + } + + public void setBinaries(@javax.annotation.Nullable List binaries) { + this.binaries = binaries; + } + + + public CreateCollectionInputBody collectionName(@javax.annotation.Nonnull String collectionName) { + this.collectionName = collectionName; + return this; + } + + /** + * Collection name. + * @return collectionName + */ + @javax.annotation.Nonnull + public String getCollectionName() { + return collectionName; + } + + public void setCollectionName(@javax.annotation.Nonnull String collectionName) { + this.collectionName = collectionName; + } + + + public CreateCollectionInputBody collectionScope(@javax.annotation.Nonnull CollectionScopeEnum collectionScope) { + this.collectionScope = collectionScope; + return this; + } + + /** + * Visibility scope. + * @return collectionScope + */ + @javax.annotation.Nonnull + public CollectionScopeEnum getCollectionScope() { + return collectionScope; + } + + public void setCollectionScope(@javax.annotation.Nonnull CollectionScopeEnum collectionScope) { + this.collectionScope = collectionScope; + } + + + public CreateCollectionInputBody description(@javax.annotation.Nonnull String description) { + this.description = description; + return this; + } + + /** + * Collection description. + * @return description + */ + @javax.annotation.Nonnull + public String getDescription() { + return description; + } + + public void setDescription(@javax.annotation.Nonnull String description) { + this.description = description; + } + + + public CreateCollectionInputBody modelId(@javax.annotation.Nonnull Long modelId) { + this.modelId = modelId; + return this; + } + + /** + * Model ID the collection is associated with. + * minimum: 1 + * @return modelId + */ + @javax.annotation.Nonnull + public Long getModelId() { + return modelId; + } + + public void setModelId(@javax.annotation.Nonnull Long modelId) { + this.modelId = modelId; + } + + + public CreateCollectionInputBody tags(@javax.annotation.Nullable List tags) { + this.tags = tags; + return this; + } + + public CreateCollectionInputBody addTagsItem(String tagsItem) { + if (this.tags == null) { + this.tags = new ArrayList<>(); + } + this.tags.add(tagsItem); + return this; + } + + /** + * Optional tags to attach to the collection. + * @return tags + */ + @javax.annotation.Nullable + public List getTags() { + return tags; + } + + public void setTags(@javax.annotation.Nullable List tags) { + this.tags = tags; + } + + /** + * 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 CreateCollectionInputBody instance itself + */ + public CreateCollectionInputBody 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; + } + CreateCollectionInputBody createCollectionInputBody = (CreateCollectionInputBody) o; + return Objects.equals(this.binaries, createCollectionInputBody.binaries) && + Objects.equals(this.collectionName, createCollectionInputBody.collectionName) && + Objects.equals(this.collectionScope, createCollectionInputBody.collectionScope) && + Objects.equals(this.description, createCollectionInputBody.description) && + Objects.equals(this.modelId, createCollectionInputBody.modelId) && + Objects.equals(this.tags, createCollectionInputBody.tags)&& + Objects.equals(this.additionalProperties, createCollectionInputBody.additionalProperties); + } + + private static boolean equalsNullable(JsonNullable a, JsonNullable b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + + @Override + public int hashCode() { + return Objects.hash(binaries, collectionName, collectionScope, description, modelId, tags, additionalProperties); + } + + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CreateCollectionInputBody {\n"); + sb.append(" binaries: ").append(toIndentedString(binaries)).append("\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(" modelId: ").append(toIndentedString(modelId)).append("\n"); + sb.append(" tags: ").append(toIndentedString(tags)).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("binaries", "collection_name", "collection_scope", "description", "model_id", "tags")); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(Arrays.asList("collection_name", "collection_scope", "description", "model_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 CreateCollectionInputBody + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!CreateCollectionInputBody.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format(Locale.ROOT, "The required field(s) %s in CreateCollectionInputBody is not found in the empty JSON string", CreateCollectionInputBody.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : CreateCollectionInputBody.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format(Locale.ROOT, "The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // ensure the optional json data is an array if present + if (jsonObj.get("binaries") != null && !jsonObj.get("binaries").isJsonNull() && !jsonObj.get("binaries").isJsonArray()) { + throw new IllegalArgumentException(String.format(Locale.ROOT, "Expected the field `binaries` to be an array in the JSON string but got `%s`", jsonObj.get("binaries").toString())); + } + 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())); + } + // validate the required field `collection_scope` + CollectionScopeEnum.validateJsonElement(jsonObj.get("collection_scope")); + 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())); + } + // ensure the optional json data is an array if present + if (jsonObj.get("tags") != null && !jsonObj.get("tags").isJsonNull() && !jsonObj.get("tags").isJsonArray()) { + throw new IllegalArgumentException(String.format(Locale.ROOT, "Expected the field `tags` to be an array in the JSON string but got `%s`", jsonObj.get("tags").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!CreateCollectionInputBody.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'CreateCollectionInputBody' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(CreateCollectionInputBody.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, CreateCollectionInputBody 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 CreateCollectionInputBody read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + CreateCollectionInputBody 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 CreateCollectionInputBody given an JSON string + * + * @param jsonString JSON string + * @return An instance of CreateCollectionInputBody + * @throws IOException if the JSON string is invalid with respect to CreateCollectionInputBody + */ + public static CreateCollectionInputBody fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, CreateCollectionInputBody.class); + } + + /** + * Convert an instance of CreateCollectionInputBody to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/ai/reveng/model/CreateCollectionOutputBody.java b/src/main/java/ai/reveng/model/CreateCollectionOutputBody.java new file mode 100644 index 0000000..1ab32a2 --- /dev/null +++ b/src/main/java/ai/reveng/model/CreateCollectionOutputBody.java @@ -0,0 +1,600 @@ +/* + * 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.Binary; +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.ArrayList; +import java.util.Arrays; +import java.util.List; +import org.openapitools.jackson.nullable.JsonNullable; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; +import java.util.Locale; + +import ai.reveng.invoker.JSON; + +/** + * CreateCollectionOutputBody + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class CreateCollectionOutputBody { + public static final String SERIALIZED_NAME_BINARIES = "binaries"; + @SerializedName(SERIALIZED_NAME_BINARIES) + @javax.annotation.Nullable + private List binaries; + + 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_TAGS = "tags"; + @SerializedName(SERIALIZED_NAME_TAGS) + @javax.annotation.Nullable + private List tags; + + 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 CreateCollectionOutputBody() { + } + + public CreateCollectionOutputBody binaries(@javax.annotation.Nullable List binaries) { + this.binaries = binaries; + return this; + } + + public CreateCollectionOutputBody addBinariesItem(Binary binariesItem) { + if (this.binaries == null) { + this.binaries = new ArrayList<>(); + } + this.binaries.add(binariesItem); + return this; + } + + /** + * Get binaries + * @return binaries + */ + @javax.annotation.Nullable + public List getBinaries() { + return binaries; + } + + public void setBinaries(@javax.annotation.Nullable List binaries) { + this.binaries = binaries; + } + + + public CreateCollectionOutputBody 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 CreateCollectionOutputBody 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 CreateCollectionOutputBody 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 CreateCollectionOutputBody 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 CreateCollectionOutputBody 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 CreateCollectionOutputBody 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 CreateCollectionOutputBody tags(@javax.annotation.Nullable List tags) { + this.tags = tags; + return this; + } + + public CreateCollectionOutputBody addTagsItem(String tagsItem) { + if (this.tags == null) { + this.tags = new ArrayList<>(); + } + this.tags.add(tagsItem); + return this; + } + + /** + * Get tags + * @return tags + */ + @javax.annotation.Nullable + public List getTags() { + return tags; + } + + public void setTags(@javax.annotation.Nullable List tags) { + this.tags = tags; + } + + + public CreateCollectionOutputBody 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 CreateCollectionOutputBody 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 CreateCollectionOutputBody 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 CreateCollectionOutputBody instance itself + */ + public CreateCollectionOutputBody 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; + } + CreateCollectionOutputBody createCollectionOutputBody = (CreateCollectionOutputBody) o; + return Objects.equals(this.binaries, createCollectionOutputBody.binaries) && + Objects.equals(this.collectionId, createCollectionOutputBody.collectionId) && + Objects.equals(this.collectionName, createCollectionOutputBody.collectionName) && + Objects.equals(this.collectionScope, createCollectionOutputBody.collectionScope) && + Objects.equals(this.createdAt, createCollectionOutputBody.createdAt) && + Objects.equals(this.description, createCollectionOutputBody.description) && + Objects.equals(this.modelId, createCollectionOutputBody.modelId) && + Objects.equals(this.tags, createCollectionOutputBody.tags) && + Objects.equals(this.teamId, createCollectionOutputBody.teamId) && + Objects.equals(this.updatedAt, createCollectionOutputBody.updatedAt) && + Objects.equals(this.userId, createCollectionOutputBody.userId)&& + Objects.equals(this.additionalProperties, createCollectionOutputBody.additionalProperties); + } + + private static boolean equalsNullable(JsonNullable a, JsonNullable b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + + @Override + public int hashCode() { + return Objects.hash(binaries, collectionId, collectionName, collectionScope, createdAt, description, modelId, tags, teamId, updatedAt, userId, additionalProperties); + } + + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CreateCollectionOutputBody {\n"); + sb.append(" binaries: ").append(toIndentedString(binaries)).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(" tags: ").append(toIndentedString(tags)).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("binaries", "collection_id", "collection_name", "collection_scope", "created_at", "description", "model_id", "tags", "team_id", "updated_at", "user_id")); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(Arrays.asList("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 CreateCollectionOutputBody + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!CreateCollectionOutputBody.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format(Locale.ROOT, "The required field(s) %s in CreateCollectionOutputBody is not found in the empty JSON string", CreateCollectionOutputBody.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : CreateCollectionOutputBody.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format(Locale.ROOT, "The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // ensure the optional json data is an array if present + if (jsonObj.get("binaries") != null && !jsonObj.get("binaries").isJsonNull() && !jsonObj.get("binaries").isJsonArray()) { + throw new IllegalArgumentException(String.format(Locale.ROOT, "Expected the field `binaries` to be an array in the JSON string but got `%s`", jsonObj.get("binaries").toString())); + } + 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())); + } + // ensure the optional json data is an array if present + if (jsonObj.get("tags") != null && !jsonObj.get("tags").isJsonNull() && !jsonObj.get("tags").isJsonArray()) { + throw new IllegalArgumentException(String.format(Locale.ROOT, "Expected the field `tags` to be an array in the JSON string but got `%s`", jsonObj.get("tags").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!CreateCollectionOutputBody.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'CreateCollectionOutputBody' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(CreateCollectionOutputBody.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, CreateCollectionOutputBody 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 CreateCollectionOutputBody read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + CreateCollectionOutputBody 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 CreateCollectionOutputBody given an JSON string + * + * @param jsonString JSON string + * @return An instance of CreateCollectionOutputBody + * @throws IOException if the JSON string is invalid with respect to CreateCollectionOutputBody + */ + public static CreateCollectionOutputBody fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, CreateCollectionOutputBody.class); + } + + /** + * Convert an instance of CreateCollectionOutputBody to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} +