diff --git a/.sdk-version b/.sdk-version index ceece8f..4bccaba 100644 --- a/.sdk-version +++ b/.sdk-version @@ -1 +1 @@ -v3.86.8 +v3.87.0 diff --git a/README.md b/README.md index 967df3d..05735c4 100644 --- a/README.md +++ b/README.md @@ -16,7 +16,7 @@ Add this dependency to your project's POM: ai.reveng sdk - 3.86.8 + 3.87.0 compile ``` @@ -31,7 +31,7 @@ repositories { } dependencies { - implementation "ai.reveng:sdk:3.86.8" + implementation "ai.reveng:sdk:3.87.0" } ``` @@ -95,6 +95,7 @@ Class | Method | HTTP request | Description *AnalysesCoreApi* | [**createAnalysis**](docs/AnalysesCoreApi.md#createAnalysis) | **POST** /v2/analyses | Create Analysis *AnalysesCoreApi* | [**deleteAnalysis**](docs/AnalysesCoreApi.md#deleteAnalysis) | **DELETE** /v2/analyses/{analysis_id} | Delete Analysis *AnalysesCoreApi* | [**getAnalysisBasicInfo**](docs/AnalysesCoreApi.md#getAnalysisBasicInfo) | **GET** /v2/analyses/{analysis_id}/basic | Gets basic analysis information +*AnalysesCoreApi* | [**getAnalysisBasicInfo_0**](docs/AnalysesCoreApi.md#getAnalysisBasicInfo_0) | **GET** /v3/analyses/{analysis_id}/basic | Get basic analysis information *AnalysesCoreApi* | [**getAnalysisBytes**](docs/AnalysesCoreApi.md#getAnalysisBytes) | **GET** /v3/analyses/{analysis_id}/bytes | Get the bytes of a binary *AnalysesCoreApi* | [**getAnalysisFunctionMap**](docs/AnalysesCoreApi.md#getAnalysisFunctionMap) | **GET** /v2/analyses/{analysis_id}/func_maps | Get Analysis Function Map *AnalysesCoreApi* | [**getAnalysisLogs**](docs/AnalysesCoreApi.md#getAnalysisLogs) | **GET** /v2/analyses/{analysis_id}/logs | Gets the logs of an analysis @@ -124,13 +125,13 @@ Class | Method | HTTP request | Description *BinariesApi* | [**downloadZippedBinary**](docs/BinariesApi.md#downloadZippedBinary) | **GET** /v2/binaries/{binary_id}/download-zipped | Downloads a zipped binary with password protection *BinariesApi* | [**getBinaryAdditionalDetails**](docs/BinariesApi.md#getBinaryAdditionalDetails) | **GET** /v2/binaries/{binary_id}/additional-details | Gets the additional details of a binary *BinariesApi* | [**getBinaryAdditionalDetailsStatus**](docs/BinariesApi.md#getBinaryAdditionalDetailsStatus) | **GET** /v2/binaries/{binary_id}/additional-details/status | Gets the status of the additional details task for a binary +*BinariesApi* | [**getBinaryAdditionalDetailsStatus_0**](docs/BinariesApi.md#getBinaryAdditionalDetailsStatus_0) | **GET** /v3/binaries/{binary_id}/additional-details/status | Get the additional-details extraction status for a binary. +*BinariesApi* | [**getBinaryAdditionalDetails_0**](docs/BinariesApi.md#getBinaryAdditionalDetails_0) | **GET** /v3/binaries/{binary_id}/additional-details | Get additional details for a binary. *BinariesApi* | [**getBinaryDetails**](docs/BinariesApi.md#getBinaryDetails) | **GET** /v2/binaries/{binary_id}/details | Gets the details of a binary *BinariesApi* | [**getBinaryDieInfo**](docs/BinariesApi.md#getBinaryDieInfo) | **GET** /v2/binaries/{binary_id}/die-info | Gets the die info of a binary *BinariesApi* | [**getBinaryExternals**](docs/BinariesApi.md#getBinaryExternals) | **GET** /v2/binaries/{binary_id}/externals | Gets the external details of a binary *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. -*BinariesCoreApi* | [**getBinaryAdditionalDetails**](docs/BinariesCoreApi.md#getBinaryAdditionalDetails) | **GET** /v3/binaries/{binary_id}/additional-details | Get additional details for a binary. -*BinariesCoreApi* | [**getBinaryAdditionalDetailsStatus**](docs/BinariesCoreApi.md#getBinaryAdditionalDetailsStatus) | **GET** /v3/binaries/{binary_id}/additional-details/status | Get the additional-details extraction status for a binary. *CollectionsApi* | [**createCollection**](docs/CollectionsApi.md#createCollection) | **POST** /v2/collections | Creates new collection information *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 @@ -227,6 +228,7 @@ Class | Method | HTTP request | Description - [AiDecompilationTaskStatus](docs/AiDecompilationTaskStatus.md) - [AiUnstripRequest](docs/AiUnstripRequest.md) - [AnalysisAccessInfo](docs/AnalysisAccessInfo.md) + - [AnalysisBasicInfoOutputBody](docs/AnalysisBasicInfoOutputBody.md) - [AnalysisBulkAddTagsRequest](docs/AnalysisBulkAddTagsRequest.md) - [AnalysisBulkAddTagsResponse](docs/AnalysisBulkAddTagsResponse.md) - [AnalysisBulkAddTagsResponseItem](docs/AnalysisBulkAddTagsResponseItem.md) @@ -379,7 +381,9 @@ Class | Method | HTTP request | Description - [ConversationContext](docs/ConversationContext.md) - [ConversationWithEvents](docs/ConversationWithEvents.md) - [CreateAIDecompOutputBody](docs/CreateAIDecompOutputBody.md) + - [CreateCheckoutSessionInputBody](docs/CreateCheckoutSessionInputBody.md) - [CreateConversationRequest](docs/CreateConversationRequest.md) + - [CreatePortalSessionInputBody](docs/CreatePortalSessionInputBody.md) - [Created](docs/Created.md) - [DecompFailedEvent](docs/DecompFailedEvent.md) - [DecompFinishedEvent](docs/DecompFinishedEvent.md) @@ -484,7 +488,9 @@ Class | Method | HTTP request | Description - [GetAiDecompilationRatingResponse](docs/GetAiDecompilationRatingResponse.md) - [GetAiDecompilationTask](docs/GetAiDecompilationTask.md) - [GetAnalysisStringsStatusOutputBody](docs/GetAnalysisStringsStatusOutputBody.md) + - [GetProductsOutputBody](docs/GetProductsOutputBody.md) - [GetPublicUserResponse](docs/GetPublicUserResponse.md) + - [GetSubscriptionOutputBody](docs/GetSubscriptionOutputBody.md) - [GlobalVariable](docs/GlobalVariable.md) - [HistoryEntry](docs/HistoryEntry.md) - [HttpRequest](docs/HttpRequest.md) @@ -521,11 +527,15 @@ Class | Method | HTTP request | Description - [Params](docs/Params.md) - [PatchCommentBody](docs/PatchCommentBody.md) - [Platform](docs/Platform.md) + - [PriceOutput](docs/PriceOutput.md) + - [PriceSummary](docs/PriceSummary.md) - [ProcessActivityEntry](docs/ProcessActivityEntry.md) - [ProcessExtractedFiles](docs/ProcessExtractedFiles.md) - [ProcessMemdumps](docs/ProcessMemdumps.md) - [ProcessNode](docs/ProcessNode.md) - [ProcessTree](docs/ProcessTree.md) + - [ProductOutput](docs/ProductOutput.md) + - [ProductSummary](docs/ProductSummary.md) - [ProgressMessage](docs/ProgressMessage.md) - [ProseEvent](docs/ProseEvent.md) - [PutAnalysisStringsRequest](docs/PutAnalysisStringsRequest.md) @@ -557,6 +567,7 @@ Class | Method | HTTP request | Description - [SegmentInfo](docs/SegmentInfo.md) - [SendMessageRequest](docs/SendMessageRequest.md) - [ServiceEntry](docs/ServiceEntry.md) + - [SessionOutputBody](docs/SessionOutputBody.md) - [SingleCodeCertificateModel](docs/SingleCodeCertificateModel.md) - [SingleCodeSignatureModel](docs/SingleCodeSignatureModel.md) - [SinglePDBEntryModel](docs/SinglePDBEntryModel.md) diff --git a/build.gradle b/build.gradle index 6400b4f..82581f2 100644 --- a/build.gradle +++ b/build.gradle @@ -19,7 +19,7 @@ apply plugin: 'java' apply plugin: 'com.diffplug.spotless' group = 'ai.reveng' -version = '3.86.8' +version = '3.87.0' @@ -171,7 +171,7 @@ mavenPublishing { publishToMavenCentral(true) signAllPublications() - coordinates("ai.reveng", "sdk", "3.86.8") + coordinates("ai.reveng", "sdk", "3.87.0") pom { name = "sdk" diff --git a/build.sbt b/build.sbt index aa88bcc..0771715 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.86.8", + version := "3.87.0", scalaVersion := "2.11.12", scalacOptions ++= Seq("-feature"), compile / javacOptions ++= Seq("-Xlint:deprecation"), diff --git a/docs/AnalysesCoreApi.md b/docs/AnalysesCoreApi.md index e4de8af..8208eeb 100644 --- a/docs/AnalysesCoreApi.md +++ b/docs/AnalysesCoreApi.md @@ -8,6 +8,7 @@ All URIs are relative to *https://api.reveng.ai* | [**createAnalysis**](AnalysesCoreApi.md#createAnalysis) | **POST** /v2/analyses | Create Analysis | | [**deleteAnalysis**](AnalysesCoreApi.md#deleteAnalysis) | **DELETE** /v2/analyses/{analysis_id} | Delete Analysis | | [**getAnalysisBasicInfo**](AnalysesCoreApi.md#getAnalysisBasicInfo) | **GET** /v2/analyses/{analysis_id}/basic | Gets basic analysis information | +| [**getAnalysisBasicInfo_0**](AnalysesCoreApi.md#getAnalysisBasicInfo_0) | **GET** /v3/analyses/{analysis_id}/basic | Get basic analysis information | | [**getAnalysisBytes**](AnalysesCoreApi.md#getAnalysisBytes) | **GET** /v3/analyses/{analysis_id}/bytes | Get the bytes of a binary | | [**getAnalysisFunctionMap**](AnalysesCoreApi.md#getAnalysisFunctionMap) | **GET** /v2/analyses/{analysis_id}/func_maps | Get Analysis Function Map | | [**getAnalysisLogs**](AnalysesCoreApi.md#getAnalysisLogs) | **GET** /v2/analyses/{analysis_id}/logs | Gets the logs of an analysis | @@ -317,6 +318,79 @@ public class Example { | **200** | Successful Response | - | | **422** | Invalid request parameters | - | + +# **getAnalysisBasicInfo_0** +> AnalysisBasicInfoOutputBody getAnalysisBasicInfo_0(analysisId) + +Get basic analysis information + +Returns basic metadata for the given analysis including binary details, model, owner, and function count. **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 { + AnalysisBasicInfoOutputBody result = apiInstance.getAnalysisBasicInfo_0(analysisId); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling AnalysesCoreApi#getAnalysisBasicInfo_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 | +|------------- | ------------- | ------------- | -------------| +| **analysisId** | **Long**| Analysis ID | | + +### Return type + +[**AnalysisBasicInfoOutputBody**](AnalysisBasicInfoOutputBody.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 | - | + # **getAnalysisBytes** > getAnalysisBytes(analysisId, page) diff --git a/docs/AnalysisBasicInfoOutputBody.md b/docs/AnalysisBasicInfoOutputBody.md new file mode 100644 index 0000000..08c00bc --- /dev/null +++ b/docs/AnalysisBasicInfoOutputBody.md @@ -0,0 +1,41 @@ + + +# AnalysisBasicInfoOutputBody + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**analysisScope** | [**AnalysisScopeEnum**](#AnalysisScopeEnum) | PUBLIC, PRIVATE, or TEAM | | +|**baseAddress** | **Long** | Base address of the binary, null when unknown | | +|**binaryId** | **Long** | Binary ID | | +|**binaryName** | **String** | Binary filename | | +|**binarySize** | **Long** | Binary size in bytes | | +|**binaryUuid** | **String** | UUID of the binary, omitted when not set | [optional] | +|**creation** | **OffsetDateTime** | When the binary was uploaded | | +|**debug** | **Boolean** | True when the binary was analysed with debug symbols | | +|**functionCount** | **Long** | Number of functions in the binary | | +|**isAdvanced** | **Boolean** | True when the analysis was run in advanced mode | | +|**isOwner** | **Boolean** | True when the caller is the analysis owner | | +|**isSystem** | **Boolean** | True when the analysis is owned by a system user | | +|**modelId** | **Long** | Model ID | | +|**modelName** | **String** | Model used for analysis | | +|**ownerUsername** | **String** | Username of the analysis owner | | +|**sequencerVersion** | **String** | Sequencer version, omitted when not set | [optional] | +|**sha256Hash** | **String** | SHA-256 hash of the binary | | +|**teamId** | **Long** | Team ID of the analysis | | + + + +## Enum: AnalysisScopeEnum + +| Name | Value | +|---- | -----| +| PRIVATE | "PRIVATE" | +| PUBLIC | "PUBLIC" | +| TEAM | "TEAM" | +| UNKNOWN_DEFAULT_OPEN_API | "unknown_default_open_api" | + + + diff --git a/docs/BinariesApi.md b/docs/BinariesApi.md index 402bca3..38e9f60 100644 --- a/docs/BinariesApi.md +++ b/docs/BinariesApi.md @@ -7,6 +7,8 @@ All URIs are relative to *https://api.reveng.ai* | [**downloadZippedBinary**](BinariesApi.md#downloadZippedBinary) | **GET** /v2/binaries/{binary_id}/download-zipped | Downloads a zipped binary with password protection | | [**getBinaryAdditionalDetails**](BinariesApi.md#getBinaryAdditionalDetails) | **GET** /v2/binaries/{binary_id}/additional-details | Gets the additional details of a binary | | [**getBinaryAdditionalDetailsStatus**](BinariesApi.md#getBinaryAdditionalDetailsStatus) | **GET** /v2/binaries/{binary_id}/additional-details/status | Gets the status of the additional details task for a binary | +| [**getBinaryAdditionalDetailsStatus_0**](BinariesApi.md#getBinaryAdditionalDetailsStatus_0) | **GET** /v3/binaries/{binary_id}/additional-details/status | Get the additional-details extraction status for a binary. | +| [**getBinaryAdditionalDetails_0**](BinariesApi.md#getBinaryAdditionalDetails_0) | **GET** /v3/binaries/{binary_id}/additional-details | Get additional details for a binary. | | [**getBinaryDetails**](BinariesApi.md#getBinaryDetails) | **GET** /v2/binaries/{binary_id}/details | Gets the details of a binary | | [**getBinaryDieInfo**](BinariesApi.md#getBinaryDieInfo) | **GET** /v2/binaries/{binary_id}/die-info | Gets the die info of a binary | | [**getBinaryExternals**](BinariesApi.md#getBinaryExternals) | **GET** /v2/binaries/{binary_id}/externals | Gets the external details of a binary | @@ -218,6 +220,152 @@ public class Example { | **200** | Successful Response | - | | **422** | Invalid request parameters | - | + +# **getBinaryAdditionalDetailsStatus_0** +> GetAdditionalDetailsStatusOutputBody getBinaryAdditionalDetailsStatus_0(binaryId) + +Get the additional-details extraction status for a binary. + +Returns the status of the additional-details extraction task. 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.BinariesApi; + +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"); + + BinariesApi apiInstance = new BinariesApi(defaultClient); + Long binaryId = 56L; // Long | Binary ID + try { + GetAdditionalDetailsStatusOutputBody result = apiInstance.getBinaryAdditionalDetailsStatus_0(binaryId); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling BinariesApi#getBinaryAdditionalDetailsStatus_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 | +|------------- | ------------- | ------------- | -------------| +| **binaryId** | **Long**| Binary ID | | + +### Return type + +[**GetAdditionalDetailsStatusOutputBody**](GetAdditionalDetailsStatusOutputBody.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 | - | + + +# **getBinaryAdditionalDetails_0** +> GetAdditionalDetailsOutputBody getBinaryAdditionalDetails_0(binaryId) + +Get additional details for a binary. + +Returns structured metadata extracted by the additional-details pipeline for the given binary. Returns `null` for `details` when the pipeline has not yet run. **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.BinariesApi; + +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"); + + BinariesApi apiInstance = new BinariesApi(defaultClient); + Long binaryId = 56L; // Long | Binary ID + try { + GetAdditionalDetailsOutputBody result = apiInstance.getBinaryAdditionalDetails_0(binaryId); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling BinariesApi#getBinaryAdditionalDetails_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 | +|------------- | ------------- | ------------- | -------------| +| **binaryId** | **Long**| Binary ID | | + +### Return type + +[**GetAdditionalDetailsOutputBody**](GetAdditionalDetailsOutputBody.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 | - | + # **getBinaryDetails** > BaseResponseBinaryDetailsResponse getBinaryDetails(binaryId) diff --git a/docs/BinariesCoreApi.md b/docs/BinariesCoreApi.md deleted file mode 100644 index 3afd528..0000000 --- a/docs/BinariesCoreApi.md +++ /dev/null @@ -1,156 +0,0 @@ -# BinariesCoreApi - -All URIs are relative to *https://api.reveng.ai* - -| Method | HTTP request | Description | -|------------- | ------------- | -------------| -| [**getBinaryAdditionalDetails**](BinariesCoreApi.md#getBinaryAdditionalDetails) | **GET** /v3/binaries/{binary_id}/additional-details | Get additional details for a binary. | -| [**getBinaryAdditionalDetailsStatus**](BinariesCoreApi.md#getBinaryAdditionalDetailsStatus) | **GET** /v3/binaries/{binary_id}/additional-details/status | Get the additional-details extraction status for a binary. | - - - -# **getBinaryAdditionalDetails** -> GetAdditionalDetailsOutputBody getBinaryAdditionalDetails(binaryId) - -Get additional details for a binary. - -Returns structured metadata extracted by the additional-details pipeline for the given binary. Returns `null` for `details` when the pipeline has not yet run. **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.BinariesCoreApi; - -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"); - - BinariesCoreApi apiInstance = new BinariesCoreApi(defaultClient); - Long binaryId = 56L; // Long | Binary ID - try { - GetAdditionalDetailsOutputBody result = apiInstance.getBinaryAdditionalDetails(binaryId); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling BinariesCoreApi#getBinaryAdditionalDetails"); - 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 | -|------------- | ------------- | ------------- | -------------| -| **binaryId** | **Long**| Binary ID | | - -### Return type - -[**GetAdditionalDetailsOutputBody**](GetAdditionalDetailsOutputBody.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 | - | - - -# **getBinaryAdditionalDetailsStatus** -> GetAdditionalDetailsStatusOutputBody getBinaryAdditionalDetailsStatus(binaryId) - -Get the additional-details extraction status for a binary. - -Returns the status of the additional-details extraction task. 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.BinariesCoreApi; - -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"); - - BinariesCoreApi apiInstance = new BinariesCoreApi(defaultClient); - Long binaryId = 56L; // Long | Binary ID - try { - GetAdditionalDetailsStatusOutputBody result = apiInstance.getBinaryAdditionalDetailsStatus(binaryId); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling BinariesCoreApi#getBinaryAdditionalDetailsStatus"); - 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 | -|------------- | ------------- | ------------- | -------------| -| **binaryId** | **Long**| Binary ID | | - -### Return type - -[**GetAdditionalDetailsStatusOutputBody**](GetAdditionalDetailsStatusOutputBody.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/CreateCheckoutSessionInputBody.md b/docs/CreateCheckoutSessionInputBody.md new file mode 100644 index 0000000..5301e41 --- /dev/null +++ b/docs/CreateCheckoutSessionInputBody.md @@ -0,0 +1,15 @@ + + +# CreateCheckoutSessionInputBody + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**cancelUrl** | **String** | URL to redirect to on cancel. | | +|**priceId** | **String** | Price ID from /v3/billing/products. | | +|**successUrl** | **String** | URL to redirect to on success. | | + + + diff --git a/docs/CreatePortalSessionInputBody.md b/docs/CreatePortalSessionInputBody.md new file mode 100644 index 0000000..dd8f71d --- /dev/null +++ b/docs/CreatePortalSessionInputBody.md @@ -0,0 +1,13 @@ + + +# CreatePortalSessionInputBody + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**returnUrl** | **String** | URL the user returns to. | | + + + diff --git a/docs/ErrorBody.md b/docs/ErrorBody.md index 87330ef..f2fc09a 100644 --- a/docs/ErrorBody.md +++ b/docs/ErrorBody.md @@ -20,6 +20,14 @@ | Name | Value | |---- | -----| | ACCESS_DENIED | "ACCESS_DENIED" | +| AGENT_BUDGET_EXCEEDED | "AGENT_BUDGET_EXCEEDED" | +| AGENT_DEFINITION_NOT_FOUND | "AGENT_DEFINITION_NOT_FOUND" | +| AGENT_INVALID_STARTING_INPUT | "AGENT_INVALID_STARTING_INPUT" | +| AGENT_MEMORY_INVALID_SCOPE | "AGENT_MEMORY_INVALID_SCOPE" | +| AGENT_MEMORY_NOT_FOUND | "AGENT_MEMORY_NOT_FOUND" | +| AGENT_MEMORY_VERSION_CONFLICT | "AGENT_MEMORY_VERSION_CONFLICT" | +| AGENT_NO_PENDING_QUESTION | "AGENT_NO_PENDING_QUESTION" | +| AGENT_RUN_NOT_FOUND | "AGENT_RUN_NOT_FOUND" | | ALREADY_EXISTS | "ALREADY_EXISTS" | | ANALYSIS_NOT_READY | "ANALYSIS_NOT_READY" | | BAD_REQUEST | "BAD_REQUEST" | diff --git a/docs/GetProductsOutputBody.md b/docs/GetProductsOutputBody.md new file mode 100644 index 0000000..d15aa7b --- /dev/null +++ b/docs/GetProductsOutputBody.md @@ -0,0 +1,13 @@ + + +# GetProductsOutputBody + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**products** | **List<ProductOutput>** | List of available products | | + + + diff --git a/docs/GetSubscriptionOutputBody.md b/docs/GetSubscriptionOutputBody.md new file mode 100644 index 0000000..597fa41 --- /dev/null +++ b/docs/GetSubscriptionOutputBody.md @@ -0,0 +1,43 @@ + + +# GetSubscriptionOutputBody + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**endsAt** | **OffsetDateTime** | Date access ends (CANCELING only). | [optional] | +|**price** | **PriceSummary** | Current price (ACTIVE / CANCELING / PAYMENT_ISSUE only). | [optional] | +|**product** | **ProductSummary** | Subscribed product (ACTIVE / CANCELING / PAYMENT_ISSUE only). | [optional] | +|**renewsAt** | **OffsetDateTime** | Next billing date (ACTIVE only). | [optional] | +|**status** | [**StatusEnum**](#StatusEnum) | Subscription state. | | +|**tier** | [**TierEnum**](#TierEnum) | User's effective tier. | | + + + +## Enum: StatusEnum + +| Name | Value | +|---- | -----| +| ACTIVE | "ACTIVE" | +| CANCELING | "CANCELING" | +| PAYMENT_ISSUE | "PAYMENT_ISSUE" | +| NONE | "NONE" | +| UNKNOWN_DEFAULT_OPEN_API | "unknown_default_open_api" | + + + +## Enum: TierEnum + +| Name | Value | +|---- | -----| +| ENTHUSIAST | "ENTHUSIAST" | +| REVERSER | "REVERSER" | +| VULNERABILITY_HUNTER | "VULNERABILITY_HUNTER" | +| MALWARE_ANALYST | "MALWARE_ANALYST" | +| SECURITY_RESEARCHER | "SECURITY_RESEARCHER" | +| UNKNOWN_DEFAULT_OPEN_API | "unknown_default_open_api" | + + + diff --git a/docs/PriceOutput.md b/docs/PriceOutput.md new file mode 100644 index 0000000..f218f35 --- /dev/null +++ b/docs/PriceOutput.md @@ -0,0 +1,26 @@ + + +# PriceOutput + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**currency** | **String** | Lowercase ISO 4217 currency code (e.g. \"usd\", \"gbp\"). | | +|**id** | **String** | Price ID. | | +|**interval** | [**IntervalEnum**](#IntervalEnum) | Billing interval at which the price recurs. | | +|**unitAmount** | **Long** | Price per billing interval, expressed in the smallest unit of the currency (e.g. cents for USD, pence for GBP). | | + + + +## Enum: IntervalEnum + +| Name | Value | +|---- | -----| +| MONTH | "month" | +| YEAR | "year" | +| UNKNOWN_DEFAULT_OPEN_API | "unknown_default_open_api" | + + + diff --git a/docs/PriceSummary.md b/docs/PriceSummary.md new file mode 100644 index 0000000..54bd294 --- /dev/null +++ b/docs/PriceSummary.md @@ -0,0 +1,25 @@ + + +# PriceSummary + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**currency** | **String** | Lowercase ISO 4217 currency code. | | +|**interval** | [**IntervalEnum**](#IntervalEnum) | Billing interval at which the price recurs. | | +|**unitAmount** | **Long** | Price per billing interval, in the smallest unit of the currency. | | + + + +## Enum: IntervalEnum + +| Name | Value | +|---- | -----| +| MONTH | "month" | +| YEAR | "year" | +| UNKNOWN_DEFAULT_OPEN_API | "unknown_default_open_api" | + + + diff --git a/docs/ProductOutput.md b/docs/ProductOutput.md new file mode 100644 index 0000000..dcfe6d0 --- /dev/null +++ b/docs/ProductOutput.md @@ -0,0 +1,19 @@ + + +# ProductOutput + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**creditsPerMonth** | **Long** | Credits awarded per billing month, if applicable. | [optional] | +|**description** | **String** | Human-readable product description. | | +|**features** | **List<String>** | Marketing feature list for this product. | | +|**id** | **String** | Product ID. | | +|**name** | **String** | Human-readable product name. | | +|**prices** | **List<PriceOutput>** | All active recurring prices for this product. | | +|**tier** | **String** | User tier associated with this product, if any. | [optional] | + + + diff --git a/docs/ProductSummary.md b/docs/ProductSummary.md new file mode 100644 index 0000000..e7648c5 --- /dev/null +++ b/docs/ProductSummary.md @@ -0,0 +1,13 @@ + + +# ProductSummary + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**name** | **String** | Product name. | | + + + diff --git a/docs/SessionOutputBody.md b/docs/SessionOutputBody.md new file mode 100644 index 0000000..10d024e --- /dev/null +++ b/docs/SessionOutputBody.md @@ -0,0 +1,13 @@ + + +# SessionOutputBody + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**url** | **String** | Hosted session URL to redirect the user to. | | + + + diff --git a/pom.xml b/pom.xml index 74481c6..ff124d3 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ sdk jar sdk - 3.86.8 + 3.87.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 9383f67..d024800 100644 --- a/src/main/java/ai/reveng/api/AnalysesCoreApi.java +++ b/src/main/java/ai/reveng/api/AnalysesCoreApi.java @@ -28,6 +28,7 @@ import ai.reveng.model.APIError; import ai.reveng.model.AddUserStringInputBody; +import ai.reveng.model.AnalysisBasicInfoOutputBody; import ai.reveng.model.AnalysisCreateRequest; import ai.reveng.model.AnalysisUpdateRequest; import ai.reveng.model.AnalysisUpdateTagsRequest; @@ -673,6 +674,149 @@ public okhttp3.Call getAnalysisBasicInfoAsync(@javax.annotation.Nonnull Integer localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } + /** + * Build call for getAnalysisBasicInfo_0 + * @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 + * @http.response.details + + + + + + + + +
Response Details
Status Code Description Response Headers
200 OK -
403 Forbidden -
404 Not Found -
422 Unprocessable Entity -
500 Internal Server Error -
+ */ + public okhttp3.Call getAnalysisBasicInfo_0Call(@javax.annotation.Nonnull Long analysisId, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/v3/analyses/{analysis_id}/basic" + .replace("{" + "analysis_id" + "}", localVarApiClient.escapeString(analysisId.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "APIKey" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getAnalysisBasicInfo_0ValidateBeforeCall(@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 getAnalysisBasicInfo_0(Async)"); + } + + return getAnalysisBasicInfo_0Call(analysisId, _callback); + + } + + /** + * Get basic analysis information + * Returns basic metadata for the given analysis including binary details, model, owner, and function count. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied + * @param analysisId Analysis ID (required) + * @return AnalysisBasicInfoOutputBody + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + + + +
Response Details
Status Code Description Response Headers
200 OK -
403 Forbidden -
404 Not Found -
422 Unprocessable Entity -
500 Internal Server Error -
+ */ + public AnalysisBasicInfoOutputBody getAnalysisBasicInfo_0(@javax.annotation.Nonnull Long analysisId) throws ApiException { + ApiResponse localVarResp = getAnalysisBasicInfo_0WithHttpInfo(analysisId); + return localVarResp.getData(); + } + + /** + * Get basic analysis information + * Returns basic metadata for the given analysis including binary details, model, owner, and function count. **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<AnalysisBasicInfoOutputBody> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + + + +
Response Details
Status Code Description Response Headers
200 OK -
403 Forbidden -
404 Not Found -
422 Unprocessable Entity -
500 Internal Server Error -
+ */ + public ApiResponse getAnalysisBasicInfo_0WithHttpInfo(@javax.annotation.Nonnull Long analysisId) throws ApiException { + okhttp3.Call localVarCall = getAnalysisBasicInfo_0ValidateBeforeCall(analysisId, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Get basic analysis information (asynchronously) + * Returns basic metadata for the given analysis including binary details, model, owner, and function count. **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 + * @http.response.details + + + + + + + + +
Response Details
Status Code Description Response Headers
200 OK -
403 Forbidden -
404 Not Found -
422 Unprocessable Entity -
500 Internal Server Error -
+ */ + public okhttp3.Call getAnalysisBasicInfo_0Async(@javax.annotation.Nonnull Long analysisId, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = getAnalysisBasicInfo_0ValidateBeforeCall(analysisId, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } /** * Build call for getAnalysisBytes * @param analysisId Analysis ID (required) diff --git a/src/main/java/ai/reveng/api/BinariesApi.java b/src/main/java/ai/reveng/api/BinariesApi.java index 1eb4d4d..647cd90 100644 --- a/src/main/java/ai/reveng/api/BinariesApi.java +++ b/src/main/java/ai/reveng/api/BinariesApi.java @@ -26,6 +26,7 @@ import java.io.IOException; +import ai.reveng.model.APIError; import ai.reveng.model.BaseResponse; import ai.reveng.model.BaseResponseAdditionalDetailsStatusResponse; import ai.reveng.model.BaseResponseBinariesRelatedStatusResponse; @@ -35,6 +36,8 @@ import ai.reveng.model.BaseResponseChildBinariesResponse; import ai.reveng.model.BaseResponseListDieMatch; import java.io.File; +import ai.reveng.model.GetAdditionalDetailsOutputBody; +import ai.reveng.model.GetAdditionalDetailsStatusOutputBody; import java.lang.reflect.Type; import java.util.ArrayList; @@ -473,6 +476,292 @@ public okhttp3.Call getBinaryAdditionalDetailsStatusAsync(@javax.annotation.Nonn localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } + /** + * Build call for getBinaryAdditionalDetailsStatus_0 + * @param binaryId Binary ID (required) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + + + + +
Response Details
Status Code Description Response Headers
200 OK -
403 Forbidden -
404 Not Found -
422 Unprocessable Entity -
500 Internal Server Error -
+ */ + public okhttp3.Call getBinaryAdditionalDetailsStatus_0Call(@javax.annotation.Nonnull Long binaryId, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/v3/binaries/{binary_id}/additional-details/status" + .replace("{" + "binary_id" + "}", localVarApiClient.escapeString(binaryId.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "APIKey" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getBinaryAdditionalDetailsStatus_0ValidateBeforeCall(@javax.annotation.Nonnull Long 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 getBinaryAdditionalDetailsStatus_0(Async)"); + } + + return getBinaryAdditionalDetailsStatus_0Call(binaryId, _callback); + + } + + /** + * Get the additional-details extraction status for a binary. + * Returns the status of the additional-details extraction task. 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 binaryId Binary ID (required) + * @return GetAdditionalDetailsStatusOutputBody + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + + + +
Response Details
Status Code Description Response Headers
200 OK -
403 Forbidden -
404 Not Found -
422 Unprocessable Entity -
500 Internal Server Error -
+ */ + public GetAdditionalDetailsStatusOutputBody getBinaryAdditionalDetailsStatus_0(@javax.annotation.Nonnull Long binaryId) throws ApiException { + ApiResponse localVarResp = getBinaryAdditionalDetailsStatus_0WithHttpInfo(binaryId); + return localVarResp.getData(); + } + + /** + * Get the additional-details extraction status for a binary. + * Returns the status of the additional-details extraction task. 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 binaryId Binary ID (required) + * @return ApiResponse<GetAdditionalDetailsStatusOutputBody> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + + + +
Response Details
Status Code Description Response Headers
200 OK -
403 Forbidden -
404 Not Found -
422 Unprocessable Entity -
500 Internal Server Error -
+ */ + public ApiResponse getBinaryAdditionalDetailsStatus_0WithHttpInfo(@javax.annotation.Nonnull Long binaryId) throws ApiException { + okhttp3.Call localVarCall = getBinaryAdditionalDetailsStatus_0ValidateBeforeCall(binaryId, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Get the additional-details extraction status for a binary. (asynchronously) + * Returns the status of the additional-details extraction task. 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 binaryId Binary 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 + * @http.response.details + + + + + + + + +
Response Details
Status Code Description Response Headers
200 OK -
403 Forbidden -
404 Not Found -
422 Unprocessable Entity -
500 Internal Server Error -
+ */ + public okhttp3.Call getBinaryAdditionalDetailsStatus_0Async(@javax.annotation.Nonnull Long binaryId, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = getBinaryAdditionalDetailsStatus_0ValidateBeforeCall(binaryId, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for getBinaryAdditionalDetails_0 + * @param binaryId Binary ID (required) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + + + + +
Response Details
Status Code Description Response Headers
200 OK -
403 Forbidden -
404 Not Found -
422 Unprocessable Entity -
500 Internal Server Error -
+ */ + public okhttp3.Call getBinaryAdditionalDetails_0Call(@javax.annotation.Nonnull Long binaryId, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/v3/binaries/{binary_id}/additional-details" + .replace("{" + "binary_id" + "}", localVarApiClient.escapeString(binaryId.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "APIKey" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getBinaryAdditionalDetails_0ValidateBeforeCall(@javax.annotation.Nonnull Long 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 getBinaryAdditionalDetails_0(Async)"); + } + + return getBinaryAdditionalDetails_0Call(binaryId, _callback); + + } + + /** + * Get additional details for a binary. + * Returns structured metadata extracted by the additional-details pipeline for the given binary. Returns `null` for `details` when the pipeline has not yet run. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied + * @param binaryId Binary ID (required) + * @return GetAdditionalDetailsOutputBody + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + + + +
Response Details
Status Code Description Response Headers
200 OK -
403 Forbidden -
404 Not Found -
422 Unprocessable Entity -
500 Internal Server Error -
+ */ + public GetAdditionalDetailsOutputBody getBinaryAdditionalDetails_0(@javax.annotation.Nonnull Long binaryId) throws ApiException { + ApiResponse localVarResp = getBinaryAdditionalDetails_0WithHttpInfo(binaryId); + return localVarResp.getData(); + } + + /** + * Get additional details for a binary. + * Returns structured metadata extracted by the additional-details pipeline for the given binary. Returns `null` for `details` when the pipeline has not yet run. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied + * @param binaryId Binary ID (required) + * @return ApiResponse<GetAdditionalDetailsOutputBody> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + + + +
Response Details
Status Code Description Response Headers
200 OK -
403 Forbidden -
404 Not Found -
422 Unprocessable Entity -
500 Internal Server Error -
+ */ + public ApiResponse getBinaryAdditionalDetails_0WithHttpInfo(@javax.annotation.Nonnull Long binaryId) throws ApiException { + okhttp3.Call localVarCall = getBinaryAdditionalDetails_0ValidateBeforeCall(binaryId, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Get additional details for a binary. (asynchronously) + * Returns structured metadata extracted by the additional-details pipeline for the given binary. Returns `null` for `details` when the pipeline has not yet run. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied + * @param binaryId Binary 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 + * @http.response.details + + + + + + + + +
Response Details
Status Code Description Response Headers
200 OK -
403 Forbidden -
404 Not Found -
422 Unprocessable Entity -
500 Internal Server Error -
+ */ + public okhttp3.Call getBinaryAdditionalDetails_0Async(@javax.annotation.Nonnull Long binaryId, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = getBinaryAdditionalDetails_0ValidateBeforeCall(binaryId, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } /** * Build call for getBinaryDetails * @param binaryId (required) diff --git a/src/main/java/ai/reveng/api/BinariesCoreApi.java b/src/main/java/ai/reveng/api/BinariesCoreApi.java deleted file mode 100644 index cec9f48..0000000 --- a/src/main/java/ai/reveng/api/BinariesCoreApi.java +++ /dev/null @@ -1,362 +0,0 @@ -/* - * RevEng.AI API - * RevEng.AI is an AI-powered binary analysis platform for reverse engineering and malware analysis. It provides similarity search across executable binaries and functions, AI-driven decompilation, dynamic execution analysis, firmware unpacking, and integration with external threat intelligence sources like VirusTotal. - * - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package ai.reveng.api; - -import ai.reveng.invoker.ApiCallback; -import ai.reveng.invoker.ApiClient; -import ai.reveng.invoker.ApiException; -import ai.reveng.invoker.ApiResponse; -import ai.reveng.invoker.Configuration; -import ai.reveng.invoker.Pair; -import ai.reveng.invoker.ProgressRequestBody; -import ai.reveng.invoker.ProgressResponseBody; - -import com.google.gson.reflect.TypeToken; - -import java.io.IOException; - - -import ai.reveng.model.APIError; -import ai.reveng.model.GetAdditionalDetailsOutputBody; -import ai.reveng.model.GetAdditionalDetailsStatusOutputBody; - -import java.lang.reflect.Type; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -public class BinariesCoreApi { - private ApiClient localVarApiClient; - private int localHostIndex; - private String localCustomBaseUrl; - - public BinariesCoreApi() { - this(Configuration.getDefaultApiClient()); - } - - public BinariesCoreApi(ApiClient apiClient) { - this.localVarApiClient = apiClient; - } - - public ApiClient getApiClient() { - return localVarApiClient; - } - - public void setApiClient(ApiClient apiClient) { - this.localVarApiClient = apiClient; - } - - public int getHostIndex() { - return localHostIndex; - } - - public void setHostIndex(int hostIndex) { - this.localHostIndex = hostIndex; - } - - public String getCustomBaseUrl() { - return localCustomBaseUrl; - } - - public void setCustomBaseUrl(String customBaseUrl) { - this.localCustomBaseUrl = customBaseUrl; - } - - /** - * Build call for getBinaryAdditionalDetails - * @param binaryId Binary ID (required) - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - * @http.response.details - - - - - - - - -
Response Details
Status Code Description Response Headers
200 OK -
403 Forbidden -
404 Not Found -
422 Unprocessable Entity -
500 Internal Server Error -
- */ - public okhttp3.Call getBinaryAdditionalDetailsCall(@javax.annotation.Nonnull Long binaryId, final ApiCallback _callback) throws ApiException { - String basePath = null; - // Operation Servers - String[] localBasePaths = new String[] { }; - - // Determine Base Path to Use - if (localCustomBaseUrl != null){ - basePath = localCustomBaseUrl; - } else if ( localBasePaths.length > 0 ) { - basePath = localBasePaths[localHostIndex]; - } else { - basePath = null; - } - - Object localVarPostBody = null; - - // create path and map variables - String localVarPath = "/v3/binaries/{binary_id}/additional-details" - .replace("{" + "binary_id" + "}", localVarApiClient.escapeString(binaryId.toString())); - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = { - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - - String[] localVarAuthNames = new String[] { "APIKey" }; - return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call getBinaryAdditionalDetailsValidateBeforeCall(@javax.annotation.Nonnull Long 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 getBinaryAdditionalDetails(Async)"); - } - - return getBinaryAdditionalDetailsCall(binaryId, _callback); - - } - - /** - * Get additional details for a binary. - * Returns structured metadata extracted by the additional-details pipeline for the given binary. Returns `null` for `details` when the pipeline has not yet run. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - * @param binaryId Binary ID (required) - * @return GetAdditionalDetailsOutputBody - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - - - - - -
Response Details
Status Code Description Response Headers
200 OK -
403 Forbidden -
404 Not Found -
422 Unprocessable Entity -
500 Internal Server Error -
- */ - public GetAdditionalDetailsOutputBody getBinaryAdditionalDetails(@javax.annotation.Nonnull Long binaryId) throws ApiException { - ApiResponse localVarResp = getBinaryAdditionalDetailsWithHttpInfo(binaryId); - return localVarResp.getData(); - } - - /** - * Get additional details for a binary. - * Returns structured metadata extracted by the additional-details pipeline for the given binary. Returns `null` for `details` when the pipeline has not yet run. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - * @param binaryId Binary ID (required) - * @return ApiResponse<GetAdditionalDetailsOutputBody> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - - - - - -
Response Details
Status Code Description Response Headers
200 OK -
403 Forbidden -
404 Not Found -
422 Unprocessable Entity -
500 Internal Server Error -
- */ - public ApiResponse getBinaryAdditionalDetailsWithHttpInfo(@javax.annotation.Nonnull Long binaryId) throws ApiException { - okhttp3.Call localVarCall = getBinaryAdditionalDetailsValidateBeforeCall(binaryId, null); - Type localVarReturnType = new TypeToken(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * Get additional details for a binary. (asynchronously) - * Returns structured metadata extracted by the additional-details pipeline for the given binary. Returns `null` for `details` when the pipeline has not yet run. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - * @param binaryId Binary 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 - * @http.response.details - - - - - - - - -
Response Details
Status Code Description Response Headers
200 OK -
403 Forbidden -
404 Not Found -
422 Unprocessable Entity -
500 Internal Server Error -
- */ - public okhttp3.Call getBinaryAdditionalDetailsAsync(@javax.annotation.Nonnull Long binaryId, final ApiCallback _callback) throws ApiException { - - okhttp3.Call localVarCall = getBinaryAdditionalDetailsValidateBeforeCall(binaryId, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); - return localVarCall; - } - /** - * Build call for getBinaryAdditionalDetailsStatus - * @param binaryId Binary ID (required) - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - * @http.response.details - - - - - - - - -
Response Details
Status Code Description Response Headers
200 OK -
403 Forbidden -
404 Not Found -
422 Unprocessable Entity -
500 Internal Server Error -
- */ - public okhttp3.Call getBinaryAdditionalDetailsStatusCall(@javax.annotation.Nonnull Long binaryId, final ApiCallback _callback) throws ApiException { - String basePath = null; - // Operation Servers - String[] localBasePaths = new String[] { }; - - // Determine Base Path to Use - if (localCustomBaseUrl != null){ - basePath = localCustomBaseUrl; - } else if ( localBasePaths.length > 0 ) { - basePath = localBasePaths[localHostIndex]; - } else { - basePath = null; - } - - Object localVarPostBody = null; - - // create path and map variables - String localVarPath = "/v3/binaries/{binary_id}/additional-details/status" - .replace("{" + "binary_id" + "}", localVarApiClient.escapeString(binaryId.toString())); - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = { - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - - String[] localVarAuthNames = new String[] { "APIKey" }; - return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call getBinaryAdditionalDetailsStatusValidateBeforeCall(@javax.annotation.Nonnull Long 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 getBinaryAdditionalDetailsStatus(Async)"); - } - - return getBinaryAdditionalDetailsStatusCall(binaryId, _callback); - - } - - /** - * Get the additional-details extraction status for a binary. - * Returns the status of the additional-details extraction task. 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 binaryId Binary ID (required) - * @return GetAdditionalDetailsStatusOutputBody - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - - - - - -
Response Details
Status Code Description Response Headers
200 OK -
403 Forbidden -
404 Not Found -
422 Unprocessable Entity -
500 Internal Server Error -
- */ - public GetAdditionalDetailsStatusOutputBody getBinaryAdditionalDetailsStatus(@javax.annotation.Nonnull Long binaryId) throws ApiException { - ApiResponse localVarResp = getBinaryAdditionalDetailsStatusWithHttpInfo(binaryId); - return localVarResp.getData(); - } - - /** - * Get the additional-details extraction status for a binary. - * Returns the status of the additional-details extraction task. 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 binaryId Binary ID (required) - * @return ApiResponse<GetAdditionalDetailsStatusOutputBody> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - - - - - -
Response Details
Status Code Description Response Headers
200 OK -
403 Forbidden -
404 Not Found -
422 Unprocessable Entity -
500 Internal Server Error -
- */ - public ApiResponse getBinaryAdditionalDetailsStatusWithHttpInfo(@javax.annotation.Nonnull Long binaryId) throws ApiException { - okhttp3.Call localVarCall = getBinaryAdditionalDetailsStatusValidateBeforeCall(binaryId, null); - Type localVarReturnType = new TypeToken(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * Get the additional-details extraction status for a binary. (asynchronously) - * Returns the status of the additional-details extraction task. 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 binaryId Binary 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 - * @http.response.details - - - - - - - - -
Response Details
Status Code Description Response Headers
200 OK -
403 Forbidden -
404 Not Found -
422 Unprocessable Entity -
500 Internal Server Error -
- */ - public okhttp3.Call getBinaryAdditionalDetailsStatusAsync(@javax.annotation.Nonnull Long binaryId, final ApiCallback _callback) throws ApiException { - - okhttp3.Call localVarCall = getBinaryAdditionalDetailsStatusValidateBeforeCall(binaryId, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); - return localVarCall; - } -} diff --git a/src/main/java/ai/reveng/api/FunctionsCoreApi.java b/src/main/java/ai/reveng/api/FunctionsCoreApi.java index d6c6668..cff55c9 100644 --- a/src/main/java/ai/reveng/api/FunctionsCoreApi.java +++ b/src/main/java/ai/reveng/api/FunctionsCoreApi.java @@ -1234,7 +1234,9 @@ public okhttp3.Call cancelAutoUnstripAsync(@javax.annotation.Nonnull Integer ana 200 Successful Response - 422 Invalid request parameters - + * @deprecated */ + @Deprecated public okhttp3.Call getAnalysisStringsCall(@javax.annotation.Nonnull Integer analysisId, @javax.annotation.Nullable Integer page, @javax.annotation.Nullable Integer 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 @@ -1304,6 +1306,7 @@ public okhttp3.Call getAnalysisStringsCall(@javax.annotation.Nonnull Integer ana return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } + @Deprecated @SuppressWarnings("rawtypes") private okhttp3.Call getAnalysisStringsValidateBeforeCall(@javax.annotation.Nonnull Integer analysisId, @javax.annotation.Nullable Integer page, @javax.annotation.Nullable Integer 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 @@ -1334,7 +1337,9 @@ private okhttp3.Call getAnalysisStringsValidateBeforeCall(@javax.annotation.Nonn 200 Successful Response - 422 Invalid request parameters - + * @deprecated */ + @Deprecated public BaseResponseAnalysisStringsResponse getAnalysisStrings(@javax.annotation.Nonnull Integer analysisId, @javax.annotation.Nullable Integer page, @javax.annotation.Nullable Integer 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); return localVarResp.getData(); @@ -1359,7 +1364,9 @@ public BaseResponseAnalysisStringsResponse getAnalysisStrings(@javax.annotation. 200 Successful Response - 422 Invalid request parameters - + * @deprecated */ + @Deprecated public ApiResponse getAnalysisStringsWithHttpInfo(@javax.annotation.Nonnull Integer analysisId, @javax.annotation.Nullable Integer page, @javax.annotation.Nullable Integer 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(); @@ -1386,7 +1393,9 @@ public ApiResponse getAnalysisStringsWithHt 200 Successful Response - 422 Invalid request parameters - + * @deprecated */ + @Deprecated public okhttp3.Call getAnalysisStringsAsync(@javax.annotation.Nonnull Integer analysisId, @javax.annotation.Nullable Integer page, @javax.annotation.Nullable Integer 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 = getAnalysisStringsValidateBeforeCall(analysisId, page, pageSize, search, functionSearch, orderBy, sortOrder, _callback); @@ -1407,7 +1416,9 @@ public okhttp3.Call getAnalysisStringsAsync(@javax.annotation.Nonnull Integer an 200 Successful Response - 422 Invalid request parameters - + * @deprecated */ + @Deprecated public okhttp3.Call getAnalysisStringsStatusCall(@javax.annotation.Nonnull Integer analysisId, final ApiCallback _callback) throws ApiException { String basePath = null; // Operation Servers @@ -1453,6 +1464,7 @@ public okhttp3.Call getAnalysisStringsStatusCall(@javax.annotation.Nonnull Integ return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } + @Deprecated @SuppressWarnings("rawtypes") private okhttp3.Call getAnalysisStringsStatusValidateBeforeCall(@javax.annotation.Nonnull Integer analysisId, final ApiCallback _callback) throws ApiException { // verify the required parameter 'analysisId' is set @@ -1477,7 +1489,9 @@ private okhttp3.Call getAnalysisStringsStatusValidateBeforeCall(@javax.annotatio 200 Successful Response - 422 Invalid request parameters - + * @deprecated */ + @Deprecated public BaseResponseAnalysisStringsStatusResponse getAnalysisStringsStatus(@javax.annotation.Nonnull Integer analysisId) throws ApiException { ApiResponse localVarResp = getAnalysisStringsStatusWithHttpInfo(analysisId); return localVarResp.getData(); @@ -1496,7 +1510,9 @@ public BaseResponseAnalysisStringsStatusResponse getAnalysisStringsStatus(@javax 200 Successful Response - 422 Invalid request parameters - + * @deprecated */ + @Deprecated public ApiResponse getAnalysisStringsStatusWithHttpInfo(@javax.annotation.Nonnull Integer analysisId) throws ApiException { okhttp3.Call localVarCall = getAnalysisStringsStatusValidateBeforeCall(analysisId, null); Type localVarReturnType = new TypeToken(){}.getType(); @@ -1517,7 +1533,9 @@ public ApiResponse getAnalysisStrings 200 Successful Response - 422 Invalid request parameters - + * @deprecated */ + @Deprecated public okhttp3.Call getAnalysisStringsStatusAsync(@javax.annotation.Nonnull Integer analysisId, final ApiCallback _callback) throws ApiException { okhttp3.Call localVarCall = getAnalysisStringsStatusValidateBeforeCall(analysisId, _callback); @@ -2207,7 +2225,9 @@ public okhttp3.Call getFunctionDetailsAsync(@javax.annotation.Nonnull Integer fu 200 Successful Response - 422 Invalid request parameters - + * @deprecated */ + @Deprecated public okhttp3.Call getFunctionStringsCall(@javax.annotation.Nonnull Integer functionId, @javax.annotation.Nullable Integer page, @javax.annotation.Nullable Integer pageSize, @javax.annotation.Nullable String search, final ApiCallback _callback) throws ApiException { String basePath = null; // Operation Servers @@ -2265,6 +2285,7 @@ public okhttp3.Call getFunctionStringsCall(@javax.annotation.Nonnull Integer fun return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } + @Deprecated @SuppressWarnings("rawtypes") private okhttp3.Call getFunctionStringsValidateBeforeCall(@javax.annotation.Nonnull Integer functionId, @javax.annotation.Nullable Integer page, @javax.annotation.Nullable Integer pageSize, @javax.annotation.Nullable String search, final ApiCallback _callback) throws ApiException { // verify the required parameter 'functionId' is set @@ -2292,7 +2313,9 @@ private okhttp3.Call getFunctionStringsValidateBeforeCall(@javax.annotation.Nonn 200 Successful Response - 422 Invalid request parameters - + * @deprecated */ + @Deprecated public BaseResponseFunctionStringsResponse getFunctionStrings(@javax.annotation.Nonnull Integer functionId, @javax.annotation.Nullable Integer page, @javax.annotation.Nullable Integer pageSize, @javax.annotation.Nullable String search) throws ApiException { ApiResponse localVarResp = getFunctionStringsWithHttpInfo(functionId, page, pageSize, search); return localVarResp.getData(); @@ -2314,7 +2337,9 @@ public BaseResponseFunctionStringsResponse getFunctionStrings(@javax.annotation. 200 Successful Response - 422 Invalid request parameters - + * @deprecated */ + @Deprecated public ApiResponse getFunctionStringsWithHttpInfo(@javax.annotation.Nonnull Integer functionId, @javax.annotation.Nullable Integer page, @javax.annotation.Nullable Integer pageSize, @javax.annotation.Nullable String search) throws ApiException { okhttp3.Call localVarCall = getFunctionStringsValidateBeforeCall(functionId, page, pageSize, search, null); Type localVarReturnType = new TypeToken(){}.getType(); @@ -2338,7 +2363,9 @@ public ApiResponse getFunctionStringsWithHt 200 Successful Response - 422 Invalid request parameters - + * @deprecated */ + @Deprecated public okhttp3.Call getFunctionStringsAsync(@javax.annotation.Nonnull Integer functionId, @javax.annotation.Nullable Integer page, @javax.annotation.Nullable Integer pageSize, @javax.annotation.Nullable String search, final ApiCallback _callback) throws ApiException { okhttp3.Call localVarCall = getFunctionStringsValidateBeforeCall(functionId, page, pageSize, search, _callback); diff --git a/src/main/java/ai/reveng/invoker/ApiClient.java b/src/main/java/ai/reveng/invoker/ApiClient.java index 8477e05..5abbf77 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.86.8/java"); + setUserAgent("OpenAPI-Generator/3.87.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 db2c74f..e76271f 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.86.8"; + public static final String VERSION = "3.87.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 e34902c..810a2d2 100644 --- a/src/main/java/ai/reveng/invoker/JSON.java +++ b/src/main/java/ai/reveng/invoker/JSON.java @@ -106,6 +106,7 @@ private static Class getClassByDiscriminator(Map classByDiscriminatorValue, Stri gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.Addr.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.AiUnstripRequest.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.AnalysisAccessInfo.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.AnalysisBasicInfoOutputBody.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.AnalysisBulkAddTagsRequest.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.AnalysisBulkAddTagsResponse.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.AnalysisBulkAddTagsResponseItem.CustomTypeAdapterFactory()); @@ -252,7 +253,9 @@ private static Class getClassByDiscriminator(Map classByDiscriminatorValue, Stri gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.ConversationContext.CustomTypeAdapterFactory()); 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.CreateConversationRequest.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.CreatePortalSessionInputBody.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.Created.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.DecompFailedEvent.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.DecompFinishedEvent.CustomTypeAdapterFactory()); @@ -352,7 +355,9 @@ private static Class getClassByDiscriminator(Map classByDiscriminatorValue, Stri gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.GetAiDecompilationRatingResponse.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.GetAiDecompilationTask.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.GetAnalysisStringsStatusOutputBody.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.GetProductsOutputBody.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.GetPublicUserResponse.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.GetSubscriptionOutputBody.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.GlobalVariable.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.HistoryEntry.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.HttpRequest.CustomTypeAdapterFactory()); @@ -385,11 +390,15 @@ private static Class getClassByDiscriminator(Map classByDiscriminatorValue, Stri gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.PaginationModel.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.Params.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.PatchCommentBody.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.PriceOutput.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.PriceSummary.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.ProcessActivityEntry.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.ProcessExtractedFiles.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.ProcessMemdumps.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.ProcessNode.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.ProcessTree.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.ProductOutput.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.ProductSummary.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.ProgressMessage.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.ProseEvent.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.PutAnalysisStringsRequest.CustomTypeAdapterFactory()); @@ -418,6 +427,7 @@ private static Class getClassByDiscriminator(Map classByDiscriminatorValue, Stri gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.SegmentInfo.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.SendMessageRequest.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.ServiceEntry.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.SessionOutputBody.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.SingleCodeCertificateModel.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.SingleCodeSignatureModel.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.SinglePDBEntryModel.CustomTypeAdapterFactory()); diff --git a/src/main/java/ai/reveng/model/AnalysisBasicInfoOutputBody.java b/src/main/java/ai/reveng/model/AnalysisBasicInfoOutputBody.java new file mode 100644 index 0000000..d140131 --- /dev/null +++ b/src/main/java/ai/reveng/model/AnalysisBasicInfoOutputBody.java @@ -0,0 +1,813 @@ +/* + * 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; + +/** + * AnalysisBasicInfoOutputBody + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class AnalysisBasicInfoOutputBody { + /** + * PUBLIC, PRIVATE, or TEAM + */ + @JsonAdapter(AnalysisScopeEnum.Adapter.class) + public enum AnalysisScopeEnum { + PRIVATE("PRIVATE"), + + PUBLIC("PUBLIC"), + + TEAM("TEAM"), + + UNKNOWN_DEFAULT_OPEN_API("unknown_default_open_api"); + + private String value; + + AnalysisScopeEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static AnalysisScopeEnum fromValue(String value) { + for (AnalysisScopeEnum b : AnalysisScopeEnum.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 AnalysisScopeEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public AnalysisScopeEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return AnalysisScopeEnum.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + AnalysisScopeEnum.fromValue(value); + } + } + + public static final String SERIALIZED_NAME_ANALYSIS_SCOPE = "analysis_scope"; + @SerializedName(SERIALIZED_NAME_ANALYSIS_SCOPE) + @javax.annotation.Nonnull + private AnalysisScopeEnum analysisScope; + + public static final String SERIALIZED_NAME_BASE_ADDRESS = "base_address"; + @SerializedName(SERIALIZED_NAME_BASE_ADDRESS) + @javax.annotation.Nullable + private Long baseAddress; + + 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_BINARY_SIZE = "binary_size"; + @SerializedName(SERIALIZED_NAME_BINARY_SIZE) + @javax.annotation.Nonnull + private Long binarySize; + + public static final String SERIALIZED_NAME_BINARY_UUID = "binary_uuid"; + @SerializedName(SERIALIZED_NAME_BINARY_UUID) + @javax.annotation.Nullable + private String binaryUuid; + + public static final String SERIALIZED_NAME_CREATION = "creation"; + @SerializedName(SERIALIZED_NAME_CREATION) + @javax.annotation.Nonnull + private OffsetDateTime creation; + + public static final String SERIALIZED_NAME_DEBUG = "debug"; + @SerializedName(SERIALIZED_NAME_DEBUG) + @javax.annotation.Nonnull + private Boolean debug; + + public static final String SERIALIZED_NAME_FUNCTION_COUNT = "function_count"; + @SerializedName(SERIALIZED_NAME_FUNCTION_COUNT) + @javax.annotation.Nonnull + private Long functionCount; + + public static final String SERIALIZED_NAME_IS_ADVANCED = "is_advanced"; + @SerializedName(SERIALIZED_NAME_IS_ADVANCED) + @javax.annotation.Nonnull + private Boolean isAdvanced; + + public static final String SERIALIZED_NAME_IS_OWNER = "is_owner"; + @SerializedName(SERIALIZED_NAME_IS_OWNER) + @javax.annotation.Nonnull + private Boolean isOwner; + + public static final String SERIALIZED_NAME_IS_SYSTEM = "is_system"; + @SerializedName(SERIALIZED_NAME_IS_SYSTEM) + @javax.annotation.Nonnull + private Boolean isSystem; + + 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_MODEL_NAME = "model_name"; + @SerializedName(SERIALIZED_NAME_MODEL_NAME) + @javax.annotation.Nonnull + private String modelName; + + public static final String SERIALIZED_NAME_OWNER_USERNAME = "owner_username"; + @SerializedName(SERIALIZED_NAME_OWNER_USERNAME) + @javax.annotation.Nonnull + private String ownerUsername; + + public static final String SERIALIZED_NAME_SEQUENCER_VERSION = "sequencer_version"; + @SerializedName(SERIALIZED_NAME_SEQUENCER_VERSION) + @javax.annotation.Nullable + private String sequencerVersion; + + public static final String SERIALIZED_NAME_SHA256_HASH = "sha_256_hash"; + @SerializedName(SERIALIZED_NAME_SHA256_HASH) + @javax.annotation.Nonnull + private String sha256Hash; + + public static final String SERIALIZED_NAME_TEAM_ID = "team_id"; + @SerializedName(SERIALIZED_NAME_TEAM_ID) + @javax.annotation.Nonnull + private Long teamId; + + public AnalysisBasicInfoOutputBody() { + } + + public AnalysisBasicInfoOutputBody analysisScope(@javax.annotation.Nonnull AnalysisScopeEnum analysisScope) { + this.analysisScope = analysisScope; + return this; + } + + /** + * PUBLIC, PRIVATE, or TEAM + * @return analysisScope + */ + @javax.annotation.Nonnull + public AnalysisScopeEnum getAnalysisScope() { + return analysisScope; + } + + public void setAnalysisScope(@javax.annotation.Nonnull AnalysisScopeEnum analysisScope) { + this.analysisScope = analysisScope; + } + + + public AnalysisBasicInfoOutputBody baseAddress(@javax.annotation.Nullable Long baseAddress) { + this.baseAddress = baseAddress; + return this; + } + + /** + * Base address of the binary, null when unknown + * @return baseAddress + */ + @javax.annotation.Nullable + public Long getBaseAddress() { + return baseAddress; + } + + public void setBaseAddress(@javax.annotation.Nullable Long baseAddress) { + this.baseAddress = baseAddress; + } + + + public AnalysisBasicInfoOutputBody binaryId(@javax.annotation.Nonnull Long binaryId) { + this.binaryId = binaryId; + return this; + } + + /** + * Binary ID + * @return binaryId + */ + @javax.annotation.Nonnull + public Long getBinaryId() { + return binaryId; + } + + public void setBinaryId(@javax.annotation.Nonnull Long binaryId) { + this.binaryId = binaryId; + } + + + public AnalysisBasicInfoOutputBody binaryName(@javax.annotation.Nonnull String binaryName) { + this.binaryName = binaryName; + return this; + } + + /** + * Binary filename + * @return binaryName + */ + @javax.annotation.Nonnull + public String getBinaryName() { + return binaryName; + } + + public void setBinaryName(@javax.annotation.Nonnull String binaryName) { + this.binaryName = binaryName; + } + + + public AnalysisBasicInfoOutputBody binarySize(@javax.annotation.Nonnull Long binarySize) { + this.binarySize = binarySize; + return this; + } + + /** + * Binary size in bytes + * @return binarySize + */ + @javax.annotation.Nonnull + public Long getBinarySize() { + return binarySize; + } + + public void setBinarySize(@javax.annotation.Nonnull Long binarySize) { + this.binarySize = binarySize; + } + + + public AnalysisBasicInfoOutputBody binaryUuid(@javax.annotation.Nullable String binaryUuid) { + this.binaryUuid = binaryUuid; + return this; + } + + /** + * UUID of the binary, omitted when not set + * @return binaryUuid + */ + @javax.annotation.Nullable + public String getBinaryUuid() { + return binaryUuid; + } + + public void setBinaryUuid(@javax.annotation.Nullable String binaryUuid) { + this.binaryUuid = binaryUuid; + } + + + public AnalysisBasicInfoOutputBody creation(@javax.annotation.Nonnull OffsetDateTime creation) { + this.creation = creation; + return this; + } + + /** + * When the binary was uploaded + * @return creation + */ + @javax.annotation.Nonnull + public OffsetDateTime getCreation() { + return creation; + } + + public void setCreation(@javax.annotation.Nonnull OffsetDateTime creation) { + this.creation = creation; + } + + + public AnalysisBasicInfoOutputBody debug(@javax.annotation.Nonnull Boolean debug) { + this.debug = debug; + return this; + } + + /** + * True when the binary was analysed with debug symbols + * @return debug + */ + @javax.annotation.Nonnull + public Boolean getDebug() { + return debug; + } + + public void setDebug(@javax.annotation.Nonnull Boolean debug) { + this.debug = debug; + } + + + public AnalysisBasicInfoOutputBody functionCount(@javax.annotation.Nonnull Long functionCount) { + this.functionCount = functionCount; + return this; + } + + /** + * Number of functions in the binary + * @return functionCount + */ + @javax.annotation.Nonnull + public Long getFunctionCount() { + return functionCount; + } + + public void setFunctionCount(@javax.annotation.Nonnull Long functionCount) { + this.functionCount = functionCount; + } + + + public AnalysisBasicInfoOutputBody isAdvanced(@javax.annotation.Nonnull Boolean isAdvanced) { + this.isAdvanced = isAdvanced; + return this; + } + + /** + * True when the analysis was run in advanced mode + * @return isAdvanced + */ + @javax.annotation.Nonnull + public Boolean getIsAdvanced() { + return isAdvanced; + } + + public void setIsAdvanced(@javax.annotation.Nonnull Boolean isAdvanced) { + this.isAdvanced = isAdvanced; + } + + + public AnalysisBasicInfoOutputBody isOwner(@javax.annotation.Nonnull Boolean isOwner) { + this.isOwner = isOwner; + return this; + } + + /** + * True when the caller is the analysis owner + * @return isOwner + */ + @javax.annotation.Nonnull + public Boolean getIsOwner() { + return isOwner; + } + + public void setIsOwner(@javax.annotation.Nonnull Boolean isOwner) { + this.isOwner = isOwner; + } + + + public AnalysisBasicInfoOutputBody isSystem(@javax.annotation.Nonnull Boolean isSystem) { + this.isSystem = isSystem; + return this; + } + + /** + * True when the analysis is owned by a system user + * @return isSystem + */ + @javax.annotation.Nonnull + public Boolean getIsSystem() { + return isSystem; + } + + public void setIsSystem(@javax.annotation.Nonnull Boolean isSystem) { + this.isSystem = isSystem; + } + + + public AnalysisBasicInfoOutputBody modelId(@javax.annotation.Nonnull Long modelId) { + this.modelId = modelId; + return this; + } + + /** + * Model ID + * @return modelId + */ + @javax.annotation.Nonnull + public Long getModelId() { + return modelId; + } + + public void setModelId(@javax.annotation.Nonnull Long modelId) { + this.modelId = modelId; + } + + + public AnalysisBasicInfoOutputBody modelName(@javax.annotation.Nonnull String modelName) { + this.modelName = modelName; + return this; + } + + /** + * Model used for analysis + * @return modelName + */ + @javax.annotation.Nonnull + public String getModelName() { + return modelName; + } + + public void setModelName(@javax.annotation.Nonnull String modelName) { + this.modelName = modelName; + } + + + public AnalysisBasicInfoOutputBody ownerUsername(@javax.annotation.Nonnull String ownerUsername) { + this.ownerUsername = ownerUsername; + return this; + } + + /** + * Username of the analysis owner + * @return ownerUsername + */ + @javax.annotation.Nonnull + public String getOwnerUsername() { + return ownerUsername; + } + + public void setOwnerUsername(@javax.annotation.Nonnull String ownerUsername) { + this.ownerUsername = ownerUsername; + } + + + public AnalysisBasicInfoOutputBody sequencerVersion(@javax.annotation.Nullable String sequencerVersion) { + this.sequencerVersion = sequencerVersion; + return this; + } + + /** + * Sequencer version, omitted when not set + * @return sequencerVersion + */ + @javax.annotation.Nullable + public String getSequencerVersion() { + return sequencerVersion; + } + + public void setSequencerVersion(@javax.annotation.Nullable String sequencerVersion) { + this.sequencerVersion = sequencerVersion; + } + + + public AnalysisBasicInfoOutputBody sha256Hash(@javax.annotation.Nonnull String sha256Hash) { + this.sha256Hash = sha256Hash; + return this; + } + + /** + * SHA-256 hash of the binary + * @return sha256Hash + */ + @javax.annotation.Nonnull + public String getSha256Hash() { + return sha256Hash; + } + + public void setSha256Hash(@javax.annotation.Nonnull String sha256Hash) { + this.sha256Hash = sha256Hash; + } + + + public AnalysisBasicInfoOutputBody teamId(@javax.annotation.Nonnull Long teamId) { + this.teamId = teamId; + return this; + } + + /** + * Team ID of the analysis + * @return teamId + */ + @javax.annotation.Nonnull + public Long getTeamId() { + return teamId; + } + + public void setTeamId(@javax.annotation.Nonnull Long teamId) { + this.teamId = teamId; + } + + /** + * 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 AnalysisBasicInfoOutputBody instance itself + */ + public AnalysisBasicInfoOutputBody 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; + } + AnalysisBasicInfoOutputBody analysisBasicInfoOutputBody = (AnalysisBasicInfoOutputBody) o; + return Objects.equals(this.analysisScope, analysisBasicInfoOutputBody.analysisScope) && + Objects.equals(this.baseAddress, analysisBasicInfoOutputBody.baseAddress) && + Objects.equals(this.binaryId, analysisBasicInfoOutputBody.binaryId) && + Objects.equals(this.binaryName, analysisBasicInfoOutputBody.binaryName) && + Objects.equals(this.binarySize, analysisBasicInfoOutputBody.binarySize) && + Objects.equals(this.binaryUuid, analysisBasicInfoOutputBody.binaryUuid) && + Objects.equals(this.creation, analysisBasicInfoOutputBody.creation) && + Objects.equals(this.debug, analysisBasicInfoOutputBody.debug) && + Objects.equals(this.functionCount, analysisBasicInfoOutputBody.functionCount) && + Objects.equals(this.isAdvanced, analysisBasicInfoOutputBody.isAdvanced) && + Objects.equals(this.isOwner, analysisBasicInfoOutputBody.isOwner) && + Objects.equals(this.isSystem, analysisBasicInfoOutputBody.isSystem) && + Objects.equals(this.modelId, analysisBasicInfoOutputBody.modelId) && + Objects.equals(this.modelName, analysisBasicInfoOutputBody.modelName) && + Objects.equals(this.ownerUsername, analysisBasicInfoOutputBody.ownerUsername) && + Objects.equals(this.sequencerVersion, analysisBasicInfoOutputBody.sequencerVersion) && + Objects.equals(this.sha256Hash, analysisBasicInfoOutputBody.sha256Hash) && + Objects.equals(this.teamId, analysisBasicInfoOutputBody.teamId)&& + Objects.equals(this.additionalProperties, analysisBasicInfoOutputBody.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(analysisScope, baseAddress, binaryId, binaryName, binarySize, binaryUuid, creation, debug, functionCount, isAdvanced, isOwner, isSystem, modelId, modelName, ownerUsername, sequencerVersion, sha256Hash, teamId, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AnalysisBasicInfoOutputBody {\n"); + sb.append(" analysisScope: ").append(toIndentedString(analysisScope)).append("\n"); + sb.append(" baseAddress: ").append(toIndentedString(baseAddress)).append("\n"); + sb.append(" binaryId: ").append(toIndentedString(binaryId)).append("\n"); + sb.append(" binaryName: ").append(toIndentedString(binaryName)).append("\n"); + sb.append(" binarySize: ").append(toIndentedString(binarySize)).append("\n"); + sb.append(" binaryUuid: ").append(toIndentedString(binaryUuid)).append("\n"); + sb.append(" creation: ").append(toIndentedString(creation)).append("\n"); + sb.append(" debug: ").append(toIndentedString(debug)).append("\n"); + sb.append(" functionCount: ").append(toIndentedString(functionCount)).append("\n"); + sb.append(" isAdvanced: ").append(toIndentedString(isAdvanced)).append("\n"); + sb.append(" isOwner: ").append(toIndentedString(isOwner)).append("\n"); + sb.append(" isSystem: ").append(toIndentedString(isSystem)).append("\n"); + sb.append(" modelId: ").append(toIndentedString(modelId)).append("\n"); + sb.append(" modelName: ").append(toIndentedString(modelName)).append("\n"); + sb.append(" ownerUsername: ").append(toIndentedString(ownerUsername)).append("\n"); + sb.append(" sequencerVersion: ").append(toIndentedString(sequencerVersion)).append("\n"); + sb.append(" sha256Hash: ").append(toIndentedString(sha256Hash)).append("\n"); + sb.append(" teamId: ").append(toIndentedString(teamId)).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_scope", "base_address", "binary_id", "binary_name", "binary_size", "binary_uuid", "creation", "debug", "function_count", "is_advanced", "is_owner", "is_system", "model_id", "model_name", "owner_username", "sequencer_version", "sha_256_hash", "team_id")); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(Arrays.asList("analysis_scope", "base_address", "binary_id", "binary_name", "binary_size", "creation", "debug", "function_count", "is_advanced", "is_owner", "is_system", "model_id", "model_name", "owner_username", "sha_256_hash", "team_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 AnalysisBasicInfoOutputBody + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!AnalysisBasicInfoOutputBody.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format(Locale.ROOT, "The required field(s) %s in AnalysisBasicInfoOutputBody is not found in the empty JSON string", AnalysisBasicInfoOutputBody.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : AnalysisBasicInfoOutputBody.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("analysis_scope").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(Locale.ROOT, "Expected the field `analysis_scope` to be a primitive type in the JSON string but got `%s`", jsonObj.get("analysis_scope").toString())); + } + // validate the required field `analysis_scope` + AnalysisScopeEnum.validateJsonElement(jsonObj.get("analysis_scope")); + 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("binary_uuid") != null && !jsonObj.get("binary_uuid").isJsonNull()) && !jsonObj.get("binary_uuid").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(Locale.ROOT, "Expected the field `binary_uuid` to be a primitive type in the JSON string but got `%s`", jsonObj.get("binary_uuid").toString())); + } + if (!jsonObj.get("model_name").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(Locale.ROOT, "Expected the field `model_name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("model_name").toString())); + } + if (!jsonObj.get("owner_username").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(Locale.ROOT, "Expected the field `owner_username` to be a primitive type in the JSON string but got `%s`", jsonObj.get("owner_username").toString())); + } + if ((jsonObj.get("sequencer_version") != null && !jsonObj.get("sequencer_version").isJsonNull()) && !jsonObj.get("sequencer_version").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(Locale.ROOT, "Expected the field `sequencer_version` to be a primitive type in the JSON string but got `%s`", jsonObj.get("sequencer_version").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 (!AnalysisBasicInfoOutputBody.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'AnalysisBasicInfoOutputBody' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(AnalysisBasicInfoOutputBody.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, AnalysisBasicInfoOutputBody 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 AnalysisBasicInfoOutputBody read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + AnalysisBasicInfoOutputBody 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 AnalysisBasicInfoOutputBody given an JSON string + * + * @param jsonString JSON string + * @return An instance of AnalysisBasicInfoOutputBody + * @throws IOException if the JSON string is invalid with respect to AnalysisBasicInfoOutputBody + */ + public static AnalysisBasicInfoOutputBody fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, AnalysisBasicInfoOutputBody.class); + } + + /** + * Convert an instance of AnalysisBasicInfoOutputBody to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/ai/reveng/model/CreateCheckoutSessionInputBody.java b/src/main/java/ai/reveng/model/CreateCheckoutSessionInputBody.java new file mode 100644 index 0000000..68e19fe --- /dev/null +++ b/src/main/java/ai/reveng/model/CreateCheckoutSessionInputBody.java @@ -0,0 +1,352 @@ +/* + * RevEng.AI API + * RevEng.AI is an AI-powered binary analysis platform for reverse engineering and malware analysis. It provides similarity search across executable binaries and functions, AI-driven decompilation, dynamic execution analysis, firmware unpacking, and integration with external threat intelligence sources like VirusTotal. + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package ai.reveng.model; + +import java.util.Objects; +import java.util.Locale; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; +import java.util.Locale; + +import ai.reveng.invoker.JSON; + +/** + * CreateCheckoutSessionInputBody + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class CreateCheckoutSessionInputBody { + public static final String SERIALIZED_NAME_CANCEL_URL = "cancel_url"; + @SerializedName(SERIALIZED_NAME_CANCEL_URL) + @javax.annotation.Nonnull + private String cancelUrl; + + public static final String SERIALIZED_NAME_PRICE_ID = "price_id"; + @SerializedName(SERIALIZED_NAME_PRICE_ID) + @javax.annotation.Nonnull + private String priceId; + + public static final String SERIALIZED_NAME_SUCCESS_URL = "success_url"; + @SerializedName(SERIALIZED_NAME_SUCCESS_URL) + @javax.annotation.Nonnull + private String successUrl; + + public CreateCheckoutSessionInputBody() { + } + + public CreateCheckoutSessionInputBody cancelUrl(@javax.annotation.Nonnull String cancelUrl) { + this.cancelUrl = cancelUrl; + return this; + } + + /** + * URL to redirect to on cancel. + * @return cancelUrl + */ + @javax.annotation.Nonnull + public String getCancelUrl() { + return cancelUrl; + } + + public void setCancelUrl(@javax.annotation.Nonnull String cancelUrl) { + this.cancelUrl = cancelUrl; + } + + + public CreateCheckoutSessionInputBody priceId(@javax.annotation.Nonnull String priceId) { + this.priceId = priceId; + return this; + } + + /** + * Price ID from /v3/billing/products. + * @return priceId + */ + @javax.annotation.Nonnull + public String getPriceId() { + return priceId; + } + + public void setPriceId(@javax.annotation.Nonnull String priceId) { + this.priceId = priceId; + } + + + public CreateCheckoutSessionInputBody successUrl(@javax.annotation.Nonnull String successUrl) { + this.successUrl = successUrl; + return this; + } + + /** + * URL to redirect to on success. + * @return successUrl + */ + @javax.annotation.Nonnull + public String getSuccessUrl() { + return successUrl; + } + + public void setSuccessUrl(@javax.annotation.Nonnull String successUrl) { + this.successUrl = successUrl; + } + + /** + * 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 CreateCheckoutSessionInputBody instance itself + */ + public CreateCheckoutSessionInputBody 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; + } + CreateCheckoutSessionInputBody createCheckoutSessionInputBody = (CreateCheckoutSessionInputBody) o; + return Objects.equals(this.cancelUrl, createCheckoutSessionInputBody.cancelUrl) && + Objects.equals(this.priceId, createCheckoutSessionInputBody.priceId) && + Objects.equals(this.successUrl, createCheckoutSessionInputBody.successUrl)&& + Objects.equals(this.additionalProperties, createCheckoutSessionInputBody.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(cancelUrl, priceId, successUrl, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CreateCheckoutSessionInputBody {\n"); + sb.append(" cancelUrl: ").append(toIndentedString(cancelUrl)).append("\n"); + sb.append(" priceId: ").append(toIndentedString(priceId)).append("\n"); + sb.append(" successUrl: ").append(toIndentedString(successUrl)).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("cancel_url", "price_id", "success_url")); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(Arrays.asList("cancel_url", "price_id", "success_url")); + } + + /** + * 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 CreateCheckoutSessionInputBody + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!CreateCheckoutSessionInputBody.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format(Locale.ROOT, "The required field(s) %s in CreateCheckoutSessionInputBody is not found in the empty JSON string", CreateCheckoutSessionInputBody.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : CreateCheckoutSessionInputBody.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("cancel_url").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(Locale.ROOT, "Expected the field `cancel_url` to be a primitive type in the JSON string but got `%s`", jsonObj.get("cancel_url").toString())); + } + if (!jsonObj.get("price_id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(Locale.ROOT, "Expected the field `price_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("price_id").toString())); + } + if (!jsonObj.get("success_url").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(Locale.ROOT, "Expected the field `success_url` to be a primitive type in the JSON string but got `%s`", jsonObj.get("success_url").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!CreateCheckoutSessionInputBody.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'CreateCheckoutSessionInputBody' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(CreateCheckoutSessionInputBody.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, CreateCheckoutSessionInputBody 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 CreateCheckoutSessionInputBody read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + CreateCheckoutSessionInputBody 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 CreateCheckoutSessionInputBody given an JSON string + * + * @param jsonString JSON string + * @return An instance of CreateCheckoutSessionInputBody + * @throws IOException if the JSON string is invalid with respect to CreateCheckoutSessionInputBody + */ + public static CreateCheckoutSessionInputBody fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, CreateCheckoutSessionInputBody.class); + } + + /** + * Convert an instance of CreateCheckoutSessionInputBody to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/ai/reveng/model/CreatePortalSessionInputBody.java b/src/main/java/ai/reveng/model/CreatePortalSessionInputBody.java new file mode 100644 index 0000000..8e511e9 --- /dev/null +++ b/src/main/java/ai/reveng/model/CreatePortalSessionInputBody.java @@ -0,0 +1,294 @@ +/* + * RevEng.AI API + * RevEng.AI is an AI-powered binary analysis platform for reverse engineering and malware analysis. It provides similarity search across executable binaries and functions, AI-driven decompilation, dynamic execution analysis, firmware unpacking, and integration with external threat intelligence sources like VirusTotal. + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package ai.reveng.model; + +import java.util.Objects; +import java.util.Locale; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; +import java.util.Locale; + +import ai.reveng.invoker.JSON; + +/** + * CreatePortalSessionInputBody + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class CreatePortalSessionInputBody { + public static final String SERIALIZED_NAME_RETURN_URL = "return_url"; + @SerializedName(SERIALIZED_NAME_RETURN_URL) + @javax.annotation.Nonnull + private String returnUrl; + + public CreatePortalSessionInputBody() { + } + + public CreatePortalSessionInputBody returnUrl(@javax.annotation.Nonnull String returnUrl) { + this.returnUrl = returnUrl; + return this; + } + + /** + * URL the user returns to. + * @return returnUrl + */ + @javax.annotation.Nonnull + public String getReturnUrl() { + return returnUrl; + } + + public void setReturnUrl(@javax.annotation.Nonnull String returnUrl) { + this.returnUrl = returnUrl; + } + + /** + * 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 CreatePortalSessionInputBody instance itself + */ + public CreatePortalSessionInputBody 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; + } + CreatePortalSessionInputBody createPortalSessionInputBody = (CreatePortalSessionInputBody) o; + return Objects.equals(this.returnUrl, createPortalSessionInputBody.returnUrl)&& + Objects.equals(this.additionalProperties, createPortalSessionInputBody.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(returnUrl, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CreatePortalSessionInputBody {\n"); + sb.append(" returnUrl: ").append(toIndentedString(returnUrl)).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("return_url")); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(Arrays.asList("return_url")); + } + + /** + * 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 CreatePortalSessionInputBody + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!CreatePortalSessionInputBody.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format(Locale.ROOT, "The required field(s) %s in CreatePortalSessionInputBody is not found in the empty JSON string", CreatePortalSessionInputBody.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : CreatePortalSessionInputBody.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("return_url").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(Locale.ROOT, "Expected the field `return_url` to be a primitive type in the JSON string but got `%s`", jsonObj.get("return_url").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!CreatePortalSessionInputBody.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'CreatePortalSessionInputBody' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(CreatePortalSessionInputBody.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, CreatePortalSessionInputBody 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 CreatePortalSessionInputBody read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + CreatePortalSessionInputBody 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 CreatePortalSessionInputBody given an JSON string + * + * @param jsonString JSON string + * @return An instance of CreatePortalSessionInputBody + * @throws IOException if the JSON string is invalid with respect to CreatePortalSessionInputBody + */ + public static CreatePortalSessionInputBody fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, CreatePortalSessionInputBody.class); + } + + /** + * Convert an instance of CreatePortalSessionInputBody to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/ai/reveng/model/ErrorBody.java b/src/main/java/ai/reveng/model/ErrorBody.java index 5e9eb51..7d5741c 100644 --- a/src/main/java/ai/reveng/model/ErrorBody.java +++ b/src/main/java/ai/reveng/model/ErrorBody.java @@ -58,6 +58,22 @@ public class ErrorBody { public enum CodeEnum { ACCESS_DENIED("ACCESS_DENIED"), + AGENT_BUDGET_EXCEEDED("AGENT_BUDGET_EXCEEDED"), + + AGENT_DEFINITION_NOT_FOUND("AGENT_DEFINITION_NOT_FOUND"), + + AGENT_INVALID_STARTING_INPUT("AGENT_INVALID_STARTING_INPUT"), + + AGENT_MEMORY_INVALID_SCOPE("AGENT_MEMORY_INVALID_SCOPE"), + + AGENT_MEMORY_NOT_FOUND("AGENT_MEMORY_NOT_FOUND"), + + AGENT_MEMORY_VERSION_CONFLICT("AGENT_MEMORY_VERSION_CONFLICT"), + + AGENT_NO_PENDING_QUESTION("AGENT_NO_PENDING_QUESTION"), + + AGENT_RUN_NOT_FOUND("AGENT_RUN_NOT_FOUND"), + ALREADY_EXISTS("ALREADY_EXISTS"), ANALYSIS_NOT_READY("ANALYSIS_NOT_READY"), diff --git a/src/main/java/ai/reveng/model/GetProductsOutputBody.java b/src/main/java/ai/reveng/model/GetProductsOutputBody.java new file mode 100644 index 0000000..a52812d --- /dev/null +++ b/src/main/java/ai/reveng/model/GetProductsOutputBody.java @@ -0,0 +1,308 @@ +/* + * 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.ProductOutput; +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 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; + +/** + * GetProductsOutputBody + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class GetProductsOutputBody { + public static final String SERIALIZED_NAME_PRODUCTS = "products"; + @SerializedName(SERIALIZED_NAME_PRODUCTS) + @javax.annotation.Nullable + private List products; + + public GetProductsOutputBody() { + } + + public GetProductsOutputBody products(@javax.annotation.Nullable List products) { + this.products = products; + return this; + } + + public GetProductsOutputBody addProductsItem(ProductOutput productsItem) { + if (this.products == null) { + this.products = new ArrayList<>(); + } + this.products.add(productsItem); + return this; + } + + /** + * List of available products + * @return products + */ + @javax.annotation.Nullable + public List getProducts() { + return products; + } + + public void setProducts(@javax.annotation.Nullable List products) { + this.products = products; + } + + /** + * 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 GetProductsOutputBody instance itself + */ + public GetProductsOutputBody 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; + } + GetProductsOutputBody getProductsOutputBody = (GetProductsOutputBody) o; + return Objects.equals(this.products, getProductsOutputBody.products)&& + Objects.equals(this.additionalProperties, getProductsOutputBody.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(products, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetProductsOutputBody {\n"); + sb.append(" products: ").append(toIndentedString(products)).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("products")); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(Arrays.asList("products")); + } + + /** + * 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 GetProductsOutputBody + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!GetProductsOutputBody.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format(Locale.ROOT, "The required field(s) %s in GetProductsOutputBody is not found in the empty JSON string", GetProductsOutputBody.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : GetProductsOutputBody.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format(Locale.ROOT, "The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // ensure the required json array is present + if (jsonObj.get("products") == null) { + throw new IllegalArgumentException("Expected the field `linkedContent` to be an array in the JSON string but got `null`"); + } else if (!jsonObj.get("products").isJsonArray()) { + throw new IllegalArgumentException(String.format(Locale.ROOT, "Expected the field `products` to be an array in the JSON string but got `%s`", jsonObj.get("products").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!GetProductsOutputBody.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'GetProductsOutputBody' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(GetProductsOutputBody.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, GetProductsOutputBody 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 GetProductsOutputBody read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + GetProductsOutputBody 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 GetProductsOutputBody given an JSON string + * + * @param jsonString JSON string + * @return An instance of GetProductsOutputBody + * @throws IOException if the JSON string is invalid with respect to GetProductsOutputBody + */ + public static GetProductsOutputBody fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, GetProductsOutputBody.class); + } + + /** + * Convert an instance of GetProductsOutputBody to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/ai/reveng/model/GetSubscriptionOutputBody.java b/src/main/java/ai/reveng/model/GetSubscriptionOutputBody.java new file mode 100644 index 0000000..8da5a78 --- /dev/null +++ b/src/main/java/ai/reveng/model/GetSubscriptionOutputBody.java @@ -0,0 +1,552 @@ +/* + * 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.PriceSummary; +import ai.reveng.model.ProductSummary; +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; + +/** + * GetSubscriptionOutputBody + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class GetSubscriptionOutputBody { + public static final String SERIALIZED_NAME_ENDS_AT = "ends_at"; + @SerializedName(SERIALIZED_NAME_ENDS_AT) + @javax.annotation.Nullable + private OffsetDateTime endsAt; + + public static final String SERIALIZED_NAME_PRICE = "price"; + @SerializedName(SERIALIZED_NAME_PRICE) + @javax.annotation.Nullable + private PriceSummary price; + + public static final String SERIALIZED_NAME_PRODUCT = "product"; + @SerializedName(SERIALIZED_NAME_PRODUCT) + @javax.annotation.Nullable + private ProductSummary product; + + public static final String SERIALIZED_NAME_RENEWS_AT = "renews_at"; + @SerializedName(SERIALIZED_NAME_RENEWS_AT) + @javax.annotation.Nullable + private OffsetDateTime renewsAt; + + /** + * Subscription state. + */ + @JsonAdapter(StatusEnum.Adapter.class) + public enum StatusEnum { + ACTIVE("ACTIVE"), + + CANCELING("CANCELING"), + + PAYMENT_ISSUE("PAYMENT_ISSUE"), + + NONE("NONE"), + + UNKNOWN_DEFAULT_OPEN_API("unknown_default_open_api"); + + private String value; + + StatusEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static StatusEnum fromValue(String value) { + for (StatusEnum b : StatusEnum.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 StatusEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public StatusEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return StatusEnum.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + StatusEnum.fromValue(value); + } + } + + public static final String SERIALIZED_NAME_STATUS = "status"; + @SerializedName(SERIALIZED_NAME_STATUS) + @javax.annotation.Nonnull + private StatusEnum status; + + /** + * User's effective tier. + */ + @JsonAdapter(TierEnum.Adapter.class) + public enum TierEnum { + ENTHUSIAST("ENTHUSIAST"), + + REVERSER("REVERSER"), + + VULNERABILITY_HUNTER("VULNERABILITY_HUNTER"), + + MALWARE_ANALYST("MALWARE_ANALYST"), + + SECURITY_RESEARCHER("SECURITY_RESEARCHER"), + + UNKNOWN_DEFAULT_OPEN_API("unknown_default_open_api"); + + private String value; + + TierEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static TierEnum fromValue(String value) { + for (TierEnum b : TierEnum.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 TierEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public TierEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return TierEnum.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + TierEnum.fromValue(value); + } + } + + public static final String SERIALIZED_NAME_TIER = "tier"; + @SerializedName(SERIALIZED_NAME_TIER) + @javax.annotation.Nonnull + private TierEnum tier; + + public GetSubscriptionOutputBody() { + } + + public GetSubscriptionOutputBody endsAt(@javax.annotation.Nullable OffsetDateTime endsAt) { + this.endsAt = endsAt; + return this; + } + + /** + * Date access ends (CANCELING only). + * @return endsAt + */ + @javax.annotation.Nullable + public OffsetDateTime getEndsAt() { + return endsAt; + } + + public void setEndsAt(@javax.annotation.Nullable OffsetDateTime endsAt) { + this.endsAt = endsAt; + } + + + public GetSubscriptionOutputBody price(@javax.annotation.Nullable PriceSummary price) { + this.price = price; + return this; + } + + /** + * Current price (ACTIVE / CANCELING / PAYMENT_ISSUE only). + * @return price + */ + @javax.annotation.Nullable + public PriceSummary getPrice() { + return price; + } + + public void setPrice(@javax.annotation.Nullable PriceSummary price) { + this.price = price; + } + + + public GetSubscriptionOutputBody product(@javax.annotation.Nullable ProductSummary product) { + this.product = product; + return this; + } + + /** + * Subscribed product (ACTIVE / CANCELING / PAYMENT_ISSUE only). + * @return product + */ + @javax.annotation.Nullable + public ProductSummary getProduct() { + return product; + } + + public void setProduct(@javax.annotation.Nullable ProductSummary product) { + this.product = product; + } + + + public GetSubscriptionOutputBody renewsAt(@javax.annotation.Nullable OffsetDateTime renewsAt) { + this.renewsAt = renewsAt; + return this; + } + + /** + * Next billing date (ACTIVE only). + * @return renewsAt + */ + @javax.annotation.Nullable + public OffsetDateTime getRenewsAt() { + return renewsAt; + } + + public void setRenewsAt(@javax.annotation.Nullable OffsetDateTime renewsAt) { + this.renewsAt = renewsAt; + } + + + public GetSubscriptionOutputBody status(@javax.annotation.Nonnull StatusEnum status) { + this.status = status; + return this; + } + + /** + * Subscription state. + * @return status + */ + @javax.annotation.Nonnull + public StatusEnum getStatus() { + return status; + } + + public void setStatus(@javax.annotation.Nonnull StatusEnum status) { + this.status = status; + } + + + public GetSubscriptionOutputBody tier(@javax.annotation.Nonnull TierEnum tier) { + this.tier = tier; + return this; + } + + /** + * User's effective tier. + * @return tier + */ + @javax.annotation.Nonnull + public TierEnum getTier() { + return tier; + } + + public void setTier(@javax.annotation.Nonnull TierEnum tier) { + this.tier = tier; + } + + /** + * 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 GetSubscriptionOutputBody instance itself + */ + public GetSubscriptionOutputBody 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; + } + GetSubscriptionOutputBody getSubscriptionOutputBody = (GetSubscriptionOutputBody) o; + return Objects.equals(this.endsAt, getSubscriptionOutputBody.endsAt) && + Objects.equals(this.price, getSubscriptionOutputBody.price) && + Objects.equals(this.product, getSubscriptionOutputBody.product) && + Objects.equals(this.renewsAt, getSubscriptionOutputBody.renewsAt) && + Objects.equals(this.status, getSubscriptionOutputBody.status) && + Objects.equals(this.tier, getSubscriptionOutputBody.tier)&& + Objects.equals(this.additionalProperties, getSubscriptionOutputBody.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(endsAt, price, product, renewsAt, status, tier, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetSubscriptionOutputBody {\n"); + sb.append(" endsAt: ").append(toIndentedString(endsAt)).append("\n"); + sb.append(" price: ").append(toIndentedString(price)).append("\n"); + sb.append(" product: ").append(toIndentedString(product)).append("\n"); + sb.append(" renewsAt: ").append(toIndentedString(renewsAt)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append(" tier: ").append(toIndentedString(tier)).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("ends_at", "price", "product", "renews_at", "status", "tier")); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(Arrays.asList("status", "tier")); + } + + /** + * 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 GetSubscriptionOutputBody + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!GetSubscriptionOutputBody.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format(Locale.ROOT, "The required field(s) %s in GetSubscriptionOutputBody is not found in the empty JSON string", GetSubscriptionOutputBody.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : GetSubscriptionOutputBody.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("status").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(Locale.ROOT, "Expected the field `status` to be a primitive type in the JSON string but got `%s`", jsonObj.get("status").toString())); + } + // validate the required field `status` + StatusEnum.validateJsonElement(jsonObj.get("status")); + if (!jsonObj.get("tier").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(Locale.ROOT, "Expected the field `tier` to be a primitive type in the JSON string but got `%s`", jsonObj.get("tier").toString())); + } + // validate the required field `tier` + TierEnum.validateJsonElement(jsonObj.get("tier")); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!GetSubscriptionOutputBody.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'GetSubscriptionOutputBody' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(GetSubscriptionOutputBody.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, GetSubscriptionOutputBody 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 GetSubscriptionOutputBody read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + GetSubscriptionOutputBody 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 GetSubscriptionOutputBody given an JSON string + * + * @param jsonString JSON string + * @return An instance of GetSubscriptionOutputBody + * @throws IOException if the JSON string is invalid with respect to GetSubscriptionOutputBody + */ + public static GetSubscriptionOutputBody fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, GetSubscriptionOutputBody.class); + } + + /** + * Convert an instance of GetSubscriptionOutputBody to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/ai/reveng/model/PriceOutput.java b/src/main/java/ai/reveng/model/PriceOutput.java new file mode 100644 index 0000000..bd7e0db --- /dev/null +++ b/src/main/java/ai/reveng/model/PriceOutput.java @@ -0,0 +1,434 @@ +/* + * RevEng.AI API + * RevEng.AI is an AI-powered binary analysis platform for reverse engineering and malware analysis. It provides similarity search across executable binaries and functions, AI-driven decompilation, dynamic execution analysis, firmware unpacking, and integration with external threat intelligence sources like VirusTotal. + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package ai.reveng.model; + +import java.util.Objects; +import java.util.Locale; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; +import java.util.Locale; + +import ai.reveng.invoker.JSON; + +/** + * PriceOutput + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class PriceOutput { + public static final String SERIALIZED_NAME_CURRENCY = "currency"; + @SerializedName(SERIALIZED_NAME_CURRENCY) + @javax.annotation.Nonnull + private String currency; + + public static final String SERIALIZED_NAME_ID = "id"; + @SerializedName(SERIALIZED_NAME_ID) + @javax.annotation.Nonnull + private String id; + + /** + * Billing interval at which the price recurs. + */ + @JsonAdapter(IntervalEnum.Adapter.class) + public enum IntervalEnum { + MONTH("month"), + + YEAR("year"), + + UNKNOWN_DEFAULT_OPEN_API("unknown_default_open_api"); + + private String value; + + IntervalEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static IntervalEnum fromValue(String value) { + for (IntervalEnum b : IntervalEnum.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 IntervalEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public IntervalEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return IntervalEnum.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + IntervalEnum.fromValue(value); + } + } + + public static final String SERIALIZED_NAME_INTERVAL = "interval"; + @SerializedName(SERIALIZED_NAME_INTERVAL) + @javax.annotation.Nonnull + private IntervalEnum interval; + + public static final String SERIALIZED_NAME_UNIT_AMOUNT = "unit_amount"; + @SerializedName(SERIALIZED_NAME_UNIT_AMOUNT) + @javax.annotation.Nonnull + private Long unitAmount; + + public PriceOutput() { + } + + public PriceOutput currency(@javax.annotation.Nonnull String currency) { + this.currency = currency; + return this; + } + + /** + * Lowercase ISO 4217 currency code (e.g. \"usd\", \"gbp\"). + * @return currency + */ + @javax.annotation.Nonnull + public String getCurrency() { + return currency; + } + + public void setCurrency(@javax.annotation.Nonnull String currency) { + this.currency = currency; + } + + + public PriceOutput id(@javax.annotation.Nonnull String id) { + this.id = id; + return this; + } + + /** + * Price ID. + * @return id + */ + @javax.annotation.Nonnull + public String getId() { + return id; + } + + public void setId(@javax.annotation.Nonnull String id) { + this.id = id; + } + + + public PriceOutput interval(@javax.annotation.Nonnull IntervalEnum interval) { + this.interval = interval; + return this; + } + + /** + * Billing interval at which the price recurs. + * @return interval + */ + @javax.annotation.Nonnull + public IntervalEnum getInterval() { + return interval; + } + + public void setInterval(@javax.annotation.Nonnull IntervalEnum interval) { + this.interval = interval; + } + + + public PriceOutput unitAmount(@javax.annotation.Nonnull Long unitAmount) { + this.unitAmount = unitAmount; + return this; + } + + /** + * Price per billing interval, expressed in the smallest unit of the currency (e.g. cents for USD, pence for GBP). + * @return unitAmount + */ + @javax.annotation.Nonnull + public Long getUnitAmount() { + return unitAmount; + } + + public void setUnitAmount(@javax.annotation.Nonnull Long unitAmount) { + this.unitAmount = unitAmount; + } + + /** + * 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 PriceOutput instance itself + */ + public PriceOutput 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; + } + PriceOutput priceOutput = (PriceOutput) o; + return Objects.equals(this.currency, priceOutput.currency) && + Objects.equals(this.id, priceOutput.id) && + Objects.equals(this.interval, priceOutput.interval) && + Objects.equals(this.unitAmount, priceOutput.unitAmount)&& + Objects.equals(this.additionalProperties, priceOutput.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(currency, id, interval, unitAmount, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class PriceOutput {\n"); + sb.append(" currency: ").append(toIndentedString(currency)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" interval: ").append(toIndentedString(interval)).append("\n"); + sb.append(" unitAmount: ").append(toIndentedString(unitAmount)).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("currency", "id", "interval", "unit_amount")); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(Arrays.asList("currency", "id", "interval", "unit_amount")); + } + + /** + * 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 PriceOutput + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!PriceOutput.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format(Locale.ROOT, "The required field(s) %s in PriceOutput is not found in the empty JSON string", PriceOutput.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : PriceOutput.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("currency").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(Locale.ROOT, "Expected the field `currency` to be a primitive type in the JSON string but got `%s`", jsonObj.get("currency").toString())); + } + if (!jsonObj.get("id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(Locale.ROOT, "Expected the field `id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("id").toString())); + } + if (!jsonObj.get("interval").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(Locale.ROOT, "Expected the field `interval` to be a primitive type in the JSON string but got `%s`", jsonObj.get("interval").toString())); + } + // validate the required field `interval` + IntervalEnum.validateJsonElement(jsonObj.get("interval")); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!PriceOutput.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'PriceOutput' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(PriceOutput.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, PriceOutput 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 PriceOutput read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + PriceOutput 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 PriceOutput given an JSON string + * + * @param jsonString JSON string + * @return An instance of PriceOutput + * @throws IOException if the JSON string is invalid with respect to PriceOutput + */ + public static PriceOutput fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, PriceOutput.class); + } + + /** + * Convert an instance of PriceOutput to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/ai/reveng/model/PriceSummary.java b/src/main/java/ai/reveng/model/PriceSummary.java new file mode 100644 index 0000000..8544aaa --- /dev/null +++ b/src/main/java/ai/reveng/model/PriceSummary.java @@ -0,0 +1,405 @@ +/* + * RevEng.AI API + * RevEng.AI is an AI-powered binary analysis platform for reverse engineering and malware analysis. It provides similarity search across executable binaries and functions, AI-driven decompilation, dynamic execution analysis, firmware unpacking, and integration with external threat intelligence sources like VirusTotal. + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package ai.reveng.model; + +import java.util.Objects; +import java.util.Locale; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; +import java.util.Locale; + +import ai.reveng.invoker.JSON; + +/** + * PriceSummary + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class PriceSummary { + public static final String SERIALIZED_NAME_CURRENCY = "currency"; + @SerializedName(SERIALIZED_NAME_CURRENCY) + @javax.annotation.Nonnull + private String currency; + + /** + * Billing interval at which the price recurs. + */ + @JsonAdapter(IntervalEnum.Adapter.class) + public enum IntervalEnum { + MONTH("month"), + + YEAR("year"), + + UNKNOWN_DEFAULT_OPEN_API("unknown_default_open_api"); + + private String value; + + IntervalEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static IntervalEnum fromValue(String value) { + for (IntervalEnum b : IntervalEnum.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 IntervalEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public IntervalEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return IntervalEnum.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + IntervalEnum.fromValue(value); + } + } + + public static final String SERIALIZED_NAME_INTERVAL = "interval"; + @SerializedName(SERIALIZED_NAME_INTERVAL) + @javax.annotation.Nonnull + private IntervalEnum interval; + + public static final String SERIALIZED_NAME_UNIT_AMOUNT = "unit_amount"; + @SerializedName(SERIALIZED_NAME_UNIT_AMOUNT) + @javax.annotation.Nonnull + private Long unitAmount; + + public PriceSummary() { + } + + public PriceSummary currency(@javax.annotation.Nonnull String currency) { + this.currency = currency; + return this; + } + + /** + * Lowercase ISO 4217 currency code. + * @return currency + */ + @javax.annotation.Nonnull + public String getCurrency() { + return currency; + } + + public void setCurrency(@javax.annotation.Nonnull String currency) { + this.currency = currency; + } + + + public PriceSummary interval(@javax.annotation.Nonnull IntervalEnum interval) { + this.interval = interval; + return this; + } + + /** + * Billing interval at which the price recurs. + * @return interval + */ + @javax.annotation.Nonnull + public IntervalEnum getInterval() { + return interval; + } + + public void setInterval(@javax.annotation.Nonnull IntervalEnum interval) { + this.interval = interval; + } + + + public PriceSummary unitAmount(@javax.annotation.Nonnull Long unitAmount) { + this.unitAmount = unitAmount; + return this; + } + + /** + * Price per billing interval, in the smallest unit of the currency. + * @return unitAmount + */ + @javax.annotation.Nonnull + public Long getUnitAmount() { + return unitAmount; + } + + public void setUnitAmount(@javax.annotation.Nonnull Long unitAmount) { + this.unitAmount = unitAmount; + } + + /** + * 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 PriceSummary instance itself + */ + public PriceSummary 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; + } + PriceSummary priceSummary = (PriceSummary) o; + return Objects.equals(this.currency, priceSummary.currency) && + Objects.equals(this.interval, priceSummary.interval) && + Objects.equals(this.unitAmount, priceSummary.unitAmount)&& + Objects.equals(this.additionalProperties, priceSummary.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(currency, interval, unitAmount, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class PriceSummary {\n"); + sb.append(" currency: ").append(toIndentedString(currency)).append("\n"); + sb.append(" interval: ").append(toIndentedString(interval)).append("\n"); + sb.append(" unitAmount: ").append(toIndentedString(unitAmount)).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("currency", "interval", "unit_amount")); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(Arrays.asList("currency", "interval", "unit_amount")); + } + + /** + * 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 PriceSummary + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!PriceSummary.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format(Locale.ROOT, "The required field(s) %s in PriceSummary is not found in the empty JSON string", PriceSummary.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : PriceSummary.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("currency").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(Locale.ROOT, "Expected the field `currency` to be a primitive type in the JSON string but got `%s`", jsonObj.get("currency").toString())); + } + if (!jsonObj.get("interval").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(Locale.ROOT, "Expected the field `interval` to be a primitive type in the JSON string but got `%s`", jsonObj.get("interval").toString())); + } + // validate the required field `interval` + IntervalEnum.validateJsonElement(jsonObj.get("interval")); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!PriceSummary.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'PriceSummary' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(PriceSummary.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, PriceSummary 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 PriceSummary read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + PriceSummary 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 PriceSummary given an JSON string + * + * @param jsonString JSON string + * @return An instance of PriceSummary + * @throws IOException if the JSON string is invalid with respect to PriceSummary + */ + public static PriceSummary fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, PriceSummary.class); + } + + /** + * Convert an instance of PriceSummary to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/ai/reveng/model/ProductOutput.java b/src/main/java/ai/reveng/model/ProductOutput.java new file mode 100644 index 0000000..817014f --- /dev/null +++ b/src/main/java/ai/reveng/model/ProductOutput.java @@ -0,0 +1,490 @@ +/* + * 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.PriceOutput; +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 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; + +/** + * ProductOutput + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class ProductOutput { + public static final String SERIALIZED_NAME_CREDITS_PER_MONTH = "credits_per_month"; + @SerializedName(SERIALIZED_NAME_CREDITS_PER_MONTH) + @javax.annotation.Nullable + private Long creditsPerMonth; + + public static final String SERIALIZED_NAME_DESCRIPTION = "description"; + @SerializedName(SERIALIZED_NAME_DESCRIPTION) + @javax.annotation.Nonnull + private String description; + + public static final String SERIALIZED_NAME_FEATURES = "features"; + @SerializedName(SERIALIZED_NAME_FEATURES) + @javax.annotation.Nullable + private List features; + + public static final String SERIALIZED_NAME_ID = "id"; + @SerializedName(SERIALIZED_NAME_ID) + @javax.annotation.Nonnull + private String id; + + public static final String SERIALIZED_NAME_NAME = "name"; + @SerializedName(SERIALIZED_NAME_NAME) + @javax.annotation.Nonnull + private String name; + + public static final String SERIALIZED_NAME_PRICES = "prices"; + @SerializedName(SERIALIZED_NAME_PRICES) + @javax.annotation.Nullable + private List prices; + + public static final String SERIALIZED_NAME_TIER = "tier"; + @SerializedName(SERIALIZED_NAME_TIER) + @javax.annotation.Nullable + private String tier; + + public ProductOutput() { + } + + public ProductOutput creditsPerMonth(@javax.annotation.Nullable Long creditsPerMonth) { + this.creditsPerMonth = creditsPerMonth; + return this; + } + + /** + * Credits awarded per billing month, if applicable. + * @return creditsPerMonth + */ + @javax.annotation.Nullable + public Long getCreditsPerMonth() { + return creditsPerMonth; + } + + public void setCreditsPerMonth(@javax.annotation.Nullable Long creditsPerMonth) { + this.creditsPerMonth = creditsPerMonth; + } + + + public ProductOutput description(@javax.annotation.Nonnull String description) { + this.description = description; + return this; + } + + /** + * Human-readable product description. + * @return description + */ + @javax.annotation.Nonnull + public String getDescription() { + return description; + } + + public void setDescription(@javax.annotation.Nonnull String description) { + this.description = description; + } + + + public ProductOutput features(@javax.annotation.Nullable List features) { + this.features = features; + return this; + } + + public ProductOutput addFeaturesItem(String featuresItem) { + if (this.features == null) { + this.features = new ArrayList<>(); + } + this.features.add(featuresItem); + return this; + } + + /** + * Marketing feature list for this product. + * @return features + */ + @javax.annotation.Nullable + public List getFeatures() { + return features; + } + + public void setFeatures(@javax.annotation.Nullable List features) { + this.features = features; + } + + + public ProductOutput id(@javax.annotation.Nonnull String id) { + this.id = id; + return this; + } + + /** + * Product ID. + * @return id + */ + @javax.annotation.Nonnull + public String getId() { + return id; + } + + public void setId(@javax.annotation.Nonnull String id) { + this.id = id; + } + + + public ProductOutput name(@javax.annotation.Nonnull String name) { + this.name = name; + return this; + } + + /** + * Human-readable product name. + * @return name + */ + @javax.annotation.Nonnull + public String getName() { + return name; + } + + public void setName(@javax.annotation.Nonnull String name) { + this.name = name; + } + + + public ProductOutput prices(@javax.annotation.Nullable List prices) { + this.prices = prices; + return this; + } + + public ProductOutput addPricesItem(PriceOutput pricesItem) { + if (this.prices == null) { + this.prices = new ArrayList<>(); + } + this.prices.add(pricesItem); + return this; + } + + /** + * All active recurring prices for this product. + * @return prices + */ + @javax.annotation.Nullable + public List getPrices() { + return prices; + } + + public void setPrices(@javax.annotation.Nullable List prices) { + this.prices = prices; + } + + + public ProductOutput tier(@javax.annotation.Nullable String tier) { + this.tier = tier; + return this; + } + + /** + * User tier associated with this product, if any. + * @return tier + */ + @javax.annotation.Nullable + public String getTier() { + return tier; + } + + public void setTier(@javax.annotation.Nullable String tier) { + this.tier = tier; + } + + /** + * 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 ProductOutput instance itself + */ + public ProductOutput 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; + } + ProductOutput productOutput = (ProductOutput) o; + return Objects.equals(this.creditsPerMonth, productOutput.creditsPerMonth) && + Objects.equals(this.description, productOutput.description) && + Objects.equals(this.features, productOutput.features) && + Objects.equals(this.id, productOutput.id) && + Objects.equals(this.name, productOutput.name) && + Objects.equals(this.prices, productOutput.prices) && + Objects.equals(this.tier, productOutput.tier)&& + Objects.equals(this.additionalProperties, productOutput.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(creditsPerMonth, description, features, id, name, prices, tier, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ProductOutput {\n"); + sb.append(" creditsPerMonth: ").append(toIndentedString(creditsPerMonth)).append("\n"); + sb.append(" description: ").append(toIndentedString(description)).append("\n"); + sb.append(" features: ").append(toIndentedString(features)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" prices: ").append(toIndentedString(prices)).append("\n"); + sb.append(" tier: ").append(toIndentedString(tier)).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("credits_per_month", "description", "features", "id", "name", "prices", "tier")); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(Arrays.asList("description", "features", "id", "name", "prices")); + } + + /** + * 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 ProductOutput + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ProductOutput.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format(Locale.ROOT, "The required field(s) %s in ProductOutput is not found in the empty JSON string", ProductOutput.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : ProductOutput.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("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 required json array is present + if (jsonObj.get("features") == null) { + throw new IllegalArgumentException("Expected the field `linkedContent` to be an array in the JSON string but got `null`"); + } else if (!jsonObj.get("features").isJsonArray()) { + throw new IllegalArgumentException(String.format(Locale.ROOT, "Expected the field `features` to be an array in the JSON string but got `%s`", jsonObj.get("features").toString())); + } + if (!jsonObj.get("id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(Locale.ROOT, "Expected the field `id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("id").toString())); + } + if (!jsonObj.get("name").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(Locale.ROOT, "Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString())); + } + // ensure the required json array is present + if (jsonObj.get("prices") == null) { + throw new IllegalArgumentException("Expected the field `linkedContent` to be an array in the JSON string but got `null`"); + } else if (!jsonObj.get("prices").isJsonArray()) { + throw new IllegalArgumentException(String.format(Locale.ROOT, "Expected the field `prices` to be an array in the JSON string but got `%s`", jsonObj.get("prices").toString())); + } + if ((jsonObj.get("tier") != null && !jsonObj.get("tier").isJsonNull()) && !jsonObj.get("tier").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(Locale.ROOT, "Expected the field `tier` to be a primitive type in the JSON string but got `%s`", jsonObj.get("tier").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ProductOutput.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ProductOutput' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ProductOutput.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, ProductOutput 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 ProductOutput read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + ProductOutput 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 ProductOutput given an JSON string + * + * @param jsonString JSON string + * @return An instance of ProductOutput + * @throws IOException if the JSON string is invalid with respect to ProductOutput + */ + public static ProductOutput fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ProductOutput.class); + } + + /** + * Convert an instance of ProductOutput to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/ai/reveng/model/ProductSummary.java b/src/main/java/ai/reveng/model/ProductSummary.java new file mode 100644 index 0000000..4f02b2d --- /dev/null +++ b/src/main/java/ai/reveng/model/ProductSummary.java @@ -0,0 +1,294 @@ +/* + * RevEng.AI API + * RevEng.AI is an AI-powered binary analysis platform for reverse engineering and malware analysis. It provides similarity search across executable binaries and functions, AI-driven decompilation, dynamic execution analysis, firmware unpacking, and integration with external threat intelligence sources like VirusTotal. + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package ai.reveng.model; + +import java.util.Objects; +import java.util.Locale; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; +import java.util.Locale; + +import ai.reveng.invoker.JSON; + +/** + * ProductSummary + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class ProductSummary { + public static final String SERIALIZED_NAME_NAME = "name"; + @SerializedName(SERIALIZED_NAME_NAME) + @javax.annotation.Nonnull + private String name; + + public ProductSummary() { + } + + public ProductSummary name(@javax.annotation.Nonnull String name) { + this.name = name; + return this; + } + + /** + * Product name. + * @return name + */ + @javax.annotation.Nonnull + public String getName() { + return name; + } + + public void setName(@javax.annotation.Nonnull String name) { + this.name = name; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the ProductSummary instance itself + */ + public ProductSummary 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; + } + ProductSummary productSummary = (ProductSummary) o; + return Objects.equals(this.name, productSummary.name)&& + Objects.equals(this.additionalProperties, productSummary.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(name, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ProductSummary {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(Arrays.asList("name")); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(Arrays.asList("name")); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to ProductSummary + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ProductSummary.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format(Locale.ROOT, "The required field(s) %s in ProductSummary is not found in the empty JSON string", ProductSummary.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : ProductSummary.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format(Locale.ROOT, "The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("name").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(Locale.ROOT, "Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ProductSummary.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ProductSummary' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ProductSummary.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, ProductSummary 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 ProductSummary read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + ProductSummary 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 ProductSummary given an JSON string + * + * @param jsonString JSON string + * @return An instance of ProductSummary + * @throws IOException if the JSON string is invalid with respect to ProductSummary + */ + public static ProductSummary fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ProductSummary.class); + } + + /** + * Convert an instance of ProductSummary to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/ai/reveng/model/SessionOutputBody.java b/src/main/java/ai/reveng/model/SessionOutputBody.java new file mode 100644 index 0000000..9a5731a --- /dev/null +++ b/src/main/java/ai/reveng/model/SessionOutputBody.java @@ -0,0 +1,294 @@ +/* + * RevEng.AI API + * RevEng.AI is an AI-powered binary analysis platform for reverse engineering and malware analysis. It provides similarity search across executable binaries and functions, AI-driven decompilation, dynamic execution analysis, firmware unpacking, and integration with external threat intelligence sources like VirusTotal. + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package ai.reveng.model; + +import java.util.Objects; +import java.util.Locale; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; +import java.util.Locale; + +import ai.reveng.invoker.JSON; + +/** + * SessionOutputBody + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class SessionOutputBody { + public static final String SERIALIZED_NAME_URL = "url"; + @SerializedName(SERIALIZED_NAME_URL) + @javax.annotation.Nonnull + private String url; + + public SessionOutputBody() { + } + + public SessionOutputBody url(@javax.annotation.Nonnull String url) { + this.url = url; + return this; + } + + /** + * Hosted session URL to redirect the user to. + * @return url + */ + @javax.annotation.Nonnull + public String getUrl() { + return url; + } + + public void setUrl(@javax.annotation.Nonnull String url) { + this.url = url; + } + + /** + * 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 SessionOutputBody instance itself + */ + public SessionOutputBody 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; + } + SessionOutputBody sessionOutputBody = (SessionOutputBody) o; + return Objects.equals(this.url, sessionOutputBody.url)&& + Objects.equals(this.additionalProperties, sessionOutputBody.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(url, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SessionOutputBody {\n"); + sb.append(" url: ").append(toIndentedString(url)).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("url")); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(Arrays.asList("url")); + } + + /** + * 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 SessionOutputBody + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!SessionOutputBody.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format(Locale.ROOT, "The required field(s) %s in SessionOutputBody is not found in the empty JSON string", SessionOutputBody.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : SessionOutputBody.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("url").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(Locale.ROOT, "Expected the field `url` to be a primitive type in the JSON string but got `%s`", jsonObj.get("url").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!SessionOutputBody.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'SessionOutputBody' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(SessionOutputBody.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, SessionOutputBody 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 SessionOutputBody read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + SessionOutputBody 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 SessionOutputBody given an JSON string + * + * @param jsonString JSON string + * @return An instance of SessionOutputBody + * @throws IOException if the JSON string is invalid with respect to SessionOutputBody + */ + public static SessionOutputBody fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, SessionOutputBody.class); + } + + /** + * Convert an instance of SessionOutputBody to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} +