From e4c1b634ace92e9d278ff7c9bf54756611b45542 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Wed, 23 Sep 2026 07:06:47 +0000 Subject: [PATCH] Update SDK to version v4.54.0 - Generated from OpenAPI spec version v4.54.0 - Auto-generated by GitHub Actions --- .sdk-version | 2 +- README.md | 30 +- build.gradle | 4 +- build.sbt | 2 +- docs/AnalysesBulkActionsApi.md | 77 + docs/AnalysesCoreApi.md | 554 +++++- docs/AnalysesResultsMetadataApi.md | 78 + docs/AnalysisAccessBody.md | 14 + docs/AnalysisCapabilitiesOutputBody.md | 13 + docs/AnalysisCapabilityBody.md | 15 + docs/AnalysisDetailOutputBody.md | 39 + docs/AutoRunAgentsBody.md | 13 + docs/Binary.md | 5 + docs/BinaryExportMetadata.md | 13 + docs/BinaryExportResult.md | 13 + docs/BulkDeleteAnalysesInputBody.md | 13 + docs/DisassemblyOutputBody.md | 2 +- docs/EvidenceInner.md | 2 +- docs/ImportDynamicExecutionFileOutputBody.md | 18 + docs/LookupAnalysisByBinaryIDOutputBody.md | 13 + ...nBinaryExportMetadataBinaryExportResult.md | 17 + docs/RequestedConfigBody.md | 17 + docs/{SuspiciousString.md => StringMatch.md} | 2 +- ...ringEvidence.md => StringMatchEvidence.md} | 8 +- docs/UpdateAnalysisInputBody.md | 25 + pom.xml | 2 +- .../ai/reveng/api/AnalysesBulkActionsApi.java | 141 ++ .../java/ai/reveng/api/AnalysesCoreApi.java | 1731 +++++++++++++---- .../api/AnalysesResultsMetadataApi.java | 145 ++ .../java/ai/reveng/invoker/ApiClient.java | 2 +- .../java/ai/reveng/invoker/Configuration.java | 2 +- src/main/java/ai/reveng/invoker/JSON.java | 19 +- .../ai/reveng/model/AnalysisAccessBody.java | 315 +++ .../model/AnalysisCapabilitiesOutputBody.java | 303 +++ .../reveng/model/AnalysisCapabilityBody.java | 357 ++++ .../model/AnalysisDetailOutputBody.java | 764 ++++++++ .../ai/reveng/model/AutoRunAgentsBody.java | 286 +++ src/main/java/ai/reveng/model/Binary.java | 153 +- .../ai/reveng/model/BinaryExportMetadata.java | 286 +++ .../ai/reveng/model/BinaryExportResult.java | 289 +++ .../model/BulkDeleteAnalysesInputBody.java | 302 +++ .../reveng/model/DisassemblyOutputBody.java | 2 +- .../java/ai/reveng/model/EvidenceInner.java | 56 +- .../ImportDynamicExecutionFileOutputBody.java | 422 ++++ .../LookupAnalysisByBinaryIDOutputBody.java | 286 +++ ...inaryExportMetadataBinaryExportResult.java | 396 ++++ .../ai/reveng/model/RequestedConfigBody.java | 390 ++++ ...SuspiciousString.java => StringMatch.java} | 60 +- ...Evidence.java => StringMatchEvidence.java} | 88 +- .../reveng/model/UpdateAnalysisInputBody.java | 371 ++++ 50 files changed, 7673 insertions(+), 484 deletions(-) create mode 100644 docs/AnalysisAccessBody.md create mode 100644 docs/AnalysisCapabilitiesOutputBody.md create mode 100644 docs/AnalysisCapabilityBody.md create mode 100644 docs/AnalysisDetailOutputBody.md create mode 100644 docs/AutoRunAgentsBody.md create mode 100644 docs/BinaryExportMetadata.md create mode 100644 docs/BinaryExportResult.md create mode 100644 docs/BulkDeleteAnalysesInputBody.md create mode 100644 docs/ImportDynamicExecutionFileOutputBody.md create mode 100644 docs/LookupAnalysisByBinaryIDOutputBody.md create mode 100644 docs/OperationBinaryExportMetadataBinaryExportResult.md create mode 100644 docs/RequestedConfigBody.md rename docs/{SuspiciousString.md => StringMatch.md} (91%) rename docs/{SuspiciousStringEvidence.md => StringMatchEvidence.md} (79%) create mode 100644 docs/UpdateAnalysisInputBody.md create mode 100644 src/main/java/ai/reveng/model/AnalysisAccessBody.java create mode 100644 src/main/java/ai/reveng/model/AnalysisCapabilitiesOutputBody.java create mode 100644 src/main/java/ai/reveng/model/AnalysisCapabilityBody.java create mode 100644 src/main/java/ai/reveng/model/AnalysisDetailOutputBody.java create mode 100644 src/main/java/ai/reveng/model/AutoRunAgentsBody.java create mode 100644 src/main/java/ai/reveng/model/BinaryExportMetadata.java create mode 100644 src/main/java/ai/reveng/model/BinaryExportResult.java create mode 100644 src/main/java/ai/reveng/model/BulkDeleteAnalysesInputBody.java create mode 100644 src/main/java/ai/reveng/model/ImportDynamicExecutionFileOutputBody.java create mode 100644 src/main/java/ai/reveng/model/LookupAnalysisByBinaryIDOutputBody.java create mode 100644 src/main/java/ai/reveng/model/OperationBinaryExportMetadataBinaryExportResult.java create mode 100644 src/main/java/ai/reveng/model/RequestedConfigBody.java rename src/main/java/ai/reveng/model/{SuspiciousString.java => StringMatch.java} (84%) rename src/main/java/ai/reveng/model/{SuspiciousStringEvidence.java => StringMatchEvidence.java} (84%) create mode 100644 src/main/java/ai/reveng/model/UpdateAnalysisInputBody.java diff --git a/.sdk-version b/.sdk-version index 7947760..4fc4729 100644 --- a/.sdk-version +++ b/.sdk-version @@ -1 +1 @@ -v4.51.0 +v4.54.0 diff --git a/README.md b/README.md index ce1d8b1..6c99f7e 100644 --- a/README.md +++ b/README.md @@ -16,7 +16,7 @@ Add this dependency to your project's POM: ai.reveng sdk - 4.51.0 + 4.54.0 compile ``` @@ -31,7 +31,7 @@ repositories { } dependencies { - implementation "ai.reveng:sdk:4.51.0" + implementation "ai.reveng:sdk:4.54.0" } ``` @@ -133,6 +133,7 @@ Class | Method | HTTP request | Description *AgentApi* | [**v3UpsertBinaryAgentFeedback**](docs/AgentApi.md#v3UpsertBinaryAgentFeedback) | **PUT** /v3/analyses/{analysis_id}/agents/{agent}/feedback | Record feedback on an agent's output. *AnalysesBulkActionsApi* | [**bulkAddAnalysisTags**](docs/AnalysesBulkActionsApi.md#bulkAddAnalysisTags) | **PATCH** /v2/analyses/tags/add | Bulk Add Analysis Tags *AnalysesBulkActionsApi* | [**bulkDeleteAnalyses**](docs/AnalysesBulkActionsApi.md#bulkDeleteAnalyses) | **PATCH** /v2/analyses/delete | Bulk Delete Analyses +*AnalysesBulkActionsApi* | [**v3BatchDeleteAnalyses**](docs/AnalysesBulkActionsApi.md#v3BatchDeleteAnalyses) | **POST** /v3/analyses:batchDelete | Delete multiple analyses. *AnalysesCommentsApi* | [**createAnalysisComment**](docs/AnalysesCommentsApi.md#createAnalysisComment) | **POST** /v2/analyses/{analysis_id}/comments | Create a comment for this analysis *AnalysesCommentsApi* | [**deleteAnalysisComment**](docs/AnalysesCommentsApi.md#deleteAnalysisComment) | **DELETE** /v2/analyses/{analysis_id}/comments/{comment_id} | Delete a comment *AnalysesCommentsApi* | [**getAnalysisComments**](docs/AnalysesCommentsApi.md#getAnalysisComments) | **GET** /v2/analyses/{analysis_id}/comments | Get comments for this analysis @@ -161,19 +162,27 @@ Class | Method | HTTP request | Description *AnalysesCoreApi* | [**updateAnalysisTags**](docs/AnalysesCoreApi.md#updateAnalysisTags) | **PATCH** /v2/analyses/{analysis_id}/tags | Update Analysis Tags *AnalysesCoreApi* | [**uploadFile**](docs/AnalysesCoreApi.md#uploadFile) | **POST** /v2/upload | Upload File *AnalysesCoreApi* | [**v3CreateAnalysis**](docs/AnalysesCoreApi.md#v3CreateAnalysis) | **POST** /v3/analyses | Create an analysis +*AnalysesCoreApi* | [**v3DeleteAnalysis**](docs/AnalysesCoreApi.md#v3DeleteAnalysis) | **DELETE** /v3/analyses/{analysis_id} | Delete an analysis. +*AnalysesCoreApi* | [**v3DownloadBinaryExport**](docs/AnalysesCoreApi.md#v3DownloadBinaryExport) | **GET** /v3/analyses/{analysis_id}/binary-export | Download a binary export +*AnalysesCoreApi* | [**v3GetAnalysis**](docs/AnalysesCoreApi.md#v3GetAnalysis) | **GET** /v3/analyses/{analysis_id} | Get an analysis. *AnalysesCoreApi* | [**v3GetAnalysisAutoUnstripStatus**](docs/AnalysesCoreApi.md#v3GetAnalysisAutoUnstripStatus) | **GET** /v3/analyses/{analysis_id}/auto-unstrip/status | Get the auto-unstrip status for an analysis. *AnalysesCoreApi* | [**v3GetAnalysisFunctionsProgress**](docs/AnalysesCoreApi.md#v3GetAnalysisFunctionsProgress) | **GET** /v3/analyses/{analysis_id}/progress/functions | Get function embedding progress for an analysis. *AnalysesCoreApi* | [**v3GetAnalysisLogs**](docs/AnalysesCoreApi.md#v3GetAnalysisLogs) | **GET** /v3/analyses/{analysis_id}/logs | Get the Analysis log *AnalysesCoreApi* | [**v3GetAnalysisOperation**](docs/AnalysesCoreApi.md#v3GetAnalysisOperation) | **GET** /v3/operations/analyses/{analysis_id} | Get an Analysis-creation operation *AnalysesCoreApi* | [**v3GetAnalysisStrings**](docs/AnalysesCoreApi.md#v3GetAnalysisStrings) | **GET** /v3/analyses/{analysis_id}/functions/strings | List strings for an analysis. *AnalysesCoreApi* | [**v3GetAnalysisStringsStatus**](docs/AnalysesCoreApi.md#v3GetAnalysisStringsStatus) | **GET** /v3/analyses/{analysis_id}/functions/strings/status | Get the string-extraction status for an analysis. +*AnalysesCoreApi* | [**v3GetBinaryExportOperation**](docs/AnalysesCoreApi.md#v3GetBinaryExportOperation) | **GET** /v3/operations/binary-export/{task_id} | Get a binary export operation *AnalysesCoreApi* | [**v3ListAnalyses**](docs/AnalysesCoreApi.md#v3ListAnalyses) | **GET** /v3/analyses | List analyses *AnalysesCoreApi* | [**v3ListExampleAnalyses**](docs/AnalysesCoreApi.md#v3ListExampleAnalyses) | **GET** /v3/analyses/examples | List example analyses +*AnalysesCoreApi* | [**v3LookupAnalysisByBinaryId**](docs/AnalysesCoreApi.md#v3LookupAnalysisByBinaryId) | **GET** /v3/analyses/lookup/{binary_id} | Look up the most recent analysis for a binary. +*AnalysesCoreApi* | [**v3QueueBinaryExport**](docs/AnalysesCoreApi.md#v3QueueBinaryExport) | **POST** /v3/analyses/{analysis_id}/binary-export | Queue a binary export +*AnalysesCoreApi* | [**v3UpdateAnalysis**](docs/AnalysesCoreApi.md#v3UpdateAnalysis) | **PATCH** /v3/analyses/{analysis_id} | Update an analysis. *AnalysesCoreApi* | [**v3UpgradeAnalysisModel**](docs/AnalysesCoreApi.md#v3UpgradeAnalysisModel) | **POST** /v3/analyses/{analysis_id}/upgrade-model | Re-analyse on the latest model *AnalysesResultsMetadataApi* | [**getAnalysisFunctionsPaginated**](docs/AnalysesResultsMetadataApi.md#getAnalysisFunctionsPaginated) | **GET** /v2/analyses/{analysis_id}/functions | Get functions from analysis *AnalysesResultsMetadataApi* | [**getCapabilities**](docs/AnalysesResultsMetadataApi.md#getCapabilities) | **GET** /v2/analyses/{analysis_id}/capabilities | Gets the capabilities from the analysis *AnalysesResultsMetadataApi* | [**getFunctionsList**](docs/AnalysesResultsMetadataApi.md#getFunctionsList) | **GET** /v2/analyses/{analysis_id}/functions/list | Gets functions from analysis *AnalysesResultsMetadataApi* | [**getTags**](docs/AnalysesResultsMetadataApi.md#getTags) | **GET** /v2/analyses/{analysis_id}/tags | Get function tags with maliciousness score +*AnalysesResultsMetadataApi* | [**v3ListAnalysisCapabilities**](docs/AnalysesResultsMetadataApi.md#v3ListAnalysisCapabilities) | **GET** /v3/analyses/{analysis_id}/capabilities | List the capabilities found in an analysis. *AnalysesXRefsApi* | [**getXrefByVaddr**](docs/AnalysesXRefsApi.md#getXrefByVaddr) | **GET** /v2/analyses/{analysis_id}/xrefs/{vaddr} | [Beta] Look up xrefs by virtual address *AuthenticationUsersApi* | [**getUser**](docs/AuthenticationUsersApi.md#getUser) | **GET** /v2/users/{user_id} | Get a user's public information *AuthenticationUsersApi* | [**getUserActivity**](docs/AuthenticationUsersApi.md#getUserActivity) | **GET** /v2/users/activity | Get auth user activity @@ -306,17 +315,21 @@ Class | Method | HTTP request | Description - [AddUserStringToFunctionInputBody](docs/AddUserStringToFunctionInputBody.md) - [AdditionalDetailsStatusResponse](docs/AdditionalDetailsStatusResponse.md) - [AiDecompilationRating](docs/AiDecompilationRating.md) + - [AnalysisAccessBody](docs/AnalysisAccessBody.md) - [AnalysisAccessInfo](docs/AnalysisAccessInfo.md) - [AnalysisBasicInfoOutputBody](docs/AnalysisBasicInfoOutputBody.md) - [AnalysisBulkAddTagsRequest](docs/AnalysisBulkAddTagsRequest.md) - [AnalysisBulkAddTagsResponse](docs/AnalysisBulkAddTagsResponse.md) - [AnalysisBulkAddTagsResponseItem](docs/AnalysisBulkAddTagsResponseItem.md) + - [AnalysisCapabilitiesOutputBody](docs/AnalysisCapabilitiesOutputBody.md) + - [AnalysisCapabilityBody](docs/AnalysisCapabilityBody.md) - [AnalysisConfig](docs/AnalysisConfig.md) - [AnalysisConfigSnapshot](docs/AnalysisConfigSnapshot.md) - [AnalysisCreateRequest](docs/AnalysisCreateRequest.md) - [AnalysisCreateResponse](docs/AnalysisCreateResponse.md) - [AnalysisDataTypesGroup](docs/AnalysisDataTypesGroup.md) - [AnalysisDataTypesOutputBody](docs/AnalysisDataTypesOutputBody.md) + - [AnalysisDetailOutputBody](docs/AnalysisDetailOutputBody.md) - [AnalysisDetailResponse](docs/AnalysisDetailResponse.md) - [AnalysisFunctionEntry](docs/AnalysisFunctionEntry.md) - [AnalysisFunctionMapping](docs/AnalysisFunctionMapping.md) @@ -355,6 +368,7 @@ Class | Method | HTTP request | Description - [AttemptFailedEvent](docs/AttemptFailedEvent.md) - [AttemptStartedEvent](docs/AttemptStartedEvent.md) - [AutoRunAgents](docs/AutoRunAgents.md) + - [AutoRunAgentsBody](docs/AutoRunAgentsBody.md) - [AutoUnstripStatusOutputBody](docs/AutoUnstripStatusOutputBody.md) - [BaseDataType](docs/BaseDataType.md) - [BaseResponse](docs/BaseResponse.md) @@ -433,6 +447,8 @@ Class | Method | HTTP request | Description - [BinaryAdditionalResponse](docs/BinaryAdditionalResponse.md) - [BinaryConfig](docs/BinaryConfig.md) - [BinaryDetailsResponse](docs/BinaryDetailsResponse.md) + - [BinaryExportMetadata](docs/BinaryExportMetadata.md) + - [BinaryExportResult](docs/BinaryExportResult.md) - [BinaryExternalsResponse](docs/BinaryExternalsResponse.md) - [BinarySearchResponse](docs/BinarySearchResponse.md) - [BinarySearchResult](docs/BinarySearchResult.md) @@ -440,6 +456,7 @@ Class | Method | HTTP request | Description - [BitfieldDataType](docs/BitfieldDataType.md) - [BulkCreateUserResult](docs/BulkCreateUserResult.md) - [BulkCreateUsersOutputBody](docs/BulkCreateUsersOutputBody.md) + - [BulkDeleteAnalysesInputBody](docs/BulkDeleteAnalysesInputBody.md) - [BulkDeleteAnalysesRequest](docs/BulkDeleteAnalysesRequest.md) - [BytesConstant](docs/BytesConstant.md) - [CallChain](docs/CallChain.md) @@ -679,6 +696,7 @@ Class | Method | HTTP request | Description - [IOC](docs/IOC.md) - [ISA](docs/ISA.md) - [IconModel](docs/IconModel.md) + - [ImportDynamicExecutionFileOutputBody](docs/ImportDynamicExecutionFileOutputBody.md) - [ImportModel](docs/ImportModel.md) - [ImportedApi](docs/ImportedApi.md) - [ImportedApiCall](docs/ImportedApiCall.md) @@ -711,6 +729,7 @@ Class | Method | HTTP request | Description - [ListUsersOutputBody](docs/ListUsersOutputBody.md) - [LocationOutputBody](docs/LocationOutputBody.md) - [Logs](docs/Logs.md) + - [LookupAnalysisByBinaryIDOutputBody](docs/LookupAnalysisByBinaryIDOutputBody.md) - [MITRETechnique](docs/MITRETechnique.md) - [MatchFilters](docs/MatchFilters.md) - [MatchedFunction](docs/MatchedFunction.md) @@ -738,6 +757,7 @@ Class | Method | HTTP request | Description - [NetworkingScanMetadata](docs/NetworkingScanMetadata.md) - [NetworkingScanResult](docs/NetworkingScanResult.md) - [OIDCCallbackInputBody](docs/OIDCCallbackInputBody.md) + - [OperationBinaryExportMetadataBinaryExportResult](docs/OperationBinaryExportMetadataBinaryExportResult.md) - [OperationCreateMetadataCreateResult](docs/OperationCreateMetadataCreateResult.md) - [OperationCryptoExplainMetadataCryptoExplainResult](docs/OperationCryptoExplainMetadataCryptoExplainResult.md) - [OperationCryptoScanMetadataCryptoScanResult](docs/OperationCryptoScanMetadataCryptoScanResult.md) @@ -813,6 +833,7 @@ Class | Method | HTTP request | Description - [ReportOptions](docs/ReportOptions.md) - [ReportReachabilityStatus](docs/ReportReachabilityStatus.md) - [ReportResult](docs/ReportResult.md) + - [RequestedConfigBody](docs/RequestedConfigBody.md) - [ResolvedEntity](docs/ResolvedEntity.md) - [ResultBody](docs/ResultBody.md) - [RevokeBody](docs/RevokeBody.md) @@ -877,6 +898,8 @@ Class | Method | HTTP request | Description - [StatusOutput](docs/StatusOutput.md) - [StatusResponse](docs/StatusResponse.md) - [StringFunctions](docs/StringFunctions.md) + - [StringMatch](docs/StringMatch.md) + - [StringMatchEvidence](docs/StringMatchEvidence.md) - [StringSource](docs/StringSource.md) - [StructDataType](docs/StructDataType.md) - [StructDefinition](docs/StructDefinition.md) @@ -891,8 +914,6 @@ Class | Method | HTTP request | Description - [SuggestedMemberView](docs/SuggestedMemberView.md) - [SuggestedTypeView](docs/SuggestedTypeView.md) - [SummaryData](docs/SummaryData.md) - - [SuspiciousString](docs/SuspiciousString.md) - - [SuspiciousStringEvidence](docs/SuspiciousStringEvidence.md) - [Symbols](docs/Symbols.md) - [Tag](docs/Tag.md) - [TagItem](docs/TagItem.md) @@ -935,6 +956,7 @@ Class | Method | HTTP request | Description - [UnionDefinition](docs/UnionDefinition.md) - [UnknownDataType](docs/UnknownDataType.md) - [UpdateAnalysisDataTypesInputBody](docs/UpdateAnalysisDataTypesInputBody.md) + - [UpdateAnalysisInputBody](docs/UpdateAnalysisInputBody.md) - [UpdateArrayDataType](docs/UpdateArrayDataType.md) - [UpdateBaseDataType](docs/UpdateBaseDataType.md) - [UpdateBitfieldDataType](docs/UpdateBitfieldDataType.md) diff --git a/build.gradle b/build.gradle index fdc5134..6a1febf 100644 --- a/build.gradle +++ b/build.gradle @@ -19,7 +19,7 @@ apply plugin: 'java' apply plugin: 'com.diffplug.spotless' group = 'ai.reveng' -version = '4.51.0' +version = '4.54.0' @@ -174,7 +174,7 @@ mavenPublishing { // key, and signing without one fails the build. if (project.hasProperty("signingInMemoryKey")) signAllPublications() - coordinates("ai.reveng", "sdk", "4.51.0") + coordinates("ai.reveng", "sdk", "4.54.0") pom { name = "sdk" diff --git a/build.sbt b/build.sbt index ea32e9e..edeb6c1 100644 --- a/build.sbt +++ b/build.sbt @@ -2,7 +2,7 @@ lazy val root = (project in file(".")). settings( organization := "ai.reveng", name := "sdk", - version := "4.51.0", + version := "4.54.0", scalaVersion := "2.11.12", scalacOptions ++= Seq("-feature"), compile / javacOptions ++= Seq("-Xlint:deprecation"), diff --git a/docs/AnalysesBulkActionsApi.md b/docs/AnalysesBulkActionsApi.md index 76d0382..cf201a1 100644 --- a/docs/AnalysesBulkActionsApi.md +++ b/docs/AnalysesBulkActionsApi.md @@ -6,6 +6,7 @@ All URIs are relative to *https://api.reveng.ai* |------------- | ------------- | -------------| | [**bulkAddAnalysisTags**](AnalysesBulkActionsApi.md#bulkAddAnalysisTags) | **PATCH** /v2/analyses/tags/add | Bulk Add Analysis Tags | | [**bulkDeleteAnalyses**](AnalysesBulkActionsApi.md#bulkDeleteAnalyses) | **PATCH** /v2/analyses/delete | Bulk Delete Analyses | +| [**v3BatchDeleteAnalyses**](AnalysesBulkActionsApi.md#v3BatchDeleteAnalyses) | **POST** /v3/analyses:batchDelete | Delete multiple analyses. | @@ -158,3 +159,79 @@ public class Example { | **404** | Not Found | - | | **403** | Forbidden | - | + +# **v3BatchDeleteAnalyses** +> v3BatchDeleteAnalyses(bulkDeleteAnalysesInputBody) + +Delete multiple analyses. + +Deactivates every given analysis. The caller must own all of them, or none are deleted. **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.AnalysesBulkActionsApi; + +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"); + + // Configure HTTP bearer authorization: bearerAuth + HttpBearerAuth bearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("bearerAuth"); + bearerAuth.setBearerToken("BEARER TOKEN"); + + AnalysesBulkActionsApi apiInstance = new AnalysesBulkActionsApi(defaultClient); + BulkDeleteAnalysesInputBody bulkDeleteAnalysesInputBody = new BulkDeleteAnalysesInputBody(); // BulkDeleteAnalysesInputBody | + try { + apiInstance.v3BatchDeleteAnalyses(bulkDeleteAnalysesInputBody); + } catch (ApiException e) { + System.err.println("Exception when calling AnalysesBulkActionsApi#v3BatchDeleteAnalyses"); + 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 | +|------------- | ------------- | ------------- | -------------| +| **bulkDeleteAnalysesInputBody** | [**BulkDeleteAnalysesInputBody**](BulkDeleteAnalysesInputBody.md)| | | + +### Return type + +null (empty response body) + +### Authorization + +[APIKey](../README.md#APIKey), [bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **204** | No Content | - | +| **403** | Forbidden | - | +| **404** | Not Found | - | +| **422** | Unprocessable Entity | - | +| **500** | Internal Server Error | - | + diff --git a/docs/AnalysesCoreApi.md b/docs/AnalysesCoreApi.md index cb0a7ca..4200dca 100644 --- a/docs/AnalysesCoreApi.md +++ b/docs/AnalysesCoreApi.md @@ -28,14 +28,21 @@ All URIs are relative to *https://api.reveng.ai* | [**updateAnalysisTags**](AnalysesCoreApi.md#updateAnalysisTags) | **PATCH** /v2/analyses/{analysis_id}/tags | Update Analysis Tags | | [**uploadFile**](AnalysesCoreApi.md#uploadFile) | **POST** /v2/upload | Upload File | | [**v3CreateAnalysis**](AnalysesCoreApi.md#v3CreateAnalysis) | **POST** /v3/analyses | Create an analysis | +| [**v3DeleteAnalysis**](AnalysesCoreApi.md#v3DeleteAnalysis) | **DELETE** /v3/analyses/{analysis_id} | Delete an analysis. | +| [**v3DownloadBinaryExport**](AnalysesCoreApi.md#v3DownloadBinaryExport) | **GET** /v3/analyses/{analysis_id}/binary-export | Download a binary export | +| [**v3GetAnalysis**](AnalysesCoreApi.md#v3GetAnalysis) | **GET** /v3/analyses/{analysis_id} | Get an analysis. | | [**v3GetAnalysisAutoUnstripStatus**](AnalysesCoreApi.md#v3GetAnalysisAutoUnstripStatus) | **GET** /v3/analyses/{analysis_id}/auto-unstrip/status | Get the auto-unstrip status for an analysis. | | [**v3GetAnalysisFunctionsProgress**](AnalysesCoreApi.md#v3GetAnalysisFunctionsProgress) | **GET** /v3/analyses/{analysis_id}/progress/functions | Get function embedding progress for an analysis. | | [**v3GetAnalysisLogs**](AnalysesCoreApi.md#v3GetAnalysisLogs) | **GET** /v3/analyses/{analysis_id}/logs | Get the Analysis log | | [**v3GetAnalysisOperation**](AnalysesCoreApi.md#v3GetAnalysisOperation) | **GET** /v3/operations/analyses/{analysis_id} | Get an Analysis-creation operation | | [**v3GetAnalysisStrings**](AnalysesCoreApi.md#v3GetAnalysisStrings) | **GET** /v3/analyses/{analysis_id}/functions/strings | List strings for an analysis. | | [**v3GetAnalysisStringsStatus**](AnalysesCoreApi.md#v3GetAnalysisStringsStatus) | **GET** /v3/analyses/{analysis_id}/functions/strings/status | Get the string-extraction status for an analysis. | +| [**v3GetBinaryExportOperation**](AnalysesCoreApi.md#v3GetBinaryExportOperation) | **GET** /v3/operations/binary-export/{task_id} | Get a binary export operation | | [**v3ListAnalyses**](AnalysesCoreApi.md#v3ListAnalyses) | **GET** /v3/analyses | List analyses | | [**v3ListExampleAnalyses**](AnalysesCoreApi.md#v3ListExampleAnalyses) | **GET** /v3/analyses/examples | List example analyses | +| [**v3LookupAnalysisByBinaryId**](AnalysesCoreApi.md#v3LookupAnalysisByBinaryId) | **GET** /v3/analyses/lookup/{binary_id} | Look up the most recent analysis for a binary. | +| [**v3QueueBinaryExport**](AnalysesCoreApi.md#v3QueueBinaryExport) | **POST** /v3/analyses/{analysis_id}/binary-export | Queue a binary export | +| [**v3UpdateAnalysis**](AnalysesCoreApi.md#v3UpdateAnalysis) | **PATCH** /v3/analyses/{analysis_id} | Update an analysis. | | [**v3UpgradeAnalysisModel**](AnalysesCoreApi.md#v3UpgradeAnalysisModel) | **POST** /v3/analyses/{analysis_id}/upgrade-model | Re-analyse on the latest model | @@ -1904,6 +1911,237 @@ public class Example { | **422** | Unprocessable Entity | - | | **500** | Internal Server Error | - | + +# **v3DeleteAnalysis** +> v3DeleteAnalysis(analysisId) + +Delete an analysis. + +Deactivates the analysis. Only the owner may call it. **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"); + + // Configure HTTP bearer authorization: bearerAuth + HttpBearerAuth bearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("bearerAuth"); + bearerAuth.setBearerToken("BEARER TOKEN"); + + AnalysesCoreApi apiInstance = new AnalysesCoreApi(defaultClient); + Long analysisId = 56L; // Long | Analysis ID + try { + apiInstance.v3DeleteAnalysis(analysisId); + } catch (ApiException e) { + System.err.println("Exception when calling AnalysesCoreApi#v3DeleteAnalysis"); + 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 + +null (empty response body) + +### Authorization + +[APIKey](../README.md#APIKey), [bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **204** | No Content | - | +| **403** | Forbidden | - | +| **404** | Not Found | - | +| **422** | Unprocessable Entity | - | +| **500** | Internal Server Error | - | + + +# **v3DownloadBinaryExport** +> v3DownloadBinaryExport(analysisId, taskId) + +Download a binary export + +Streams the exported binary. Returns 404 if the task is not complete or its result has expired -- export again in either case. **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"); + + // Configure HTTP bearer authorization: bearerAuth + HttpBearerAuth bearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("bearerAuth"); + bearerAuth.setBearerToken("BEARER TOKEN"); + + AnalysesCoreApi apiInstance = new AnalysesCoreApi(defaultClient); + Long analysisId = 56L; // Long | Analysis ID + String taskId = "taskId_example"; // String | Task ID returned by queueing the export + try { + apiInstance.v3DownloadBinaryExport(analysisId, taskId); + } catch (ApiException e) { + System.err.println("Exception when calling AnalysesCoreApi#v3DownloadBinaryExport"); + 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 | | +| **taskId** | **String**| Task ID returned by queueing the export | [optional] | + +### Return type + +null (empty response body) + +### Authorization + +[APIKey](../README.md#APIKey), [bearerAuth](../README.md#bearerAuth) + +### 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 | - | + + +# **v3GetAnalysis** +> AnalysisDetailOutputBody v3GetAnalysis(analysisId) + +Get an analysis. + +Returns the analysis' resource-level detail: binary attributes, ownership, and the configuration it was submitted with. **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"); + + // Configure HTTP bearer authorization: bearerAuth + HttpBearerAuth bearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("bearerAuth"); + bearerAuth.setBearerToken("BEARER TOKEN"); + + AnalysesCoreApi apiInstance = new AnalysesCoreApi(defaultClient); + Long analysisId = 56L; // Long | Analysis ID + try { + AnalysisDetailOutputBody result = apiInstance.v3GetAnalysis(analysisId); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling AnalysesCoreApi#v3GetAnalysis"); + 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 + +[**AnalysisDetailOutputBody**](AnalysisDetailOutputBody.md) + +### Authorization + +[APIKey](../README.md#APIKey), [bearerAuth](../README.md#bearerAuth) + +### 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 | - | + # **v3GetAnalysisAutoUnstripStatus** > AutoUnstripStatusOutputBody v3GetAnalysisAutoUnstripStatus(analysisId) @@ -2380,9 +2618,86 @@ public class Example { | **422** | Unprocessable Entity | - | | **500** | Internal Server Error | - | + +# **v3GetBinaryExportOperation** +> OperationBinaryExportMetadataBinaryExportResult v3GetBinaryExportOperation(taskId) + +Get a binary export operation + +Returns the current state of the export started for this task ID. `done` is the only readiness signal: while false, poll again; once true, exactly one of `response` or `error` is set. A task ID the platform no longer recognises -- whether it never existed or its history has expired -- resolves to a failed operation, since either way the caller must export again. **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"); + + // Configure HTTP bearer authorization: bearerAuth + HttpBearerAuth bearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("bearerAuth"); + bearerAuth.setBearerToken("BEARER TOKEN"); + + AnalysesCoreApi apiInstance = new AnalysesCoreApi(defaultClient); + String taskId = "taskId_example"; // String | Task ID returned by queueing the export + try { + OperationBinaryExportMetadataBinaryExportResult result = apiInstance.v3GetBinaryExportOperation(taskId); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling AnalysesCoreApi#v3GetBinaryExportOperation"); + 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 | +|------------- | ------------- | ------------- | -------------| +| **taskId** | **String**| Task ID returned by queueing the export | | + +### Return type + +[**OperationBinaryExportMetadataBinaryExportResult**](OperationBinaryExportMetadataBinaryExportResult.md) + +### Authorization + +[APIKey](../README.md#APIKey), [bearerAuth](../README.md#bearerAuth) + +### 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 | - | + # **v3ListAnalyses** -> ListAnalysesOutputBody v3ListAnalyses(searchTerm, analysisScope, status, modelName, usernames, sha256Hash, platform, architecture, pageSize, nextPageToken, orderBy, order) +> ListAnalysesOutputBody v3ListAnalyses(searchTerm, analysisScope, status, modelName, usernames, sha256Hash, binaryId, platform, architecture, pageSize, nextPageToken, orderBy, order) List analyses @@ -2420,6 +2735,7 @@ public class Example { List modelName = Arrays.asList(); // List | List usernames = Arrays.asList(); // List | String sha256Hash = "sha256Hash_example"; // String | + Long binaryId = 56L; // Long | Restrict to analyses of this binary. A binary can carry more than one analysis; they are returned newest first under the default sort List platform = Arrays.asList(); // List | Restrict to binaries running on one of these operating-system platforms. Matches the uploader's override when they set one, the detected platform otherwise; a binary with neither is never matched. Leave empty for no filter List architecture = Arrays.asList(); // List | Restrict to binaries built for one of these instruction-set architectures. Resolved the same way as platform. Leave empty for no filter Long pageSize = 20L; // Long | @@ -2427,7 +2743,7 @@ public class Example { String orderBy = "created"; // String | String order = "ASC"; // String | try { - ListAnalysesOutputBody result = apiInstance.v3ListAnalyses(searchTerm, analysisScope, status, modelName, usernames, sha256Hash, platform, architecture, pageSize, nextPageToken, orderBy, order); + ListAnalysesOutputBody result = apiInstance.v3ListAnalyses(searchTerm, analysisScope, status, modelName, usernames, sha256Hash, binaryId, platform, architecture, pageSize, nextPageToken, orderBy, order); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling AnalysesCoreApi#v3ListAnalyses"); @@ -2450,6 +2766,7 @@ public class Example { | **modelName** | [**List<String>**](String.md)| | [optional] | | **usernames** | [**List<String>**](String.md)| | [optional] | | **sha256Hash** | **String**| | [optional] | +| **binaryId** | **Long**| Restrict to analyses of this binary. A binary can carry more than one analysis; they are returned newest first under the default sort | [optional] | | **platform** | [**List<String>**](String.md)| Restrict to binaries running on one of these operating-system platforms. Matches the uploader's override when they set one, the detected platform otherwise; a binary with neither is never matched. Leave empty for no filter | [optional] [enum: windows, linux, android] | | **architecture** | [**List<String>**](String.md)| Restrict to binaries built for one of these instruction-set architectures. Resolved the same way as platform. Leave empty for no filter | [optional] [enum: x86_64, x86_32, arm_64] | | **pageSize** | **Long**| | [optional] [default to 20] | @@ -2548,6 +2865,239 @@ This endpoint does not need any parameter. | **200** | OK | - | | **0** | Error | - | + +# **v3LookupAnalysisByBinaryId** +> LookupAnalysisByBinaryIDOutputBody v3LookupAnalysisByBinaryId(binaryId) + +Look up the most recent analysis for a binary. + +Returns the ID of the most recent analysis of this binary that the caller may see (their own, their team's, or public). Returns 404 if the binary has none, whether because it has never been analysed or because every analysis of it is private to someone else. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found + +### 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"); + + // Configure HTTP bearer authorization: bearerAuth + HttpBearerAuth bearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("bearerAuth"); + bearerAuth.setBearerToken("BEARER TOKEN"); + + AnalysesCoreApi apiInstance = new AnalysesCoreApi(defaultClient); + Long binaryId = 56L; // Long | Binary ID + try { + LookupAnalysisByBinaryIDOutputBody result = apiInstance.v3LookupAnalysisByBinaryId(binaryId); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling AnalysesCoreApi#v3LookupAnalysisByBinaryId"); + 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 + +[**LookupAnalysisByBinaryIDOutputBody**](LookupAnalysisByBinaryIDOutputBody.md) + +### Authorization + +[APIKey](../README.md#APIKey), [bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | OK | - | +| **404** | Not Found | - | +| **422** | Unprocessable Entity | - | +| **500** | Internal Server Error | - | + + +# **v3QueueBinaryExport** +> OperationBinaryExportMetadataBinaryExportResult v3QueueBinaryExport(analysisId) + +Queue a binary export + +Starts an asynchronous export of the binary with its current symbols rewritten in, and returns the operation to poll for its outcome. Only the owner may call it, and it requires a subscription tier that supports symbol export. Download the result once the operation reports done. **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"); + + // Configure HTTP bearer authorization: bearerAuth + HttpBearerAuth bearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("bearerAuth"); + bearerAuth.setBearerToken("BEARER TOKEN"); + + AnalysesCoreApi apiInstance = new AnalysesCoreApi(defaultClient); + Long analysisId = 56L; // Long | Analysis ID + try { + OperationBinaryExportMetadataBinaryExportResult result = apiInstance.v3QueueBinaryExport(analysisId); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling AnalysesCoreApi#v3QueueBinaryExport"); + 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 + +[**OperationBinaryExportMetadataBinaryExportResult**](OperationBinaryExportMetadataBinaryExportResult.md) + +### Authorization + +[APIKey](../README.md#APIKey), [bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **202** | Accepted | - | +| **403** | Forbidden | - | +| **404** | Not Found | - | +| **422** | Unprocessable Entity | - | +| **500** | Internal Server Error | - | + + +# **v3UpdateAnalysis** +> AnalysisDetailOutputBody v3UpdateAnalysis(analysisId, updateAnalysisInputBody) + +Update an analysis. + +Renames the analysis' binary and/or changes its scope. Only the owner may call it. Changing to a non-PUBLIC scope requires a subscription tier that supports private analyses. **Error codes:** - `400` [`BAD_REQUEST`](/errors/BAD_REQUEST) — Bad Request - `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"); + + // Configure HTTP bearer authorization: bearerAuth + HttpBearerAuth bearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("bearerAuth"); + bearerAuth.setBearerToken("BEARER TOKEN"); + + AnalysesCoreApi apiInstance = new AnalysesCoreApi(defaultClient); + Long analysisId = 56L; // Long | Analysis ID + UpdateAnalysisInputBody updateAnalysisInputBody = new UpdateAnalysisInputBody(); // UpdateAnalysisInputBody | + try { + AnalysisDetailOutputBody result = apiInstance.v3UpdateAnalysis(analysisId, updateAnalysisInputBody); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling AnalysesCoreApi#v3UpdateAnalysis"); + 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 | | +| **updateAnalysisInputBody** | [**UpdateAnalysisInputBody**](UpdateAnalysisInputBody.md)| | | + +### Return type + +[**AnalysisDetailOutputBody**](AnalysisDetailOutputBody.md) + +### Authorization + +[APIKey](../README.md#APIKey), [bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | OK | - | +| **400** | Bad Request | - | +| **403** | Forbidden | - | +| **404** | Not Found | - | +| **422** | Unprocessable Entity | - | +| **500** | Internal Server Error | - | + # **v3UpgradeAnalysisModel** > UpgradeAnalysisModelOutputBody v3UpgradeAnalysisModel(analysisId) diff --git a/docs/AnalysesResultsMetadataApi.md b/docs/AnalysesResultsMetadataApi.md index ddf157f..7dc6e39 100644 --- a/docs/AnalysesResultsMetadataApi.md +++ b/docs/AnalysesResultsMetadataApi.md @@ -8,6 +8,7 @@ All URIs are relative to *https://api.reveng.ai* | [**getCapabilities**](AnalysesResultsMetadataApi.md#getCapabilities) | **GET** /v2/analyses/{analysis_id}/capabilities | Gets the capabilities from the analysis | | [**getFunctionsList**](AnalysesResultsMetadataApi.md#getFunctionsList) | **GET** /v2/analyses/{analysis_id}/functions/list | Gets functions from analysis | | [**getTags**](AnalysesResultsMetadataApi.md#getTags) | **GET** /v2/analyses/{analysis_id}/tags | Get function tags with maliciousness score | +| [**v3ListAnalysisCapabilities**](AnalysesResultsMetadataApi.md#v3ListAnalysisCapabilities) | **GET** /v3/analyses/{analysis_id}/capabilities | List the capabilities found in an analysis. | @@ -318,3 +319,80 @@ public class Example { | **200** | Successful Response | - | | **422** | Invalid request parameters | - | + +# **v3ListAnalysisCapabilities** +> AnalysisCapabilitiesOutputBody v3ListAnalysisCapabilities(analysisId) + +List the capabilities found in an analysis. + +Returns the capabilities the binary-analysis pipeline attributed to the analysis' functions, ordered by function address. This is the static capability set recorded against the binary, not the AI capabilities agent's findings, which are triggered by `/v3/analyses/{analysis_id}/capabilities: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.AnalysesResultsMetadataApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("https://api.reveng.ai"); + + // Configure API key authorization: APIKey + ApiKeyAuth APIKey = (ApiKeyAuth) defaultClient.getAuthentication("APIKey"); + APIKey.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //APIKey.setApiKeyPrefix("Token"); + + // Configure HTTP bearer authorization: bearerAuth + HttpBearerAuth bearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("bearerAuth"); + bearerAuth.setBearerToken("BEARER TOKEN"); + + AnalysesResultsMetadataApi apiInstance = new AnalysesResultsMetadataApi(defaultClient); + Long analysisId = 56L; // Long | Analysis ID + try { + AnalysisCapabilitiesOutputBody result = apiInstance.v3ListAnalysisCapabilities(analysisId); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling AnalysesResultsMetadataApi#v3ListAnalysisCapabilities"); + 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 + +[**AnalysisCapabilitiesOutputBody**](AnalysisCapabilitiesOutputBody.md) + +### Authorization + +[APIKey](../README.md#APIKey), [bearerAuth](../README.md#bearerAuth) + +### 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/AnalysisAccessBody.md b/docs/AnalysisAccessBody.md new file mode 100644 index 0000000..395445a --- /dev/null +++ b/docs/AnalysisAccessBody.md @@ -0,0 +1,14 @@ + + +# AnalysisAccessBody + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**owner** | **Boolean** | True when the caller owns this analysis | | +|**username** | **String** | Username of the analysis owner | | + + + diff --git a/docs/AnalysisCapabilitiesOutputBody.md b/docs/AnalysisCapabilitiesOutputBody.md new file mode 100644 index 0000000..b41a41d --- /dev/null +++ b/docs/AnalysisCapabilitiesOutputBody.md @@ -0,0 +1,13 @@ + + +# AnalysisCapabilitiesOutputBody + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**capabilities** | **List<AnalysisCapabilityBody>** | Capabilities found across the binary, ordered by function address. Empty when the binary has no capability record | | + + + diff --git a/docs/AnalysisCapabilityBody.md b/docs/AnalysisCapabilityBody.md new file mode 100644 index 0000000..07868b3 --- /dev/null +++ b/docs/AnalysisCapabilityBody.md @@ -0,0 +1,15 @@ + + +# AnalysisCapabilityBody + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**capabilities** | **List<String>** | Capabilities attributed to the function | | +|**functionName** | **String** | Name of the function the capability was found in | | +|**functionVaddr** | **Long** | Virtual address of that function | | + + + diff --git a/docs/AnalysisDetailOutputBody.md b/docs/AnalysisDetailOutputBody.md new file mode 100644 index 0000000..2216a6a --- /dev/null +++ b/docs/AnalysisDetailOutputBody.md @@ -0,0 +1,39 @@ + + +# AnalysisDetailOutputBody + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**access** | **AnalysisAccessBody** | | | +|**analysisId** | **Long** | | | +|**analysisScope** | [**AnalysisScopeEnum**](#AnalysisScopeEnum) | | | +|**architecture** | **String** | | | +|**autoRunAgents** | **AutoRunAgentsBody** | | | +|**binaryDynamic** | **Boolean** | | | +|**binaryFormat** | **String** | | | +|**binaryName** | **String** | | | +|**binarySize** | **Long** | | | +|**binaryType** | **String** | | | +|**creation** | **String** | | | +|**dashboardUrl** | **String** | URL to view this analysis in the dashboard | | +|**debug** | **Boolean** | | | +|**modelName** | **String** | | | +|**requestedConfig** | **RequestedConfigBody** | Snapshot of the configuration the analysis was submitted with | | +|**sha256Hash** | **String** | | | + + + +## Enum: AnalysisScopeEnum + +| Name | Value | +|---- | -----| +| PUBLIC | "PUBLIC" | +| PRIVATE | "PRIVATE" | +| TEAM | "TEAM" | +| UNKNOWN_DEFAULT_OPEN_API | "unknown_default_open_api" | + + + diff --git a/docs/AutoRunAgentsBody.md b/docs/AutoRunAgentsBody.md new file mode 100644 index 0000000..ec427c6 --- /dev/null +++ b/docs/AutoRunAgentsBody.md @@ -0,0 +1,13 @@ + + +# AutoRunAgentsBody + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**triage** | **Boolean** | Whether the triage agent ran automatically once the functions pipeline finished | | + + + diff --git a/docs/Binary.md b/docs/Binary.md index 15dc492..4b1c358 100644 --- a/docs/Binary.md +++ b/docs/Binary.md @@ -11,9 +11,14 @@ |**binaryId** | **Long** | | | |**binaryName** | **String** | | | |**createdAt** | **OffsetDateTime** | | | +|**detectedArchitecture** | **String** | Detected instruction-set architecture; empty when unavailable | | +|**detectedBinaryType** | **String** | Detected operating-system platform; empty when unavailable | | |**isSystemAnalysis** | **Boolean** | | | +|**modelName** | **String** | Name of the model the analysis ran on | | |**ownerId** | **Long** | | | |**sha256Hash** | **String** | | | +|**suppliedArchitecture** | **String** | User-supplied instruction-set architecture; \"AUTO\" when not overridden | | +|**suppliedBinaryType** | **String** | User-supplied operating-system platform; \"AUTO\" when not overridden | | diff --git a/docs/BinaryExportMetadata.md b/docs/BinaryExportMetadata.md new file mode 100644 index 0000000..24e5900 --- /dev/null +++ b/docs/BinaryExportMetadata.md @@ -0,0 +1,13 @@ + + +# BinaryExportMetadata + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**analysisId** | **Long** | Analysis ID | | + + + diff --git a/docs/BinaryExportResult.md b/docs/BinaryExportResult.md new file mode 100644 index 0000000..c791a12 --- /dev/null +++ b/docs/BinaryExportResult.md @@ -0,0 +1,13 @@ + + +# BinaryExportResult + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**fileName** | **String** | Name to give the downloaded file | | + + + diff --git a/docs/BulkDeleteAnalysesInputBody.md b/docs/BulkDeleteAnalysesInputBody.md new file mode 100644 index 0000000..96f9cc5 --- /dev/null +++ b/docs/BulkDeleteAnalysesInputBody.md @@ -0,0 +1,13 @@ + + +# BulkDeleteAnalysesInputBody + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**analysisIds** | **List<Long>** | IDs of the analyses to delete. The caller must own every one, or none are deleted | | + + + diff --git a/docs/DisassemblyOutputBody.md b/docs/DisassemblyOutputBody.md index cc4fe3f..91aba71 100644 --- a/docs/DisassemblyOutputBody.md +++ b/docs/DisassemblyOutputBody.md @@ -12,7 +12,7 @@ |**globalVariables** | **Object** | | [optional] | |**localVariables** | **Object** | | [optional] | |**params** | **Object** | | [optional] | -|**returnType** | **String** | Search is applied to string value | [optional] | +|**returnType** | **String** | | [optional] | |**returns** | **Boolean** | | | diff --git a/docs/EvidenceInner.md b/docs/EvidenceInner.md index bfe30f6..de87d36 100644 --- a/docs/EvidenceInner.md +++ b/docs/EvidenceInner.md @@ -14,7 +14,7 @@ |**callChain** | **List<Integer>** | | | |**constants** | [**List<ReferencedConstant>**](ReferencedConstant.md) | | | |**calls** | [**List<ImportedApiCall>**](ImportedApiCall.md) | | | -|**strings** | [**List<SuspiciousString>**](SuspiciousString.md) | | | +|**strings** | [**List<StringMatch>**](StringMatch.md) | | | |**similarities** | [**List<FunctionSimilarity>**](FunctionSimilarity.md) | | | |**apis** | [**List<ImportedApi>**](ImportedApi.md) | | | |**summaries** | [**List<DecompilerSummary>**](DecompilerSummary.md) | | | diff --git a/docs/ImportDynamicExecutionFileOutputBody.md b/docs/ImportDynamicExecutionFileOutputBody.md new file mode 100644 index 0000000..13ef14d --- /dev/null +++ b/docs/ImportDynamicExecutionFileOutputBody.md @@ -0,0 +1,18 @@ + + +# ImportDynamicExecutionFileOutputBody + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**canExtract** | **Boolean** | Whether the firmware/extraction flow can accept this file. | | +|**canSandbox** | **Boolean** | Whether the file can be extracted and run in the Windows sandbox. | | +|**isArchive** | **Boolean** | Whether the detected format is a container/compression archive. | | +|**mime** | **String** | The MIME type detected from the file's contents. | | +|**sha256Hash** | **String** | SHA-256 hash the file is stored under; the storage key for every subsequent reference to it. | | +|**size** | **Long** | Size of the file in bytes. | | + + + diff --git a/docs/LookupAnalysisByBinaryIDOutputBody.md b/docs/LookupAnalysisByBinaryIDOutputBody.md new file mode 100644 index 0000000..573411f --- /dev/null +++ b/docs/LookupAnalysisByBinaryIDOutputBody.md @@ -0,0 +1,13 @@ + + +# LookupAnalysisByBinaryIDOutputBody + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**analysisId** | **Long** | Most recent analysis for this binary that the caller may see | | + + + diff --git a/docs/OperationBinaryExportMetadataBinaryExportResult.md b/docs/OperationBinaryExportMetadataBinaryExportResult.md new file mode 100644 index 0000000..e1dbfab --- /dev/null +++ b/docs/OperationBinaryExportMetadataBinaryExportResult.md @@ -0,0 +1,17 @@ + + +# OperationBinaryExportMetadataBinaryExportResult + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**done** | **Boolean** | Whether the operation has reached a terminal state. | | +|**error** | **Status** | Failure detail, populated only when done is true and the operation failed. | [optional] | +|**metadata** | **BinaryExportMetadata** | In-flight information and details. | [optional] | +|**name** | **String** | API resource name. | | +|**response** | **BinaryExportResult** | Result, set only when done is true and the operation succeeded. | [optional] | + + + diff --git a/docs/RequestedConfigBody.md b/docs/RequestedConfigBody.md new file mode 100644 index 0000000..a348036 --- /dev/null +++ b/docs/RequestedConfigBody.md @@ -0,0 +1,17 @@ + + +# RequestedConfigBody + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**capabilities** | **Boolean** | Whether the capabilities agent was requested | | +|**functions** | **Boolean** | Whether the functions pipeline was requested | | +|**sandbox** | **Boolean** | Whether dynamic execution (sandbox) was requested | | +|**scrape** | **Boolean** | Whether external-source scraping was requested | | +|**triage** | **Boolean** | Whether the triage agent was requested | | + + + diff --git a/docs/SuspiciousString.md b/docs/StringMatch.md similarity index 91% rename from docs/SuspiciousString.md rename to docs/StringMatch.md index b387c6e..f0ed722 100644 --- a/docs/SuspiciousString.md +++ b/docs/StringMatch.md @@ -1,6 +1,6 @@ -# SuspiciousString +# StringMatch ## Properties diff --git a/docs/SuspiciousStringEvidence.md b/docs/StringMatchEvidence.md similarity index 79% rename from docs/SuspiciousStringEvidence.md rename to docs/StringMatchEvidence.md index 8f7cffc..b630bbc 100644 --- a/docs/SuspiciousStringEvidence.md +++ b/docs/StringMatchEvidence.md @@ -1,8 +1,8 @@ -# SuspiciousStringEvidence +# StringMatchEvidence -Suspicious strings without demonstrated semantic use. +String matches without demonstrated semantic use. ## Properties @@ -12,7 +12,7 @@ Suspicious strings without demonstrated semantic use. |**kind** | [**KindEnum**](#KindEnum) | | [optional] | |**effect** | **EvidenceEffect** | | | |**strength** | [**StrengthEnum**](#StrengthEnum) | | [optional] | -|**strings** | [**List<SuspiciousString>**](SuspiciousString.md) | | | +|**strings** | [**List<StringMatch>**](StringMatch.md) | | | @@ -20,7 +20,7 @@ Suspicious strings without demonstrated semantic use. | Name | Value | |---- | -----| -| SUSPICIOUS_STRING | "suspicious_string" | +| STRING_MATCH | "string_match" | | UNKNOWN_DEFAULT_OPEN_API | "unknown_default_open_api" | diff --git a/docs/UpdateAnalysisInputBody.md b/docs/UpdateAnalysisInputBody.md new file mode 100644 index 0000000..56c5232 --- /dev/null +++ b/docs/UpdateAnalysisInputBody.md @@ -0,0 +1,25 @@ + + +# UpdateAnalysisInputBody + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**analysisScope** | [**AnalysisScopeEnum**](#AnalysisScopeEnum) | The analysis' visibility. Changing to a non-PUBLIC scope requires a subscription tier that supports private analyses | [optional] | +|**binaryName** | **String** | Renames the analysis' binary. Empty or whitespace-only is rejected | [optional] | + + + +## Enum: AnalysisScopeEnum + +| Name | Value | +|---- | -----| +| PUBLIC | "PUBLIC" | +| PRIVATE | "PRIVATE" | +| TEAM | "TEAM" | +| UNKNOWN_DEFAULT_OPEN_API | "unknown_default_open_api" | + + + diff --git a/pom.xml b/pom.xml index 99d0cc6..c6c3db1 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ sdk jar sdk - 4.51.0 + 4.54.0 https://github.com/RevEngAI/sdk-java Java SDK for the RevEng.AI API diff --git a/src/main/java/ai/reveng/api/AnalysesBulkActionsApi.java b/src/main/java/ai/reveng/api/AnalysesBulkActionsApi.java index f853ef4..1894b1b 100644 --- a/src/main/java/ai/reveng/api/AnalysesBulkActionsApi.java +++ b/src/main/java/ai/reveng/api/AnalysesBulkActionsApi.java @@ -26,10 +26,12 @@ import java.io.IOException; +import ai.reveng.model.APIError; import ai.reveng.model.AnalysisBulkAddTagsRequest; import ai.reveng.model.BaseResponse; import ai.reveng.model.BaseResponseAnalysisBulkAddTagsResponse; import ai.reveng.model.BaseResponseDict; +import ai.reveng.model.BulkDeleteAnalysesInputBody; import ai.reveng.model.BulkDeleteAnalysesRequest; import java.lang.reflect.Type; @@ -345,4 +347,143 @@ public okhttp3.Call bulkDeleteAnalysesAsync(@javax.annotation.Nonnull BulkDelete localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } + /** + * Build call for v3BatchDeleteAnalyses + * @param bulkDeleteAnalysesInputBody (required) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + + + + +
Response Details
Status Code Description Response Headers
204 No Content -
403 Forbidden -
404 Not Found -
422 Unprocessable Entity -
500 Internal Server Error -
+ */ + public okhttp3.Call v3BatchDeleteAnalysesCall(@javax.annotation.Nonnull BulkDeleteAnalysesInputBody bulkDeleteAnalysesInputBody, 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 = bulkDeleteAnalysesInputBody; + + // create path and map variables + String localVarPath = "/v3/analyses:batchDelete"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "APIKey", "bearerAuth" }; + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call v3BatchDeleteAnalysesValidateBeforeCall(@javax.annotation.Nonnull BulkDeleteAnalysesInputBody bulkDeleteAnalysesInputBody, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'bulkDeleteAnalysesInputBody' is set + if (bulkDeleteAnalysesInputBody == null) { + throw new ApiException("Missing the required parameter 'bulkDeleteAnalysesInputBody' when calling v3BatchDeleteAnalyses(Async)"); + } + + return v3BatchDeleteAnalysesCall(bulkDeleteAnalysesInputBody, _callback); + + } + + /** + * Delete multiple analyses. + * Deactivates every given analysis. The caller must own all of them, or none are deleted. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied + * @param bulkDeleteAnalysesInputBody (required) + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + + + +
Response Details
Status Code Description Response Headers
204 No Content -
403 Forbidden -
404 Not Found -
422 Unprocessable Entity -
500 Internal Server Error -
+ */ + public void v3BatchDeleteAnalyses(@javax.annotation.Nonnull BulkDeleteAnalysesInputBody bulkDeleteAnalysesInputBody) throws ApiException { + v3BatchDeleteAnalysesWithHttpInfo(bulkDeleteAnalysesInputBody); + } + + /** + * Delete multiple analyses. + * Deactivates every given analysis. The caller must own all of them, or none are deleted. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied + * @param bulkDeleteAnalysesInputBody (required) + * @return ApiResponse<Void> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + + + +
Response Details
Status Code Description Response Headers
204 No Content -
403 Forbidden -
404 Not Found -
422 Unprocessable Entity -
500 Internal Server Error -
+ */ + public ApiResponse v3BatchDeleteAnalysesWithHttpInfo(@javax.annotation.Nonnull BulkDeleteAnalysesInputBody bulkDeleteAnalysesInputBody) throws ApiException { + okhttp3.Call localVarCall = v3BatchDeleteAnalysesValidateBeforeCall(bulkDeleteAnalysesInputBody, null); + return localVarApiClient.execute(localVarCall); + } + + /** + * Delete multiple analyses. (asynchronously) + * Deactivates every given analysis. The caller must own all of them, or none are deleted. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied + * @param bulkDeleteAnalysesInputBody (required) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + + + + + +
Response Details
Status Code Description Response Headers
204 No Content -
403 Forbidden -
404 Not Found -
422 Unprocessable Entity -
500 Internal Server Error -
+ */ + public okhttp3.Call v3BatchDeleteAnalysesAsync(@javax.annotation.Nonnull BulkDeleteAnalysesInputBody bulkDeleteAnalysesInputBody, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = v3BatchDeleteAnalysesValidateBeforeCall(bulkDeleteAnalysesInputBody, _callback); + localVarApiClient.executeAsync(localVarCall, _callback); + return localVarCall; + } } diff --git a/src/main/java/ai/reveng/api/AnalysesCoreApi.java b/src/main/java/ai/reveng/api/AnalysesCoreApi.java index f14a485..d2c9f4e 100644 --- a/src/main/java/ai/reveng/api/AnalysesCoreApi.java +++ b/src/main/java/ai/reveng/api/AnalysesCoreApi.java @@ -30,6 +30,7 @@ import ai.reveng.model.AddUserStringInputBody; import ai.reveng.model.AnalysisBasicInfoOutputBody; import ai.reveng.model.AnalysisCreateRequest; +import ai.reveng.model.AnalysisDetailOutputBody; import ai.reveng.model.AnalysisReport; import ai.reveng.model.AnalysisUpdateRequest; import ai.reveng.model.AnalysisUpdateTagsRequest; @@ -61,7 +62,9 @@ import ai.reveng.model.ListAnalysesOutputBody; import ai.reveng.model.ListAnalysisStringsOutputBody; import ai.reveng.model.ListExampleAnalysesOutputBody; +import ai.reveng.model.LookupAnalysisByBinaryIDOutputBody; import ai.reveng.model.ModelName; +import ai.reveng.model.OperationBinaryExportMetadataBinaryExportResult; import ai.reveng.model.OperationCreateMetadataCreateResult; import ai.reveng.model.Order; import ai.reveng.model.PutAnalysisStringsRequest; @@ -69,6 +72,7 @@ import ai.reveng.model.StartMatchingForAnalysisInputBody; import ai.reveng.model.StartMatchingOutputBody; import ai.reveng.model.StatusInput; +import ai.reveng.model.UpdateAnalysisInputBody; import ai.reveng.model.UpgradeAnalysisModelOutputBody; import ai.reveng.model.UploadFileType; import ai.reveng.model.Workspace; @@ -3721,7 +3725,7 @@ public okhttp3.Call v3CreateAnalysisAsync(@javax.annotation.Nonnull CreateReques return localVarCall; } /** - * Build call for v3GetAnalysisAutoUnstripStatus + * Build call for v3DeleteAnalysis * @param analysisId Analysis ID (required) * @param _callback Callback for upload/download progress * @return Call to execute @@ -3730,14 +3734,14 @@ public okhttp3.Call v3CreateAnalysisAsync(@javax.annotation.Nonnull CreateReques - +
Response Details
Status Code Description Response Headers
200 OK -
204 No Content -
403 Forbidden -
404 Not Found -
422 Unprocessable Entity -
500 Internal Server Error -
*/ - public okhttp3.Call v3GetAnalysisAutoUnstripStatusCall(@javax.annotation.Nonnull Long analysisId, final ApiCallback _callback) throws ApiException { + public okhttp3.Call v3DeleteAnalysisCall(@javax.annotation.Nonnull Long analysisId, final ApiCallback _callback) throws ApiException { String basePath = null; // Operation Servers String[] localBasePaths = new String[] { }; @@ -3754,7 +3758,7 @@ public okhttp3.Call v3GetAnalysisAutoUnstripStatusCall(@javax.annotation.Nonnull Object localVarPostBody = null; // create path and map variables - String localVarPath = "/v3/analyses/{analysis_id}/auto-unstrip/status" + String localVarPath = "/v3/analyses/{analysis_id}" .replace("{" + "analysis_id" + "}", localVarApiClient.escapeString(analysisId.toString())); List localVarQueryParams = new ArrayList(); @@ -3779,68 +3783,65 @@ public okhttp3.Call v3GetAnalysisAutoUnstripStatusCall(@javax.annotation.Nonnull } String[] localVarAuthNames = new String[] { "APIKey", "bearerAuth" }; - return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + return localVarApiClient.buildCall(basePath, localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") - private okhttp3.Call v3GetAnalysisAutoUnstripStatusValidateBeforeCall(@javax.annotation.Nonnull Long analysisId, final ApiCallback _callback) throws ApiException { + private okhttp3.Call v3DeleteAnalysisValidateBeforeCall(@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 v3GetAnalysisAutoUnstripStatus(Async)"); + throw new ApiException("Missing the required parameter 'analysisId' when calling v3DeleteAnalysis(Async)"); } - return v3GetAnalysisAutoUnstripStatusCall(analysisId, _callback); + return v3DeleteAnalysisCall(analysisId, _callback); } /** - * Get the auto-unstrip status for an analysis. - * Returns the status of the auto-unstrip task for the binary backing the analysis. One of `UNINITIALISED`, `PENDING`, `RUNNING`, `COMPLETED`, `FAILED`. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied + * Delete an analysis. + * Deactivates the analysis. Only the owner may call it. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied * @param analysisId Analysis ID (required) - * @return AutoUnstripStatusOutputBody * @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 -
204 No Content -
403 Forbidden -
404 Not Found -
422 Unprocessable Entity -
500 Internal Server Error -
*/ - public AutoUnstripStatusOutputBody v3GetAnalysisAutoUnstripStatus(@javax.annotation.Nonnull Long analysisId) throws ApiException { - ApiResponse localVarResp = v3GetAnalysisAutoUnstripStatusWithHttpInfo(analysisId); - return localVarResp.getData(); + public void v3DeleteAnalysis(@javax.annotation.Nonnull Long analysisId) throws ApiException { + v3DeleteAnalysisWithHttpInfo(analysisId); } /** - * Get the auto-unstrip status for an analysis. - * Returns the status of the auto-unstrip task for the binary backing the analysis. One of `UNINITIALISED`, `PENDING`, `RUNNING`, `COMPLETED`, `FAILED`. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied + * Delete an analysis. + * Deactivates the analysis. Only the owner may call it. **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<AutoUnstripStatusOutputBody> + * @return ApiResponse<Void> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details - +
Response Details
Status Code Description Response Headers
200 OK -
204 No Content -
403 Forbidden -
404 Not Found -
422 Unprocessable Entity -
500 Internal Server Error -
*/ - public ApiResponse v3GetAnalysisAutoUnstripStatusWithHttpInfo(@javax.annotation.Nonnull Long analysisId) throws ApiException { - okhttp3.Call localVarCall = v3GetAnalysisAutoUnstripStatusValidateBeforeCall(analysisId, null); - Type localVarReturnType = new TypeToken(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); + public ApiResponse v3DeleteAnalysisWithHttpInfo(@javax.annotation.Nonnull Long analysisId) throws ApiException { + okhttp3.Call localVarCall = v3DeleteAnalysisValidateBeforeCall(analysisId, null); + return localVarApiClient.execute(localVarCall); } /** - * Get the auto-unstrip status for an analysis. (asynchronously) - * Returns the status of the auto-unstrip task for the binary backing the analysis. One of `UNINITIALISED`, `PENDING`, `RUNNING`, `COMPLETED`, `FAILED`. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied + * Delete an analysis. (asynchronously) + * Deactivates the analysis. Only the owner may call it. **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 @@ -3849,23 +3850,23 @@ public ApiResponse v3GetAnalysisAutoUnstripStatusWi - +
Response Details
Status Code Description Response Headers
200 OK -
204 No Content -
403 Forbidden -
404 Not Found -
422 Unprocessable Entity -
500 Internal Server Error -
*/ - public okhttp3.Call v3GetAnalysisAutoUnstripStatusAsync(@javax.annotation.Nonnull Long analysisId, final ApiCallback _callback) throws ApiException { + public okhttp3.Call v3DeleteAnalysisAsync(@javax.annotation.Nonnull Long analysisId, final ApiCallback _callback) throws ApiException { - okhttp3.Call localVarCall = v3GetAnalysisAutoUnstripStatusValidateBeforeCall(analysisId, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + okhttp3.Call localVarCall = v3DeleteAnalysisValidateBeforeCall(analysisId, _callback); + localVarApiClient.executeAsync(localVarCall, _callback); return localVarCall; } /** - * Build call for v3GetAnalysisFunctionsProgress + * Build call for v3DownloadBinaryExport * @param analysisId Analysis ID (required) + * @param taskId Task ID returned by queueing the export (optional) * @param _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object @@ -3880,7 +3881,7 @@ public okhttp3.Call v3GetAnalysisAutoUnstripStatusAsync(@javax.annotation.Nonnul 500 Internal Server Error - */ - public okhttp3.Call v3GetAnalysisFunctionsProgressCall(@javax.annotation.Nonnull Long analysisId, final ApiCallback _callback) throws ApiException { + public okhttp3.Call v3DownloadBinaryExportCall(@javax.annotation.Nonnull Long analysisId, @javax.annotation.Nullable String taskId, final ApiCallback _callback) throws ApiException { String basePath = null; // Operation Servers String[] localBasePaths = new String[] { }; @@ -3897,7 +3898,7 @@ public okhttp3.Call v3GetAnalysisFunctionsProgressCall(@javax.annotation.Nonnull Object localVarPostBody = null; // create path and map variables - String localVarPath = "/v3/analyses/{analysis_id}/progress/functions" + String localVarPath = "/v3/analyses/{analysis_id}/binary-export" .replace("{" + "analysis_id" + "}", localVarApiClient.escapeString(analysisId.toString())); List localVarQueryParams = new ArrayList(); @@ -3906,6 +3907,10 @@ public okhttp3.Call v3GetAnalysisFunctionsProgressCall(@javax.annotation.Nonnull Map localVarCookieParams = new HashMap(); Map localVarFormParams = new HashMap(); + if (taskId != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("task_id", taskId)); + } + final String[] localVarAccepts = { "application/json" }; @@ -3926,21 +3931,21 @@ public okhttp3.Call v3GetAnalysisFunctionsProgressCall(@javax.annotation.Nonnull } @SuppressWarnings("rawtypes") - private okhttp3.Call v3GetAnalysisFunctionsProgressValidateBeforeCall(@javax.annotation.Nonnull Long analysisId, final ApiCallback _callback) throws ApiException { + private okhttp3.Call v3DownloadBinaryExportValidateBeforeCall(@javax.annotation.Nonnull Long analysisId, @javax.annotation.Nullable String taskId, 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 v3GetAnalysisFunctionsProgress(Async)"); + throw new ApiException("Missing the required parameter 'analysisId' when calling v3DownloadBinaryExport(Async)"); } - return v3GetAnalysisFunctionsProgressCall(analysisId, _callback); + return v3DownloadBinaryExportCall(analysisId, taskId, _callback); } /** - * Get function embedding progress for an analysis. - * Returns how many functions the analysis has and how many carry an embedding, with the percentage complete. Embeddings are counted from the unified store, so an analysis whose model predates the current multi-arch one reports zero. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied + * Download a binary export + * Streams the exported binary. Returns 404 if the task is not complete or its result has expired -- export again in either case. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied * @param analysisId Analysis ID (required) - * @return FunctionsProgressOutputBody + * @param taskId Task ID returned by queueing the export (optional) * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details @@ -3953,16 +3958,16 @@ private okhttp3.Call v3GetAnalysisFunctionsProgressValidateBeforeCall(@javax.ann
500 Internal Server Error -
*/ - public FunctionsProgressOutputBody v3GetAnalysisFunctionsProgress(@javax.annotation.Nonnull Long analysisId) throws ApiException { - ApiResponse localVarResp = v3GetAnalysisFunctionsProgressWithHttpInfo(analysisId); - return localVarResp.getData(); + public void v3DownloadBinaryExport(@javax.annotation.Nonnull Long analysisId, @javax.annotation.Nullable String taskId) throws ApiException { + v3DownloadBinaryExportWithHttpInfo(analysisId, taskId); } /** - * Get function embedding progress for an analysis. - * Returns how many functions the analysis has and how many carry an embedding, with the percentage complete. Embeddings are counted from the unified store, so an analysis whose model predates the current multi-arch one reports zero. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied + * Download a binary export + * Streams the exported binary. Returns 404 if the task is not complete or its result has expired -- export again in either case. **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<FunctionsProgressOutputBody> + * @param taskId Task ID returned by queueing the export (optional) + * @return ApiResponse<Void> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details @@ -3975,16 +3980,16 @@ public FunctionsProgressOutputBody v3GetAnalysisFunctionsProgress(@javax.annotat
500 Internal Server Error -
*/ - public ApiResponse v3GetAnalysisFunctionsProgressWithHttpInfo(@javax.annotation.Nonnull Long analysisId) throws ApiException { - okhttp3.Call localVarCall = v3GetAnalysisFunctionsProgressValidateBeforeCall(analysisId, null); - Type localVarReturnType = new TypeToken(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); + public ApiResponse v3DownloadBinaryExportWithHttpInfo(@javax.annotation.Nonnull Long analysisId, @javax.annotation.Nullable String taskId) throws ApiException { + okhttp3.Call localVarCall = v3DownloadBinaryExportValidateBeforeCall(analysisId, taskId, null); + return localVarApiClient.execute(localVarCall); } /** - * Get function embedding progress for an analysis. (asynchronously) - * Returns how many functions the analysis has and how many carry an embedding, with the percentage complete. Embeddings are counted from the unified store, so an analysis whose model predates the current multi-arch one reports zero. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied + * Download a binary export (asynchronously) + * Streams the exported binary. Returns 404 if the task is not complete or its result has expired -- export again in either case. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied * @param analysisId Analysis ID (required) + * @param taskId Task ID returned by queueing the export (optional) * @param _callback The callback to be executed when the API call finishes * @return The request call * @throws ApiException If fail to process the API call, e.g. serializing the request body object @@ -3999,15 +4004,14 @@ public ApiResponse v3GetAnalysisFunctionsProgressWi 500 Internal Server Error - */ - public okhttp3.Call v3GetAnalysisFunctionsProgressAsync(@javax.annotation.Nonnull Long analysisId, final ApiCallback _callback) throws ApiException { + public okhttp3.Call v3DownloadBinaryExportAsync(@javax.annotation.Nonnull Long analysisId, @javax.annotation.Nullable String taskId, final ApiCallback _callback) throws ApiException { - okhttp3.Call localVarCall = v3GetAnalysisFunctionsProgressValidateBeforeCall(analysisId, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + okhttp3.Call localVarCall = v3DownloadBinaryExportValidateBeforeCall(analysisId, taskId, _callback); + localVarApiClient.executeAsync(localVarCall, _callback); return localVarCall; } /** - * Build call for v3GetAnalysisLogs + * Build call for v3GetAnalysis * @param analysisId Analysis ID (required) * @param _callback Callback for upload/download progress * @return Call to execute @@ -4023,7 +4027,7 @@ public okhttp3.Call v3GetAnalysisFunctionsProgressAsync(@javax.annotation.Nonnul 500 Internal Server Error - */ - public okhttp3.Call v3GetAnalysisLogsCall(@javax.annotation.Nonnull Long analysisId, final ApiCallback _callback) throws ApiException { + public okhttp3.Call v3GetAnalysisCall(@javax.annotation.Nonnull Long analysisId, final ApiCallback _callback) throws ApiException { String basePath = null; // Operation Servers String[] localBasePaths = new String[] { }; @@ -4040,7 +4044,7 @@ public okhttp3.Call v3GetAnalysisLogsCall(@javax.annotation.Nonnull Long analysi Object localVarPostBody = null; // create path and map variables - String localVarPath = "/v3/analyses/{analysis_id}/logs" + String localVarPath = "/v3/analyses/{analysis_id}" .replace("{" + "analysis_id" + "}", localVarApiClient.escapeString(analysisId.toString())); List localVarQueryParams = new ArrayList(); @@ -4069,21 +4073,21 @@ public okhttp3.Call v3GetAnalysisLogsCall(@javax.annotation.Nonnull Long analysi } @SuppressWarnings("rawtypes") - private okhttp3.Call v3GetAnalysisLogsValidateBeforeCall(@javax.annotation.Nonnull Long analysisId, final ApiCallback _callback) throws ApiException { + private okhttp3.Call v3GetAnalysisValidateBeforeCall(@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 v3GetAnalysisLogs(Async)"); + throw new ApiException("Missing the required parameter 'analysisId' when calling v3GetAnalysis(Async)"); } - return v3GetAnalysisLogsCall(analysisId, _callback); + return v3GetAnalysisCall(analysisId, _callback); } /** - * Get the Analysis log - * Returns every log line recorded for the Analysis, oldest first, merged from every source that has written one. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied + * Get an analysis. + * Returns the analysis' resource-level detail: binary attributes, ownership, and the configuration it was submitted with. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied * @param analysisId Analysis ID (required) - * @return GetAnalysisLogsOutputBody + * @return AnalysisDetailOutputBody * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details @@ -4096,16 +4100,16 @@ private okhttp3.Call v3GetAnalysisLogsValidateBeforeCall(@javax.annotation.Nonnu
500 Internal Server Error -
*/ - public GetAnalysisLogsOutputBody v3GetAnalysisLogs(@javax.annotation.Nonnull Long analysisId) throws ApiException { - ApiResponse localVarResp = v3GetAnalysisLogsWithHttpInfo(analysisId); + public AnalysisDetailOutputBody v3GetAnalysis(@javax.annotation.Nonnull Long analysisId) throws ApiException { + ApiResponse localVarResp = v3GetAnalysisWithHttpInfo(analysisId); return localVarResp.getData(); } /** - * Get the Analysis log - * Returns every log line recorded for the Analysis, oldest first, merged from every source that has written one. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied + * Get an analysis. + * Returns the analysis' resource-level detail: binary attributes, ownership, and the configuration it was submitted with. **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<GetAnalysisLogsOutputBody> + * @return ApiResponse<AnalysisDetailOutputBody> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details @@ -4118,15 +4122,15 @@ public GetAnalysisLogsOutputBody v3GetAnalysisLogs(@javax.annotation.Nonnull Lon
500 Internal Server Error -
*/ - public ApiResponse v3GetAnalysisLogsWithHttpInfo(@javax.annotation.Nonnull Long analysisId) throws ApiException { - okhttp3.Call localVarCall = v3GetAnalysisLogsValidateBeforeCall(analysisId, null); - Type localVarReturnType = new TypeToken(){}.getType(); + public ApiResponse v3GetAnalysisWithHttpInfo(@javax.annotation.Nonnull Long analysisId) throws ApiException { + okhttp3.Call localVarCall = v3GetAnalysisValidateBeforeCall(analysisId, null); + Type localVarReturnType = new TypeToken(){}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } /** - * Get the Analysis log (asynchronously) - * Returns every log line recorded for the Analysis, oldest first, merged from every source that has written one. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied + * Get an analysis. (asynchronously) + * Returns the analysis' resource-level detail: binary attributes, ownership, and the configuration it was submitted with. **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 @@ -4142,15 +4146,15 @@ public ApiResponse v3GetAnalysisLogsWithHttpInfo(@jav 500 Internal Server Error - */ - public okhttp3.Call v3GetAnalysisLogsAsync(@javax.annotation.Nonnull Long analysisId, final ApiCallback _callback) throws ApiException { + public okhttp3.Call v3GetAnalysisAsync(@javax.annotation.Nonnull Long analysisId, final ApiCallback _callback) throws ApiException { - okhttp3.Call localVarCall = v3GetAnalysisLogsValidateBeforeCall(analysisId, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); + okhttp3.Call localVarCall = v3GetAnalysisValidateBeforeCall(analysisId, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } /** - * Build call for v3GetAnalysisOperation + * Build call for v3GetAnalysisAutoUnstripStatus * @param analysisId Analysis ID (required) * @param _callback Callback for upload/download progress * @return Call to execute @@ -4166,7 +4170,7 @@ public okhttp3.Call v3GetAnalysisLogsAsync(@javax.annotation.Nonnull Long analys 500 Internal Server Error - */ - public okhttp3.Call v3GetAnalysisOperationCall(@javax.annotation.Nonnull Long analysisId, final ApiCallback _callback) throws ApiException { + public okhttp3.Call v3GetAnalysisAutoUnstripStatusCall(@javax.annotation.Nonnull Long analysisId, final ApiCallback _callback) throws ApiException { String basePath = null; // Operation Servers String[] localBasePaths = new String[] { }; @@ -4183,7 +4187,7 @@ public okhttp3.Call v3GetAnalysisOperationCall(@javax.annotation.Nonnull Long an Object localVarPostBody = null; // create path and map variables - String localVarPath = "/v3/operations/analyses/{analysis_id}" + String localVarPath = "/v3/analyses/{analysis_id}/auto-unstrip/status" .replace("{" + "analysis_id" + "}", localVarApiClient.escapeString(analysisId.toString())); List localVarQueryParams = new ArrayList(); @@ -4212,21 +4216,21 @@ public okhttp3.Call v3GetAnalysisOperationCall(@javax.annotation.Nonnull Long an } @SuppressWarnings("rawtypes") - private okhttp3.Call v3GetAnalysisOperationValidateBeforeCall(@javax.annotation.Nonnull Long analysisId, final ApiCallback _callback) throws ApiException { + private okhttp3.Call v3GetAnalysisAutoUnstripStatusValidateBeforeCall(@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 v3GetAnalysisOperation(Async)"); + throw new ApiException("Missing the required parameter 'analysisId' when calling v3GetAnalysisAutoUnstripStatus(Async)"); } - return v3GetAnalysisOperationCall(analysisId, _callback); + return v3GetAnalysisAutoUnstripStatusCall(analysisId, _callback); } /** - * Get an Analysis-creation operation - * Polls the status of an Analysis-creation operation. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied + * Get the auto-unstrip status for an analysis. + * Returns the status of the auto-unstrip task for the binary backing the analysis. One of `UNINITIALISED`, `PENDING`, `RUNNING`, `COMPLETED`, `FAILED`. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied * @param analysisId Analysis ID (required) - * @return OperationCreateMetadataCreateResult + * @return AutoUnstripStatusOutputBody * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details @@ -4239,16 +4243,16 @@ private okhttp3.Call v3GetAnalysisOperationValidateBeforeCall(@javax.annotation.
500 Internal Server Error -
*/ - public OperationCreateMetadataCreateResult v3GetAnalysisOperation(@javax.annotation.Nonnull Long analysisId) throws ApiException { - ApiResponse localVarResp = v3GetAnalysisOperationWithHttpInfo(analysisId); + public AutoUnstripStatusOutputBody v3GetAnalysisAutoUnstripStatus(@javax.annotation.Nonnull Long analysisId) throws ApiException { + ApiResponse localVarResp = v3GetAnalysisAutoUnstripStatusWithHttpInfo(analysisId); return localVarResp.getData(); } /** - * Get an Analysis-creation operation - * Polls the status of an Analysis-creation operation. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied + * Get the auto-unstrip status for an analysis. + * Returns the status of the auto-unstrip task for the binary backing the analysis. One of `UNINITIALISED`, `PENDING`, `RUNNING`, `COMPLETED`, `FAILED`. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied * @param analysisId Analysis ID (required) - * @return ApiResponse<OperationCreateMetadataCreateResult> + * @return ApiResponse<AutoUnstripStatusOutputBody> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details @@ -4261,15 +4265,15 @@ public OperationCreateMetadataCreateResult v3GetAnalysisOperation(@javax.annotat
500 Internal Server Error -
*/ - public ApiResponse v3GetAnalysisOperationWithHttpInfo(@javax.annotation.Nonnull Long analysisId) throws ApiException { - okhttp3.Call localVarCall = v3GetAnalysisOperationValidateBeforeCall(analysisId, null); - Type localVarReturnType = new TypeToken(){}.getType(); + public ApiResponse v3GetAnalysisAutoUnstripStatusWithHttpInfo(@javax.annotation.Nonnull Long analysisId) throws ApiException { + okhttp3.Call localVarCall = v3GetAnalysisAutoUnstripStatusValidateBeforeCall(analysisId, null); + Type localVarReturnType = new TypeToken(){}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } /** - * Get an Analysis-creation operation (asynchronously) - * Polls the status of an Analysis-creation operation. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied + * Get the auto-unstrip status for an analysis. (asynchronously) + * Returns the status of the auto-unstrip task for the binary backing the analysis. One of `UNINITIALISED`, `PENDING`, `RUNNING`, `COMPLETED`, `FAILED`. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied * @param analysisId Analysis ID (required) * @param _callback The callback to be executed when the API call finishes * @return The request call @@ -4285,23 +4289,16 @@ public ApiResponse v3GetAnalysisOperationWi 500 Internal Server Error - */ - public okhttp3.Call v3GetAnalysisOperationAsync(@javax.annotation.Nonnull Long analysisId, final ApiCallback _callback) throws ApiException { + public okhttp3.Call v3GetAnalysisAutoUnstripStatusAsync(@javax.annotation.Nonnull Long analysisId, final ApiCallback _callback) throws ApiException { - okhttp3.Call localVarCall = v3GetAnalysisOperationValidateBeforeCall(analysisId, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); + okhttp3.Call localVarCall = v3GetAnalysisAutoUnstripStatusValidateBeforeCall(analysisId, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } /** - * Build call for v3GetAnalysisStrings + * Build call for v3GetAnalysisFunctionsProgress * @param analysisId Analysis ID (required) - * @param page Page number (1-indexed). (optional, default to 1) - * @param pageSize Number of results per page. (optional, default to 100) - * @param search Filter by string value (case-insensitive substring match). (optional) - * @param searchOperator How the search term matches string values. (optional, default to CONTAINS) - * @param functionSearch Filter by function name (case-insensitive substring match). (optional) - * @param orderBy Field to order results by. (optional, default to value) - * @param sortOrder Sort direction. (optional, default to ASC) * @param _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object @@ -4316,7 +4313,7 @@ public okhttp3.Call v3GetAnalysisOperationAsync(@javax.annotation.Nonnull Long a 500 Internal Server Error - */ - public okhttp3.Call v3GetAnalysisStringsCall(@javax.annotation.Nonnull Long analysisId, @javax.annotation.Nullable Long page, @javax.annotation.Nullable Long pageSize, @javax.annotation.Nullable String search, @javax.annotation.Nullable String searchOperator, @javax.annotation.Nullable String functionSearch, @javax.annotation.Nullable String orderBy, @javax.annotation.Nullable String sortOrder, final ApiCallback _callback) throws ApiException { + public okhttp3.Call v3GetAnalysisFunctionsProgressCall(@javax.annotation.Nonnull Long analysisId, final ApiCallback _callback) throws ApiException { String basePath = null; // Operation Servers String[] localBasePaths = new String[] { }; @@ -4333,7 +4330,7 @@ public okhttp3.Call v3GetAnalysisStringsCall(@javax.annotation.Nonnull Long anal Object localVarPostBody = null; // create path and map variables - String localVarPath = "/v3/analyses/{analysis_id}/functions/strings" + String localVarPath = "/v3/analyses/{analysis_id}/progress/functions" .replace("{" + "analysis_id" + "}", localVarApiClient.escapeString(analysisId.toString())); List localVarQueryParams = new ArrayList(); @@ -4342,34 +4339,6 @@ public okhttp3.Call v3GetAnalysisStringsCall(@javax.annotation.Nonnull Long anal Map localVarCookieParams = new HashMap(); Map localVarFormParams = new HashMap(); - if (page != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("page", page)); - } - - if (pageSize != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("page_size", pageSize)); - } - - if (search != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("search", search)); - } - - if (searchOperator != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("search_operator", searchOperator)); - } - - if (functionSearch != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("function_search", functionSearch)); - } - - if (orderBy != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("order_by", orderBy)); - } - - if (sortOrder != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("sort_order", sortOrder)); - } - final String[] localVarAccepts = { "application/json" }; @@ -4390,28 +4359,21 @@ public okhttp3.Call v3GetAnalysisStringsCall(@javax.annotation.Nonnull Long anal } @SuppressWarnings("rawtypes") - private okhttp3.Call v3GetAnalysisStringsValidateBeforeCall(@javax.annotation.Nonnull Long analysisId, @javax.annotation.Nullable Long page, @javax.annotation.Nullable Long pageSize, @javax.annotation.Nullable String search, @javax.annotation.Nullable String searchOperator, @javax.annotation.Nullable String functionSearch, @javax.annotation.Nullable String orderBy, @javax.annotation.Nullable String sortOrder, final ApiCallback _callback) throws ApiException { + private okhttp3.Call v3GetAnalysisFunctionsProgressValidateBeforeCall(@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 v3GetAnalysisStrings(Async)"); + throw new ApiException("Missing the required parameter 'analysisId' when calling v3GetAnalysisFunctionsProgress(Async)"); } - return v3GetAnalysisStringsCall(analysisId, page, pageSize, search, searchOperator, functionSearch, orderBy, sortOrder, _callback); + return v3GetAnalysisFunctionsProgressCall(analysisId, _callback); } /** - * List strings for an analysis. - * Returns the strings discovered in an analysis, combining function-level and analysis-level strings. Supports value/function-name search, sorting and pagination. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied + * Get function embedding progress for an analysis. + * Returns how many functions the analysis has and how many carry an embedding, with the percentage complete. Embeddings are counted from the unified store, so an analysis whose model predates the current multi-arch one reports zero. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied * @param analysisId Analysis ID (required) - * @param page Page number (1-indexed). (optional, default to 1) - * @param pageSize Number of results per page. (optional, default to 100) - * @param search Filter by string value (case-insensitive substring match). (optional) - * @param searchOperator How the search term matches string values. (optional, default to CONTAINS) - * @param functionSearch Filter by function name (case-insensitive substring match). (optional) - * @param orderBy Field to order results by. (optional, default to value) - * @param sortOrder Sort direction. (optional, default to ASC) - * @return ListAnalysisStringsOutputBody + * @return FunctionsProgressOutputBody * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details @@ -4424,23 +4386,16 @@ private okhttp3.Call v3GetAnalysisStringsValidateBeforeCall(@javax.annotation.No
500 Internal Server Error -
*/ - public ListAnalysisStringsOutputBody v3GetAnalysisStrings(@javax.annotation.Nonnull Long analysisId, @javax.annotation.Nullable Long page, @javax.annotation.Nullable Long pageSize, @javax.annotation.Nullable String search, @javax.annotation.Nullable String searchOperator, @javax.annotation.Nullable String functionSearch, @javax.annotation.Nullable String orderBy, @javax.annotation.Nullable String sortOrder) throws ApiException { - ApiResponse localVarResp = v3GetAnalysisStringsWithHttpInfo(analysisId, page, pageSize, search, searchOperator, functionSearch, orderBy, sortOrder); + public FunctionsProgressOutputBody v3GetAnalysisFunctionsProgress(@javax.annotation.Nonnull Long analysisId) throws ApiException { + ApiResponse localVarResp = v3GetAnalysisFunctionsProgressWithHttpInfo(analysisId); return localVarResp.getData(); } /** - * List strings for an analysis. - * Returns the strings discovered in an analysis, combining function-level and analysis-level strings. Supports value/function-name search, sorting and pagination. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied + * Get function embedding progress for an analysis. + * Returns how many functions the analysis has and how many carry an embedding, with the percentage complete. Embeddings are counted from the unified store, so an analysis whose model predates the current multi-arch one reports zero. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied * @param analysisId Analysis ID (required) - * @param page Page number (1-indexed). (optional, default to 1) - * @param pageSize Number of results per page. (optional, default to 100) - * @param search Filter by string value (case-insensitive substring match). (optional) - * @param searchOperator How the search term matches string values. (optional, default to CONTAINS) - * @param functionSearch Filter by function name (case-insensitive substring match). (optional) - * @param orderBy Field to order results by. (optional, default to value) - * @param sortOrder Sort direction. (optional, default to ASC) - * @return ApiResponse<ListAnalysisStringsOutputBody> + * @return ApiResponse<FunctionsProgressOutputBody> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details @@ -4453,23 +4408,16 @@ public ListAnalysisStringsOutputBody v3GetAnalysisStrings(@javax.annotation.Nonn
500 Internal Server Error -
*/ - public ApiResponse v3GetAnalysisStringsWithHttpInfo(@javax.annotation.Nonnull Long analysisId, @javax.annotation.Nullable Long page, @javax.annotation.Nullable Long pageSize, @javax.annotation.Nullable String search, @javax.annotation.Nullable String searchOperator, @javax.annotation.Nullable String functionSearch, @javax.annotation.Nullable String orderBy, @javax.annotation.Nullable String sortOrder) throws ApiException { - okhttp3.Call localVarCall = v3GetAnalysisStringsValidateBeforeCall(analysisId, page, pageSize, search, searchOperator, functionSearch, orderBy, sortOrder, null); - Type localVarReturnType = new TypeToken(){}.getType(); + public ApiResponse v3GetAnalysisFunctionsProgressWithHttpInfo(@javax.annotation.Nonnull Long analysisId) throws ApiException { + okhttp3.Call localVarCall = v3GetAnalysisFunctionsProgressValidateBeforeCall(analysisId, null); + Type localVarReturnType = new TypeToken(){}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } /** - * List strings for an analysis. (asynchronously) - * Returns the strings discovered in an analysis, combining function-level and analysis-level strings. Supports value/function-name search, sorting and pagination. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied + * Get function embedding progress for an analysis. (asynchronously) + * Returns how many functions the analysis has and how many carry an embedding, with the percentage complete. Embeddings are counted from the unified store, so an analysis whose model predates the current multi-arch one reports zero. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied * @param analysisId Analysis ID (required) - * @param page Page number (1-indexed). (optional, default to 1) - * @param pageSize Number of results per page. (optional, default to 100) - * @param search Filter by string value (case-insensitive substring match). (optional) - * @param searchOperator How the search term matches string values. (optional, default to CONTAINS) - * @param functionSearch Filter by function name (case-insensitive substring match). (optional) - * @param orderBy Field to order results by. (optional, default to value) - * @param sortOrder Sort direction. (optional, default to ASC) * @param _callback The callback to be executed when the API call finishes * @return The request call * @throws ApiException If fail to process the API call, e.g. serializing the request body object @@ -4484,15 +4432,15 @@ public ApiResponse v3GetAnalysisStringsWithHttpIn 500 Internal Server Error - */ - public okhttp3.Call v3GetAnalysisStringsAsync(@javax.annotation.Nonnull Long analysisId, @javax.annotation.Nullable Long page, @javax.annotation.Nullable Long pageSize, @javax.annotation.Nullable String search, @javax.annotation.Nullable String searchOperator, @javax.annotation.Nullable String functionSearch, @javax.annotation.Nullable String orderBy, @javax.annotation.Nullable String sortOrder, final ApiCallback _callback) throws ApiException { + public okhttp3.Call v3GetAnalysisFunctionsProgressAsync(@javax.annotation.Nonnull Long analysisId, final ApiCallback _callback) throws ApiException { - okhttp3.Call localVarCall = v3GetAnalysisStringsValidateBeforeCall(analysisId, page, pageSize, search, searchOperator, functionSearch, orderBy, sortOrder, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); + okhttp3.Call localVarCall = v3GetAnalysisFunctionsProgressValidateBeforeCall(analysisId, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } /** - * Build call for v3GetAnalysisStringsStatus + * Build call for v3GetAnalysisLogs * @param analysisId Analysis ID (required) * @param _callback Callback for upload/download progress * @return Call to execute @@ -4508,7 +4456,7 @@ public okhttp3.Call v3GetAnalysisStringsAsync(@javax.annotation.Nonnull Long ana 500 Internal Server Error - */ - public okhttp3.Call v3GetAnalysisStringsStatusCall(@javax.annotation.Nonnull Long analysisId, final ApiCallback _callback) throws ApiException { + public okhttp3.Call v3GetAnalysisLogsCall(@javax.annotation.Nonnull Long analysisId, final ApiCallback _callback) throws ApiException { String basePath = null; // Operation Servers String[] localBasePaths = new String[] { }; @@ -4525,7 +4473,7 @@ public okhttp3.Call v3GetAnalysisStringsStatusCall(@javax.annotation.Nonnull Lon Object localVarPostBody = null; // create path and map variables - String localVarPath = "/v3/analyses/{analysis_id}/functions/strings/status" + String localVarPath = "/v3/analyses/{analysis_id}/logs" .replace("{" + "analysis_id" + "}", localVarApiClient.escapeString(analysisId.toString())); List localVarQueryParams = new ArrayList(); @@ -4554,21 +4502,21 @@ public okhttp3.Call v3GetAnalysisStringsStatusCall(@javax.annotation.Nonnull Lon } @SuppressWarnings("rawtypes") - private okhttp3.Call v3GetAnalysisStringsStatusValidateBeforeCall(@javax.annotation.Nonnull Long analysisId, final ApiCallback _callback) throws ApiException { + private okhttp3.Call v3GetAnalysisLogsValidateBeforeCall(@javax.annotation.Nonnull Long analysisId, final ApiCallback _callback) throws ApiException { // verify the required parameter 'analysisId' is set if (analysisId == null) { - throw new ApiException("Missing the required parameter 'analysisId' when calling v3GetAnalysisStringsStatus(Async)"); + throw new ApiException("Missing the required parameter 'analysisId' when calling v3GetAnalysisLogs(Async)"); } - return v3GetAnalysisStringsStatusCall(analysisId, _callback); + return v3GetAnalysisLogsCall(analysisId, _callback); } /** - * Get the string-extraction status for an analysis. - * Returns the status of the string-extraction task for the binary backing the analysis. One of UNINITIALISED, PENDING, RUNNING, COMPLETED, FAILED. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied + * Get the Analysis log + * Returns every log line recorded for the Analysis, oldest first, merged from every source that has written one. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied * @param analysisId Analysis ID (required) - * @return GetAnalysisStringsStatusOutputBody + * @return GetAnalysisLogsOutputBody * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details @@ -4581,14 +4529,499 @@ private okhttp3.Call v3GetAnalysisStringsStatusValidateBeforeCall(@javax.annotat
500 Internal Server Error -
*/ - public GetAnalysisStringsStatusOutputBody v3GetAnalysisStringsStatus(@javax.annotation.Nonnull Long analysisId) throws ApiException { - ApiResponse localVarResp = v3GetAnalysisStringsStatusWithHttpInfo(analysisId); + public GetAnalysisLogsOutputBody v3GetAnalysisLogs(@javax.annotation.Nonnull Long analysisId) throws ApiException { + ApiResponse localVarResp = v3GetAnalysisLogsWithHttpInfo(analysisId); return localVarResp.getData(); } /** - * Get the string-extraction status for an analysis. - * Returns the status of the string-extraction task for the binary backing the analysis. One of UNINITIALISED, PENDING, RUNNING, COMPLETED, FAILED. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied + * Get the Analysis log + * Returns every log line recorded for the Analysis, oldest first, merged from every source that has written one. **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<GetAnalysisLogsOutputBody> + * @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 v3GetAnalysisLogsWithHttpInfo(@javax.annotation.Nonnull Long analysisId) throws ApiException { + okhttp3.Call localVarCall = v3GetAnalysisLogsValidateBeforeCall(analysisId, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Get the Analysis log (asynchronously) + * Returns every log line recorded for the Analysis, oldest first, merged from every source that has written one. **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 v3GetAnalysisLogsAsync(@javax.annotation.Nonnull Long analysisId, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = v3GetAnalysisLogsValidateBeforeCall(analysisId, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for v3GetAnalysisOperation + * @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 v3GetAnalysisOperationCall(@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/operations/analyses/{analysis_id}" + .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", "bearerAuth" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call v3GetAnalysisOperationValidateBeforeCall(@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 v3GetAnalysisOperation(Async)"); + } + + return v3GetAnalysisOperationCall(analysisId, _callback); + + } + + /** + * Get an Analysis-creation operation + * Polls the status of an Analysis-creation operation. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied + * @param analysisId Analysis ID (required) + * @return OperationCreateMetadataCreateResult + * @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 OperationCreateMetadataCreateResult v3GetAnalysisOperation(@javax.annotation.Nonnull Long analysisId) throws ApiException { + ApiResponse localVarResp = v3GetAnalysisOperationWithHttpInfo(analysisId); + return localVarResp.getData(); + } + + /** + * Get an Analysis-creation operation + * Polls the status of an Analysis-creation operation. **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<OperationCreateMetadataCreateResult> + * @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 v3GetAnalysisOperationWithHttpInfo(@javax.annotation.Nonnull Long analysisId) throws ApiException { + okhttp3.Call localVarCall = v3GetAnalysisOperationValidateBeforeCall(analysisId, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Get an Analysis-creation operation (asynchronously) + * Polls the status of an Analysis-creation operation. **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 v3GetAnalysisOperationAsync(@javax.annotation.Nonnull Long analysisId, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = v3GetAnalysisOperationValidateBeforeCall(analysisId, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for v3GetAnalysisStrings + * @param analysisId Analysis ID (required) + * @param page Page number (1-indexed). (optional, default to 1) + * @param pageSize Number of results per page. (optional, default to 100) + * @param search Filter by string value (case-insensitive substring match). (optional) + * @param searchOperator How the search term matches string values. (optional, default to CONTAINS) + * @param functionSearch Filter by function name (case-insensitive substring match). (optional) + * @param orderBy Field to order results by. (optional, default to value) + * @param sortOrder Sort direction. (optional, default to ASC) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @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 v3GetAnalysisStringsCall(@javax.annotation.Nonnull Long analysisId, @javax.annotation.Nullable Long page, @javax.annotation.Nullable Long pageSize, @javax.annotation.Nullable String search, @javax.annotation.Nullable String searchOperator, @javax.annotation.Nullable String functionSearch, @javax.annotation.Nullable String orderBy, @javax.annotation.Nullable String sortOrder, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // 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}/functions/strings" + .replace("{" + "analysis_id" + "}", localVarApiClient.escapeString(analysisId.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + if (page != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("page", page)); + } + + if (pageSize != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("page_size", pageSize)); + } + + if (search != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("search", search)); + } + + if (searchOperator != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("search_operator", searchOperator)); + } + + if (functionSearch != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("function_search", functionSearch)); + } + + if (orderBy != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("order_by", orderBy)); + } + + if (sortOrder != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("sort_order", sortOrder)); + } + + final String[] localVarAccepts = { + "application/json" + }; + 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", "bearerAuth" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call v3GetAnalysisStringsValidateBeforeCall(@javax.annotation.Nonnull Long analysisId, @javax.annotation.Nullable Long page, @javax.annotation.Nullable Long pageSize, @javax.annotation.Nullable String search, @javax.annotation.Nullable String searchOperator, @javax.annotation.Nullable String functionSearch, @javax.annotation.Nullable String orderBy, @javax.annotation.Nullable String sortOrder, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'analysisId' is set + if (analysisId == null) { + throw new ApiException("Missing the required parameter 'analysisId' when calling v3GetAnalysisStrings(Async)"); + } + + return v3GetAnalysisStringsCall(analysisId, page, pageSize, search, searchOperator, functionSearch, orderBy, sortOrder, _callback); + + } + + /** + * List strings for an analysis. + * Returns the strings discovered in an analysis, combining function-level and analysis-level strings. Supports value/function-name search, sorting and pagination. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied + * @param analysisId Analysis ID (required) + * @param page Page number (1-indexed). (optional, default to 1) + * @param pageSize Number of results per page. (optional, default to 100) + * @param search Filter by string value (case-insensitive substring match). (optional) + * @param searchOperator How the search term matches string values. (optional, default to CONTAINS) + * @param functionSearch Filter by function name (case-insensitive substring match). (optional) + * @param orderBy Field to order results by. (optional, default to value) + * @param sortOrder Sort direction. (optional, default to ASC) + * @return ListAnalysisStringsOutputBody + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + + + +
Response Details
Status Code Description Response Headers
200 OK -
403 Forbidden -
404 Not Found -
422 Unprocessable Entity -
500 Internal Server Error -
+ */ + public ListAnalysisStringsOutputBody v3GetAnalysisStrings(@javax.annotation.Nonnull Long analysisId, @javax.annotation.Nullable Long page, @javax.annotation.Nullable Long pageSize, @javax.annotation.Nullable String search, @javax.annotation.Nullable String searchOperator, @javax.annotation.Nullable String functionSearch, @javax.annotation.Nullable String orderBy, @javax.annotation.Nullable String sortOrder) throws ApiException { + ApiResponse localVarResp = v3GetAnalysisStringsWithHttpInfo(analysisId, page, pageSize, search, searchOperator, functionSearch, orderBy, sortOrder); + return localVarResp.getData(); + } + + /** + * List strings for an analysis. + * Returns the strings discovered in an analysis, combining function-level and analysis-level strings. Supports value/function-name search, sorting and pagination. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied + * @param analysisId Analysis ID (required) + * @param page Page number (1-indexed). (optional, default to 1) + * @param pageSize Number of results per page. (optional, default to 100) + * @param search Filter by string value (case-insensitive substring match). (optional) + * @param searchOperator How the search term matches string values. (optional, default to CONTAINS) + * @param functionSearch Filter by function name (case-insensitive substring match). (optional) + * @param orderBy Field to order results by. (optional, default to value) + * @param sortOrder Sort direction. (optional, default to ASC) + * @return ApiResponse<ListAnalysisStringsOutputBody> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + + + +
Response Details
Status Code Description Response Headers
200 OK -
403 Forbidden -
404 Not Found -
422 Unprocessable Entity -
500 Internal Server Error -
+ */ + public ApiResponse v3GetAnalysisStringsWithHttpInfo(@javax.annotation.Nonnull Long analysisId, @javax.annotation.Nullable Long page, @javax.annotation.Nullable Long pageSize, @javax.annotation.Nullable String search, @javax.annotation.Nullable String searchOperator, @javax.annotation.Nullable String functionSearch, @javax.annotation.Nullable String orderBy, @javax.annotation.Nullable String sortOrder) throws ApiException { + okhttp3.Call localVarCall = v3GetAnalysisStringsValidateBeforeCall(analysisId, page, pageSize, search, searchOperator, functionSearch, orderBy, sortOrder, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * List strings for an analysis. (asynchronously) + * Returns the strings discovered in an analysis, combining function-level and analysis-level strings. Supports value/function-name search, sorting and pagination. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied + * @param analysisId Analysis ID (required) + * @param page Page number (1-indexed). (optional, default to 1) + * @param pageSize Number of results per page. (optional, default to 100) + * @param search Filter by string value (case-insensitive substring match). (optional) + * @param searchOperator How the search term matches string values. (optional, default to CONTAINS) + * @param functionSearch Filter by function name (case-insensitive substring match). (optional) + * @param orderBy Field to order results by. (optional, default to value) + * @param sortOrder Sort direction. (optional, default to ASC) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @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 v3GetAnalysisStringsAsync(@javax.annotation.Nonnull Long analysisId, @javax.annotation.Nullable Long page, @javax.annotation.Nullable Long pageSize, @javax.annotation.Nullable String search, @javax.annotation.Nullable String searchOperator, @javax.annotation.Nullable String functionSearch, @javax.annotation.Nullable String orderBy, @javax.annotation.Nullable String sortOrder, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = v3GetAnalysisStringsValidateBeforeCall(analysisId, page, pageSize, search, searchOperator, functionSearch, orderBy, sortOrder, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for v3GetAnalysisStringsStatus + * @param analysisId Analysis ID (required) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @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 v3GetAnalysisStringsStatusCall(@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}/functions/strings/status" + .replace("{" + "analysis_id" + "}", localVarApiClient.escapeString(analysisId.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "APIKey", "bearerAuth" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call v3GetAnalysisStringsStatusValidateBeforeCall(@javax.annotation.Nonnull Long analysisId, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'analysisId' is set + if (analysisId == null) { + throw new ApiException("Missing the required parameter 'analysisId' when calling v3GetAnalysisStringsStatus(Async)"); + } + + return v3GetAnalysisStringsStatusCall(analysisId, _callback); + + } + + /** + * Get the string-extraction status for an analysis. + * Returns the status of the string-extraction task for the binary backing the analysis. One of UNINITIALISED, PENDING, RUNNING, COMPLETED, FAILED. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied + * @param analysisId Analysis ID (required) + * @return GetAnalysisStringsStatusOutputBody + * @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 GetAnalysisStringsStatusOutputBody v3GetAnalysisStringsStatus(@javax.annotation.Nonnull Long analysisId) throws ApiException { + ApiResponse localVarResp = v3GetAnalysisStringsStatusWithHttpInfo(analysisId); + return localVarResp.getData(); + } + + /** + * Get the string-extraction status for an analysis. + * Returns the status of the string-extraction task for the binary backing the analysis. One of UNINITIALISED, PENDING, RUNNING, COMPLETED, FAILED. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied * @param analysisId Analysis ID (required) * @return ApiResponse<GetAnalysisStringsStatusOutputBody> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body @@ -4597,22 +5030,659 @@ public GetAnalysisStringsStatusOutputBody v3GetAnalysisStringsStatus(@javax.anno Response Details Status Code Description Response Headers 200 OK - - 403 Forbidden - + 403 Forbidden - + 404 Not Found - + 422 Unprocessable Entity - + 500 Internal Server Error - + + */ + public ApiResponse v3GetAnalysisStringsStatusWithHttpInfo(@javax.annotation.Nonnull Long analysisId) throws ApiException { + okhttp3.Call localVarCall = v3GetAnalysisStringsStatusValidateBeforeCall(analysisId, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Get the string-extraction status for an analysis. (asynchronously) + * Returns the status of the string-extraction task for the binary backing the analysis. One of UNINITIALISED, PENDING, RUNNING, COMPLETED, FAILED. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied + * @param analysisId Analysis ID (required) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @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 v3GetAnalysisStringsStatusAsync(@javax.annotation.Nonnull Long analysisId, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = v3GetAnalysisStringsStatusValidateBeforeCall(analysisId, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for v3GetBinaryExportOperation + * @param taskId Task ID returned by queueing the export (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 v3GetBinaryExportOperationCall(@javax.annotation.Nonnull String taskId, 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/operations/binary-export/{task_id}" + .replace("{" + "task_id" + "}", localVarApiClient.escapeString(taskId.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", "bearerAuth" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call v3GetBinaryExportOperationValidateBeforeCall(@javax.annotation.Nonnull String taskId, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'taskId' is set + if (taskId == null) { + throw new ApiException("Missing the required parameter 'taskId' when calling v3GetBinaryExportOperation(Async)"); + } + + return v3GetBinaryExportOperationCall(taskId, _callback); + + } + + /** + * Get a binary export operation + * Returns the current state of the export started for this task ID. `done` is the only readiness signal: while false, poll again; once true, exactly one of `response` or `error` is set. A task ID the platform no longer recognises -- whether it never existed or its history has expired -- resolves to a failed operation, since either way the caller must export again. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied + * @param taskId Task ID returned by queueing the export (required) + * @return OperationBinaryExportMetadataBinaryExportResult + * @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 OperationBinaryExportMetadataBinaryExportResult v3GetBinaryExportOperation(@javax.annotation.Nonnull String taskId) throws ApiException { + ApiResponse localVarResp = v3GetBinaryExportOperationWithHttpInfo(taskId); + return localVarResp.getData(); + } + + /** + * Get a binary export operation + * Returns the current state of the export started for this task ID. `done` is the only readiness signal: while false, poll again; once true, exactly one of `response` or `error` is set. A task ID the platform no longer recognises -- whether it never existed or its history has expired -- resolves to a failed operation, since either way the caller must export again. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied + * @param taskId Task ID returned by queueing the export (required) + * @return ApiResponse<OperationBinaryExportMetadataBinaryExportResult> + * @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 v3GetBinaryExportOperationWithHttpInfo(@javax.annotation.Nonnull String taskId) throws ApiException { + okhttp3.Call localVarCall = v3GetBinaryExportOperationValidateBeforeCall(taskId, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Get a binary export operation (asynchronously) + * Returns the current state of the export started for this task ID. `done` is the only readiness signal: while false, poll again; once true, exactly one of `response` or `error` is set. A task ID the platform no longer recognises -- whether it never existed or its history has expired -- resolves to a failed operation, since either way the caller must export again. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied + * @param taskId Task ID returned by queueing the export (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 v3GetBinaryExportOperationAsync(@javax.annotation.Nonnull String taskId, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = v3GetBinaryExportOperationValidateBeforeCall(taskId, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for v3ListAnalyses + * @param searchTerm (optional) + * @param analysisScope Leave empty to search your own, your team's and all public analyses (optional) + * @param status (optional) + * @param modelName (optional) + * @param usernames (optional) + * @param sha256Hash (optional) + * @param binaryId Restrict to analyses of this binary. A binary can carry more than one analysis; they are returned newest first under the default sort (optional) + * @param platform Restrict to binaries running on one of these operating-system platforms. Matches the uploader's override when they set one, the detected platform otherwise; a binary with neither is never matched. Leave empty for no filter (optional) + * @param architecture Restrict to binaries built for one of these instruction-set architectures. Resolved the same way as platform. Leave empty for no filter (optional) + * @param pageSize (optional, default to 20) + * @param nextPageToken Forward-pagination cursor from a prior response. When set, order_by/order are taken from the token (the sort cannot change mid-pagination). (optional) + * @param orderBy (optional, default to created) + * @param order (optional, default to DESC) + * @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 -
400 Bad Request -
422 Unprocessable Entity -
500 Internal Server Error -
+ */ + public okhttp3.Call v3ListAnalysesCall(@javax.annotation.Nullable String searchTerm, @javax.annotation.Nullable List analysisScope, @javax.annotation.Nullable List status, @javax.annotation.Nullable List modelName, @javax.annotation.Nullable List usernames, @javax.annotation.Nullable String sha256Hash, @javax.annotation.Nullable Long binaryId, @javax.annotation.Nullable List platform, @javax.annotation.Nullable List architecture, @javax.annotation.Nullable Long pageSize, @javax.annotation.Nullable String nextPageToken, @javax.annotation.Nullable String orderBy, @javax.annotation.Nullable String order, 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"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + if (searchTerm != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("search_term", searchTerm)); + } + + if (analysisScope != null) { + localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "analysis_scope", analysisScope)); + } + + if (status != null) { + localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "status", status)); + } + + if (modelName != null) { + localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("csv", "model_name", modelName)); + } + + if (usernames != null) { + localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("csv", "usernames", usernames)); + } + + if (sha256Hash != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("sha256_hash", sha256Hash)); + } + + if (binaryId != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("binary_id", binaryId)); + } + + if (platform != null) { + localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("csv", "platform", platform)); + } + + if (architecture != null) { + localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("csv", "architecture", architecture)); + } + + if (pageSize != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("page_size", pageSize)); + } + + if (nextPageToken != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("next_page_token", nextPageToken)); + } + + if (orderBy != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("order_by", orderBy)); + } + + if (order != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("order", order)); + } + + 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", "bearerAuth" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call v3ListAnalysesValidateBeforeCall(@javax.annotation.Nullable String searchTerm, @javax.annotation.Nullable List analysisScope, @javax.annotation.Nullable List status, @javax.annotation.Nullable List modelName, @javax.annotation.Nullable List usernames, @javax.annotation.Nullable String sha256Hash, @javax.annotation.Nullable Long binaryId, @javax.annotation.Nullable List platform, @javax.annotation.Nullable List architecture, @javax.annotation.Nullable Long pageSize, @javax.annotation.Nullable String nextPageToken, @javax.annotation.Nullable String orderBy, @javax.annotation.Nullable String order, final ApiCallback _callback) throws ApiException { + return v3ListAnalysesCall(searchTerm, analysisScope, status, modelName, usernames, sha256Hash, binaryId, platform, architecture, pageSize, nextPageToken, orderBy, order, _callback); + + } + + /** + * List analyses + * Returns a page of analyses visible to the caller, filtered and ordered by the query parameters. **Error codes:** - `400` [`BAD_REQUEST`](/errors/BAD_REQUEST) — Bad Request + * @param searchTerm (optional) + * @param analysisScope Leave empty to search your own, your team's and all public analyses (optional) + * @param status (optional) + * @param modelName (optional) + * @param usernames (optional) + * @param sha256Hash (optional) + * @param binaryId Restrict to analyses of this binary. A binary can carry more than one analysis; they are returned newest first under the default sort (optional) + * @param platform Restrict to binaries running on one of these operating-system platforms. Matches the uploader's override when they set one, the detected platform otherwise; a binary with neither is never matched. Leave empty for no filter (optional) + * @param architecture Restrict to binaries built for one of these instruction-set architectures. Resolved the same way as platform. Leave empty for no filter (optional) + * @param pageSize (optional, default to 20) + * @param nextPageToken Forward-pagination cursor from a prior response. When set, order_by/order are taken from the token (the sort cannot change mid-pagination). (optional) + * @param orderBy (optional, default to created) + * @param order (optional, default to DESC) + * @return ListAnalysesOutputBody + * @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 -
400 Bad Request -
422 Unprocessable Entity -
500 Internal Server Error -
+ */ + public ListAnalysesOutputBody v3ListAnalyses(@javax.annotation.Nullable String searchTerm, @javax.annotation.Nullable List analysisScope, @javax.annotation.Nullable List status, @javax.annotation.Nullable List modelName, @javax.annotation.Nullable List usernames, @javax.annotation.Nullable String sha256Hash, @javax.annotation.Nullable Long binaryId, @javax.annotation.Nullable List platform, @javax.annotation.Nullable List architecture, @javax.annotation.Nullable Long pageSize, @javax.annotation.Nullable String nextPageToken, @javax.annotation.Nullable String orderBy, @javax.annotation.Nullable String order) throws ApiException { + ApiResponse localVarResp = v3ListAnalysesWithHttpInfo(searchTerm, analysisScope, status, modelName, usernames, sha256Hash, binaryId, platform, architecture, pageSize, nextPageToken, orderBy, order); + return localVarResp.getData(); + } + + /** + * List analyses + * Returns a page of analyses visible to the caller, filtered and ordered by the query parameters. **Error codes:** - `400` [`BAD_REQUEST`](/errors/BAD_REQUEST) — Bad Request + * @param searchTerm (optional) + * @param analysisScope Leave empty to search your own, your team's and all public analyses (optional) + * @param status (optional) + * @param modelName (optional) + * @param usernames (optional) + * @param sha256Hash (optional) + * @param binaryId Restrict to analyses of this binary. A binary can carry more than one analysis; they are returned newest first under the default sort (optional) + * @param platform Restrict to binaries running on one of these operating-system platforms. Matches the uploader's override when they set one, the detected platform otherwise; a binary with neither is never matched. Leave empty for no filter (optional) + * @param architecture Restrict to binaries built for one of these instruction-set architectures. Resolved the same way as platform. Leave empty for no filter (optional) + * @param pageSize (optional, default to 20) + * @param nextPageToken Forward-pagination cursor from a prior response. When set, order_by/order are taken from the token (the sort cannot change mid-pagination). (optional) + * @param orderBy (optional, default to created) + * @param order (optional, default to DESC) + * @return ApiResponse<ListAnalysesOutputBody> + * @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 -
400 Bad Request -
422 Unprocessable Entity -
500 Internal Server Error -
+ */ + public ApiResponse v3ListAnalysesWithHttpInfo(@javax.annotation.Nullable String searchTerm, @javax.annotation.Nullable List analysisScope, @javax.annotation.Nullable List status, @javax.annotation.Nullable List modelName, @javax.annotation.Nullable List usernames, @javax.annotation.Nullable String sha256Hash, @javax.annotation.Nullable Long binaryId, @javax.annotation.Nullable List platform, @javax.annotation.Nullable List architecture, @javax.annotation.Nullable Long pageSize, @javax.annotation.Nullable String nextPageToken, @javax.annotation.Nullable String orderBy, @javax.annotation.Nullable String order) throws ApiException { + okhttp3.Call localVarCall = v3ListAnalysesValidateBeforeCall(searchTerm, analysisScope, status, modelName, usernames, sha256Hash, binaryId, platform, architecture, pageSize, nextPageToken, orderBy, order, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * List analyses (asynchronously) + * Returns a page of analyses visible to the caller, filtered and ordered by the query parameters. **Error codes:** - `400` [`BAD_REQUEST`](/errors/BAD_REQUEST) — Bad Request + * @param searchTerm (optional) + * @param analysisScope Leave empty to search your own, your team's and all public analyses (optional) + * @param status (optional) + * @param modelName (optional) + * @param usernames (optional) + * @param sha256Hash (optional) + * @param binaryId Restrict to analyses of this binary. A binary can carry more than one analysis; they are returned newest first under the default sort (optional) + * @param platform Restrict to binaries running on one of these operating-system platforms. Matches the uploader's override when they set one, the detected platform otherwise; a binary with neither is never matched. Leave empty for no filter (optional) + * @param architecture Restrict to binaries built for one of these instruction-set architectures. Resolved the same way as platform. Leave empty for no filter (optional) + * @param pageSize (optional, default to 20) + * @param nextPageToken Forward-pagination cursor from a prior response. When set, order_by/order are taken from the token (the sort cannot change mid-pagination). (optional) + * @param orderBy (optional, default to created) + * @param order (optional, default to DESC) + * @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 -
400 Bad Request -
422 Unprocessable Entity -
500 Internal Server Error -
+ */ + public okhttp3.Call v3ListAnalysesAsync(@javax.annotation.Nullable String searchTerm, @javax.annotation.Nullable List analysisScope, @javax.annotation.Nullable List status, @javax.annotation.Nullable List modelName, @javax.annotation.Nullable List usernames, @javax.annotation.Nullable String sha256Hash, @javax.annotation.Nullable Long binaryId, @javax.annotation.Nullable List platform, @javax.annotation.Nullable List architecture, @javax.annotation.Nullable Long pageSize, @javax.annotation.Nullable String nextPageToken, @javax.annotation.Nullable String orderBy, @javax.annotation.Nullable String order, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = v3ListAnalysesValidateBeforeCall(searchTerm, analysisScope, status, modelName, usernames, sha256Hash, binaryId, platform, architecture, pageSize, nextPageToken, orderBy, order, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for v3ListExampleAnalyses + * @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 -
0 Error -
+ */ + public okhttp3.Call v3ListExampleAnalysesCall(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/examples"; + + 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", "bearerAuth" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call v3ListExampleAnalysesValidateBeforeCall(final ApiCallback _callback) throws ApiException { + return v3ListExampleAnalysesCall(_callback); + + } + + /** + * List example analyses + * Returns the curated example Analyses. + * @return ListExampleAnalysesOutputBody + * @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 -
0 Error -
+ */ + public ListExampleAnalysesOutputBody v3ListExampleAnalyses() throws ApiException { + ApiResponse localVarResp = v3ListExampleAnalysesWithHttpInfo(); + return localVarResp.getData(); + } + + /** + * List example analyses + * Returns the curated example Analyses. + * @return ApiResponse<ListExampleAnalysesOutputBody> + * @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 -
0 Error -
+ */ + public ApiResponse v3ListExampleAnalysesWithHttpInfo() throws ApiException { + okhttp3.Call localVarCall = v3ListExampleAnalysesValidateBeforeCall(null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * List example analyses (asynchronously) + * Returns the curated example Analyses. + * @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 -
0 Error -
+ */ + public okhttp3.Call v3ListExampleAnalysesAsync(final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = v3ListExampleAnalysesValidateBeforeCall(_callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for v3LookupAnalysisByBinaryId + * @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 -
404 Not Found -
422 Unprocessable Entity -
500 Internal Server Error -
+ */ + public okhttp3.Call v3LookupAnalysisByBinaryIdCall(@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/analyses/lookup/{binary_id}" + .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", "bearerAuth" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call v3LookupAnalysisByBinaryIdValidateBeforeCall(@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 v3LookupAnalysisByBinaryId(Async)"); + } + + return v3LookupAnalysisByBinaryIdCall(binaryId, _callback); + + } + + /** + * Look up the most recent analysis for a binary. + * Returns the ID of the most recent analysis of this binary that the caller may see (their own, their team's, or public). Returns 404 if the binary has none, whether because it has never been analysed or because every analysis of it is private to someone else. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found + * @param binaryId Binary ID (required) + * @return LookupAnalysisByBinaryIDOutputBody + * @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 -
404 Not Found -
422 Unprocessable Entity -
500 Internal Server Error -
*/ - public ApiResponse v3GetAnalysisStringsStatusWithHttpInfo(@javax.annotation.Nonnull Long analysisId) throws ApiException { - okhttp3.Call localVarCall = v3GetAnalysisStringsStatusValidateBeforeCall(analysisId, null); - Type localVarReturnType = new TypeToken(){}.getType(); + public LookupAnalysisByBinaryIDOutputBody v3LookupAnalysisByBinaryId(@javax.annotation.Nonnull Long binaryId) throws ApiException { + ApiResponse localVarResp = v3LookupAnalysisByBinaryIdWithHttpInfo(binaryId); + return localVarResp.getData(); + } + + /** + * Look up the most recent analysis for a binary. + * Returns the ID of the most recent analysis of this binary that the caller may see (their own, their team's, or public). Returns 404 if the binary has none, whether because it has never been analysed or because every analysis of it is private to someone else. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found + * @param binaryId Binary ID (required) + * @return ApiResponse<LookupAnalysisByBinaryIDOutputBody> + * @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 -
404 Not Found -
422 Unprocessable Entity -
500 Internal Server Error -
+ */ + public ApiResponse v3LookupAnalysisByBinaryIdWithHttpInfo(@javax.annotation.Nonnull Long binaryId) throws ApiException { + okhttp3.Call localVarCall = v3LookupAnalysisByBinaryIdValidateBeforeCall(binaryId, null); + Type localVarReturnType = new TypeToken(){}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } /** - * Get the string-extraction status for an analysis. (asynchronously) - * Returns the status of the string-extraction task for the binary backing the analysis. One of UNINITIALISED, PENDING, RUNNING, COMPLETED, FAILED. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - * @param analysisId Analysis ID (required) + * Look up the most recent analysis for a binary. (asynchronously) + * Returns the ID of the most recent analysis of this binary that the caller may see (their own, their team's, or public). Returns 404 if the binary has none, whether because it has never been analysed or because every analysis of it is private to someone else. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found + * @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 @@ -4621,33 +5691,21 @@ public ApiResponse v3GetAnalysisStringsStatu Response Details Status Code Description Response Headers 200 OK - - 403 Forbidden - 404 Not Found - 422 Unprocessable Entity - 500 Internal Server Error - */ - public okhttp3.Call v3GetAnalysisStringsStatusAsync(@javax.annotation.Nonnull Long analysisId, final ApiCallback _callback) throws ApiException { + public okhttp3.Call v3LookupAnalysisByBinaryIdAsync(@javax.annotation.Nonnull Long binaryId, final ApiCallback _callback) throws ApiException { - okhttp3.Call localVarCall = v3GetAnalysisStringsStatusValidateBeforeCall(analysisId, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); + okhttp3.Call localVarCall = v3LookupAnalysisByBinaryIdValidateBeforeCall(binaryId, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } /** - * Build call for v3ListAnalyses - * @param searchTerm (optional) - * @param analysisScope Leave empty to search your own, your team's and all public analyses (optional) - * @param status (optional) - * @param modelName (optional) - * @param usernames (optional) - * @param sha256Hash (optional) - * @param platform Restrict to binaries running on one of these operating-system platforms. Matches the uploader's override when they set one, the detected platform otherwise; a binary with neither is never matched. Leave empty for no filter (optional) - * @param architecture Restrict to binaries built for one of these instruction-set architectures. Resolved the same way as platform. Leave empty for no filter (optional) - * @param pageSize (optional, default to 20) - * @param nextPageToken Forward-pagination cursor from a prior response. When set, order_by/order are taken from the token (the sort cannot change mid-pagination). (optional) - * @param orderBy (optional, default to created) - * @param order (optional, default to DESC) + * Build call for v3QueueBinaryExport + * @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 @@ -4655,13 +5713,14 @@ public okhttp3.Call v3GetAnalysisStringsStatusAsync(@javax.annotation.Nonnull Lo - - + + +
Response Details
Status Code Description Response Headers
200 OK -
400 Bad Request -
202 Accepted -
403 Forbidden -
404 Not Found -
422 Unprocessable Entity -
500 Internal Server Error -
*/ - public okhttp3.Call v3ListAnalysesCall(@javax.annotation.Nullable String searchTerm, @javax.annotation.Nullable List analysisScope, @javax.annotation.Nullable List status, @javax.annotation.Nullable List modelName, @javax.annotation.Nullable List usernames, @javax.annotation.Nullable String sha256Hash, @javax.annotation.Nullable List platform, @javax.annotation.Nullable List architecture, @javax.annotation.Nullable Long pageSize, @javax.annotation.Nullable String nextPageToken, @javax.annotation.Nullable String orderBy, @javax.annotation.Nullable String order, final ApiCallback _callback) throws ApiException { + public okhttp3.Call v3QueueBinaryExportCall(@javax.annotation.Nonnull Long analysisId, final ApiCallback _callback) throws ApiException { String basePath = null; // Operation Servers String[] localBasePaths = new String[] { }; @@ -4678,7 +5737,8 @@ public okhttp3.Call v3ListAnalysesCall(@javax.annotation.Nullable String searchT Object localVarPostBody = null; // create path and map variables - String localVarPath = "/v3/analyses"; + String localVarPath = "/v3/analyses/{analysis_id}/binary-export" + .replace("{" + "analysis_id" + "}", localVarApiClient.escapeString(analysisId.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -4686,54 +5746,6 @@ public okhttp3.Call v3ListAnalysesCall(@javax.annotation.Nullable String searchT Map localVarCookieParams = new HashMap(); Map localVarFormParams = new HashMap(); - if (searchTerm != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("search_term", searchTerm)); - } - - if (analysisScope != null) { - localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "analysis_scope", analysisScope)); - } - - if (status != null) { - localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "status", status)); - } - - if (modelName != null) { - localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("csv", "model_name", modelName)); - } - - if (usernames != null) { - localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("csv", "usernames", usernames)); - } - - if (sha256Hash != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("sha256_hash", sha256Hash)); - } - - if (platform != null) { - localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("csv", "platform", platform)); - } - - if (architecture != null) { - localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("csv", "architecture", architecture)); - } - - if (pageSize != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("page_size", pageSize)); - } - - if (nextPageToken != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("next_page_token", nextPageToken)); - } - - if (orderBy != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("order_by", orderBy)); - } - - if (order != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("order", order)); - } - final String[] localVarAccepts = { "application/json" }; @@ -4750,95 +5762,69 @@ public okhttp3.Call v3ListAnalysesCall(@javax.annotation.Nullable String searchT } String[] localVarAuthNames = new String[] { "APIKey", "bearerAuth" }; - return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") - private okhttp3.Call v3ListAnalysesValidateBeforeCall(@javax.annotation.Nullable String searchTerm, @javax.annotation.Nullable List analysisScope, @javax.annotation.Nullable List status, @javax.annotation.Nullable List modelName, @javax.annotation.Nullable List usernames, @javax.annotation.Nullable String sha256Hash, @javax.annotation.Nullable List platform, @javax.annotation.Nullable List architecture, @javax.annotation.Nullable Long pageSize, @javax.annotation.Nullable String nextPageToken, @javax.annotation.Nullable String orderBy, @javax.annotation.Nullable String order, final ApiCallback _callback) throws ApiException { - return v3ListAnalysesCall(searchTerm, analysisScope, status, modelName, usernames, sha256Hash, platform, architecture, pageSize, nextPageToken, orderBy, order, _callback); + private okhttp3.Call v3QueueBinaryExportValidateBeforeCall(@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 v3QueueBinaryExport(Async)"); + } + + return v3QueueBinaryExportCall(analysisId, _callback); } /** - * List analyses - * Returns a page of analyses visible to the caller, filtered and ordered by the query parameters. **Error codes:** - `400` [`BAD_REQUEST`](/errors/BAD_REQUEST) — Bad Request - * @param searchTerm (optional) - * @param analysisScope Leave empty to search your own, your team's and all public analyses (optional) - * @param status (optional) - * @param modelName (optional) - * @param usernames (optional) - * @param sha256Hash (optional) - * @param platform Restrict to binaries running on one of these operating-system platforms. Matches the uploader's override when they set one, the detected platform otherwise; a binary with neither is never matched. Leave empty for no filter (optional) - * @param architecture Restrict to binaries built for one of these instruction-set architectures. Resolved the same way as platform. Leave empty for no filter (optional) - * @param pageSize (optional, default to 20) - * @param nextPageToken Forward-pagination cursor from a prior response. When set, order_by/order are taken from the token (the sort cannot change mid-pagination). (optional) - * @param orderBy (optional, default to created) - * @param order (optional, default to DESC) - * @return ListAnalysesOutputBody + * Queue a binary export + * Starts an asynchronous export of the binary with its current symbols rewritten in, and returns the operation to poll for its outcome. Only the owner may call it, and it requires a subscription tier that supports symbol export. Download the result once the operation reports done. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied + * @param analysisId Analysis ID (required) + * @return OperationBinaryExportMetadataBinaryExportResult * @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 -
400 Bad Request -
202 Accepted -
403 Forbidden -
404 Not Found -
422 Unprocessable Entity -
500 Internal Server Error -
*/ - public ListAnalysesOutputBody v3ListAnalyses(@javax.annotation.Nullable String searchTerm, @javax.annotation.Nullable List analysisScope, @javax.annotation.Nullable List status, @javax.annotation.Nullable List modelName, @javax.annotation.Nullable List usernames, @javax.annotation.Nullable String sha256Hash, @javax.annotation.Nullable List platform, @javax.annotation.Nullable List architecture, @javax.annotation.Nullable Long pageSize, @javax.annotation.Nullable String nextPageToken, @javax.annotation.Nullable String orderBy, @javax.annotation.Nullable String order) throws ApiException { - ApiResponse localVarResp = v3ListAnalysesWithHttpInfo(searchTerm, analysisScope, status, modelName, usernames, sha256Hash, platform, architecture, pageSize, nextPageToken, orderBy, order); + public OperationBinaryExportMetadataBinaryExportResult v3QueueBinaryExport(@javax.annotation.Nonnull Long analysisId) throws ApiException { + ApiResponse localVarResp = v3QueueBinaryExportWithHttpInfo(analysisId); return localVarResp.getData(); } /** - * List analyses - * Returns a page of analyses visible to the caller, filtered and ordered by the query parameters. **Error codes:** - `400` [`BAD_REQUEST`](/errors/BAD_REQUEST) — Bad Request - * @param searchTerm (optional) - * @param analysisScope Leave empty to search your own, your team's and all public analyses (optional) - * @param status (optional) - * @param modelName (optional) - * @param usernames (optional) - * @param sha256Hash (optional) - * @param platform Restrict to binaries running on one of these operating-system platforms. Matches the uploader's override when they set one, the detected platform otherwise; a binary with neither is never matched. Leave empty for no filter (optional) - * @param architecture Restrict to binaries built for one of these instruction-set architectures. Resolved the same way as platform. Leave empty for no filter (optional) - * @param pageSize (optional, default to 20) - * @param nextPageToken Forward-pagination cursor from a prior response. When set, order_by/order are taken from the token (the sort cannot change mid-pagination). (optional) - * @param orderBy (optional, default to created) - * @param order (optional, default to DESC) - * @return ApiResponse<ListAnalysesOutputBody> + * Queue a binary export + * Starts an asynchronous export of the binary with its current symbols rewritten in, and returns the operation to poll for its outcome. Only the owner may call it, and it requires a subscription tier that supports symbol export. Download the result once the operation reports done. **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<OperationBinaryExportMetadataBinaryExportResult> * @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 -
400 Bad Request -
202 Accepted -
403 Forbidden -
404 Not Found -
422 Unprocessable Entity -
500 Internal Server Error -
*/ - public ApiResponse v3ListAnalysesWithHttpInfo(@javax.annotation.Nullable String searchTerm, @javax.annotation.Nullable List analysisScope, @javax.annotation.Nullable List status, @javax.annotation.Nullable List modelName, @javax.annotation.Nullable List usernames, @javax.annotation.Nullable String sha256Hash, @javax.annotation.Nullable List platform, @javax.annotation.Nullable List architecture, @javax.annotation.Nullable Long pageSize, @javax.annotation.Nullable String nextPageToken, @javax.annotation.Nullable String orderBy, @javax.annotation.Nullable String order) throws ApiException { - okhttp3.Call localVarCall = v3ListAnalysesValidateBeforeCall(searchTerm, analysisScope, status, modelName, usernames, sha256Hash, platform, architecture, pageSize, nextPageToken, orderBy, order, null); - Type localVarReturnType = new TypeToken(){}.getType(); + public ApiResponse v3QueueBinaryExportWithHttpInfo(@javax.annotation.Nonnull Long analysisId) throws ApiException { + okhttp3.Call localVarCall = v3QueueBinaryExportValidateBeforeCall(analysisId, null); + Type localVarReturnType = new TypeToken(){}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } /** - * List analyses (asynchronously) - * Returns a page of analyses visible to the caller, filtered and ordered by the query parameters. **Error codes:** - `400` [`BAD_REQUEST`](/errors/BAD_REQUEST) — Bad Request - * @param searchTerm (optional) - * @param analysisScope Leave empty to search your own, your team's and all public analyses (optional) - * @param status (optional) - * @param modelName (optional) - * @param usernames (optional) - * @param sha256Hash (optional) - * @param platform Restrict to binaries running on one of these operating-system platforms. Matches the uploader's override when they set one, the detected platform otherwise; a binary with neither is never matched. Leave empty for no filter (optional) - * @param architecture Restrict to binaries built for one of these instruction-set architectures. Resolved the same way as platform. Leave empty for no filter (optional) - * @param pageSize (optional, default to 20) - * @param nextPageToken Forward-pagination cursor from a prior response. When set, order_by/order are taken from the token (the sort cannot change mid-pagination). (optional) - * @param orderBy (optional, default to created) - * @param order (optional, default to DESC) + * Queue a binary export (asynchronously) + * Starts an asynchronous export of the binary with its current symbols rewritten in, and returns the operation to poll for its outcome. Only the owner may call it, and it requires a subscription tier that supports symbol export. Download the result once the operation reports done. **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 @@ -4846,21 +5832,24 @@ public ApiResponse v3ListAnalysesWithHttpInfo(@javax.ann - - + + +
Response Details
Status Code Description Response Headers
200 OK -
400 Bad Request -
202 Accepted -
403 Forbidden -
404 Not Found -
422 Unprocessable Entity -
500 Internal Server Error -
*/ - public okhttp3.Call v3ListAnalysesAsync(@javax.annotation.Nullable String searchTerm, @javax.annotation.Nullable List analysisScope, @javax.annotation.Nullable List status, @javax.annotation.Nullable List modelName, @javax.annotation.Nullable List usernames, @javax.annotation.Nullable String sha256Hash, @javax.annotation.Nullable List platform, @javax.annotation.Nullable List architecture, @javax.annotation.Nullable Long pageSize, @javax.annotation.Nullable String nextPageToken, @javax.annotation.Nullable String orderBy, @javax.annotation.Nullable String order, final ApiCallback _callback) throws ApiException { + public okhttp3.Call v3QueueBinaryExportAsync(@javax.annotation.Nonnull Long analysisId, final ApiCallback _callback) throws ApiException { - okhttp3.Call localVarCall = v3ListAnalysesValidateBeforeCall(searchTerm, analysisScope, status, modelName, usernames, sha256Hash, platform, architecture, pageSize, nextPageToken, orderBy, order, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); + okhttp3.Call localVarCall = v3QueueBinaryExportValidateBeforeCall(analysisId, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } /** - * Build call for v3ListExampleAnalyses + * Build call for v3UpdateAnalysis + * @param analysisId Analysis ID (required) + * @param updateAnalysisInputBody (required) * @param _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object @@ -4869,10 +5858,14 @@ public okhttp3.Call v3ListAnalysesAsync(@javax.annotation.Nullable String search Response Details Status Code Description Response Headers 200 OK - - 0 Error - + 400 Bad Request - + 403 Forbidden - + 404 Not Found - + 422 Unprocessable Entity - + 500 Internal Server Error - */ - public okhttp3.Call v3ListExampleAnalysesCall(final ApiCallback _callback) throws ApiException { + public okhttp3.Call v3UpdateAnalysisCall(@javax.annotation.Nonnull Long analysisId, @javax.annotation.Nonnull UpdateAnalysisInputBody updateAnalysisInputBody, final ApiCallback _callback) throws ApiException { String basePath = null; // Operation Servers String[] localBasePaths = new String[] { }; @@ -4886,10 +5879,11 @@ public okhttp3.Call v3ListExampleAnalysesCall(final ApiCallback _callback) throw basePath = null; } - Object localVarPostBody = null; + Object localVarPostBody = updateAnalysisInputBody; // create path and map variables - String localVarPath = "/v3/analyses/examples"; + String localVarPath = "/v3/analyses/{analysis_id}" + .replace("{" + "analysis_id" + "}", localVarApiClient.escapeString(analysisId.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -4906,6 +5900,7 @@ public okhttp3.Call v3ListExampleAnalysesCall(final ApiCallback _callback) throw } final String[] localVarContentTypes = { + "application/json" }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { @@ -4913,55 +5908,79 @@ public okhttp3.Call v3ListExampleAnalysesCall(final ApiCallback _callback) throw } String[] localVarAuthNames = new String[] { "APIKey", "bearerAuth" }; - return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + return localVarApiClient.buildCall(basePath, localVarPath, "PATCH", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") - private okhttp3.Call v3ListExampleAnalysesValidateBeforeCall(final ApiCallback _callback) throws ApiException { - return v3ListExampleAnalysesCall(_callback); + private okhttp3.Call v3UpdateAnalysisValidateBeforeCall(@javax.annotation.Nonnull Long analysisId, @javax.annotation.Nonnull UpdateAnalysisInputBody updateAnalysisInputBody, 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 v3UpdateAnalysis(Async)"); + } + + // verify the required parameter 'updateAnalysisInputBody' is set + if (updateAnalysisInputBody == null) { + throw new ApiException("Missing the required parameter 'updateAnalysisInputBody' when calling v3UpdateAnalysis(Async)"); + } + + return v3UpdateAnalysisCall(analysisId, updateAnalysisInputBody, _callback); } /** - * List example analyses - * Returns the curated example Analyses. - * @return ListExampleAnalysesOutputBody + * Update an analysis. + * Renames the analysis' binary and/or changes its scope. Only the owner may call it. Changing to a non-PUBLIC scope requires a subscription tier that supports private analyses. **Error codes:** - `400` [`BAD_REQUEST`](/errors/BAD_REQUEST) — Bad Request - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied + * @param analysisId Analysis ID (required) + * @param updateAnalysisInputBody (required) + * @return AnalysisDetailOutputBody * @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 -
0 Error -
400 Bad Request -
403 Forbidden -
404 Not Found -
422 Unprocessable Entity -
500 Internal Server Error -
*/ - public ListExampleAnalysesOutputBody v3ListExampleAnalyses() throws ApiException { - ApiResponse localVarResp = v3ListExampleAnalysesWithHttpInfo(); + public AnalysisDetailOutputBody v3UpdateAnalysis(@javax.annotation.Nonnull Long analysisId, @javax.annotation.Nonnull UpdateAnalysisInputBody updateAnalysisInputBody) throws ApiException { + ApiResponse localVarResp = v3UpdateAnalysisWithHttpInfo(analysisId, updateAnalysisInputBody); return localVarResp.getData(); } /** - * List example analyses - * Returns the curated example Analyses. - * @return ApiResponse<ListExampleAnalysesOutputBody> + * Update an analysis. + * Renames the analysis' binary and/or changes its scope. Only the owner may call it. Changing to a non-PUBLIC scope requires a subscription tier that supports private analyses. **Error codes:** - `400` [`BAD_REQUEST`](/errors/BAD_REQUEST) — Bad Request - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied + * @param analysisId Analysis ID (required) + * @param updateAnalysisInputBody (required) + * @return ApiResponse<AnalysisDetailOutputBody> * @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 -
0 Error -
400 Bad Request -
403 Forbidden -
404 Not Found -
422 Unprocessable Entity -
500 Internal Server Error -
*/ - public ApiResponse v3ListExampleAnalysesWithHttpInfo() throws ApiException { - okhttp3.Call localVarCall = v3ListExampleAnalysesValidateBeforeCall(null); - Type localVarReturnType = new TypeToken(){}.getType(); + public ApiResponse v3UpdateAnalysisWithHttpInfo(@javax.annotation.Nonnull Long analysisId, @javax.annotation.Nonnull UpdateAnalysisInputBody updateAnalysisInputBody) throws ApiException { + okhttp3.Call localVarCall = v3UpdateAnalysisValidateBeforeCall(analysisId, updateAnalysisInputBody, null); + Type localVarReturnType = new TypeToken(){}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } /** - * List example analyses (asynchronously) - * Returns the curated example Analyses. + * Update an analysis. (asynchronously) + * Renames the analysis' binary and/or changes its scope. Only the owner may call it. Changing to a non-PUBLIC scope requires a subscription tier that supports private analyses. **Error codes:** - `400` [`BAD_REQUEST`](/errors/BAD_REQUEST) — Bad Request - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied + * @param analysisId Analysis ID (required) + * @param updateAnalysisInputBody (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 @@ -4970,13 +5989,17 @@ public ApiResponse v3ListExampleAnalysesWithHttpI Response Details Status Code Description Response Headers 200 OK - - 0 Error - + 400 Bad Request - + 403 Forbidden - + 404 Not Found - + 422 Unprocessable Entity - + 500 Internal Server Error - */ - public okhttp3.Call v3ListExampleAnalysesAsync(final ApiCallback _callback) throws ApiException { + public okhttp3.Call v3UpdateAnalysisAsync(@javax.annotation.Nonnull Long analysisId, @javax.annotation.Nonnull UpdateAnalysisInputBody updateAnalysisInputBody, final ApiCallback _callback) throws ApiException { - okhttp3.Call localVarCall = v3ListExampleAnalysesValidateBeforeCall(_callback); - Type localVarReturnType = new TypeToken(){}.getType(); + okhttp3.Call localVarCall = v3UpdateAnalysisValidateBeforeCall(analysisId, updateAnalysisInputBody, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } diff --git a/src/main/java/ai/reveng/api/AnalysesResultsMetadataApi.java b/src/main/java/ai/reveng/api/AnalysesResultsMetadataApi.java index dab657f..b8589cc 100644 --- a/src/main/java/ai/reveng/api/AnalysesResultsMetadataApi.java +++ b/src/main/java/ai/reveng/api/AnalysesResultsMetadataApi.java @@ -26,6 +26,8 @@ import java.io.IOException; +import ai.reveng.model.APIError; +import ai.reveng.model.AnalysisCapabilitiesOutputBody; import ai.reveng.model.BaseResponse; import ai.reveng.model.BaseResponseAnalysisFunctions; import ai.reveng.model.BaseResponseAnalysisFunctionsList; @@ -681,4 +683,147 @@ public okhttp3.Call getTagsAsync(@javax.annotation.Nonnull Integer analysisId, f localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } + /** + * Build call for v3ListAnalysisCapabilities + * @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 v3ListAnalysisCapabilitiesCall(@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}/capabilities" + .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", "bearerAuth" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call v3ListAnalysisCapabilitiesValidateBeforeCall(@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 v3ListAnalysisCapabilities(Async)"); + } + + return v3ListAnalysisCapabilitiesCall(analysisId, _callback); + + } + + /** + * List the capabilities found in an analysis. + * Returns the capabilities the binary-analysis pipeline attributed to the analysis' functions, ordered by function address. This is the static capability set recorded against the binary, not the AI capabilities agent's findings, which are triggered by `/v3/analyses/{analysis_id}/capabilities:run`. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied + * @param analysisId Analysis ID (required) + * @return AnalysisCapabilitiesOutputBody + * @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 AnalysisCapabilitiesOutputBody v3ListAnalysisCapabilities(@javax.annotation.Nonnull Long analysisId) throws ApiException { + ApiResponse localVarResp = v3ListAnalysisCapabilitiesWithHttpInfo(analysisId); + return localVarResp.getData(); + } + + /** + * List the capabilities found in an analysis. + * Returns the capabilities the binary-analysis pipeline attributed to the analysis' functions, ordered by function address. This is the static capability set recorded against the binary, not the AI capabilities agent's findings, which are triggered by `/v3/analyses/{analysis_id}/capabilities:run`. **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<AnalysisCapabilitiesOutputBody> + * @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 v3ListAnalysisCapabilitiesWithHttpInfo(@javax.annotation.Nonnull Long analysisId) throws ApiException { + okhttp3.Call localVarCall = v3ListAnalysisCapabilitiesValidateBeforeCall(analysisId, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * List the capabilities found in an analysis. (asynchronously) + * Returns the capabilities the binary-analysis pipeline attributed to the analysis' functions, ordered by function address. This is the static capability set recorded against the binary, not the AI capabilities agent's findings, which are triggered by `/v3/analyses/{analysis_id}/capabilities:run`. **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 v3ListAnalysisCapabilitiesAsync(@javax.annotation.Nonnull Long analysisId, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = v3ListAnalysisCapabilitiesValidateBeforeCall(analysisId, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } } diff --git a/src/main/java/ai/reveng/invoker/ApiClient.java b/src/main/java/ai/reveng/invoker/ApiClient.java index aff6cea..ad1cdbe 100644 --- a/src/main/java/ai/reveng/invoker/ApiClient.java +++ b/src/main/java/ai/reveng/invoker/ApiClient.java @@ -148,7 +148,7 @@ protected void init() { json = new JSON(); // Set default User-Agent. - setUserAgent("OpenAPI-Generator/4.51.0/java"); + setUserAgent("OpenAPI-Generator/4.54.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 3a056e0..61a190d 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 = "4.51.0"; + public static final String VERSION = "4.54.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 bb19ad4..e052aa7 100644 --- a/src/main/java/ai/reveng/invoker/JSON.java +++ b/src/main/java/ai/reveng/invoker/JSON.java @@ -114,7 +114,7 @@ public Class getClassForElement(JsonEle classByDiscriminatorValue.put("known_constant", ai.reveng.model.KnownConstantEvidence.class); classByDiscriminatorValue.put("model_interpretation", ai.reveng.model.ModelInterpretationEvidence.class); classByDiscriminatorValue.put("referenced_constant", ai.reveng.model.ReferencedConstantEvidence.class); - classByDiscriminatorValue.put("suspicious_string", ai.reveng.model.SuspiciousStringEvidence.class); + classByDiscriminatorValue.put("string_match", ai.reveng.model.StringMatchEvidence.class); classByDiscriminatorValue.put("Evidence_inner", ai.reveng.model.EvidenceInner.class); return getClassByDiscriminator(classByDiscriminatorValue, getDiscriminatorValue(readElement, "evidence_kind")); @@ -183,17 +183,21 @@ private static Class getClassByDiscriminator(Map classByDiscriminatorValue, Stri gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.AddUserStringInputBody.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.AddUserStringToFunctionInputBody.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.AdditionalDetailsStatusResponse.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.AnalysisAccessBody.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()); + gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.AnalysisCapabilitiesOutputBody.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.AnalysisCapabilityBody.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.AnalysisConfig.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.AnalysisConfigSnapshot.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.AnalysisCreateRequest.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.AnalysisCreateResponse.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.AnalysisDataTypesGroup.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.AnalysisDataTypesOutputBody.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.AnalysisDetailOutputBody.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.AnalysisDetailResponse.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.AnalysisFunctionEntry.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.AnalysisFunctionMapping.CustomTypeAdapterFactory()); @@ -229,6 +233,7 @@ private static Class getClassByDiscriminator(Map classByDiscriminatorValue, Stri gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.AttemptFailedEvent.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.AttemptStartedEvent.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.AutoRunAgents.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.AutoRunAgentsBody.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.AutoUnstripStatusOutputBody.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.BaseDataType.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.BaseResponse.CustomTypeAdapterFactory()); @@ -306,12 +311,15 @@ private static Class getClassByDiscriminator(Map classByDiscriminatorValue, Stri gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.BinaryAdditionalResponse.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.BinaryConfig.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.BinaryDetailsResponse.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.BinaryExportMetadata.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.BinaryExportResult.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.BinaryExternalsResponse.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.BinarySearchResponse.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.BinarySearchResult.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.BitfieldDataType.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.BulkCreateUserResult.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.BulkCreateUsersOutputBody.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.BulkDeleteAnalysesInputBody.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.BulkDeleteAnalysesRequest.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.BytesConstant.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.CallChain.CustomTypeAdapterFactory()); @@ -541,6 +549,7 @@ private static Class getClassByDiscriminator(Map classByDiscriminatorValue, Stri gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.HttpRequest.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.IOC.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.IconModel.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.ImportDynamicExecutionFileOutputBody.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.ImportModel.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.ImportedApi.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.ImportedApiCall.CustomTypeAdapterFactory()); @@ -573,6 +582,7 @@ private static Class getClassByDiscriminator(Map classByDiscriminatorValue, Stri gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.ListUsersOutputBody.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.LocationOutputBody.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.Logs.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.LookupAnalysisByBinaryIDOutputBody.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.MITRETechnique.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.MatchFilters.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.MatchedFunction.CustomTypeAdapterFactory()); @@ -599,6 +609,7 @@ private static Class getClassByDiscriminator(Map classByDiscriminatorValue, Stri gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.NetworkingScanMetadata.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.NetworkingScanResult.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.OIDCCallbackInputBody.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.OperationBinaryExportMetadataBinaryExportResult.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.OperationCreateMetadataCreateResult.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.OperationCryptoExplainMetadataCryptoExplainResult.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.OperationCryptoScanMetadataCryptoScanResult.CustomTypeAdapterFactory()); @@ -671,6 +682,7 @@ private static Class getClassByDiscriminator(Map classByDiscriminatorValue, Stri gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.ReportInfo.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.ReportOptions.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.ReportResult.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.RequestedConfigBody.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.ResolvedEntity.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.ResultBody.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.RevokeBody.CustomTypeAdapterFactory()); @@ -731,6 +743,8 @@ private static Class getClassByDiscriminator(Map classByDiscriminatorValue, Stri gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.StatusOutput.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.StatusResponse.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.StringFunctions.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.StringMatch.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.StringMatchEvidence.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.StructDataType.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.StructDefinition.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.Subject.CustomTypeAdapterFactory()); @@ -744,8 +758,6 @@ private static Class getClassByDiscriminator(Map classByDiscriminatorValue, Stri gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.SuggestedMemberView.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.SuggestedTypeView.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.SummaryData.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.SuspiciousString.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.SuspiciousStringEvidence.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.Symbols.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.Tag.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.TagItem.CustomTypeAdapterFactory()); @@ -787,6 +799,7 @@ private static Class getClassByDiscriminator(Map classByDiscriminatorValue, Stri gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.UnionDefinition.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.UnknownDataType.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.UpdateAnalysisDataTypesInputBody.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.UpdateAnalysisInputBody.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.UpdateArrayDataType.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.UpdateBaseDataType.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.UpdateBitfieldDataType.CustomTypeAdapterFactory()); diff --git a/src/main/java/ai/reveng/model/AnalysisAccessBody.java b/src/main/java/ai/reveng/model/AnalysisAccessBody.java new file mode 100644 index 0000000..810b977 --- /dev/null +++ b/src/main/java/ai/reveng/model/AnalysisAccessBody.java @@ -0,0 +1,315 @@ +/* + * 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 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 ai.reveng.invoker.JSON; + +/** + * AnalysisAccessBody + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class AnalysisAccessBody { + public static final String SERIALIZED_NAME_OWNER = "owner"; + @SerializedName(SERIALIZED_NAME_OWNER) + @javax.annotation.Nonnull + private Boolean owner; + + public static final String SERIALIZED_NAME_USERNAME = "username"; + @SerializedName(SERIALIZED_NAME_USERNAME) + @javax.annotation.Nonnull + private String username; + + public AnalysisAccessBody() { + } + + public AnalysisAccessBody owner(@javax.annotation.Nonnull Boolean owner) { + this.owner = owner; + return this; + } + + /** + * True when the caller owns this analysis + * @return owner + */ + @javax.annotation.Nonnull + public Boolean getOwner() { + return owner; + } + + public void setOwner(@javax.annotation.Nonnull Boolean owner) { + this.owner = owner; + } + + + public AnalysisAccessBody username(@javax.annotation.Nonnull String username) { + this.username = username; + return this; + } + + /** + * Username of the analysis owner + * @return username + */ + @javax.annotation.Nonnull + public String getUsername() { + return username; + } + + public void setUsername(@javax.annotation.Nonnull String username) { + this.username = username; + } + + /** + * 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 AnalysisAccessBody instance itself + */ + public AnalysisAccessBody 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; + } + AnalysisAccessBody analysisAccessBody = (AnalysisAccessBody) o; + return Objects.equals(this.owner, analysisAccessBody.owner) && + Objects.equals(this.username, analysisAccessBody.username)&& + Objects.equals(this.additionalProperties, analysisAccessBody.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(owner, username, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AnalysisAccessBody {\n"); + sb.append(" owner: ").append(toIndentedString(owner)).append("\n"); + sb.append(" username: ").append(toIndentedString(username)).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) { + return o == null ? "null" : 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("owner", "username")); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(Arrays.asList("owner", "username")); + } + + /** + * 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 AnalysisAccessBody + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!AnalysisAccessBody.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field(s) %s in AnalysisAccessBody is not found in the empty JSON string", AnalysisAccessBody.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : AnalysisAccessBody.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("username").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `username` to be a primitive type in the JSON string but got `%s`", jsonObj.get("username").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!AnalysisAccessBody.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'AnalysisAccessBody' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(AnalysisAccessBody.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, AnalysisAccessBody 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 AnalysisAccessBody read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + AnalysisAccessBody 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(java.util.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 AnalysisAccessBody given an JSON string + * + * @param jsonString JSON string + * @return An instance of AnalysisAccessBody + * @throws IOException if the JSON string is invalid with respect to AnalysisAccessBody + */ + public static AnalysisAccessBody fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, AnalysisAccessBody.class); + } + + /** + * Convert an instance of AnalysisAccessBody to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/ai/reveng/model/AnalysisCapabilitiesOutputBody.java b/src/main/java/ai/reveng/model/AnalysisCapabilitiesOutputBody.java new file mode 100644 index 0000000..219a52c --- /dev/null +++ b/src/main/java/ai/reveng/model/AnalysisCapabilitiesOutputBody.java @@ -0,0 +1,303 @@ +/* + * 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 ai.reveng.model.AnalysisCapabilityBody; +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 ai.reveng.invoker.JSON; + +/** + * AnalysisCapabilitiesOutputBody + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class AnalysisCapabilitiesOutputBody { + public static final String SERIALIZED_NAME_CAPABILITIES = "capabilities"; + @SerializedName(SERIALIZED_NAME_CAPABILITIES) + @javax.annotation.Nullable + private List capabilities; + + public AnalysisCapabilitiesOutputBody() { + } + + public AnalysisCapabilitiesOutputBody capabilities(@javax.annotation.Nullable List capabilities) { + this.capabilities = capabilities; + return this; + } + + public AnalysisCapabilitiesOutputBody addCapabilitiesItem(AnalysisCapabilityBody capabilitiesItem) { + if (this.capabilities == null) { + this.capabilities = new ArrayList<>(); + } + this.capabilities.add(capabilitiesItem); + return this; + } + + /** + * Capabilities found across the binary, ordered by function address. Empty when the binary has no capability record + * @return capabilities + */ + @javax.annotation.Nullable + public List getCapabilities() { + return capabilities; + } + + public void setCapabilities(@javax.annotation.Nullable List capabilities) { + this.capabilities = capabilities; + } + + /** + * 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 AnalysisCapabilitiesOutputBody instance itself + */ + public AnalysisCapabilitiesOutputBody 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; + } + AnalysisCapabilitiesOutputBody analysisCapabilitiesOutputBody = (AnalysisCapabilitiesOutputBody) o; + return Objects.equals(this.capabilities, analysisCapabilitiesOutputBody.capabilities)&& + Objects.equals(this.additionalProperties, analysisCapabilitiesOutputBody.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(capabilities, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AnalysisCapabilitiesOutputBody {\n"); + sb.append(" capabilities: ").append(toIndentedString(capabilities)).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) { + return o == null ? "null" : 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("capabilities")); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(Arrays.asList("capabilities")); + } + + /** + * 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 AnalysisCapabilitiesOutputBody + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!AnalysisCapabilitiesOutputBody.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field(s) %s in AnalysisCapabilitiesOutputBody is not found in the empty JSON string", AnalysisCapabilitiesOutputBody.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : AnalysisCapabilitiesOutputBody.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format(java.util.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("capabilities") == null) { + throw new IllegalArgumentException("Expected the field `linkedContent` to be an array in the JSON string but got `null`"); + } else if (!jsonObj.get("capabilities").isJsonArray() && !jsonObj.get("capabilities").isJsonNull()) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `capabilities` to be an array in the JSON string but got `%s`", jsonObj.get("capabilities").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!AnalysisCapabilitiesOutputBody.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'AnalysisCapabilitiesOutputBody' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(AnalysisCapabilitiesOutputBody.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, AnalysisCapabilitiesOutputBody 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 AnalysisCapabilitiesOutputBody read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + AnalysisCapabilitiesOutputBody 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(java.util.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 AnalysisCapabilitiesOutputBody given an JSON string + * + * @param jsonString JSON string + * @return An instance of AnalysisCapabilitiesOutputBody + * @throws IOException if the JSON string is invalid with respect to AnalysisCapabilitiesOutputBody + */ + public static AnalysisCapabilitiesOutputBody fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, AnalysisCapabilitiesOutputBody.class); + } + + /** + * Convert an instance of AnalysisCapabilitiesOutputBody to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/ai/reveng/model/AnalysisCapabilityBody.java b/src/main/java/ai/reveng/model/AnalysisCapabilityBody.java new file mode 100644 index 0000000..e08f522 --- /dev/null +++ b/src/main/java/ai/reveng/model/AnalysisCapabilityBody.java @@ -0,0 +1,357 @@ +/* + * 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 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 ai.reveng.invoker.JSON; + +/** + * AnalysisCapabilityBody + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class AnalysisCapabilityBody { + public static final String SERIALIZED_NAME_CAPABILITIES = "capabilities"; + @SerializedName(SERIALIZED_NAME_CAPABILITIES) + @javax.annotation.Nullable + private List capabilities; + + public static final String SERIALIZED_NAME_FUNCTION_NAME = "function_name"; + @SerializedName(SERIALIZED_NAME_FUNCTION_NAME) + @javax.annotation.Nonnull + private String functionName; + + public static final String SERIALIZED_NAME_FUNCTION_VADDR = "function_vaddr"; + @SerializedName(SERIALIZED_NAME_FUNCTION_VADDR) + @javax.annotation.Nonnull + private Long functionVaddr; + + public AnalysisCapabilityBody() { + } + + public AnalysisCapabilityBody capabilities(@javax.annotation.Nullable List capabilities) { + this.capabilities = capabilities; + return this; + } + + public AnalysisCapabilityBody addCapabilitiesItem(String capabilitiesItem) { + if (this.capabilities == null) { + this.capabilities = new ArrayList<>(); + } + this.capabilities.add(capabilitiesItem); + return this; + } + + /** + * Capabilities attributed to the function + * @return capabilities + */ + @javax.annotation.Nullable + public List getCapabilities() { + return capabilities; + } + + public void setCapabilities(@javax.annotation.Nullable List capabilities) { + this.capabilities = capabilities; + } + + + public AnalysisCapabilityBody functionName(@javax.annotation.Nonnull String functionName) { + this.functionName = functionName; + return this; + } + + /** + * Name of the function the capability was found in + * @return functionName + */ + @javax.annotation.Nonnull + public String getFunctionName() { + return functionName; + } + + public void setFunctionName(@javax.annotation.Nonnull String functionName) { + this.functionName = functionName; + } + + + public AnalysisCapabilityBody functionVaddr(@javax.annotation.Nonnull Long functionVaddr) { + this.functionVaddr = functionVaddr; + return this; + } + + /** + * Virtual address of that function + * @return functionVaddr + */ + @javax.annotation.Nonnull + public Long getFunctionVaddr() { + return functionVaddr; + } + + public void setFunctionVaddr(@javax.annotation.Nonnull Long functionVaddr) { + this.functionVaddr = functionVaddr; + } + + /** + * 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 AnalysisCapabilityBody instance itself + */ + public AnalysisCapabilityBody 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; + } + AnalysisCapabilityBody analysisCapabilityBody = (AnalysisCapabilityBody) o; + return Objects.equals(this.capabilities, analysisCapabilityBody.capabilities) && + Objects.equals(this.functionName, analysisCapabilityBody.functionName) && + Objects.equals(this.functionVaddr, analysisCapabilityBody.functionVaddr)&& + Objects.equals(this.additionalProperties, analysisCapabilityBody.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(capabilities, functionName, functionVaddr, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AnalysisCapabilityBody {\n"); + sb.append(" capabilities: ").append(toIndentedString(capabilities)).append("\n"); + sb.append(" functionName: ").append(toIndentedString(functionName)).append("\n"); + sb.append(" functionVaddr: ").append(toIndentedString(functionVaddr)).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) { + return o == null ? "null" : 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("capabilities", "function_name", "function_vaddr")); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(Arrays.asList("capabilities", "function_name", "function_vaddr")); + } + + /** + * 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 AnalysisCapabilityBody + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!AnalysisCapabilityBody.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field(s) %s in AnalysisCapabilityBody is not found in the empty JSON string", AnalysisCapabilityBody.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : AnalysisCapabilityBody.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format(java.util.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("capabilities") == null) { + throw new IllegalArgumentException("Expected the field `linkedContent` to be an array in the JSON string but got `null`"); + } else if (!jsonObj.get("capabilities").isJsonArray() && !jsonObj.get("capabilities").isJsonNull()) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `capabilities` to be an array in the JSON string but got `%s`", jsonObj.get("capabilities").toString())); + } + if (!jsonObj.get("function_name").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `function_name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("function_name").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!AnalysisCapabilityBody.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'AnalysisCapabilityBody' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(AnalysisCapabilityBody.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, AnalysisCapabilityBody 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 AnalysisCapabilityBody read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + AnalysisCapabilityBody 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(java.util.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 AnalysisCapabilityBody given an JSON string + * + * @param jsonString JSON string + * @return An instance of AnalysisCapabilityBody + * @throws IOException if the JSON string is invalid with respect to AnalysisCapabilityBody + */ + public static AnalysisCapabilityBody fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, AnalysisCapabilityBody.class); + } + + /** + * Convert an instance of AnalysisCapabilityBody to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/ai/reveng/model/AnalysisDetailOutputBody.java b/src/main/java/ai/reveng/model/AnalysisDetailOutputBody.java new file mode 100644 index 0000000..3d633bc --- /dev/null +++ b/src/main/java/ai/reveng/model/AnalysisDetailOutputBody.java @@ -0,0 +1,764 @@ +/* + * 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 ai.reveng.model.AnalysisAccessBody; +import ai.reveng.model.AutoRunAgentsBody; +import ai.reveng.model.RequestedConfigBody; +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 ai.reveng.invoker.JSON; + +/** + * AnalysisDetailOutputBody + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class AnalysisDetailOutputBody { + public static final String SERIALIZED_NAME_ACCESS = "access"; + @SerializedName(SERIALIZED_NAME_ACCESS) + @javax.annotation.Nonnull + private AnalysisAccessBody access; + + public static final String SERIALIZED_NAME_ANALYSIS_ID = "analysis_id"; + @SerializedName(SERIALIZED_NAME_ANALYSIS_ID) + @javax.annotation.Nonnull + private Long analysisId; + + /** + * Gets or Sets analysisScope + */ + @JsonAdapter(AnalysisScopeEnum.Adapter.class) + public enum AnalysisScopeEnum { + PUBLIC("PUBLIC"), + + PRIVATE("PRIVATE"), + + 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_ARCHITECTURE = "architecture"; + @SerializedName(SERIALIZED_NAME_ARCHITECTURE) + @javax.annotation.Nonnull + private String architecture; + + public static final String SERIALIZED_NAME_AUTO_RUN_AGENTS = "auto_run_agents"; + @SerializedName(SERIALIZED_NAME_AUTO_RUN_AGENTS) + @javax.annotation.Nonnull + private AutoRunAgentsBody autoRunAgents; + + public static final String SERIALIZED_NAME_BINARY_DYNAMIC = "binary_dynamic"; + @SerializedName(SERIALIZED_NAME_BINARY_DYNAMIC) + @javax.annotation.Nonnull + private Boolean binaryDynamic; + + public static final String SERIALIZED_NAME_BINARY_FORMAT = "binary_format"; + @SerializedName(SERIALIZED_NAME_BINARY_FORMAT) + @javax.annotation.Nonnull + private String binaryFormat; + + 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_TYPE = "binary_type"; + @SerializedName(SERIALIZED_NAME_BINARY_TYPE) + @javax.annotation.Nonnull + private String binaryType; + + public static final String SERIALIZED_NAME_CREATION = "creation"; + @SerializedName(SERIALIZED_NAME_CREATION) + @javax.annotation.Nonnull + private String creation; + + public static final String SERIALIZED_NAME_DASHBOARD_URL = "dashboard_url"; + @SerializedName(SERIALIZED_NAME_DASHBOARD_URL) + @javax.annotation.Nonnull + private String dashboardUrl; + + public static final String SERIALIZED_NAME_DEBUG = "debug"; + @SerializedName(SERIALIZED_NAME_DEBUG) + @javax.annotation.Nonnull + private Boolean debug; + + 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_REQUESTED_CONFIG = "requested_config"; + @SerializedName(SERIALIZED_NAME_REQUESTED_CONFIG) + @javax.annotation.Nonnull + private RequestedConfigBody requestedConfig; + + public static final String SERIALIZED_NAME_SHA256_HASH = "sha_256_hash"; + @SerializedName(SERIALIZED_NAME_SHA256_HASH) + @javax.annotation.Nonnull + private String sha256Hash; + + public AnalysisDetailOutputBody() { + } + + public AnalysisDetailOutputBody access(@javax.annotation.Nonnull AnalysisAccessBody access) { + this.access = access; + return this; + } + + /** + * Get access + * @return access + */ + @javax.annotation.Nonnull + public AnalysisAccessBody getAccess() { + return access; + } + + public void setAccess(@javax.annotation.Nonnull AnalysisAccessBody access) { + this.access = access; + } + + + public AnalysisDetailOutputBody analysisId(@javax.annotation.Nonnull Long analysisId) { + this.analysisId = analysisId; + return this; + } + + /** + * Get analysisId + * @return analysisId + */ + @javax.annotation.Nonnull + public Long getAnalysisId() { + return analysisId; + } + + public void setAnalysisId(@javax.annotation.Nonnull Long analysisId) { + this.analysisId = analysisId; + } + + + public AnalysisDetailOutputBody analysisScope(@javax.annotation.Nonnull AnalysisScopeEnum analysisScope) { + this.analysisScope = analysisScope; + return this; + } + + /** + * Get analysisScope + * @return analysisScope + */ + @javax.annotation.Nonnull + public AnalysisScopeEnum getAnalysisScope() { + return analysisScope; + } + + public void setAnalysisScope(@javax.annotation.Nonnull AnalysisScopeEnum analysisScope) { + this.analysisScope = analysisScope; + } + + + public AnalysisDetailOutputBody architecture(@javax.annotation.Nonnull String architecture) { + this.architecture = architecture; + return this; + } + + /** + * Get architecture + * @return architecture + */ + @javax.annotation.Nonnull + public String getArchitecture() { + return architecture; + } + + public void setArchitecture(@javax.annotation.Nonnull String architecture) { + this.architecture = architecture; + } + + + public AnalysisDetailOutputBody autoRunAgents(@javax.annotation.Nonnull AutoRunAgentsBody autoRunAgents) { + this.autoRunAgents = autoRunAgents; + return this; + } + + /** + * Get autoRunAgents + * @return autoRunAgents + */ + @javax.annotation.Nonnull + public AutoRunAgentsBody getAutoRunAgents() { + return autoRunAgents; + } + + public void setAutoRunAgents(@javax.annotation.Nonnull AutoRunAgentsBody autoRunAgents) { + this.autoRunAgents = autoRunAgents; + } + + + public AnalysisDetailOutputBody binaryDynamic(@javax.annotation.Nonnull Boolean binaryDynamic) { + this.binaryDynamic = binaryDynamic; + return this; + } + + /** + * Get binaryDynamic + * @return binaryDynamic + */ + @javax.annotation.Nonnull + public Boolean getBinaryDynamic() { + return binaryDynamic; + } + + public void setBinaryDynamic(@javax.annotation.Nonnull Boolean binaryDynamic) { + this.binaryDynamic = binaryDynamic; + } + + + public AnalysisDetailOutputBody binaryFormat(@javax.annotation.Nonnull String binaryFormat) { + this.binaryFormat = binaryFormat; + return this; + } + + /** + * Get binaryFormat + * @return binaryFormat + */ + @javax.annotation.Nonnull + public String getBinaryFormat() { + return binaryFormat; + } + + public void setBinaryFormat(@javax.annotation.Nonnull String binaryFormat) { + this.binaryFormat = binaryFormat; + } + + + public AnalysisDetailOutputBody binaryName(@javax.annotation.Nonnull String binaryName) { + this.binaryName = binaryName; + return this; + } + + /** + * Get binaryName + * @return binaryName + */ + @javax.annotation.Nonnull + public String getBinaryName() { + return binaryName; + } + + public void setBinaryName(@javax.annotation.Nonnull String binaryName) { + this.binaryName = binaryName; + } + + + public AnalysisDetailOutputBody binarySize(@javax.annotation.Nonnull Long binarySize) { + this.binarySize = binarySize; + return this; + } + + /** + * Get binarySize + * @return binarySize + */ + @javax.annotation.Nonnull + public Long getBinarySize() { + return binarySize; + } + + public void setBinarySize(@javax.annotation.Nonnull Long binarySize) { + this.binarySize = binarySize; + } + + + public AnalysisDetailOutputBody binaryType(@javax.annotation.Nonnull String binaryType) { + this.binaryType = binaryType; + return this; + } + + /** + * Get binaryType + * @return binaryType + */ + @javax.annotation.Nonnull + public String getBinaryType() { + return binaryType; + } + + public void setBinaryType(@javax.annotation.Nonnull String binaryType) { + this.binaryType = binaryType; + } + + + public AnalysisDetailOutputBody creation(@javax.annotation.Nonnull String creation) { + this.creation = creation; + return this; + } + + /** + * Get creation + * @return creation + */ + @javax.annotation.Nonnull + public String getCreation() { + return creation; + } + + public void setCreation(@javax.annotation.Nonnull String creation) { + this.creation = creation; + } + + + public AnalysisDetailOutputBody dashboardUrl(@javax.annotation.Nonnull String dashboardUrl) { + this.dashboardUrl = dashboardUrl; + return this; + } + + /** + * URL to view this analysis in the dashboard + * @return dashboardUrl + */ + @javax.annotation.Nonnull + public String getDashboardUrl() { + return dashboardUrl; + } + + public void setDashboardUrl(@javax.annotation.Nonnull String dashboardUrl) { + this.dashboardUrl = dashboardUrl; + } + + + public AnalysisDetailOutputBody debug(@javax.annotation.Nonnull Boolean debug) { + this.debug = debug; + return this; + } + + /** + * Get debug + * @return debug + */ + @javax.annotation.Nonnull + public Boolean getDebug() { + return debug; + } + + public void setDebug(@javax.annotation.Nonnull Boolean debug) { + this.debug = debug; + } + + + public AnalysisDetailOutputBody modelName(@javax.annotation.Nonnull String modelName) { + this.modelName = modelName; + return this; + } + + /** + * Get modelName + * @return modelName + */ + @javax.annotation.Nonnull + public String getModelName() { + return modelName; + } + + public void setModelName(@javax.annotation.Nonnull String modelName) { + this.modelName = modelName; + } + + + public AnalysisDetailOutputBody requestedConfig(@javax.annotation.Nonnull RequestedConfigBody requestedConfig) { + this.requestedConfig = requestedConfig; + return this; + } + + /** + * Snapshot of the configuration the analysis was submitted with + * @return requestedConfig + */ + @javax.annotation.Nonnull + public RequestedConfigBody getRequestedConfig() { + return requestedConfig; + } + + public void setRequestedConfig(@javax.annotation.Nonnull RequestedConfigBody requestedConfig) { + this.requestedConfig = requestedConfig; + } + + + public AnalysisDetailOutputBody sha256Hash(@javax.annotation.Nonnull String sha256Hash) { + this.sha256Hash = sha256Hash; + return this; + } + + /** + * Get sha256Hash + * @return sha256Hash + */ + @javax.annotation.Nonnull + public String getSha256Hash() { + return sha256Hash; + } + + public void setSha256Hash(@javax.annotation.Nonnull String sha256Hash) { + this.sha256Hash = sha256Hash; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the AnalysisDetailOutputBody instance itself + */ + public AnalysisDetailOutputBody 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; + } + AnalysisDetailOutputBody analysisDetailOutputBody = (AnalysisDetailOutputBody) o; + return Objects.equals(this.access, analysisDetailOutputBody.access) && + Objects.equals(this.analysisId, analysisDetailOutputBody.analysisId) && + Objects.equals(this.analysisScope, analysisDetailOutputBody.analysisScope) && + Objects.equals(this.architecture, analysisDetailOutputBody.architecture) && + Objects.equals(this.autoRunAgents, analysisDetailOutputBody.autoRunAgents) && + Objects.equals(this.binaryDynamic, analysisDetailOutputBody.binaryDynamic) && + Objects.equals(this.binaryFormat, analysisDetailOutputBody.binaryFormat) && + Objects.equals(this.binaryName, analysisDetailOutputBody.binaryName) && + Objects.equals(this.binarySize, analysisDetailOutputBody.binarySize) && + Objects.equals(this.binaryType, analysisDetailOutputBody.binaryType) && + Objects.equals(this.creation, analysisDetailOutputBody.creation) && + Objects.equals(this.dashboardUrl, analysisDetailOutputBody.dashboardUrl) && + Objects.equals(this.debug, analysisDetailOutputBody.debug) && + Objects.equals(this.modelName, analysisDetailOutputBody.modelName) && + Objects.equals(this.requestedConfig, analysisDetailOutputBody.requestedConfig) && + Objects.equals(this.sha256Hash, analysisDetailOutputBody.sha256Hash)&& + Objects.equals(this.additionalProperties, analysisDetailOutputBody.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(access, analysisId, analysisScope, architecture, autoRunAgents, binaryDynamic, binaryFormat, binaryName, binarySize, binaryType, creation, dashboardUrl, debug, modelName, requestedConfig, sha256Hash, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AnalysisDetailOutputBody {\n"); + sb.append(" access: ").append(toIndentedString(access)).append("\n"); + sb.append(" analysisId: ").append(toIndentedString(analysisId)).append("\n"); + sb.append(" analysisScope: ").append(toIndentedString(analysisScope)).append("\n"); + sb.append(" architecture: ").append(toIndentedString(architecture)).append("\n"); + sb.append(" autoRunAgents: ").append(toIndentedString(autoRunAgents)).append("\n"); + sb.append(" binaryDynamic: ").append(toIndentedString(binaryDynamic)).append("\n"); + sb.append(" binaryFormat: ").append(toIndentedString(binaryFormat)).append("\n"); + sb.append(" binaryName: ").append(toIndentedString(binaryName)).append("\n"); + sb.append(" binarySize: ").append(toIndentedString(binarySize)).append("\n"); + sb.append(" binaryType: ").append(toIndentedString(binaryType)).append("\n"); + sb.append(" creation: ").append(toIndentedString(creation)).append("\n"); + sb.append(" dashboardUrl: ").append(toIndentedString(dashboardUrl)).append("\n"); + sb.append(" debug: ").append(toIndentedString(debug)).append("\n"); + sb.append(" modelName: ").append(toIndentedString(modelName)).append("\n"); + sb.append(" requestedConfig: ").append(toIndentedString(requestedConfig)).append("\n"); + sb.append(" sha256Hash: ").append(toIndentedString(sha256Hash)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + return o == null ? "null" : 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("access", "analysis_id", "analysis_scope", "architecture", "auto_run_agents", "binary_dynamic", "binary_format", "binary_name", "binary_size", "binary_type", "creation", "dashboard_url", "debug", "model_name", "requested_config", "sha_256_hash")); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(Arrays.asList("access", "analysis_id", "analysis_scope", "architecture", "auto_run_agents", "binary_dynamic", "binary_format", "binary_name", "binary_size", "binary_type", "creation", "dashboard_url", "debug", "model_name", "requested_config", "sha_256_hash")); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to AnalysisDetailOutputBody + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!AnalysisDetailOutputBody.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field(s) %s in AnalysisDetailOutputBody is not found in the empty JSON string", AnalysisDetailOutputBody.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : AnalysisDetailOutputBody.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format(java.util.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(java.util.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("architecture").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `architecture` to be a primitive type in the JSON string but got `%s`", jsonObj.get("architecture").toString())); + } + if (!jsonObj.get("binary_format").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `binary_format` to be a primitive type in the JSON string but got `%s`", jsonObj.get("binary_format").toString())); + } + if (!jsonObj.get("binary_name").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(java.util.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_type").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `binary_type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("binary_type").toString())); + } + if (!jsonObj.get("creation").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `creation` to be a primitive type in the JSON string but got `%s`", jsonObj.get("creation").toString())); + } + if (!jsonObj.get("dashboard_url").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `dashboard_url` to be a primitive type in the JSON string but got `%s`", jsonObj.get("dashboard_url").toString())); + } + if (!jsonObj.get("model_name").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(java.util.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("sha_256_hash").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(java.util.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 (!AnalysisDetailOutputBody.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'AnalysisDetailOutputBody' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(AnalysisDetailOutputBody.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, AnalysisDetailOutputBody 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 AnalysisDetailOutputBody read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + AnalysisDetailOutputBody 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(java.util.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 AnalysisDetailOutputBody given an JSON string + * + * @param jsonString JSON string + * @return An instance of AnalysisDetailOutputBody + * @throws IOException if the JSON string is invalid with respect to AnalysisDetailOutputBody + */ + public static AnalysisDetailOutputBody fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, AnalysisDetailOutputBody.class); + } + + /** + * Convert an instance of AnalysisDetailOutputBody to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/ai/reveng/model/AutoRunAgentsBody.java b/src/main/java/ai/reveng/model/AutoRunAgentsBody.java new file mode 100644 index 0000000..8b8bf5d --- /dev/null +++ b/src/main/java/ai/reveng/model/AutoRunAgentsBody.java @@ -0,0 +1,286 @@ +/* + * 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 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 ai.reveng.invoker.JSON; + +/** + * AutoRunAgentsBody + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class AutoRunAgentsBody { + public static final String SERIALIZED_NAME_TRIAGE = "triage"; + @SerializedName(SERIALIZED_NAME_TRIAGE) + @javax.annotation.Nonnull + private Boolean triage; + + public AutoRunAgentsBody() { + } + + public AutoRunAgentsBody triage(@javax.annotation.Nonnull Boolean triage) { + this.triage = triage; + return this; + } + + /** + * Whether the triage agent ran automatically once the functions pipeline finished + * @return triage + */ + @javax.annotation.Nonnull + public Boolean getTriage() { + return triage; + } + + public void setTriage(@javax.annotation.Nonnull Boolean triage) { + this.triage = triage; + } + + /** + * 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 AutoRunAgentsBody instance itself + */ + public AutoRunAgentsBody 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; + } + AutoRunAgentsBody autoRunAgentsBody = (AutoRunAgentsBody) o; + return Objects.equals(this.triage, autoRunAgentsBody.triage)&& + Objects.equals(this.additionalProperties, autoRunAgentsBody.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(triage, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AutoRunAgentsBody {\n"); + sb.append(" triage: ").append(toIndentedString(triage)).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) { + return o == null ? "null" : 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("triage")); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(Arrays.asList("triage")); + } + + /** + * 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 AutoRunAgentsBody + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!AutoRunAgentsBody.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field(s) %s in AutoRunAgentsBody is not found in the empty JSON string", AutoRunAgentsBody.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : AutoRunAgentsBody.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!AutoRunAgentsBody.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'AutoRunAgentsBody' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(AutoRunAgentsBody.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, AutoRunAgentsBody 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 AutoRunAgentsBody read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + AutoRunAgentsBody 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(java.util.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 AutoRunAgentsBody given an JSON string + * + * @param jsonString JSON string + * @return An instance of AutoRunAgentsBody + * @throws IOException if the JSON string is invalid with respect to AutoRunAgentsBody + */ + public static AutoRunAgentsBody fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, AutoRunAgentsBody.class); + } + + /** + * Convert an instance of AutoRunAgentsBody to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/ai/reveng/model/Binary.java b/src/main/java/ai/reveng/model/Binary.java index a53dc12..b0904ca 100644 --- a/src/main/java/ai/reveng/model/Binary.java +++ b/src/main/java/ai/reveng/model/Binary.java @@ -70,11 +70,26 @@ public class Binary { @javax.annotation.Nonnull private OffsetDateTime createdAt; + public static final String SERIALIZED_NAME_DETECTED_ARCHITECTURE = "detected_architecture"; + @SerializedName(SERIALIZED_NAME_DETECTED_ARCHITECTURE) + @javax.annotation.Nonnull + private String detectedArchitecture; + + public static final String SERIALIZED_NAME_DETECTED_BINARY_TYPE = "detected_binary_type"; + @SerializedName(SERIALIZED_NAME_DETECTED_BINARY_TYPE) + @javax.annotation.Nonnull + private String detectedBinaryType; + public static final String SERIALIZED_NAME_IS_SYSTEM_ANALYSIS = "is_system_analysis"; @SerializedName(SERIALIZED_NAME_IS_SYSTEM_ANALYSIS) @javax.annotation.Nonnull private Boolean isSystemAnalysis; + public static final String SERIALIZED_NAME_MODEL_NAME = "model_name"; + @SerializedName(SERIALIZED_NAME_MODEL_NAME) + @javax.annotation.Nonnull + private String modelName; + public static final String SERIALIZED_NAME_OWNER_ID = "owner_id"; @SerializedName(SERIALIZED_NAME_OWNER_ID) @javax.annotation.Nonnull @@ -85,6 +100,16 @@ public class Binary { @javax.annotation.Nonnull private String sha256Hash; + public static final String SERIALIZED_NAME_SUPPLIED_ARCHITECTURE = "supplied_architecture"; + @SerializedName(SERIALIZED_NAME_SUPPLIED_ARCHITECTURE) + @javax.annotation.Nonnull + private String suppliedArchitecture; + + public static final String SERIALIZED_NAME_SUPPLIED_BINARY_TYPE = "supplied_binary_type"; + @SerializedName(SERIALIZED_NAME_SUPPLIED_BINARY_TYPE) + @javax.annotation.Nonnull + private String suppliedBinaryType; + public Binary() { } @@ -164,6 +189,44 @@ public void setCreatedAt(@javax.annotation.Nonnull OffsetDateTime createdAt) { } + public Binary detectedArchitecture(@javax.annotation.Nonnull String detectedArchitecture) { + this.detectedArchitecture = detectedArchitecture; + return this; + } + + /** + * Detected instruction-set architecture; empty when unavailable + * @return detectedArchitecture + */ + @javax.annotation.Nonnull + public String getDetectedArchitecture() { + return detectedArchitecture; + } + + public void setDetectedArchitecture(@javax.annotation.Nonnull String detectedArchitecture) { + this.detectedArchitecture = detectedArchitecture; + } + + + public Binary detectedBinaryType(@javax.annotation.Nonnull String detectedBinaryType) { + this.detectedBinaryType = detectedBinaryType; + return this; + } + + /** + * Detected operating-system platform; empty when unavailable + * @return detectedBinaryType + */ + @javax.annotation.Nonnull + public String getDetectedBinaryType() { + return detectedBinaryType; + } + + public void setDetectedBinaryType(@javax.annotation.Nonnull String detectedBinaryType) { + this.detectedBinaryType = detectedBinaryType; + } + + public Binary isSystemAnalysis(@javax.annotation.Nonnull Boolean isSystemAnalysis) { this.isSystemAnalysis = isSystemAnalysis; return this; @@ -183,6 +246,25 @@ public void setIsSystemAnalysis(@javax.annotation.Nonnull Boolean isSystemAnalys } + public Binary modelName(@javax.annotation.Nonnull String modelName) { + this.modelName = modelName; + return this; + } + + /** + * Name of the model the analysis ran on + * @return modelName + */ + @javax.annotation.Nonnull + public String getModelName() { + return modelName; + } + + public void setModelName(@javax.annotation.Nonnull String modelName) { + this.modelName = modelName; + } + + public Binary ownerId(@javax.annotation.Nonnull Long ownerId) { this.ownerId = ownerId; return this; @@ -220,6 +302,44 @@ public void setSha256Hash(@javax.annotation.Nonnull String sha256Hash) { this.sha256Hash = sha256Hash; } + + public Binary suppliedArchitecture(@javax.annotation.Nonnull String suppliedArchitecture) { + this.suppliedArchitecture = suppliedArchitecture; + return this; + } + + /** + * User-supplied instruction-set architecture; \"AUTO\" when not overridden + * @return suppliedArchitecture + */ + @javax.annotation.Nonnull + public String getSuppliedArchitecture() { + return suppliedArchitecture; + } + + public void setSuppliedArchitecture(@javax.annotation.Nonnull String suppliedArchitecture) { + this.suppliedArchitecture = suppliedArchitecture; + } + + + public Binary suppliedBinaryType(@javax.annotation.Nonnull String suppliedBinaryType) { + this.suppliedBinaryType = suppliedBinaryType; + return this; + } + + /** + * User-supplied operating-system platform; \"AUTO\" when not overridden + * @return suppliedBinaryType + */ + @javax.annotation.Nonnull + public String getSuppliedBinaryType() { + return suppliedBinaryType; + } + + public void setSuppliedBinaryType(@javax.annotation.Nonnull String suppliedBinaryType) { + this.suppliedBinaryType = suppliedBinaryType; + } + /** * A container for additional, undeclared properties. * This is a holder for any undeclared properties as specified with @@ -279,15 +399,20 @@ public boolean equals(Object o) { Objects.equals(this.binaryId, binary.binaryId) && Objects.equals(this.binaryName, binary.binaryName) && Objects.equals(this.createdAt, binary.createdAt) && + Objects.equals(this.detectedArchitecture, binary.detectedArchitecture) && + Objects.equals(this.detectedBinaryType, binary.detectedBinaryType) && Objects.equals(this.isSystemAnalysis, binary.isSystemAnalysis) && + Objects.equals(this.modelName, binary.modelName) && Objects.equals(this.ownerId, binary.ownerId) && - Objects.equals(this.sha256Hash, binary.sha256Hash)&& + Objects.equals(this.sha256Hash, binary.sha256Hash) && + Objects.equals(this.suppliedArchitecture, binary.suppliedArchitecture) && + Objects.equals(this.suppliedBinaryType, binary.suppliedBinaryType)&& Objects.equals(this.additionalProperties, binary.additionalProperties); } @Override public int hashCode() { - return Objects.hash(analysisId, binaryId, binaryName, createdAt, isSystemAnalysis, ownerId, sha256Hash, additionalProperties); + return Objects.hash(analysisId, binaryId, binaryName, createdAt, detectedArchitecture, detectedBinaryType, isSystemAnalysis, modelName, ownerId, sha256Hash, suppliedArchitecture, suppliedBinaryType, additionalProperties); } @Override @@ -298,9 +423,14 @@ public String toString() { sb.append(" binaryId: ").append(toIndentedString(binaryId)).append("\n"); sb.append(" binaryName: ").append(toIndentedString(binaryName)).append("\n"); sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); + sb.append(" detectedArchitecture: ").append(toIndentedString(detectedArchitecture)).append("\n"); + sb.append(" detectedBinaryType: ").append(toIndentedString(detectedBinaryType)).append("\n"); sb.append(" isSystemAnalysis: ").append(toIndentedString(isSystemAnalysis)).append("\n"); + sb.append(" modelName: ").append(toIndentedString(modelName)).append("\n"); sb.append(" ownerId: ").append(toIndentedString(ownerId)).append("\n"); sb.append(" sha256Hash: ").append(toIndentedString(sha256Hash)).append("\n"); + sb.append(" suppliedArchitecture: ").append(toIndentedString(suppliedArchitecture)).append("\n"); + sb.append(" suppliedBinaryType: ").append(toIndentedString(suppliedBinaryType)).append("\n"); sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); sb.append("}"); return sb.toString(); @@ -320,10 +450,10 @@ private String toIndentedString(Object o) { static { // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(Arrays.asList("analysis_id", "binary_id", "binary_name", "created_at", "is_system_analysis", "owner_id", "sha_256_hash")); + openapiFields = new HashSet(Arrays.asList("analysis_id", "binary_id", "binary_name", "created_at", "detected_architecture", "detected_binary_type", "is_system_analysis", "model_name", "owner_id", "sha_256_hash", "supplied_architecture", "supplied_binary_type")); // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(Arrays.asList("analysis_id", "binary_id", "binary_name", "created_at", "is_system_analysis", "owner_id", "sha_256_hash")); + openapiRequiredFields = new HashSet(Arrays.asList("analysis_id", "binary_id", "binary_name", "created_at", "detected_architecture", "detected_binary_type", "is_system_analysis", "model_name", "owner_id", "sha_256_hash", "supplied_architecture", "supplied_binary_type")); } /** @@ -349,9 +479,24 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti if (!jsonObj.get("binary_name").isJsonPrimitive()) { throw new IllegalArgumentException(String.format(java.util.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("detected_architecture").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `detected_architecture` to be a primitive type in the JSON string but got `%s`", jsonObj.get("detected_architecture").toString())); + } + if (!jsonObj.get("detected_binary_type").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `detected_binary_type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("detected_binary_type").toString())); + } + if (!jsonObj.get("model_name").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(java.util.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("sha_256_hash").isJsonPrimitive()) { throw new IllegalArgumentException(String.format(java.util.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())); } + if (!jsonObj.get("supplied_architecture").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `supplied_architecture` to be a primitive type in the JSON string but got `%s`", jsonObj.get("supplied_architecture").toString())); + } + if (!jsonObj.get("supplied_binary_type").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `supplied_binary_type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("supplied_binary_type").toString())); + } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { diff --git a/src/main/java/ai/reveng/model/BinaryExportMetadata.java b/src/main/java/ai/reveng/model/BinaryExportMetadata.java new file mode 100644 index 0000000..c24ea96 --- /dev/null +++ b/src/main/java/ai/reveng/model/BinaryExportMetadata.java @@ -0,0 +1,286 @@ +/* + * 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 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 ai.reveng.invoker.JSON; + +/** + * BinaryExportMetadata + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class BinaryExportMetadata { + public static final String SERIALIZED_NAME_ANALYSIS_ID = "analysis_id"; + @SerializedName(SERIALIZED_NAME_ANALYSIS_ID) + @javax.annotation.Nonnull + private Long analysisId; + + public BinaryExportMetadata() { + } + + public BinaryExportMetadata analysisId(@javax.annotation.Nonnull Long analysisId) { + this.analysisId = analysisId; + return this; + } + + /** + * Analysis ID + * @return analysisId + */ + @javax.annotation.Nonnull + public Long getAnalysisId() { + return analysisId; + } + + public void setAnalysisId(@javax.annotation.Nonnull Long analysisId) { + this.analysisId = analysisId; + } + + /** + * 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 BinaryExportMetadata instance itself + */ + public BinaryExportMetadata 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; + } + BinaryExportMetadata binaryExportMetadata = (BinaryExportMetadata) o; + return Objects.equals(this.analysisId, binaryExportMetadata.analysisId)&& + Objects.equals(this.additionalProperties, binaryExportMetadata.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(analysisId, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class BinaryExportMetadata {\n"); + sb.append(" analysisId: ").append(toIndentedString(analysisId)).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) { + return o == null ? "null" : o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(Arrays.asList("analysis_id")); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(Arrays.asList("analysis_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 BinaryExportMetadata + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!BinaryExportMetadata.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field(s) %s in BinaryExportMetadata is not found in the empty JSON string", BinaryExportMetadata.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : BinaryExportMetadata.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!BinaryExportMetadata.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'BinaryExportMetadata' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(BinaryExportMetadata.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, BinaryExportMetadata 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 BinaryExportMetadata read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + BinaryExportMetadata 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(java.util.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 BinaryExportMetadata given an JSON string + * + * @param jsonString JSON string + * @return An instance of BinaryExportMetadata + * @throws IOException if the JSON string is invalid with respect to BinaryExportMetadata + */ + public static BinaryExportMetadata fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, BinaryExportMetadata.class); + } + + /** + * Convert an instance of BinaryExportMetadata to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/ai/reveng/model/BinaryExportResult.java b/src/main/java/ai/reveng/model/BinaryExportResult.java new file mode 100644 index 0000000..f02574c --- /dev/null +++ b/src/main/java/ai/reveng/model/BinaryExportResult.java @@ -0,0 +1,289 @@ +/* + * 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 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 ai.reveng.invoker.JSON; + +/** + * BinaryExportResult + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class BinaryExportResult { + public static final String SERIALIZED_NAME_FILE_NAME = "file_name"; + @SerializedName(SERIALIZED_NAME_FILE_NAME) + @javax.annotation.Nonnull + private String fileName; + + public BinaryExportResult() { + } + + public BinaryExportResult fileName(@javax.annotation.Nonnull String fileName) { + this.fileName = fileName; + return this; + } + + /** + * Name to give the downloaded file + * @return fileName + */ + @javax.annotation.Nonnull + public String getFileName() { + return fileName; + } + + public void setFileName(@javax.annotation.Nonnull String fileName) { + this.fileName = fileName; + } + + /** + * 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 BinaryExportResult instance itself + */ + public BinaryExportResult 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; + } + BinaryExportResult binaryExportResult = (BinaryExportResult) o; + return Objects.equals(this.fileName, binaryExportResult.fileName)&& + Objects.equals(this.additionalProperties, binaryExportResult.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(fileName, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class BinaryExportResult {\n"); + sb.append(" fileName: ").append(toIndentedString(fileName)).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) { + return o == null ? "null" : 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("file_name")); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(Arrays.asList("file_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 BinaryExportResult + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!BinaryExportResult.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field(s) %s in BinaryExportResult is not found in the empty JSON string", BinaryExportResult.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : BinaryExportResult.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("file_name").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `file_name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("file_name").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!BinaryExportResult.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'BinaryExportResult' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(BinaryExportResult.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, BinaryExportResult 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 BinaryExportResult read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + BinaryExportResult 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(java.util.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 BinaryExportResult given an JSON string + * + * @param jsonString JSON string + * @return An instance of BinaryExportResult + * @throws IOException if the JSON string is invalid with respect to BinaryExportResult + */ + public static BinaryExportResult fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, BinaryExportResult.class); + } + + /** + * Convert an instance of BinaryExportResult to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/ai/reveng/model/BulkDeleteAnalysesInputBody.java b/src/main/java/ai/reveng/model/BulkDeleteAnalysesInputBody.java new file mode 100644 index 0000000..72a1357 --- /dev/null +++ b/src/main/java/ai/reveng/model/BulkDeleteAnalysesInputBody.java @@ -0,0 +1,302 @@ +/* + * 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 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 ai.reveng.invoker.JSON; + +/** + * BulkDeleteAnalysesInputBody + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class BulkDeleteAnalysesInputBody { + public static final String SERIALIZED_NAME_ANALYSIS_IDS = "analysis_ids"; + @SerializedName(SERIALIZED_NAME_ANALYSIS_IDS) + @javax.annotation.Nullable + private List analysisIds; + + public BulkDeleteAnalysesInputBody() { + } + + public BulkDeleteAnalysesInputBody analysisIds(@javax.annotation.Nullable List analysisIds) { + this.analysisIds = analysisIds; + return this; + } + + public BulkDeleteAnalysesInputBody addAnalysisIdsItem(Long analysisIdsItem) { + if (this.analysisIds == null) { + this.analysisIds = new ArrayList<>(); + } + this.analysisIds.add(analysisIdsItem); + return this; + } + + /** + * IDs of the analyses to delete. The caller must own every one, or none are deleted + * @return analysisIds + */ + @javax.annotation.Nullable + public List getAnalysisIds() { + return analysisIds; + } + + public void setAnalysisIds(@javax.annotation.Nullable List analysisIds) { + this.analysisIds = analysisIds; + } + + /** + * 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 BulkDeleteAnalysesInputBody instance itself + */ + public BulkDeleteAnalysesInputBody 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; + } + BulkDeleteAnalysesInputBody bulkDeleteAnalysesInputBody = (BulkDeleteAnalysesInputBody) o; + return Objects.equals(this.analysisIds, bulkDeleteAnalysesInputBody.analysisIds)&& + Objects.equals(this.additionalProperties, bulkDeleteAnalysesInputBody.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(analysisIds, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class BulkDeleteAnalysesInputBody {\n"); + sb.append(" analysisIds: ").append(toIndentedString(analysisIds)).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) { + return o == null ? "null" : 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_ids")); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(Arrays.asList("analysis_ids")); + } + + /** + * 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 BulkDeleteAnalysesInputBody + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!BulkDeleteAnalysesInputBody.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field(s) %s in BulkDeleteAnalysesInputBody is not found in the empty JSON string", BulkDeleteAnalysesInputBody.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : BulkDeleteAnalysesInputBody.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format(java.util.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("analysis_ids") == null) { + throw new IllegalArgumentException("Expected the field `linkedContent` to be an array in the JSON string but got `null`"); + } else if (!jsonObj.get("analysis_ids").isJsonArray() && !jsonObj.get("analysis_ids").isJsonNull()) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `analysis_ids` to be an array in the JSON string but got `%s`", jsonObj.get("analysis_ids").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!BulkDeleteAnalysesInputBody.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'BulkDeleteAnalysesInputBody' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(BulkDeleteAnalysesInputBody.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, BulkDeleteAnalysesInputBody 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 BulkDeleteAnalysesInputBody read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + BulkDeleteAnalysesInputBody 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(java.util.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 BulkDeleteAnalysesInputBody given an JSON string + * + * @param jsonString JSON string + * @return An instance of BulkDeleteAnalysesInputBody + * @throws IOException if the JSON string is invalid with respect to BulkDeleteAnalysesInputBody + */ + public static BulkDeleteAnalysesInputBody fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, BulkDeleteAnalysesInputBody.class); + } + + /** + * Convert an instance of BulkDeleteAnalysesInputBody to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/ai/reveng/model/DisassemblyOutputBody.java b/src/main/java/ai/reveng/model/DisassemblyOutputBody.java index e6b5f4f..bd38072 100644 --- a/src/main/java/ai/reveng/model/DisassemblyOutputBody.java +++ b/src/main/java/ai/reveng/model/DisassemblyOutputBody.java @@ -189,7 +189,7 @@ public DisassemblyOutputBody returnType(@javax.annotation.Nullable String return } /** - * Search is applied to string value + * Get returnType * @return returnType */ @javax.annotation.Nullable diff --git a/src/main/java/ai/reveng/model/EvidenceInner.java b/src/main/java/ai/reveng/model/EvidenceInner.java index 4212f35..711ff8c 100644 --- a/src/main/java/ai/reveng/model/EvidenceInner.java +++ b/src/main/java/ai/reveng/model/EvidenceInner.java @@ -31,8 +31,8 @@ import ai.reveng.model.ReferencedConstant; import ai.reveng.model.ReferencedConstantEvidence; import ai.reveng.model.RuleKind; -import ai.reveng.model.SuspiciousString; -import ai.reveng.model.SuspiciousStringEvidence; +import ai.reveng.model.StringMatch; +import ai.reveng.model.StringMatchEvidence; import com.google.gson.TypeAdapter; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; @@ -94,7 +94,7 @@ public TypeAdapter create(Gson gson, TypeToken type) { final TypeAdapter adapterCallChainEvidence = gson.getDelegateAdapter(this, TypeToken.get(CallChainEvidence.class)); final TypeAdapter adapterReferencedConstantEvidence = gson.getDelegateAdapter(this, TypeToken.get(ReferencedConstantEvidence.class)); final TypeAdapter adapterImportedApiCallEvidence = gson.getDelegateAdapter(this, TypeToken.get(ImportedApiCallEvidence.class)); - final TypeAdapter adapterSuspiciousStringEvidence = gson.getDelegateAdapter(this, TypeToken.get(SuspiciousStringEvidence.class)); + final TypeAdapter adapterStringMatchEvidence = gson.getDelegateAdapter(this, TypeToken.get(StringMatchEvidence.class)); final TypeAdapter adapterFunctionSimilarityEvidence = gson.getDelegateAdapter(this, TypeToken.get(FunctionSimilarityEvidence.class)); final TypeAdapter adapterApiCombinationEvidence = gson.getDelegateAdapter(this, TypeToken.get(ApiCombinationEvidence.class)); final TypeAdapter adapterDecompilerSummaryEvidence = gson.getDelegateAdapter(this, TypeToken.get(DecompilerSummaryEvidence.class)); @@ -128,9 +128,9 @@ public void write(JsonWriter out, EvidenceInner value) throws IOException { elementAdapter.write(out, element); return; } - // check if the actual instance is of the type `SuspiciousStringEvidence` - if (value.getActualInstance() instanceof SuspiciousStringEvidence) { - JsonElement element = adapterSuspiciousStringEvidence.toJsonTree((SuspiciousStringEvidence)value.getActualInstance()); + // check if the actual instance is of the type `StringMatchEvidence` + if (value.getActualInstance() instanceof StringMatchEvidence) { + JsonElement element = adapterStringMatchEvidence.toJsonTree((StringMatchEvidence)value.getActualInstance()); elementAdapter.write(out, element); return; } @@ -170,7 +170,7 @@ public void write(JsonWriter out, EvidenceInner value) throws IOException { elementAdapter.write(out, element); return; } - throw new IOException("Failed to serialize as the type doesn't match oneOf schemas: ApiCombinationEvidence, CallChainEvidence, DecompilerSummaryEvidence, FunctionSimilarityEvidence, HardcodedSecretEvidence, ImportedApiCallEvidence, KnownConstantEvidence, ModelInterpretationEvidence, ReferencedConstantEvidence, SuspiciousStringEvidence"); + throw new IOException("Failed to serialize as the type doesn't match oneOf schemas: ApiCombinationEvidence, CallChainEvidence, DecompilerSummaryEvidence, FunctionSimilarityEvidence, HardcodedSecretEvidence, ImportedApiCallEvidence, KnownConstantEvidence, ModelInterpretationEvidence, ReferencedConstantEvidence, StringMatchEvidence"); } @Override @@ -218,17 +218,17 @@ public EvidenceInner read(JsonReader in) throws IOException { errorMessages.add(String.format(java.util.Locale.ROOT, "Deserialization for ImportedApiCallEvidence failed with `%s`.", e.getMessage())); log.log(Level.FINER, "Input data does not match schema 'ImportedApiCallEvidence'", e); } - // deserialize SuspiciousStringEvidence + // deserialize StringMatchEvidence try { // validate the JSON object to see if any exception is thrown - SuspiciousStringEvidence.validateJsonElement(jsonElement); - actualAdapter = adapterSuspiciousStringEvidence; + StringMatchEvidence.validateJsonElement(jsonElement); + actualAdapter = adapterStringMatchEvidence; match++; - log.log(Level.FINER, "Input data matches schema 'SuspiciousStringEvidence'"); + log.log(Level.FINER, "Input data matches schema 'StringMatchEvidence'"); } catch (Exception e) { // deserialization failed, continue - errorMessages.add(String.format(java.util.Locale.ROOT, "Deserialization for SuspiciousStringEvidence failed with `%s`.", e.getMessage())); - log.log(Level.FINER, "Input data does not match schema 'SuspiciousStringEvidence'", e); + errorMessages.add(String.format(java.util.Locale.ROOT, "Deserialization for StringMatchEvidence failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'StringMatchEvidence'", e); } // deserialize FunctionSimilarityEvidence try { @@ -331,7 +331,7 @@ public EvidenceInner(Object o) { schemas.put("CallChainEvidence", CallChainEvidence.class); schemas.put("ReferencedConstantEvidence", ReferencedConstantEvidence.class); schemas.put("ImportedApiCallEvidence", ImportedApiCallEvidence.class); - schemas.put("SuspiciousStringEvidence", SuspiciousStringEvidence.class); + schemas.put("StringMatchEvidence", StringMatchEvidence.class); schemas.put("FunctionSimilarityEvidence", FunctionSimilarityEvidence.class); schemas.put("ApiCombinationEvidence", ApiCombinationEvidence.class); schemas.put("DecompilerSummaryEvidence", DecompilerSummaryEvidence.class); @@ -348,7 +348,7 @@ public Map> getSchemas() { /** * Set the instance that matches the oneOf child schema, check * the instance parameter is valid against the oneOf child schemas: - * ApiCombinationEvidence, CallChainEvidence, DecompilerSummaryEvidence, FunctionSimilarityEvidence, HardcodedSecretEvidence, ImportedApiCallEvidence, KnownConstantEvidence, ModelInterpretationEvidence, ReferencedConstantEvidence, SuspiciousStringEvidence + * ApiCombinationEvidence, CallChainEvidence, DecompilerSummaryEvidence, FunctionSimilarityEvidence, HardcodedSecretEvidence, ImportedApiCallEvidence, KnownConstantEvidence, ModelInterpretationEvidence, ReferencedConstantEvidence, StringMatchEvidence * * It could be an instance of the 'oneOf' schemas. */ @@ -369,7 +369,7 @@ public void setActualInstance(Object instance) { return; } - if (instance instanceof SuspiciousStringEvidence) { + if (instance instanceof StringMatchEvidence) { super.setActualInstance(instance); return; } @@ -404,14 +404,14 @@ public void setActualInstance(Object instance) { return; } - throw new RuntimeException("Invalid instance type. Must be ApiCombinationEvidence, CallChainEvidence, DecompilerSummaryEvidence, FunctionSimilarityEvidence, HardcodedSecretEvidence, ImportedApiCallEvidence, KnownConstantEvidence, ModelInterpretationEvidence, ReferencedConstantEvidence, SuspiciousStringEvidence"); + throw new RuntimeException("Invalid instance type. Must be ApiCombinationEvidence, CallChainEvidence, DecompilerSummaryEvidence, FunctionSimilarityEvidence, HardcodedSecretEvidence, ImportedApiCallEvidence, KnownConstantEvidence, ModelInterpretationEvidence, ReferencedConstantEvidence, StringMatchEvidence"); } /** * Get the actual instance, which can be the following: - * ApiCombinationEvidence, CallChainEvidence, DecompilerSummaryEvidence, FunctionSimilarityEvidence, HardcodedSecretEvidence, ImportedApiCallEvidence, KnownConstantEvidence, ModelInterpretationEvidence, ReferencedConstantEvidence, SuspiciousStringEvidence + * ApiCombinationEvidence, CallChainEvidence, DecompilerSummaryEvidence, FunctionSimilarityEvidence, HardcodedSecretEvidence, ImportedApiCallEvidence, KnownConstantEvidence, ModelInterpretationEvidence, ReferencedConstantEvidence, StringMatchEvidence * - * @return The actual instance (ApiCombinationEvidence, CallChainEvidence, DecompilerSummaryEvidence, FunctionSimilarityEvidence, HardcodedSecretEvidence, ImportedApiCallEvidence, KnownConstantEvidence, ModelInterpretationEvidence, ReferencedConstantEvidence, SuspiciousStringEvidence) + * @return The actual instance (ApiCombinationEvidence, CallChainEvidence, DecompilerSummaryEvidence, FunctionSimilarityEvidence, HardcodedSecretEvidence, ImportedApiCallEvidence, KnownConstantEvidence, ModelInterpretationEvidence, ReferencedConstantEvidence, StringMatchEvidence) */ @SuppressWarnings("unchecked") @Override @@ -456,15 +456,15 @@ public ImportedApiCallEvidence getImportedApiCallEvidence() throws ClassCastExce } /** - * Get the actual instance of `SuspiciousStringEvidence`. If the actual instance is not `SuspiciousStringEvidence`, + * Get the actual instance of `StringMatchEvidence`. If the actual instance is not `StringMatchEvidence`, * the ClassCastException will be thrown. * - * @return The actual instance of `SuspiciousStringEvidence` - * @throws ClassCastException if the instance is not `SuspiciousStringEvidence` + * @return The actual instance of `StringMatchEvidence` + * @throws ClassCastException if the instance is not `StringMatchEvidence` */ @SuppressWarnings("unchecked") - public SuspiciousStringEvidence getSuspiciousStringEvidence() throws ClassCastException { - return (SuspiciousStringEvidence)super.getActualInstance(); + public StringMatchEvidence getStringMatchEvidence() throws ClassCastException { + return (StringMatchEvidence)super.getActualInstance(); } /** @@ -573,12 +573,12 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti errorMessages.add(String.format(java.util.Locale.ROOT, "Deserialization for ImportedApiCallEvidence failed with `%s`.", e.getMessage())); // continue to the next one } - // validate the json string with SuspiciousStringEvidence + // validate the json string with StringMatchEvidence try { - SuspiciousStringEvidence.validateJsonElement(jsonElement); + StringMatchEvidence.validateJsonElement(jsonElement); validCount++; } catch (Exception e) { - errorMessages.add(String.format(java.util.Locale.ROOT, "Deserialization for SuspiciousStringEvidence failed with `%s`.", e.getMessage())); + errorMessages.add(String.format(java.util.Locale.ROOT, "Deserialization for StringMatchEvidence failed with `%s`.", e.getMessage())); // continue to the next one } // validate the json string with FunctionSimilarityEvidence @@ -630,7 +630,7 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti // continue to the next one } if (validCount != 1) { - throw new IOException(String.format(java.util.Locale.ROOT, "The JSON string is invalid for EvidenceInner with oneOf schemas: ApiCombinationEvidence, CallChainEvidence, DecompilerSummaryEvidence, FunctionSimilarityEvidence, HardcodedSecretEvidence, ImportedApiCallEvidence, KnownConstantEvidence, ModelInterpretationEvidence, ReferencedConstantEvidence, SuspiciousStringEvidence. %d class(es) match the result, expected 1. Detailed failure message for oneOf schemas: %s. JSON: %s", validCount, errorMessages, jsonElement.toString())); + throw new IOException(String.format(java.util.Locale.ROOT, "The JSON string is invalid for EvidenceInner with oneOf schemas: ApiCombinationEvidence, CallChainEvidence, DecompilerSummaryEvidence, FunctionSimilarityEvidence, HardcodedSecretEvidence, ImportedApiCallEvidence, KnownConstantEvidence, ModelInterpretationEvidence, ReferencedConstantEvidence, StringMatchEvidence. %d class(es) match the result, expected 1. Detailed failure message for oneOf schemas: %s. JSON: %s", validCount, errorMessages, jsonElement.toString())); } } diff --git a/src/main/java/ai/reveng/model/ImportDynamicExecutionFileOutputBody.java b/src/main/java/ai/reveng/model/ImportDynamicExecutionFileOutputBody.java new file mode 100644 index 0000000..8353a46 --- /dev/null +++ b/src/main/java/ai/reveng/model/ImportDynamicExecutionFileOutputBody.java @@ -0,0 +1,422 @@ +/* + * 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 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 ai.reveng.invoker.JSON; + +/** + * ImportDynamicExecutionFileOutputBody + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class ImportDynamicExecutionFileOutputBody { + public static final String SERIALIZED_NAME_CAN_EXTRACT = "can_extract"; + @SerializedName(SERIALIZED_NAME_CAN_EXTRACT) + @javax.annotation.Nonnull + private Boolean canExtract; + + public static final String SERIALIZED_NAME_CAN_SANDBOX = "can_sandbox"; + @SerializedName(SERIALIZED_NAME_CAN_SANDBOX) + @javax.annotation.Nonnull + private Boolean canSandbox; + + public static final String SERIALIZED_NAME_IS_ARCHIVE = "is_archive"; + @SerializedName(SERIALIZED_NAME_IS_ARCHIVE) + @javax.annotation.Nonnull + private Boolean isArchive; + + public static final String SERIALIZED_NAME_MIME = "mime"; + @SerializedName(SERIALIZED_NAME_MIME) + @javax.annotation.Nonnull + private String mime; + + 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_SIZE = "size"; + @SerializedName(SERIALIZED_NAME_SIZE) + @javax.annotation.Nonnull + private Long size; + + public ImportDynamicExecutionFileOutputBody() { + } + + public ImportDynamicExecutionFileOutputBody canExtract(@javax.annotation.Nonnull Boolean canExtract) { + this.canExtract = canExtract; + return this; + } + + /** + * Whether the firmware/extraction flow can accept this file. + * @return canExtract + */ + @javax.annotation.Nonnull + public Boolean getCanExtract() { + return canExtract; + } + + public void setCanExtract(@javax.annotation.Nonnull Boolean canExtract) { + this.canExtract = canExtract; + } + + + public ImportDynamicExecutionFileOutputBody canSandbox(@javax.annotation.Nonnull Boolean canSandbox) { + this.canSandbox = canSandbox; + return this; + } + + /** + * Whether the file can be extracted and run in the Windows sandbox. + * @return canSandbox + */ + @javax.annotation.Nonnull + public Boolean getCanSandbox() { + return canSandbox; + } + + public void setCanSandbox(@javax.annotation.Nonnull Boolean canSandbox) { + this.canSandbox = canSandbox; + } + + + public ImportDynamicExecutionFileOutputBody isArchive(@javax.annotation.Nonnull Boolean isArchive) { + this.isArchive = isArchive; + return this; + } + + /** + * Whether the detected format is a container/compression archive. + * @return isArchive + */ + @javax.annotation.Nonnull + public Boolean getIsArchive() { + return isArchive; + } + + public void setIsArchive(@javax.annotation.Nonnull Boolean isArchive) { + this.isArchive = isArchive; + } + + + public ImportDynamicExecutionFileOutputBody mime(@javax.annotation.Nonnull String mime) { + this.mime = mime; + return this; + } + + /** + * The MIME type detected from the file's contents. + * @return mime + */ + @javax.annotation.Nonnull + public String getMime() { + return mime; + } + + public void setMime(@javax.annotation.Nonnull String mime) { + this.mime = mime; + } + + + public ImportDynamicExecutionFileOutputBody sha256Hash(@javax.annotation.Nonnull String sha256Hash) { + this.sha256Hash = sha256Hash; + return this; + } + + /** + * SHA-256 hash the file is stored under; the storage key for every subsequent reference to it. + * @return sha256Hash + */ + @javax.annotation.Nonnull + public String getSha256Hash() { + return sha256Hash; + } + + public void setSha256Hash(@javax.annotation.Nonnull String sha256Hash) { + this.sha256Hash = sha256Hash; + } + + + public ImportDynamicExecutionFileOutputBody size(@javax.annotation.Nonnull Long size) { + this.size = size; + return this; + } + + /** + * Size of the file in bytes. + * @return size + */ + @javax.annotation.Nonnull + public Long getSize() { + return size; + } + + public void setSize(@javax.annotation.Nonnull Long size) { + this.size = size; + } + + /** + * 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 ImportDynamicExecutionFileOutputBody instance itself + */ + public ImportDynamicExecutionFileOutputBody 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; + } + ImportDynamicExecutionFileOutputBody importDynamicExecutionFileOutputBody = (ImportDynamicExecutionFileOutputBody) o; + return Objects.equals(this.canExtract, importDynamicExecutionFileOutputBody.canExtract) && + Objects.equals(this.canSandbox, importDynamicExecutionFileOutputBody.canSandbox) && + Objects.equals(this.isArchive, importDynamicExecutionFileOutputBody.isArchive) && + Objects.equals(this.mime, importDynamicExecutionFileOutputBody.mime) && + Objects.equals(this.sha256Hash, importDynamicExecutionFileOutputBody.sha256Hash) && + Objects.equals(this.size, importDynamicExecutionFileOutputBody.size)&& + Objects.equals(this.additionalProperties, importDynamicExecutionFileOutputBody.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(canExtract, canSandbox, isArchive, mime, sha256Hash, size, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ImportDynamicExecutionFileOutputBody {\n"); + sb.append(" canExtract: ").append(toIndentedString(canExtract)).append("\n"); + sb.append(" canSandbox: ").append(toIndentedString(canSandbox)).append("\n"); + sb.append(" isArchive: ").append(toIndentedString(isArchive)).append("\n"); + sb.append(" mime: ").append(toIndentedString(mime)).append("\n"); + sb.append(" sha256Hash: ").append(toIndentedString(sha256Hash)).append("\n"); + sb.append(" size: ").append(toIndentedString(size)).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) { + return o == null ? "null" : 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("can_extract", "can_sandbox", "is_archive", "mime", "sha_256_hash", "size")); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(Arrays.asList("can_extract", "can_sandbox", "is_archive", "mime", "sha_256_hash", "size")); + } + + /** + * 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 ImportDynamicExecutionFileOutputBody + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ImportDynamicExecutionFileOutputBody.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field(s) %s in ImportDynamicExecutionFileOutputBody is not found in the empty JSON string", ImportDynamicExecutionFileOutputBody.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : ImportDynamicExecutionFileOutputBody.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("mime").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `mime` to be a primitive type in the JSON string but got `%s`", jsonObj.get("mime").toString())); + } + if (!jsonObj.get("sha_256_hash").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(java.util.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 (!ImportDynamicExecutionFileOutputBody.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ImportDynamicExecutionFileOutputBody' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ImportDynamicExecutionFileOutputBody.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, ImportDynamicExecutionFileOutputBody 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 ImportDynamicExecutionFileOutputBody read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + ImportDynamicExecutionFileOutputBody 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(java.util.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 ImportDynamicExecutionFileOutputBody given an JSON string + * + * @param jsonString JSON string + * @return An instance of ImportDynamicExecutionFileOutputBody + * @throws IOException if the JSON string is invalid with respect to ImportDynamicExecutionFileOutputBody + */ + public static ImportDynamicExecutionFileOutputBody fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ImportDynamicExecutionFileOutputBody.class); + } + + /** + * Convert an instance of ImportDynamicExecutionFileOutputBody to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/ai/reveng/model/LookupAnalysisByBinaryIDOutputBody.java b/src/main/java/ai/reveng/model/LookupAnalysisByBinaryIDOutputBody.java new file mode 100644 index 0000000..cc96858 --- /dev/null +++ b/src/main/java/ai/reveng/model/LookupAnalysisByBinaryIDOutputBody.java @@ -0,0 +1,286 @@ +/* + * 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 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 ai.reveng.invoker.JSON; + +/** + * LookupAnalysisByBinaryIDOutputBody + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class LookupAnalysisByBinaryIDOutputBody { + public static final String SERIALIZED_NAME_ANALYSIS_ID = "analysis_id"; + @SerializedName(SERIALIZED_NAME_ANALYSIS_ID) + @javax.annotation.Nonnull + private Long analysisId; + + public LookupAnalysisByBinaryIDOutputBody() { + } + + public LookupAnalysisByBinaryIDOutputBody analysisId(@javax.annotation.Nonnull Long analysisId) { + this.analysisId = analysisId; + return this; + } + + /** + * Most recent analysis for this binary that the caller may see + * @return analysisId + */ + @javax.annotation.Nonnull + public Long getAnalysisId() { + return analysisId; + } + + public void setAnalysisId(@javax.annotation.Nonnull Long analysisId) { + this.analysisId = analysisId; + } + + /** + * 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 LookupAnalysisByBinaryIDOutputBody instance itself + */ + public LookupAnalysisByBinaryIDOutputBody 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; + } + LookupAnalysisByBinaryIDOutputBody lookupAnalysisByBinaryIDOutputBody = (LookupAnalysisByBinaryIDOutputBody) o; + return Objects.equals(this.analysisId, lookupAnalysisByBinaryIDOutputBody.analysisId)&& + Objects.equals(this.additionalProperties, lookupAnalysisByBinaryIDOutputBody.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(analysisId, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class LookupAnalysisByBinaryIDOutputBody {\n"); + sb.append(" analysisId: ").append(toIndentedString(analysisId)).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) { + return o == null ? "null" : o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(Arrays.asList("analysis_id")); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(Arrays.asList("analysis_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 LookupAnalysisByBinaryIDOutputBody + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!LookupAnalysisByBinaryIDOutputBody.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field(s) %s in LookupAnalysisByBinaryIDOutputBody is not found in the empty JSON string", LookupAnalysisByBinaryIDOutputBody.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : LookupAnalysisByBinaryIDOutputBody.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!LookupAnalysisByBinaryIDOutputBody.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'LookupAnalysisByBinaryIDOutputBody' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(LookupAnalysisByBinaryIDOutputBody.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, LookupAnalysisByBinaryIDOutputBody 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 LookupAnalysisByBinaryIDOutputBody read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + LookupAnalysisByBinaryIDOutputBody 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(java.util.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 LookupAnalysisByBinaryIDOutputBody given an JSON string + * + * @param jsonString JSON string + * @return An instance of LookupAnalysisByBinaryIDOutputBody + * @throws IOException if the JSON string is invalid with respect to LookupAnalysisByBinaryIDOutputBody + */ + public static LookupAnalysisByBinaryIDOutputBody fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, LookupAnalysisByBinaryIDOutputBody.class); + } + + /** + * Convert an instance of LookupAnalysisByBinaryIDOutputBody to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/ai/reveng/model/OperationBinaryExportMetadataBinaryExportResult.java b/src/main/java/ai/reveng/model/OperationBinaryExportMetadataBinaryExportResult.java new file mode 100644 index 0000000..7411132 --- /dev/null +++ b/src/main/java/ai/reveng/model/OperationBinaryExportMetadataBinaryExportResult.java @@ -0,0 +1,396 @@ +/* + * 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 ai.reveng.model.BinaryExportMetadata; +import ai.reveng.model.BinaryExportResult; +import ai.reveng.model.Status; +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 ai.reveng.invoker.JSON; + +/** + * OperationBinaryExportMetadataBinaryExportResult + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class OperationBinaryExportMetadataBinaryExportResult { + public static final String SERIALIZED_NAME_DONE = "done"; + @SerializedName(SERIALIZED_NAME_DONE) + @javax.annotation.Nonnull + private Boolean done; + + public static final String SERIALIZED_NAME_ERROR = "error"; + @SerializedName(SERIALIZED_NAME_ERROR) + @javax.annotation.Nullable + private Status error; + + public static final String SERIALIZED_NAME_METADATA = "metadata"; + @SerializedName(SERIALIZED_NAME_METADATA) + @javax.annotation.Nullable + private BinaryExportMetadata metadata; + + public static final String SERIALIZED_NAME_NAME = "name"; + @SerializedName(SERIALIZED_NAME_NAME) + @javax.annotation.Nonnull + private String name; + + public static final String SERIALIZED_NAME_RESPONSE = "response"; + @SerializedName(SERIALIZED_NAME_RESPONSE) + @javax.annotation.Nullable + private BinaryExportResult response; + + public OperationBinaryExportMetadataBinaryExportResult() { + } + + public OperationBinaryExportMetadataBinaryExportResult done(@javax.annotation.Nonnull Boolean done) { + this.done = done; + return this; + } + + /** + * Whether the operation has reached a terminal state. + * @return done + */ + @javax.annotation.Nonnull + public Boolean getDone() { + return done; + } + + public void setDone(@javax.annotation.Nonnull Boolean done) { + this.done = done; + } + + + public OperationBinaryExportMetadataBinaryExportResult error(@javax.annotation.Nullable Status error) { + this.error = error; + return this; + } + + /** + * Failure detail, populated only when done is true and the operation failed. + * @return error + */ + @javax.annotation.Nullable + public Status getError() { + return error; + } + + public void setError(@javax.annotation.Nullable Status error) { + this.error = error; + } + + + public OperationBinaryExportMetadataBinaryExportResult metadata(@javax.annotation.Nullable BinaryExportMetadata metadata) { + this.metadata = metadata; + return this; + } + + /** + * In-flight information and details. + * @return metadata + */ + @javax.annotation.Nullable + public BinaryExportMetadata getMetadata() { + return metadata; + } + + public void setMetadata(@javax.annotation.Nullable BinaryExportMetadata metadata) { + this.metadata = metadata; + } + + + public OperationBinaryExportMetadataBinaryExportResult name(@javax.annotation.Nonnull String name) { + this.name = name; + return this; + } + + /** + * API resource name. + * @return name + */ + @javax.annotation.Nonnull + public String getName() { + return name; + } + + public void setName(@javax.annotation.Nonnull String name) { + this.name = name; + } + + + public OperationBinaryExportMetadataBinaryExportResult response(@javax.annotation.Nullable BinaryExportResult response) { + this.response = response; + return this; + } + + /** + * Result, set only when done is true and the operation succeeded. + * @return response + */ + @javax.annotation.Nullable + public BinaryExportResult getResponse() { + return response; + } + + public void setResponse(@javax.annotation.Nullable BinaryExportResult response) { + this.response = response; + } + + /** + * 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 OperationBinaryExportMetadataBinaryExportResult instance itself + */ + public OperationBinaryExportMetadataBinaryExportResult 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; + } + OperationBinaryExportMetadataBinaryExportResult operationBinaryExportMetadataBinaryExportResult = (OperationBinaryExportMetadataBinaryExportResult) o; + return Objects.equals(this.done, operationBinaryExportMetadataBinaryExportResult.done) && + Objects.equals(this.error, operationBinaryExportMetadataBinaryExportResult.error) && + Objects.equals(this.metadata, operationBinaryExportMetadataBinaryExportResult.metadata) && + Objects.equals(this.name, operationBinaryExportMetadataBinaryExportResult.name) && + Objects.equals(this.response, operationBinaryExportMetadataBinaryExportResult.response)&& + Objects.equals(this.additionalProperties, operationBinaryExportMetadataBinaryExportResult.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(done, error, metadata, name, response, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class OperationBinaryExportMetadataBinaryExportResult {\n"); + sb.append(" done: ").append(toIndentedString(done)).append("\n"); + sb.append(" error: ").append(toIndentedString(error)).append("\n"); + sb.append(" metadata: ").append(toIndentedString(metadata)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" response: ").append(toIndentedString(response)).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) { + return o == null ? "null" : 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("done", "error", "metadata", "name", "response")); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(Arrays.asList("done", "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 OperationBinaryExportMetadataBinaryExportResult + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!OperationBinaryExportMetadataBinaryExportResult.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field(s) %s in OperationBinaryExportMetadataBinaryExportResult is not found in the empty JSON string", OperationBinaryExportMetadataBinaryExportResult.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : OperationBinaryExportMetadataBinaryExportResult.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format(java.util.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(java.util.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 (!OperationBinaryExportMetadataBinaryExportResult.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'OperationBinaryExportMetadataBinaryExportResult' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(OperationBinaryExportMetadataBinaryExportResult.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, OperationBinaryExportMetadataBinaryExportResult 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 OperationBinaryExportMetadataBinaryExportResult read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + OperationBinaryExportMetadataBinaryExportResult 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(java.util.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 OperationBinaryExportMetadataBinaryExportResult given an JSON string + * + * @param jsonString JSON string + * @return An instance of OperationBinaryExportMetadataBinaryExportResult + * @throws IOException if the JSON string is invalid with respect to OperationBinaryExportMetadataBinaryExportResult + */ + public static OperationBinaryExportMetadataBinaryExportResult fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, OperationBinaryExportMetadataBinaryExportResult.class); + } + + /** + * Convert an instance of OperationBinaryExportMetadataBinaryExportResult to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/ai/reveng/model/RequestedConfigBody.java b/src/main/java/ai/reveng/model/RequestedConfigBody.java new file mode 100644 index 0000000..10cda51 --- /dev/null +++ b/src/main/java/ai/reveng/model/RequestedConfigBody.java @@ -0,0 +1,390 @@ +/* + * 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 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 ai.reveng.invoker.JSON; + +/** + * RequestedConfigBody + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class RequestedConfigBody { + public static final String SERIALIZED_NAME_CAPABILITIES = "capabilities"; + @SerializedName(SERIALIZED_NAME_CAPABILITIES) + @javax.annotation.Nonnull + private Boolean capabilities; + + public static final String SERIALIZED_NAME_FUNCTIONS = "functions"; + @SerializedName(SERIALIZED_NAME_FUNCTIONS) + @javax.annotation.Nonnull + private Boolean functions; + + public static final String SERIALIZED_NAME_SANDBOX = "sandbox"; + @SerializedName(SERIALIZED_NAME_SANDBOX) + @javax.annotation.Nonnull + private Boolean sandbox; + + public static final String SERIALIZED_NAME_SCRAPE = "scrape"; + @SerializedName(SERIALIZED_NAME_SCRAPE) + @javax.annotation.Nonnull + private Boolean scrape; + + public static final String SERIALIZED_NAME_TRIAGE = "triage"; + @SerializedName(SERIALIZED_NAME_TRIAGE) + @javax.annotation.Nonnull + private Boolean triage; + + public RequestedConfigBody() { + } + + public RequestedConfigBody capabilities(@javax.annotation.Nonnull Boolean capabilities) { + this.capabilities = capabilities; + return this; + } + + /** + * Whether the capabilities agent was requested + * @return capabilities + */ + @javax.annotation.Nonnull + public Boolean getCapabilities() { + return capabilities; + } + + public void setCapabilities(@javax.annotation.Nonnull Boolean capabilities) { + this.capabilities = capabilities; + } + + + public RequestedConfigBody functions(@javax.annotation.Nonnull Boolean functions) { + this.functions = functions; + return this; + } + + /** + * Whether the functions pipeline was requested + * @return functions + */ + @javax.annotation.Nonnull + public Boolean getFunctions() { + return functions; + } + + public void setFunctions(@javax.annotation.Nonnull Boolean functions) { + this.functions = functions; + } + + + public RequestedConfigBody sandbox(@javax.annotation.Nonnull Boolean sandbox) { + this.sandbox = sandbox; + return this; + } + + /** + * Whether dynamic execution (sandbox) was requested + * @return sandbox + */ + @javax.annotation.Nonnull + public Boolean getSandbox() { + return sandbox; + } + + public void setSandbox(@javax.annotation.Nonnull Boolean sandbox) { + this.sandbox = sandbox; + } + + + public RequestedConfigBody scrape(@javax.annotation.Nonnull Boolean scrape) { + this.scrape = scrape; + return this; + } + + /** + * Whether external-source scraping was requested + * @return scrape + */ + @javax.annotation.Nonnull + public Boolean getScrape() { + return scrape; + } + + public void setScrape(@javax.annotation.Nonnull Boolean scrape) { + this.scrape = scrape; + } + + + public RequestedConfigBody triage(@javax.annotation.Nonnull Boolean triage) { + this.triage = triage; + return this; + } + + /** + * Whether the triage agent was requested + * @return triage + */ + @javax.annotation.Nonnull + public Boolean getTriage() { + return triage; + } + + public void setTriage(@javax.annotation.Nonnull Boolean triage) { + this.triage = triage; + } + + /** + * 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 RequestedConfigBody instance itself + */ + public RequestedConfigBody 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; + } + RequestedConfigBody requestedConfigBody = (RequestedConfigBody) o; + return Objects.equals(this.capabilities, requestedConfigBody.capabilities) && + Objects.equals(this.functions, requestedConfigBody.functions) && + Objects.equals(this.sandbox, requestedConfigBody.sandbox) && + Objects.equals(this.scrape, requestedConfigBody.scrape) && + Objects.equals(this.triage, requestedConfigBody.triage)&& + Objects.equals(this.additionalProperties, requestedConfigBody.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(capabilities, functions, sandbox, scrape, triage, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class RequestedConfigBody {\n"); + sb.append(" capabilities: ").append(toIndentedString(capabilities)).append("\n"); + sb.append(" functions: ").append(toIndentedString(functions)).append("\n"); + sb.append(" sandbox: ").append(toIndentedString(sandbox)).append("\n"); + sb.append(" scrape: ").append(toIndentedString(scrape)).append("\n"); + sb.append(" triage: ").append(toIndentedString(triage)).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) { + return o == null ? "null" : 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("capabilities", "functions", "sandbox", "scrape", "triage")); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(Arrays.asList("capabilities", "functions", "sandbox", "scrape", "triage")); + } + + /** + * 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 RequestedConfigBody + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!RequestedConfigBody.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field(s) %s in RequestedConfigBody is not found in the empty JSON string", RequestedConfigBody.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : RequestedConfigBody.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!RequestedConfigBody.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'RequestedConfigBody' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(RequestedConfigBody.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, RequestedConfigBody 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 RequestedConfigBody read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + RequestedConfigBody 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(java.util.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 RequestedConfigBody given an JSON string + * + * @param jsonString JSON string + * @return An instance of RequestedConfigBody + * @throws IOException if the JSON string is invalid with respect to RequestedConfigBody + */ + public static RequestedConfigBody fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, RequestedConfigBody.class); + } + + /** + * Convert an instance of RequestedConfigBody to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/ai/reveng/model/SuspiciousString.java b/src/main/java/ai/reveng/model/StringMatch.java similarity index 84% rename from src/main/java/ai/reveng/model/SuspiciousString.java rename to src/main/java/ai/reveng/model/StringMatch.java index 944af88..dc5f701 100644 --- a/src/main/java/ai/reveng/model/SuspiciousString.java +++ b/src/main/java/ai/reveng/model/StringMatch.java @@ -47,10 +47,10 @@ import ai.reveng.invoker.JSON; /** - * SuspiciousString + * StringMatch */ @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class SuspiciousString { +public class StringMatch { public static final String SERIALIZED_NAME_VALUE = "value"; @SerializedName(SERIALIZED_NAME_VALUE) @javax.annotation.Nonnull @@ -61,10 +61,10 @@ public class SuspiciousString { @javax.annotation.Nullable private Subject subject; - public SuspiciousString() { + public StringMatch() { } - public SuspiciousString value(@javax.annotation.Nonnull String value) { + public StringMatch value(@javax.annotation.Nonnull String value) { this.value = value; return this; } @@ -83,7 +83,7 @@ public void setValue(@javax.annotation.Nonnull String value) { } - public SuspiciousString subject(@javax.annotation.Nullable Subject subject) { + public StringMatch subject(@javax.annotation.Nullable Subject subject) { this.subject = subject; return this; } @@ -114,9 +114,9 @@ public void setSubject(@javax.annotation.Nullable Subject subject) { * * @param key name of the property * @param value value of the property - * @return the SuspiciousString instance itself + * @return the StringMatch instance itself */ - public SuspiciousString putAdditionalProperty(String key, Object value) { + public StringMatch putAdditionalProperty(String key, Object value) { if (this.additionalProperties == null) { this.additionalProperties = new HashMap(); } @@ -155,10 +155,10 @@ public boolean equals(Object o) { if (o == null || getClass() != o.getClass()) { return false; } - SuspiciousString suspiciousString = (SuspiciousString) o; - return Objects.equals(this.value, suspiciousString.value) && - Objects.equals(this.subject, suspiciousString.subject)&& - Objects.equals(this.additionalProperties, suspiciousString.additionalProperties); + StringMatch stringMatch = (StringMatch) o; + return Objects.equals(this.value, stringMatch.value) && + Objects.equals(this.subject, stringMatch.subject)&& + Objects.equals(this.additionalProperties, stringMatch.additionalProperties); } private static boolean equalsNullable(JsonNullable a, JsonNullable b) { @@ -180,7 +180,7 @@ private static int hashCodeNullable(JsonNullable a) { @Override public String toString() { StringBuilder sb = new StringBuilder(); - sb.append("class SuspiciousString {\n"); + sb.append("class StringMatch {\n"); sb.append(" value: ").append(toIndentedString(value)).append("\n"); sb.append(" subject: ").append(toIndentedString(subject)).append("\n"); sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); @@ -212,17 +212,17 @@ private String toIndentedString(Object o) { * 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 SuspiciousString + * @throws IOException if the JSON Element is invalid with respect to StringMatch */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (jsonElement == null) { - if (!SuspiciousString.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field(s) %s in SuspiciousString is not found in the empty JSON string", SuspiciousString.openapiRequiredFields.toString())); + if (!StringMatch.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field(s) %s in StringMatch is not found in the empty JSON string", StringMatch.openapiRequiredFields.toString())); } } // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : SuspiciousString.openapiRequiredFields) { + for (String requiredField : StringMatch.openapiRequiredFields) { if (jsonElement.getAsJsonObject().get(requiredField) == null) { throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); } @@ -241,16 +241,16 @@ public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @SuppressWarnings("unchecked") @Override public TypeAdapter create(Gson gson, TypeToken type) { - if (!SuspiciousString.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'SuspiciousString' and its subtypes + if (!StringMatch.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'StringMatch' and its subtypes } final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(SuspiciousString.class)); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(StringMatch.class)); - return (TypeAdapter) new TypeAdapter() { + return (TypeAdapter) new TypeAdapter() { @Override - public void write(JsonWriter out, SuspiciousString value) throws IOException { + public void write(JsonWriter out, StringMatch value) throws IOException { JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); obj.remove("additionalProperties"); // serialize additional properties @@ -278,12 +278,12 @@ else if (entry.getValue() instanceof Character) } @Override - public SuspiciousString read(JsonReader in) throws IOException { + public StringMatch read(JsonReader in) throws IOException { JsonElement jsonElement = elementAdapter.read(in); validateJsonElement(jsonElement); JsonObject jsonObj = jsonElement.getAsJsonObject(); // store additional fields in the deserialized instance - SuspiciousString instance = thisAdapter.fromJsonTree(jsonObj); + StringMatch instance = thisAdapter.fromJsonTree(jsonObj); for (Map.Entry entry : jsonObj.entrySet()) { if (!openapiFields.contains(entry.getKey())) { if (entry.getValue().isJsonPrimitive()) { // primitive type @@ -310,18 +310,18 @@ else if (entry.getValue().getAsJsonPrimitive().isBoolean()) } /** - * Create an instance of SuspiciousString given an JSON string + * Create an instance of StringMatch given an JSON string * * @param jsonString JSON string - * @return An instance of SuspiciousString - * @throws IOException if the JSON string is invalid with respect to SuspiciousString + * @return An instance of StringMatch + * @throws IOException if the JSON string is invalid with respect to StringMatch */ - public static SuspiciousString fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, SuspiciousString.class); + public static StringMatch fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, StringMatch.class); } /** - * Convert an instance of SuspiciousString to an JSON string + * Convert an instance of StringMatch to an JSON string * * @return JSON string */ diff --git a/src/main/java/ai/reveng/model/SuspiciousStringEvidence.java b/src/main/java/ai/reveng/model/StringMatchEvidence.java similarity index 84% rename from src/main/java/ai/reveng/model/SuspiciousStringEvidence.java rename to src/main/java/ai/reveng/model/StringMatchEvidence.java index b4ebc62..ea7ee39 100644 --- a/src/main/java/ai/reveng/model/SuspiciousStringEvidence.java +++ b/src/main/java/ai/reveng/model/StringMatchEvidence.java @@ -14,7 +14,7 @@ import java.util.Objects; import ai.reveng.model.EvidenceEffect; -import ai.reveng.model.SuspiciousString; +import ai.reveng.model.StringMatch; import com.google.gson.TypeAdapter; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; @@ -49,16 +49,16 @@ import ai.reveng.invoker.JSON; /** - * Suspicious strings without demonstrated semantic use. + * String matches without demonstrated semantic use. */ @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class SuspiciousStringEvidence { +public class StringMatchEvidence { /** * Gets or Sets evidenceKind */ @JsonAdapter(EvidenceKindEnum.Adapter.class) public enum EvidenceKindEnum { - SUSPICIOUS_STRING("suspicious_string"), + STRING_MATCH("string_match"), UNKNOWN_DEFAULT_OPEN_API("unknown_default_open_api"); @@ -108,7 +108,7 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti public static final String SERIALIZED_NAME_EVIDENCE_KIND = "evidence_kind"; @SerializedName(SERIALIZED_NAME_EVIDENCE_KIND) @javax.annotation.Nullable - private EvidenceKindEnum evidenceKind = EvidenceKindEnum.SUSPICIOUS_STRING; + private EvidenceKindEnum evidenceKind = EvidenceKindEnum.STRING_MATCH; /** * Gets or Sets kind @@ -232,12 +232,12 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti public static final String SERIALIZED_NAME_STRINGS = "strings"; @SerializedName(SERIALIZED_NAME_STRINGS) @javax.annotation.Nonnull - private List strings = new ArrayList<>(); + private List strings = new ArrayList<>(); - public SuspiciousStringEvidence() { + public StringMatchEvidence() { } - public SuspiciousStringEvidence evidenceKind(@javax.annotation.Nullable EvidenceKindEnum evidenceKind) { + public StringMatchEvidence evidenceKind(@javax.annotation.Nullable EvidenceKindEnum evidenceKind) { this.evidenceKind = evidenceKind; return this; } @@ -256,7 +256,7 @@ public void setEvidenceKind(@javax.annotation.Nullable EvidenceKindEnum evidence } - public SuspiciousStringEvidence kind(@javax.annotation.Nullable KindEnum kind) { + public StringMatchEvidence kind(@javax.annotation.Nullable KindEnum kind) { this.kind = kind; return this; } @@ -275,7 +275,7 @@ public void setKind(@javax.annotation.Nullable KindEnum kind) { } - public SuspiciousStringEvidence effect(@javax.annotation.Nonnull EvidenceEffect effect) { + public StringMatchEvidence effect(@javax.annotation.Nonnull EvidenceEffect effect) { this.effect = effect; return this; } @@ -294,7 +294,7 @@ public void setEffect(@javax.annotation.Nonnull EvidenceEffect effect) { } - public SuspiciousStringEvidence strength(@javax.annotation.Nullable StrengthEnum strength) { + public StringMatchEvidence strength(@javax.annotation.Nullable StrengthEnum strength) { this.strength = strength; return this; } @@ -313,12 +313,12 @@ public void setStrength(@javax.annotation.Nullable StrengthEnum strength) { } - public SuspiciousStringEvidence strings(@javax.annotation.Nonnull List strings) { + public StringMatchEvidence strings(@javax.annotation.Nonnull List strings) { this.strings = strings; return this; } - public SuspiciousStringEvidence addStringsItem(SuspiciousString stringsItem) { + public StringMatchEvidence addStringsItem(StringMatch stringsItem) { if (this.strings == null) { this.strings = new ArrayList<>(); } @@ -331,11 +331,11 @@ public SuspiciousStringEvidence addStringsItem(SuspiciousString stringsItem) { * @return strings */ @javax.annotation.Nonnull - public List getStrings() { + public List getStrings() { return strings; } - public void setStrings(@javax.annotation.Nonnull List strings) { + public void setStrings(@javax.annotation.Nonnull List strings) { this.strings = strings; } @@ -352,9 +352,9 @@ public void setStrings(@javax.annotation.Nonnull List strings) * * @param key name of the property * @param value value of the property - * @return the SuspiciousStringEvidence instance itself + * @return the StringMatchEvidence instance itself */ - public SuspiciousStringEvidence putAdditionalProperty(String key, Object value) { + public StringMatchEvidence putAdditionalProperty(String key, Object value) { if (this.additionalProperties == null) { this.additionalProperties = new HashMap(); } @@ -393,13 +393,13 @@ public boolean equals(Object o) { if (o == null || getClass() != o.getClass()) { return false; } - SuspiciousStringEvidence suspiciousStringEvidence = (SuspiciousStringEvidence) o; - return Objects.equals(this.evidenceKind, suspiciousStringEvidence.evidenceKind) && - Objects.equals(this.kind, suspiciousStringEvidence.kind) && - Objects.equals(this.effect, suspiciousStringEvidence.effect) && - Objects.equals(this.strength, suspiciousStringEvidence.strength) && - Objects.equals(this.strings, suspiciousStringEvidence.strings)&& - Objects.equals(this.additionalProperties, suspiciousStringEvidence.additionalProperties); + StringMatchEvidence stringMatchEvidence = (StringMatchEvidence) o; + return Objects.equals(this.evidenceKind, stringMatchEvidence.evidenceKind) && + Objects.equals(this.kind, stringMatchEvidence.kind) && + Objects.equals(this.effect, stringMatchEvidence.effect) && + Objects.equals(this.strength, stringMatchEvidence.strength) && + Objects.equals(this.strings, stringMatchEvidence.strings)&& + Objects.equals(this.additionalProperties, stringMatchEvidence.additionalProperties); } @Override @@ -410,7 +410,7 @@ public int hashCode() { @Override public String toString() { StringBuilder sb = new StringBuilder(); - sb.append("class SuspiciousStringEvidence {\n"); + sb.append("class StringMatchEvidence {\n"); sb.append(" evidenceKind: ").append(toIndentedString(evidenceKind)).append("\n"); sb.append(" kind: ").append(toIndentedString(kind)).append("\n"); sb.append(" effect: ").append(toIndentedString(effect)).append("\n"); @@ -445,17 +445,17 @@ private String toIndentedString(Object o) { * 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 SuspiciousStringEvidence + * @throws IOException if the JSON Element is invalid with respect to StringMatchEvidence */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (jsonElement == null) { - if (!SuspiciousStringEvidence.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field(s) %s in SuspiciousStringEvidence is not found in the empty JSON string", SuspiciousStringEvidence.openapiRequiredFields.toString())); + if (!StringMatchEvidence.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field(s) %s in StringMatchEvidence is not found in the empty JSON string", StringMatchEvidence.openapiRequiredFields.toString())); } } // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : SuspiciousStringEvidence.openapiRequiredFields) { + for (String requiredField : StringMatchEvidence.openapiRequiredFields) { if (jsonElement.getAsJsonObject().get(requiredField) == null) { throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); } @@ -491,7 +491,7 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti JsonArray jsonArraystrings = jsonObj.getAsJsonArray("strings"); // validate the required field `strings` (array) for (int i = 0; i < jsonArraystrings.size(); i++) { - SuspiciousString.validateJsonElement(jsonArraystrings.get(i)); + StringMatch.validateJsonElement(jsonArraystrings.get(i)); } } } @@ -500,16 +500,16 @@ public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @SuppressWarnings("unchecked") @Override public TypeAdapter create(Gson gson, TypeToken type) { - if (!SuspiciousStringEvidence.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'SuspiciousStringEvidence' and its subtypes + if (!StringMatchEvidence.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'StringMatchEvidence' and its subtypes } final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(SuspiciousStringEvidence.class)); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(StringMatchEvidence.class)); - return (TypeAdapter) new TypeAdapter() { + return (TypeAdapter) new TypeAdapter() { @Override - public void write(JsonWriter out, SuspiciousStringEvidence value) throws IOException { + public void write(JsonWriter out, StringMatchEvidence value) throws IOException { JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); obj.remove("additionalProperties"); // serialize additional properties @@ -537,12 +537,12 @@ else if (entry.getValue() instanceof Character) } @Override - public SuspiciousStringEvidence read(JsonReader in) throws IOException { + public StringMatchEvidence read(JsonReader in) throws IOException { JsonElement jsonElement = elementAdapter.read(in); validateJsonElement(jsonElement); JsonObject jsonObj = jsonElement.getAsJsonObject(); // store additional fields in the deserialized instance - SuspiciousStringEvidence instance = thisAdapter.fromJsonTree(jsonObj); + StringMatchEvidence instance = thisAdapter.fromJsonTree(jsonObj); for (Map.Entry entry : jsonObj.entrySet()) { if (!openapiFields.contains(entry.getKey())) { if (entry.getValue().isJsonPrimitive()) { // primitive type @@ -569,18 +569,18 @@ else if (entry.getValue().getAsJsonPrimitive().isBoolean()) } /** - * Create an instance of SuspiciousStringEvidence given an JSON string + * Create an instance of StringMatchEvidence given an JSON string * * @param jsonString JSON string - * @return An instance of SuspiciousStringEvidence - * @throws IOException if the JSON string is invalid with respect to SuspiciousStringEvidence + * @return An instance of StringMatchEvidence + * @throws IOException if the JSON string is invalid with respect to StringMatchEvidence */ - public static SuspiciousStringEvidence fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, SuspiciousStringEvidence.class); + public static StringMatchEvidence fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, StringMatchEvidence.class); } /** - * Convert an instance of SuspiciousStringEvidence to an JSON string + * Convert an instance of StringMatchEvidence to an JSON string * * @return JSON string */ diff --git a/src/main/java/ai/reveng/model/UpdateAnalysisInputBody.java b/src/main/java/ai/reveng/model/UpdateAnalysisInputBody.java new file mode 100644 index 0000000..d202cf4 --- /dev/null +++ b/src/main/java/ai/reveng/model/UpdateAnalysisInputBody.java @@ -0,0 +1,371 @@ +/* + * 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 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 ai.reveng.invoker.JSON; + +/** + * UpdateAnalysisInputBody + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class UpdateAnalysisInputBody { + /** + * The analysis' visibility. Changing to a non-PUBLIC scope requires a subscription tier that supports private analyses + */ + @JsonAdapter(AnalysisScopeEnum.Adapter.class) + public enum AnalysisScopeEnum { + PUBLIC("PUBLIC"), + + PRIVATE("PRIVATE"), + + 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.Nullable + private AnalysisScopeEnum analysisScope; + + public static final String SERIALIZED_NAME_BINARY_NAME = "binary_name"; + @SerializedName(SERIALIZED_NAME_BINARY_NAME) + @javax.annotation.Nullable + private String binaryName; + + public UpdateAnalysisInputBody() { + } + + public UpdateAnalysisInputBody analysisScope(@javax.annotation.Nullable AnalysisScopeEnum analysisScope) { + this.analysisScope = analysisScope; + return this; + } + + /** + * The analysis' visibility. Changing to a non-PUBLIC scope requires a subscription tier that supports private analyses + * @return analysisScope + */ + @javax.annotation.Nullable + public AnalysisScopeEnum getAnalysisScope() { + return analysisScope; + } + + public void setAnalysisScope(@javax.annotation.Nullable AnalysisScopeEnum analysisScope) { + this.analysisScope = analysisScope; + } + + + public UpdateAnalysisInputBody binaryName(@javax.annotation.Nullable String binaryName) { + this.binaryName = binaryName; + return this; + } + + /** + * Renames the analysis' binary. Empty or whitespace-only is rejected + * @return binaryName + */ + @javax.annotation.Nullable + public String getBinaryName() { + return binaryName; + } + + public void setBinaryName(@javax.annotation.Nullable String binaryName) { + this.binaryName = binaryName; + } + + /** + * 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 UpdateAnalysisInputBody instance itself + */ + public UpdateAnalysisInputBody 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; + } + UpdateAnalysisInputBody updateAnalysisInputBody = (UpdateAnalysisInputBody) o; + return Objects.equals(this.analysisScope, updateAnalysisInputBody.analysisScope) && + Objects.equals(this.binaryName, updateAnalysisInputBody.binaryName)&& + Objects.equals(this.additionalProperties, updateAnalysisInputBody.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(analysisScope, binaryName, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UpdateAnalysisInputBody {\n"); + sb.append(" analysisScope: ").append(toIndentedString(analysisScope)).append("\n"); + sb.append(" binaryName: ").append(toIndentedString(binaryName)).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) { + return o == null ? "null" : 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", "binary_name")); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(0); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to UpdateAnalysisInputBody + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!UpdateAnalysisInputBody.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field(s) %s in UpdateAnalysisInputBody is not found in the empty JSON string", UpdateAnalysisInputBody.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("analysis_scope") != null && !jsonObj.get("analysis_scope").isJsonNull()) && !jsonObj.get("analysis_scope").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(java.util.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 optional field `analysis_scope` + if (jsonObj.get("analysis_scope") != null && !jsonObj.get("analysis_scope").isJsonNull()) { + AnalysisScopeEnum.validateJsonElement(jsonObj.get("analysis_scope")); + } + if ((jsonObj.get("binary_name") != null && !jsonObj.get("binary_name").isJsonNull()) && !jsonObj.get("binary_name").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `binary_name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("binary_name").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!UpdateAnalysisInputBody.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'UpdateAnalysisInputBody' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(UpdateAnalysisInputBody.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, UpdateAnalysisInputBody 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 UpdateAnalysisInputBody read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + UpdateAnalysisInputBody 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(java.util.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 UpdateAnalysisInputBody given an JSON string + * + * @param jsonString JSON string + * @return An instance of UpdateAnalysisInputBody + * @throws IOException if the JSON string is invalid with respect to UpdateAnalysisInputBody + */ + public static UpdateAnalysisInputBody fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, UpdateAnalysisInputBody.class); + } + + /** + * Convert an instance of UpdateAnalysisInputBody to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} +