diff --git a/.sdk-version b/.sdk-version index 1be1028..848b85e 100644 --- a/.sdk-version +++ b/.sdk-version @@ -1 +1 @@ -v4.72.2 +v4.73.0 diff --git a/README.md b/README.md index f366e99..b3cfd7f 100644 --- a/README.md +++ b/README.md @@ -16,7 +16,7 @@ Add this dependency to your project's POM: ai.reveng sdk - 4.72.2 + 4.73.0 compile ``` @@ -31,7 +31,7 @@ repositories { } dependencies { - implementation "ai.reveng:sdk:4.72.2" + implementation "ai.reveng:sdk:4.73.0" } ``` @@ -100,6 +100,7 @@ Class | Method | HTTP request | Description *AgentApi* | [**v3GetCapabilitiesOperation**](docs/AgentApi.md#v3GetCapabilitiesOperation) | **GET** /v3/operations/capabilities/{analysis_id} | Get a capabilities operation. *AgentApi* | [**v3GetCryptoExplainOperation**](docs/AgentApi.md#v3GetCryptoExplainOperation) | **GET** /v3/operations/crypto-explain/{function_id} | Get a crypto-explain operation. *AgentApi* | [**v3GetCryptoScanOperation**](docs/AgentApi.md#v3GetCryptoScanOperation) | **GET** /v3/operations/crypto-scan/{analysis_id} | Get a crypto-scan operation. +*AgentApi* | [**v3GetCryptographyOperation**](docs/AgentApi.md#v3GetCryptographyOperation) | **GET** /v3/operations/cryptography/{analysis_id} | Get a cryptography operation. *AgentApi* | [**v3GetExecutionExplainOperation**](docs/AgentApi.md#v3GetExecutionExplainOperation) | **GET** /v3/operations/execution-explain/{function_id} | Get an execution-explain operation. *AgentApi* | [**v3GetExecutionScanOperation**](docs/AgentApi.md#v3GetExecutionScanOperation) | **GET** /v3/operations/execution-scan/{analysis_id} | Get an execution-scan operation. *AgentApi* | [**v3GetFilesystemAnalyseOperation**](docs/AgentApi.md#v3GetFilesystemAnalyseOperation) | **GET** /v3/operations/filesystem-analyse/{function_id} | Get a filesystem-analyse operation. @@ -108,15 +109,18 @@ Class | Method | HTTP request | Description *AgentApi* | [**v3GetNetworkingScanOperation**](docs/AgentApi.md#v3GetNetworkingScanOperation) | **GET** /v3/operations/networking-scan/{analysis_id} | Get a networking-scan operation. *AgentApi* | [**v3GetProtocolsOperation**](docs/AgentApi.md#v3GetProtocolsOperation) | **GET** /v3/operations/protocols/{analysis_id} | Get a protocols operation. *AgentApi* | [**v3GetRemediationOperation**](docs/AgentApi.md#v3GetRemediationOperation) | **GET** /v3/operations/remediation/{analysis_id} | Get a remediation operation. +*AgentApi* | [**v3GetRenameUnnamedFunctionsOperation**](docs/AgentApi.md#v3GetRenameUnnamedFunctionsOperation) | **GET** /v3/operations/rename-unnamed-functions/{analysis_id} | Get a rename-unnamed-functions operation. *AgentApi* | [**v3GetRenameUnnamedFunctionsResult**](docs/AgentApi.md#v3GetRenameUnnamedFunctionsResult) | **GET** /v3/analyses/{analysis_id}/agents/rename-unnamed-functions | Get rename-unnamed-functions agent result. *AgentApi* | [**v3GetRenameUnnamedFunctionsStatus**](docs/AgentApi.md#v3GetRenameUnnamedFunctionsStatus) | **GET** /v3/analyses/{analysis_id}/agents/rename-unnamed-functions/status | Get rename-unnamed-functions agent status. *AgentApi* | [**v3GetReportAnalysisOperation**](docs/AgentApi.md#v3GetReportAnalysisOperation) | **GET** /v3/operations/report-analysis/{analysis_id} | Get a report-analysis operation. *AgentApi* | [**v3GetSecretsOperation**](docs/AgentApi.md#v3GetSecretsOperation) | **GET** /v3/operations/secrets/{analysis_id} | Get a secrets operation. *AgentApi* | [**v3GetSecurityScanOperation**](docs/AgentApi.md#v3GetSecurityScanOperation) | **GET** /v3/operations/security-scan/{analysis_id} | Get a security-scan operation. *AgentApi* | [**v3GetTriageOperation**](docs/AgentApi.md#v3GetTriageOperation) | **GET** /v3/operations/triage/{analysis_id} | Get a triage operation. +*AgentApi* | [**v3ListOperationPrerequisites**](docs/AgentApi.md#v3ListOperationPrerequisites) | **GET** /v3/operation-prerequisites | List operation prerequisites. *AgentApi* | [**v3RunCapabilities**](docs/AgentApi.md#v3RunCapabilities) | **POST** /v3/analyses/{analysis_id}/capabilities:run | Run the capabilities agent. *AgentApi* | [**v3RunCryptoExplain**](docs/AgentApi.md#v3RunCryptoExplain) | **POST** /v3/functions/{function_id}/crypto-explain:run | Run the crypto-explain agent. *AgentApi* | [**v3RunCryptoScan**](docs/AgentApi.md#v3RunCryptoScan) | **POST** /v3/analyses/{analysis_id}/crypto-scan:run | Run the crypto-scan agent. +*AgentApi* | [**v3RunCryptography**](docs/AgentApi.md#v3RunCryptography) | **POST** /v3/analyses/{analysis_id}/cryptography:run | Run the cryptography agent. *AgentApi* | [**v3RunExecutionExplain**](docs/AgentApi.md#v3RunExecutionExplain) | **POST** /v3/functions/{function_id}/execution-explain:run | Run the execution-explain agent. *AgentApi* | [**v3RunExecutionScan**](docs/AgentApi.md#v3RunExecutionScan) | **POST** /v3/analyses/{analysis_id}/execution-scan:run | Run the execution-scan agent. *AgentApi* | [**v3RunFilesystemAnalyse**](docs/AgentApi.md#v3RunFilesystemAnalyse) | **POST** /v3/functions/{function_id}/filesystem-analyse:run | Run the filesystem-analyse agent. @@ -167,17 +171,37 @@ Class | Method | HTTP request | Description *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* | [**v3GetAnalysisGlobal**](docs/AnalysesCoreApi.md#v3GetAnalysisGlobal) | **GET** /v3/analyses/{analysis_id}/globals/{vaddr} | Get one global variable. +*AnalysesCoreApi* | [**v3GetAnalysisGlobalHistory**](docs/AnalysesCoreApi.md#v3GetAnalysisGlobalHistory) | **GET** /v3/analyses/{analysis_id}/globals/{vaddr}/history | List a global variable's replaced values. *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* | [**v3GetDynamicExecutionArtifact**](docs/AnalysesCoreApi.md#v3GetDynamicExecutionArtifact) | **GET** /v3/analyses/{analysis_id}/dynamic-execution/artifacts/{sha256} | Download an artifact. +*AnalysesCoreApi* | [**v3GetDynamicExecutionLogsDownload**](docs/AnalysesCoreApi.md#v3GetDynamicExecutionLogsDownload) | **GET** /v3/analyses/{analysis_id}/dynamic-execution/logs/download | Download the execution logs archive. +*AnalysesCoreApi* | [**v3GetDynamicExecutionMemdump**](docs/AnalysesCoreApi.md#v3GetDynamicExecutionMemdump) | **GET** /v3/analyses/{analysis_id}/dynamic-execution/memdumps/{sha256} | Download a memory dump. +*AnalysesCoreApi* | [**v3GetDynamicExecutionOperation**](docs/AnalysesCoreApi.md#v3GetDynamicExecutionOperation) | **GET** /v3/operations/dynamic-execution/{analysis_id} | Get a dynamic execution operation. +*AnalysesCoreApi* | [**v3GetDynamicExecutionPcap**](docs/AnalysesCoreApi.md#v3GetDynamicExecutionPcap) | **GET** /v3/analyses/{analysis_id}/dynamic-execution/pcap | Download the network capture. +*AnalysesCoreApi* | [**v3GetDynamicExecutionReport**](docs/AnalysesCoreApi.md#v3GetDynamicExecutionReport) | **GET** /v3/analyses/{analysis_id}/dynamic-execution/report | Get the dynamic execution report. +*AnalysesCoreApi* | [**v3GetDynamicExecutionScreenshot**](docs/AnalysesCoreApi.md#v3GetDynamicExecutionScreenshot) | **GET** /v3/analyses/{analysis_id}/dynamic-execution/screenshots/{index} | Download a screenshot. +*AnalysesCoreApi* | [**v3GetDynamicExecutionSummary**](docs/AnalysesCoreApi.md#v3GetDynamicExecutionSummary) | **GET** /v3/analyses/{analysis_id}/dynamic-execution/summary | Get the dynamic execution summary. +*AnalysesCoreApi* | [**v3GetDynamicExecutionSummaryOperation**](docs/AnalysesCoreApi.md#v3GetDynamicExecutionSummaryOperation) | **GET** /v3/operations/dynamic-execution-summary/{analysis_id} | Get a dynamic execution summary operation. +*AnalysesCoreApi* | [**v3GetDynamicExecutionWiresharkKeys**](docs/AnalysesCoreApi.md#v3GetDynamicExecutionWiresharkKeys) | **GET** /v3/analyses/{analysis_id}/dynamic-execution/wireshark-keys | Download Wireshark TLS session keys. *AnalysesCoreApi* | [**v3ListAnalyses**](docs/AnalysesCoreApi.md#v3ListAnalyses) | **GET** /v3/analyses | List analyses +*AnalysesCoreApi* | [**v3ListAnalysisGlobals**](docs/AnalysesCoreApi.md#v3ListAnalysisGlobals) | **GET** /v3/analyses/{analysis_id}/globals | List the global variables in an analysis. +*AnalysesCoreApi* | [**v3ListAnalysisOperations**](docs/AnalysesCoreApi.md#v3ListAnalysisOperations) | **GET** /v3/analyses/{analysis_id}/operations | List the operations run on an analysis. +*AnalysesCoreApi* | [**v3ListDynamicExecutionScreenshots**](docs/AnalysesCoreApi.md#v3ListDynamicExecutionScreenshots) | **GET** /v3/analyses/{analysis_id}/dynamic-execution/screenshots | List the screenshots captured during execution. *AnalysesCoreApi* | [**v3ListExampleAnalyses**](docs/AnalysesCoreApi.md#v3ListExampleAnalyses) | **GET** /v3/analyses/examples | List example analyses +*AnalysesCoreApi* | [**v3ListGlobalFunctions**](docs/AnalysesCoreApi.md#v3ListGlobalFunctions) | **GET** /v3/analyses/{analysis_id}/globals/{vaddr}/functions | List the functions referencing a global variable. *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* | [**v3RequeueAnalysis**](docs/AnalysesCoreApi.md#v3RequeueAnalysis) | **POST** /v3/analyses/{analysis_id}/requeue | Requeue an analysis +*AnalysesCoreApi* | [**v3RunDynamicExecution**](docs/AnalysesCoreApi.md#v3RunDynamicExecution) | **POST** /v3/analyses/{analysis_id}/dynamic-execution:run | Trigger a dynamic execution run. +*AnalysesCoreApi* | [**v3RunDynamicExecutionSummary**](docs/AnalysesCoreApi.md#v3RunDynamicExecutionSummary) | **POST** /v3/analyses/{analysis_id}/dynamic-execution/summary:run | Regenerate the dynamic execution summary. *AnalysesCoreApi* | [**v3SearchTags**](docs/AnalysesCoreApi.md#v3SearchTags) | **GET** /v3/tags | Search tags *AnalysesCoreApi* | [**v3UpdateAnalysis**](docs/AnalysesCoreApi.md#v3UpdateAnalysis) | **PATCH** /v3/analyses/{analysis_id} | Update an analysis. +*AnalysesCoreApi* | [**v3UpdateAnalysisGlobal**](docs/AnalysesCoreApi.md#v3UpdateAnalysisGlobal) | **PATCH** /v3/analyses/{analysis_id}/globals/{vaddr} | Edit a global variable. *AnalysesCoreApi* | [**v3UpdateAnalysisTags**](docs/AnalysesCoreApi.md#v3UpdateAnalysisTags) | **PATCH** /v3/analyses/{analysis_id}/tags | Replace an analysis' tags. *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 @@ -193,6 +217,7 @@ Class | Method | HTTP request | Description *AuthenticationUsersApi* | [**submitUserFeedback**](docs/AuthenticationUsersApi.md#submitUserFeedback) | **POST** /v2/users/feedback | Submit feedback about the application *AuthenticationUsersApi* | [**v3GetUser**](docs/AuthenticationUsersApi.md#v3GetUser) | **GET** /v3/users/{user_id} | Get a user's public information *AuthenticationUsersApi* | [**v3GetUserActivity**](docs/AuthenticationUsersApi.md#v3GetUserActivity) | **GET** /v3/users/activity | Get the caller's activity feed +*AuthenticationUsersApi* | [**v3ListUsers**](docs/AuthenticationUsersApi.md#v3ListUsers) | **GET** /v3/users | Search users *AuthenticationUsersApi* | [**v3SubmitUserFeedback**](docs/AuthenticationUsersApi.md#v3SubmitUserFeedback) | **POST** /v3/users/feedback | Submit feedback *BinariesApi* | [**downloadZippedBinary**](docs/BinariesApi.md#downloadZippedBinary) | **GET** /v2/binaries/{binary_id}/download-zipped | Downloads a zipped binary with password protection *BinariesApi* | [**getBinaryAdditionalDetails**](docs/BinariesApi.md#getBinaryAdditionalDetails) | **GET** /v2/binaries/{binary_id}/additional-details | Gets the additional details of a binary @@ -301,6 +326,7 @@ Class | Method | HTTP request | Description *FunctionsCoreApi* | [**startFunctionsMatching**](docs/FunctionsCoreApi.md#startFunctionsMatching) | **POST** /v3/functions/matches | Start function matching for an explicit set of functions *FunctionsCoreApi* | [**v3CanonicalizeFunctionNames**](docs/FunctionsCoreApi.md#v3CanonicalizeFunctionNames) | **POST** /v3/functions/canonical-names | Canonicalize a batch of function names *FunctionsCoreApi* | [**v3GetAnalysisFuncMaps**](docs/FunctionsCoreApi.md#v3GetAnalysisFuncMaps) | **GET** /v3/analyses/{analysis_id}/func-maps | Get function ID/address maps for an analysis +*FunctionsCoreApi* | [**v3ListFunctionGlobals**](docs/FunctionsCoreApi.md#v3ListFunctionGlobals) | **GET** /v3/functions/{function_id}/globals | List the global variables a function references. *FunctionsCoreApi* | [**v3SearchFunctions**](docs/FunctionsCoreApi.md#v3SearchFunctions) | **GET** /v3/functions | Search functions *FunctionsRenamingHistoryApi* | [**batchRenameFunction**](docs/FunctionsRenamingHistoryApi.md#batchRenameFunction) | **POST** /v2/functions/rename/batch | Batch Rename Functions *FunctionsRenamingHistoryApi* | [**batchRenameFunctions**](docs/FunctionsRenamingHistoryApi.md#batchRenameFunctions) | **POST** /v3/functions/rename | Batch rename functions @@ -324,6 +350,7 @@ Class | Method | HTTP request | Description ## Documentation for Models + - [APICombinationEvidence](docs/APICombinationEvidence.md) - [APIError](docs/APIError.md) - [AcceptTypeSuggestionsInputBody](docs/AcceptTypeSuggestionsInputBody.md) - [AcceptTypeSuggestionsOutputBody](docs/AcceptTypeSuggestionsOutputBody.md) @@ -363,6 +390,8 @@ Class | Method | HTTP request | Description - [AnalysisLogEntry](docs/AnalysisLogEntry.md) - [AnalysisLogMessage](docs/AnalysisLogMessage.md) - [AnalysisLogs](docs/AnalysisLogs.md) + - [AnalysisOperationBody](docs/AnalysisOperationBody.md) + - [AnalysisOperationsOutputBody](docs/AnalysisOperationsOutputBody.md) - [AnalysisRecord](docs/AnalysisRecord.md) - [AnalysisRecordBody](docs/AnalysisRecordBody.md) - [AnalysisReport](docs/AnalysisReport.md) @@ -596,14 +625,17 @@ Class | Method | HTTP request | Description - [DecompilerSummaryEvidence](docs/DecompilerSummaryEvidence.md) - [DieMatch](docs/DieMatch.md) - [DisassemblyOutputBody](docs/DisassemblyOutputBody.md) + - [DisassemblySummaryEvidence](docs/DisassemblySummaryEvidence.md) - [Display](docs/Display.md) - [DnsQuery](docs/DnsQuery.md) - [DrakvufFileMetadata](docs/DrakvufFileMetadata.md) - [DynamicExecutionMetadata](docs/DynamicExecutionMetadata.md) + - [DynamicExecutionResult](docs/DynamicExecutionResult.md) - [DynamicExecutionStatus](docs/DynamicExecutionStatus.md) - [DynamicExecutionStatusResponse](docs/DynamicExecutionStatusResponse.md) - [DynamicExecutionSummary](docs/DynamicExecutionSummary.md) - [DynamicExecutionSummaryMetadata](docs/DynamicExecutionSummaryMetadata.md) + - [DynamicExecutionSummaryResult](docs/DynamicExecutionSummaryResult.md) - [ELFImportModel](docs/ELFImportModel.md) - [ELFModel](docs/ELFModel.md) - [ELFRelocation](docs/ELFRelocation.md) @@ -691,6 +723,7 @@ Class | Method | HTTP request | Description - [FunctionCapabilityResponse](docs/FunctionCapabilityResponse.md) - [FunctionDataType](docs/FunctionDataType.md) - [FunctionDetailsOutputBody](docs/FunctionDetailsOutputBody.md) + - [FunctionGlobalVariable](docs/FunctionGlobalVariable.md) - [FunctionListItem](docs/FunctionListItem.md) - [FunctionLocalVariableResponse](docs/FunctionLocalVariableResponse.md) - [FunctionMapping](docs/FunctionMapping.md) @@ -712,6 +745,7 @@ Class | Method | HTTP request | Description - [FunctionStringItem](docs/FunctionStringItem.md) - [FunctionStringsResponse](docs/FunctionStringsResponse.md) - [FunctionTypeDefinition](docs/FunctionTypeDefinition.md) + - [FunctionUsage](docs/FunctionUsage.md) - [FunctionsDetailResponse](docs/FunctionsDetailResponse.md) - [FunctionsListRename](docs/FunctionsListRename.md) - [FunctionsProgressOutputBody](docs/FunctionsProgressOutputBody.md) @@ -729,6 +763,7 @@ Class | Method | HTTP request | Description - [GetDieInfoOutputBody](docs/GetDieInfoOutputBody.md) - [GetFunctionMapsOutputBody](docs/GetFunctionMapsOutputBody.md) - [GetFunctionSignatureHistoryBody](docs/GetFunctionSignatureHistoryBody.md) + - [GetGlobalHistoryOutputBody](docs/GetGlobalHistoryOutputBody.md) - [GetMatchesOutputBody](docs/GetMatchesOutputBody.md) - [GetMatchesStatusOutputBody](docs/GetMatchesStatusOutputBody.md) - [GetModelsOutputBody](docs/GetModelsOutputBody.md) @@ -740,6 +775,8 @@ Class | Method | HTTP request | Description - [GetSubscriptionOutputBody](docs/GetSubscriptionOutputBody.md) - [GetTokensResponse](docs/GetTokensResponse.md) - [GetUserActivityOutputBody](docs/GetUserActivityOutputBody.md) + - [GlobalHistoryEntry](docs/GlobalHistoryEntry.md) + - [GlobalVariable](docs/GlobalVariable.md) - [HardcodedSecretEvidence](docs/HardcodedSecretEvidence.md) - [HistoryActor](docs/HistoryActor.md) - [HistoryEntry](docs/HistoryEntry.md) @@ -749,6 +786,7 @@ Class | Method | HTTP request | Description - [IconModel](docs/IconModel.md) - [ImportDynamicExecutionFileOutputBody](docs/ImportDynamicExecutionFileOutputBody.md) - [ImportModel](docs/ImportModel.md) + - [ImportedAPICallEvidence](docs/ImportedAPICallEvidence.md) - [ImportedApi](docs/ImportedApi.md) - [ImportedApiCall](docs/ImportedApiCall.md) - [ImportedApiCallEvidence](docs/ImportedApiCallEvidence.md) @@ -767,15 +805,20 @@ Class | Method | HTTP request | Description - [ListAnalysesOutputBody](docs/ListAnalysesOutputBody.md) - [ListAnalysisDataTypesOutputBody](docs/ListAnalysisDataTypesOutputBody.md) - [ListAnalysisFunctionsOutputBody](docs/ListAnalysisFunctionsOutputBody.md) + - [ListAnalysisGlobalsOutputBody](docs/ListAnalysisGlobalsOutputBody.md) - [ListAnalysisStringsOutputBody](docs/ListAnalysisStringsOutputBody.md) - [ListArchiveContentsOutputBody](docs/ListArchiveContentsOutputBody.md) - [ListCollectionResults](docs/ListCollectionResults.md) - [ListCollectionsOutputBody](docs/ListCollectionsOutputBody.md) - [ListDataTypeFunctionsBody](docs/ListDataTypeFunctionsBody.md) - [ListExampleAnalysesOutputBody](docs/ListExampleAnalysesOutputBody.md) + - [ListFunctionGlobalsOutputBody](docs/ListFunctionGlobalsOutputBody.md) - [ListFunctionSignaturesOutputBody](docs/ListFunctionSignaturesOutputBody.md) - [ListFunctionStringsOutputBody](docs/ListFunctionStringsOutputBody.md) + - [ListGlobalFunctionsOutputBody](docs/ListGlobalFunctionsOutputBody.md) - [ListImportedFunctionsOutputBody](docs/ListImportedFunctionsOutputBody.md) + - [ListOperationPrerequisitesOutputBody](docs/ListOperationPrerequisitesOutputBody.md) + - [ListPublicUsersOutputBody](docs/ListPublicUsersOutputBody.md) - [ListSecretStoreOutputBody](docs/ListSecretStoreOutputBody.md) - [ListTeamsOutputBody](docs/ListTeamsOutputBody.md) - [ListUsersOutputBody](docs/ListUsersOutputBody.md) @@ -828,6 +871,8 @@ Class | Method | HTTP request | Description - [OperationMetadataTriageResult](docs/OperationMetadataTriageResult.md) - [OperationNetworkingExplainMetadataNetworkingExplainResult](docs/OperationNetworkingExplainMetadataNetworkingExplainResult.md) - [OperationNetworkingScanMetadataNetworkingScanResult](docs/OperationNetworkingScanMetadataNetworkingScanResult.md) + - [OperationPrerequisitesBody](docs/OperationPrerequisitesBody.md) + - [OperationRenameUnnamedFunctionsMetadataRenameUnnamedFunctionsResult](docs/OperationRenameUnnamedFunctionsMetadataRenameUnnamedFunctionsResult.md) - [OperationSecurityScanMetadataSecurityScanResult](docs/OperationSecurityScanMetadataSecurityScanResult.md) - [OperationVirusTotalScanMetadataVirusTotalScanResult](docs/OperationVirusTotalScanMetadataVirusTotalScanResult.md) - [OperationWorkflowProgressResultBody](docs/OperationWorkflowProgressResultBody.md) @@ -864,6 +909,7 @@ Class | Method | HTTP request | Description - [ProgressMessage](docs/ProgressMessage.md) - [ProseEvent](docs/ProseEvent.md) - [ProtocolsAgentResponse](docs/ProtocolsAgentResponse.md) + - [PublicUserBody](docs/PublicUserBody.md) - [PutAnalysisStringsRequest](docs/PutAnalysisStringsRequest.md) - [QueuedWorkflowTaskResponse](docs/QueuedWorkflowTaskResponse.md) - [RatingOutputBody](docs/RatingOutputBody.md) @@ -883,16 +929,31 @@ Class | Method | HTTP request | Description - [RenameAppliedEvent](docs/RenameAppliedEvent.md) - [RenameInputBody](docs/RenameInputBody.md) - [RenameOutputBody](docs/RenameOutputBody.md) + - [RenameUnnamedFunctionsMetadata](docs/RenameUnnamedFunctionsMetadata.md) - [RenameUnnamedFunctionsResult](docs/RenameUnnamedFunctionsResult.md) - [RenderedToken](docs/RenderedToken.md) - [ReportAnalysisBody](docs/ReportAnalysisBody.md) - [ReportAnalysisResponse](docs/ReportAnalysisResponse.md) + - [ReportBytesConstant](docs/ReportBytesConstant.md) + - [ReportCallChain](docs/ReportCallChain.md) + - [ReportCodeSummary](docs/ReportCodeSummary.md) - [ReportEvent](docs/ReportEvent.md) + - [ReportFinding](docs/ReportFinding.md) + - [ReportFindingEvidenceInner](docs/ReportFindingEvidenceInner.md) + - [ReportFunctionSimilarity](docs/ReportFunctionSimilarity.md) + - [ReportImportedAPI](docs/ReportImportedAPI.md) + - [ReportImportedAPICall](docs/ReportImportedAPICall.md) - [ReportInfo](docs/ReportInfo.md) + - [ReportMeta](docs/ReportMeta.md) + - [ReportModelInterpretation](docs/ReportModelInterpretation.md) - [ReportOptions](docs/ReportOptions.md) - [ReportReachabilityStatus](docs/ReportReachabilityStatus.md) + - [ReportReferencedConstant](docs/ReportReferencedConstant.md) - [ReportResult](docs/ReportResult.md) + - [ReportStringMatch](docs/ReportStringMatch.md) + - [ReportSubject](docs/ReportSubject.md) - [RequestedConfigBody](docs/RequestedConfigBody.md) + - [RequeueAnalysisRequest](docs/RequeueAnalysisRequest.md) - [ResendVerificationEmailInputBody](docs/ResendVerificationEmailInputBody.md) - [ResolvedEntity](docs/ResolvedEntity.md) - [ResultBody](docs/ResultBody.md) @@ -1026,6 +1087,7 @@ Class | Method | HTTP request | Description - [UnionDefinition](docs/UnionDefinition.md) - [UnknownDataType](docs/UnknownDataType.md) - [UpdateAnalysisDataTypesInputBody](docs/UpdateAnalysisDataTypesInputBody.md) + - [UpdateAnalysisGlobalInputBody](docs/UpdateAnalysisGlobalInputBody.md) - [UpdateAnalysisInputBody](docs/UpdateAnalysisInputBody.md) - [UpdateArrayDataType](docs/UpdateArrayDataType.md) - [UpdateBaseDataType](docs/UpdateBaseDataType.md) diff --git a/build.gradle b/build.gradle index b13c39c..f95ed49 100644 --- a/build.gradle +++ b/build.gradle @@ -19,7 +19,7 @@ apply plugin: 'java' apply plugin: 'com.diffplug.spotless' group = 'ai.reveng' -version = '4.72.2' +version = '4.73.0' @@ -174,7 +174,7 @@ mavenPublishing { // key, and signing without one fails the build. if (project.hasProperty("signingInMemoryKey")) signAllPublications() - coordinates("ai.reveng", "sdk", "4.72.2") + coordinates("ai.reveng", "sdk", "4.73.0") pom { name = "sdk" diff --git a/build.sbt b/build.sbt index 81616af..a512488 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.72.2", + version := "4.73.0", scalaVersion := "2.11.12", scalacOptions ++= Seq("-feature"), compile / javacOptions ++= Seq("-Xlint:deprecation"), diff --git a/docs/APICombinationEvidence.md b/docs/APICombinationEvidence.md new file mode 100644 index 0000000..6dc666c --- /dev/null +++ b/docs/APICombinationEvidence.md @@ -0,0 +1,54 @@ + + +# APICombinationEvidence + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**apis** | **List<ReportImportedAPI>** | The APIs in the combination. | | +|**effect** | [**EffectEnum**](#EffectEnum) | Whether the evidence supports or refutes the finding. | | +|**evidenceKind** | [**EvidenceKindEnum**](#EvidenceKindEnum) | Kind of evidence. | | +|**kind** | [**KindEnum**](#KindEnum) | How the evidence was derived. | | +|**strength** | [**StrengthEnum**](#StrengthEnum) | How directly the evidence bears on the finding. | | + + + +## Enum: EffectEnum + +| Name | Value | +|---- | -----| +| SUPPORTS | "supports" | +| REFUTES | "refutes" | +| UNKNOWN_DEFAULT_OPEN_API | "unknown_default_open_api" | + + + +## Enum: EvidenceKindEnum + +| Name | Value | +|---- | -----| +| API_COMBINATION | "api_combination" | +| UNKNOWN_DEFAULT_OPEN_API | "unknown_default_open_api" | + + + +## Enum: KindEnum + +| Name | Value | +|---- | -----| +| DETERMINISTIC_DERIVATION | "deterministic_derivation" | +| UNKNOWN_DEFAULT_OPEN_API | "unknown_default_open_api" | + + + +## Enum: StrengthEnum + +| Name | Value | +|---- | -----| +| INDIRECT | "indirect" | +| UNKNOWN_DEFAULT_OPEN_API | "unknown_default_open_api" | + + + diff --git a/docs/AgentApi.md b/docs/AgentApi.md index 062c981..3e614b4 100644 --- a/docs/AgentApi.md +++ b/docs/AgentApi.md @@ -28,6 +28,7 @@ All URIs are relative to *https://api.reveng.ai* | [**v3GetCapabilitiesOperation**](AgentApi.md#v3GetCapabilitiesOperation) | **GET** /v3/operations/capabilities/{analysis_id} | Get a capabilities operation. | | [**v3GetCryptoExplainOperation**](AgentApi.md#v3GetCryptoExplainOperation) | **GET** /v3/operations/crypto-explain/{function_id} | Get a crypto-explain operation. | | [**v3GetCryptoScanOperation**](AgentApi.md#v3GetCryptoScanOperation) | **GET** /v3/operations/crypto-scan/{analysis_id} | Get a crypto-scan operation. | +| [**v3GetCryptographyOperation**](AgentApi.md#v3GetCryptographyOperation) | **GET** /v3/operations/cryptography/{analysis_id} | Get a cryptography operation. | | [**v3GetExecutionExplainOperation**](AgentApi.md#v3GetExecutionExplainOperation) | **GET** /v3/operations/execution-explain/{function_id} | Get an execution-explain operation. | | [**v3GetExecutionScanOperation**](AgentApi.md#v3GetExecutionScanOperation) | **GET** /v3/operations/execution-scan/{analysis_id} | Get an execution-scan operation. | | [**v3GetFilesystemAnalyseOperation**](AgentApi.md#v3GetFilesystemAnalyseOperation) | **GET** /v3/operations/filesystem-analyse/{function_id} | Get a filesystem-analyse operation. | @@ -36,15 +37,18 @@ All URIs are relative to *https://api.reveng.ai* | [**v3GetNetworkingScanOperation**](AgentApi.md#v3GetNetworkingScanOperation) | **GET** /v3/operations/networking-scan/{analysis_id} | Get a networking-scan operation. | | [**v3GetProtocolsOperation**](AgentApi.md#v3GetProtocolsOperation) | **GET** /v3/operations/protocols/{analysis_id} | Get a protocols operation. | | [**v3GetRemediationOperation**](AgentApi.md#v3GetRemediationOperation) | **GET** /v3/operations/remediation/{analysis_id} | Get a remediation operation. | +| [**v3GetRenameUnnamedFunctionsOperation**](AgentApi.md#v3GetRenameUnnamedFunctionsOperation) | **GET** /v3/operations/rename-unnamed-functions/{analysis_id} | Get a rename-unnamed-functions operation. | | [**v3GetRenameUnnamedFunctionsResult**](AgentApi.md#v3GetRenameUnnamedFunctionsResult) | **GET** /v3/analyses/{analysis_id}/agents/rename-unnamed-functions | Get rename-unnamed-functions agent result. | | [**v3GetRenameUnnamedFunctionsStatus**](AgentApi.md#v3GetRenameUnnamedFunctionsStatus) | **GET** /v3/analyses/{analysis_id}/agents/rename-unnamed-functions/status | Get rename-unnamed-functions agent status. | | [**v3GetReportAnalysisOperation**](AgentApi.md#v3GetReportAnalysisOperation) | **GET** /v3/operations/report-analysis/{analysis_id} | Get a report-analysis operation. | | [**v3GetSecretsOperation**](AgentApi.md#v3GetSecretsOperation) | **GET** /v3/operations/secrets/{analysis_id} | Get a secrets operation. | | [**v3GetSecurityScanOperation**](AgentApi.md#v3GetSecurityScanOperation) | **GET** /v3/operations/security-scan/{analysis_id} | Get a security-scan operation. | | [**v3GetTriageOperation**](AgentApi.md#v3GetTriageOperation) | **GET** /v3/operations/triage/{analysis_id} | Get a triage operation. | +| [**v3ListOperationPrerequisites**](AgentApi.md#v3ListOperationPrerequisites) | **GET** /v3/operation-prerequisites | List operation prerequisites. | | [**v3RunCapabilities**](AgentApi.md#v3RunCapabilities) | **POST** /v3/analyses/{analysis_id}/capabilities:run | Run the capabilities agent. | | [**v3RunCryptoExplain**](AgentApi.md#v3RunCryptoExplain) | **POST** /v3/functions/{function_id}/crypto-explain:run | Run the crypto-explain agent. | | [**v3RunCryptoScan**](AgentApi.md#v3RunCryptoScan) | **POST** /v3/analyses/{analysis_id}/crypto-scan:run | Run the crypto-scan agent. | +| [**v3RunCryptography**](AgentApi.md#v3RunCryptography) | **POST** /v3/analyses/{analysis_id}/cryptography:run | Run the cryptography agent. | | [**v3RunExecutionExplain**](AgentApi.md#v3RunExecutionExplain) | **POST** /v3/functions/{function_id}/execution-explain:run | Run the execution-explain agent. | | [**v3RunExecutionScan**](AgentApi.md#v3RunExecutionScan) | **POST** /v3/analyses/{analysis_id}/execution-scan:run | Run the execution-scan agent. | | [**v3RunFilesystemAnalyse**](AgentApi.md#v3RunFilesystemAnalyse) | **POST** /v3/functions/{function_id}/filesystem-analyse:run | Run the filesystem-analyse agent. | @@ -1573,7 +1577,7 @@ public class Example { | Name | Type | Description | Notes | |------------- | ------------- | ------------- | -------------| | **analysisId** | **Long**| Analysis ID | | -| **agent** | **String**| Which agent's output the feedback is about | [enum: triage, capabilities, report-analysis, remediation, protocols, secrets] | +| **agent** | **String**| Which agent's output the feedback is about | [enum: triage, capabilities, report-analysis, remediation, protocols, secrets, cryptography] | ### Return type @@ -1829,6 +1833,84 @@ public class Example { | **422** | Unprocessable Entity | - | | **500** | Internal Server Error | - | + +# **v3GetCryptographyOperation** +> OperationMetadataReportResult v3GetCryptographyOperation(analysisId) + +Get a cryptography operation. + +Polls a cryptography run. `metadata.status` tracks the run and `metadata.log_history` carries its progress messages; `response` is set once the run has completed and holds the findings, each with its supporting evidence. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `409` [`ANALYSIS_NOT_READY`](/errors/ANALYSIS_NOT_READY) — Analysis Not Ready + +### 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.AgentApi; + +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"); + + AgentApi apiInstance = new AgentApi(defaultClient); + Long analysisId = 56L; // Long | Analysis ID + try { + OperationMetadataReportResult result = apiInstance.v3GetCryptographyOperation(analysisId); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling AgentApi#v3GetCryptographyOperation"); + 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 + +[**OperationMetadataReportResult**](OperationMetadataReportResult.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 | - | +| **409** | Conflict | - | +| **422** | Unprocessable Entity | - | +| **500** | Internal Server Error | - | + # **v3GetExecutionExplainOperation** > OperationExecutionExplainMetadataExecutionExplainResult v3GetExecutionExplainOperation(functionId) @@ -2297,7 +2379,7 @@ public class Example { Get a protocols operation. -Polls a protocols run. `metadata.status` tracks the run and `metadata.log_history` carries its progress messages; `response.report` is set once the run has completed and carries the findings document as the agent produced it. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `409` [`ANALYSIS_NOT_READY`](/errors/ANALYSIS_NOT_READY) — Analysis Not Ready +Polls a protocols run. `metadata.status` tracks the run and `metadata.log_history` carries its progress messages; `response` is set once the run has completed and holds the findings, each with its supporting evidence. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `409` [`ANALYSIS_NOT_READY`](/errors/ANALYSIS_NOT_READY) — Analysis Not Ready ### Example ```java @@ -2447,6 +2529,83 @@ public class Example { | **422** | Unprocessable Entity | - | | **500** | Internal Server Error | - | + +# **v3GetRenameUnnamedFunctionsOperation** +> OperationRenameUnnamedFunctionsMetadataRenameUnnamedFunctionsResult v3GetRenameUnnamedFunctionsOperation(analysisId) + +Get a rename-unnamed-functions operation. + +Returns the current state of the rename-unnamed-functions run for this analysis. **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.AgentApi; + +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"); + + AgentApi apiInstance = new AgentApi(defaultClient); + Long analysisId = 56L; // Long | Analysis ID + try { + OperationRenameUnnamedFunctionsMetadataRenameUnnamedFunctionsResult result = apiInstance.v3GetRenameUnnamedFunctionsOperation(analysisId); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling AgentApi#v3GetRenameUnnamedFunctionsOperation"); + 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 + +[**OperationRenameUnnamedFunctionsMetadataRenameUnnamedFunctionsResult**](OperationRenameUnnamedFunctionsMetadataRenameUnnamedFunctionsResult.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 | - | + # **v3GetRenameUnnamedFunctionsResult** > RenameUnnamedFunctionsResult v3GetRenameUnnamedFunctionsResult(analysisId) @@ -2686,7 +2845,7 @@ public class Example { Get a secrets operation. -Polls a secrets run. `metadata.status` tracks the run and `metadata.log_history` carries its progress messages; `response.report` is set once the run has completed and carries the findings document as the agent produced it. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `409` [`ANALYSIS_NOT_READY`](/errors/ANALYSIS_NOT_READY) — Analysis Not Ready +Polls a secrets run. `metadata.status` tracks the run and `metadata.log_history` carries its progress messages; `response` is set once the run has completed and holds the findings, each with its supporting evidence. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `409` [`ANALYSIS_NOT_READY`](/errors/ANALYSIS_NOT_READY) — Analysis Not Ready ### Example ```java @@ -2913,13 +3072,83 @@ public class Example { | **422** | Unprocessable Entity | - | | **500** | Internal Server Error | - | + +# **v3ListOperationPrerequisites** +> ListOperationPrerequisitesOutputBody v3ListOperationPrerequisites() + +List operation prerequisites. + +Lists the operations that can only start once other operations have completed on the same analysis. To check whether an analysis has completed them, use `/v3/analyses/{analysis_id}/operations`. + +### 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.AgentApi; + +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"); + + AgentApi apiInstance = new AgentApi(defaultClient); + try { + ListOperationPrerequisitesOutputBody result = apiInstance.v3ListOperationPrerequisites(); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling AgentApi#v3ListOperationPrerequisites"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +[**ListOperationPrerequisitesOutputBody**](ListOperationPrerequisitesOutputBody.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 | - | +| **0** | Error | - | + # **v3RunCapabilities** > OperationMetadataCapabilitiesResult v3RunCapabilities(analysisId) Run the capabilities agent. -Starts the capabilities agent, which attributes behavioural capabilities to individual functions, and returns the operation to poll for its outcome. Returns 409 while a run is already in progress for this analysis. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `409` [`CONFLICT`](/errors/CONFLICT) — Conflict - `402` [`INSUFFICIENT_CREDITS`](/errors/INSUFFICIENT_CREDITS) — Insufficient Credits +Starts the capabilities agent, which attributes behavioural capabilities to individual functions, and returns the operation to poll for its outcome. Returns 409 while a run is already in progress for this analysis. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `409` [`CONFLICT`](/errors/CONFLICT) — Conflict - `402` [`INSUFFICIENT_CREDITS`](/errors/INSUFFICIENT_CREDITS) — Insufficient Credits - `409` [`OPERATION_PREREQUISITE_NOT_MET`](/errors/OPERATION_PREREQUISITE_NOT_MET) — Operation Prerequisite Not Met ### Example ```java @@ -3077,7 +3306,7 @@ public class Example { Run the crypto-scan agent. -Starts an agent that name-matches the analysis' functions and their callees against known crypto-library APIs, and returns the operation to poll for its outcome. Purely name-based — never triggers AI decompilation, so it costs no credits and runs in seconds. Returns 409 while a run is already in progress for this analysis. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `409` [`CONFLICT`](/errors/CONFLICT) — Conflict +Starts an agent that name-matches the analysis' functions and their callees against known crypto-library APIs, and returns the operation to poll for its outcome. Purely name-based — never triggers AI decompilation, so it costs no credits and runs in seconds. Returns 409 while a run is already in progress for this analysis. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `409` [`CONFLICT`](/errors/CONFLICT) — Conflict - `409` [`OPERATION_PREREQUISITE_NOT_MET`](/errors/OPERATION_PREREQUISITE_NOT_MET) — Operation Prerequisite Not Met ### Example ```java @@ -3151,6 +3380,85 @@ public class Example { | **422** | Unprocessable Entity | - | | **500** | Internal Server Error | - | + +# **v3RunCryptography** +> OperationMetadataReportResult v3RunCryptography(analysisId) + +Run the cryptography agent. + +Starts the cryptography agent, which identifies cryptographic operations in the binary and reports its findings, and returns the operation to poll for its outcome. Returns 409 while a run is already in progress for this analysis. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `409` [`CONFLICT`](/errors/CONFLICT) — Conflict - `402` [`INSUFFICIENT_CREDITS`](/errors/INSUFFICIENT_CREDITS) — Insufficient Credits - `409` [`OPERATION_PREREQUISITE_NOT_MET`](/errors/OPERATION_PREREQUISITE_NOT_MET) — Operation Prerequisite Not Met + +### 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.AgentApi; + +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"); + + AgentApi apiInstance = new AgentApi(defaultClient); + Long analysisId = 56L; // Long | Analysis ID + try { + OperationMetadataReportResult result = apiInstance.v3RunCryptography(analysisId); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling AgentApi#v3RunCryptography"); + 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 + +[**OperationMetadataReportResult**](OperationMetadataReportResult.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 | - | +| **402** | Payment Required | - | +| **403** | Forbidden | - | +| **404** | Not Found | - | +| **409** | Conflict | - | +| **422** | Unprocessable Entity | - | +| **500** | Internal Server Error | - | + # **v3RunExecutionExplain** > OperationExecutionExplainMetadataExecutionExplainResult v3RunExecutionExplain(functionId, triggerExecutionExplainInputBody) @@ -3238,7 +3546,7 @@ public class Example { Run the execution-scan agent. -Starts an agent that name-matches the analysis' functions and their callees against known code-execution APIs, and returns the operation to poll for its outcome. Returns 409 while a run is already in progress for this analysis. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `409` [`CONFLICT`](/errors/CONFLICT) — Conflict +Starts an agent that name-matches the analysis' functions and their callees against known code-execution APIs, and returns the operation to poll for its outcome. Returns 409 while a run is already in progress for this analysis. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `409` [`CONFLICT`](/errors/CONFLICT) — Conflict - `409` [`OPERATION_PREREQUISITE_NOT_MET`](/errors/OPERATION_PREREQUISITE_NOT_MET) — Operation Prerequisite Not Met ### Example ```java @@ -3399,7 +3707,7 @@ public class Example { Run the filesystem-scan agent. -Starts an agent that name-matches the analysis' functions and their callees against known filesystem/system APIs, and returns the operation to poll for its outcome. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `409` [`CONFLICT`](/errors/CONFLICT) — Conflict +Starts an agent that name-matches the analysis' functions and their callees against known filesystem/system APIs, and returns the operation to poll for its outcome. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `409` [`CONFLICT`](/errors/CONFLICT) — Conflict - `409` [`OPERATION_PREREQUISITE_NOT_MET`](/errors/OPERATION_PREREQUISITE_NOT_MET) — Operation Prerequisite Not Met ### Example ```java @@ -3560,7 +3868,7 @@ public class Example { Run the networking-scan agent. -Starts an agent that name-matches the analysis' functions and their callees against known networking APIs, and returns the operation to poll for its outcome. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `409` [`CONFLICT`](/errors/CONFLICT) — Conflict +Starts an agent that name-matches the analysis' functions and their callees against known networking APIs, and returns the operation to poll for its outcome. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `409` [`CONFLICT`](/errors/CONFLICT) — Conflict - `409` [`OPERATION_PREREQUISITE_NOT_MET`](/errors/OPERATION_PREREQUISITE_NOT_MET) — Operation Prerequisite Not Met ### Example ```java @@ -3640,7 +3948,7 @@ public class Example { Run the protocols agent. -Starts the protocols agent, which identifies the network and data protocols the binary implements, and returns the operation to poll for its outcome. Returns 409 while a run is already in progress for this analysis. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `409` [`CONFLICT`](/errors/CONFLICT) — Conflict - `402` [`INSUFFICIENT_CREDITS`](/errors/INSUFFICIENT_CREDITS) — Insufficient Credits +Starts the protocols agent, which identifies the network and data protocols the binary implements, and returns the operation to poll for its outcome. Returns 409 while a run is already in progress for this analysis. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `409` [`CONFLICT`](/errors/CONFLICT) — Conflict - `402` [`INSUFFICIENT_CREDITS`](/errors/INSUFFICIENT_CREDITS) — Insufficient Credits - `409` [`OPERATION_PREREQUISITE_NOT_MET`](/errors/OPERATION_PREREQUISITE_NOT_MET) — Operation Prerequisite Not Met ### Example ```java @@ -3719,7 +4027,7 @@ public class Example { Run the remediation agent. -Starts the remediation agent, which generates YARA, Snort and STIX detection rules for the binary, and returns the operation to poll for its outcome. Returns 409 while a run is already in progress for this analysis. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `409` [`CONFLICT`](/errors/CONFLICT) — Conflict - `402` [`INSUFFICIENT_CREDITS`](/errors/INSUFFICIENT_CREDITS) — Insufficient Credits +Starts the remediation agent, which generates YARA, Snort and STIX detection rules for the binary, and returns the operation to poll for its outcome. Returns 409 while a run is already in progress for this analysis. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `409` [`CONFLICT`](/errors/CONFLICT) — Conflict - `402` [`INSUFFICIENT_CREDITS`](/errors/INSUFFICIENT_CREDITS) — Insufficient Credits - `409` [`OPERATION_PREREQUISITE_NOT_MET`](/errors/OPERATION_PREREQUISITE_NOT_MET) — Operation Prerequisite Not Met ### Example ```java @@ -3798,7 +4106,7 @@ public class Example { Run the report-analysis agent. -Starts the report-analysis agent, which produces a combined threat report — summary, software type, attack flow, indicators of compromise, MITRE ATT&CK techniques and a YARA rule — and returns the operation to poll for its outcome. Returns 409 while a run is already in progress for this analysis. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `409` [`CONFLICT`](/errors/CONFLICT) — Conflict - `402` [`INSUFFICIENT_CREDITS`](/errors/INSUFFICIENT_CREDITS) — Insufficient Credits +Starts the report-analysis agent, which produces a combined threat report — summary, software type, attack flow, indicators of compromise, MITRE ATT&CK techniques and a YARA rule — and returns the operation to poll for its outcome. Returns 409 while a run is already in progress for this analysis. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `409` [`CONFLICT`](/errors/CONFLICT) — Conflict - `402` [`INSUFFICIENT_CREDITS`](/errors/INSUFFICIENT_CREDITS) — Insufficient Credits - `409` [`OPERATION_PREREQUISITE_NOT_MET`](/errors/OPERATION_PREREQUISITE_NOT_MET) — Operation Prerequisite Not Met ### Example ```java @@ -3877,7 +4185,7 @@ public class Example { Run the secrets agent. -Starts the secrets agent, which finds credentials and other hardcoded secrets in the binary, and returns the operation to poll for its outcome. Returns 409 while a run is already in progress for this analysis. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `409` [`CONFLICT`](/errors/CONFLICT) — Conflict - `402` [`INSUFFICIENT_CREDITS`](/errors/INSUFFICIENT_CREDITS) — Insufficient Credits +Starts the secrets agent, which finds credentials and other hardcoded secrets in the binary, and returns the operation to poll for its outcome. Returns 409 while a run is already in progress for this analysis. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `409` [`CONFLICT`](/errors/CONFLICT) — Conflict - `402` [`INSUFFICIENT_CREDITS`](/errors/INSUFFICIENT_CREDITS) — Insufficient Credits - `409` [`OPERATION_PREREQUISITE_NOT_MET`](/errors/OPERATION_PREREQUISITE_NOT_MET) — Operation Prerequisite Not Met ### Example ```java @@ -4037,7 +4345,7 @@ public class Example { Run the triage agent. -Starts the triage agent, which scores the binary and each of its functions for maliciousness, and returns the operation to poll for its outcome. Unlike the other binary agents this one is not gated on subscription tier. Returns 409 while a run is already in progress for this analysis. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `409` [`CONFLICT`](/errors/CONFLICT) — Conflict - `402` [`INSUFFICIENT_CREDITS`](/errors/INSUFFICIENT_CREDITS) — Insufficient Credits +Starts the triage agent, which scores the binary and each of its functions for maliciousness, and returns the operation to poll for its outcome. Unlike the other binary agents this one is not gated on subscription tier. Returns 409 while a run is already in progress for this analysis. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `409` [`CONFLICT`](/errors/CONFLICT) — Conflict - `402` [`INSUFFICIENT_CREDITS`](/errors/INSUFFICIENT_CREDITS) — Insufficient Credits - `409` [`OPERATION_PREREQUISITE_NOT_MET`](/errors/OPERATION_PREREQUISITE_NOT_MET) — Operation Prerequisite Not Met ### Example ```java @@ -4246,7 +4554,7 @@ public class Example { | Name | Type | Description | Notes | |------------- | ------------- | ------------- | -------------| | **analysisId** | **Long**| Analysis ID | | -| **agent** | **String**| Which agent's output the feedback is about | [enum: triage, capabilities, report-analysis, remediation, protocols, secrets] | +| **agent** | **String**| Which agent's output the feedback is about | [enum: triage, capabilities, report-analysis, remediation, protocols, secrets, cryptography] | | **submitFeedbackInputBody** | [**SubmitFeedbackInputBody**](SubmitFeedbackInputBody.md)| | | ### Return type diff --git a/docs/AnalysesCoreApi.md b/docs/AnalysesCoreApi.md index 662c4ea..467e7e1 100644 --- a/docs/AnalysesCoreApi.md +++ b/docs/AnalysesCoreApi.md @@ -32,17 +32,37 @@ All URIs are relative to *https://api.reveng.ai* | [**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. | +| [**v3GetAnalysisGlobal**](AnalysesCoreApi.md#v3GetAnalysisGlobal) | **GET** /v3/analyses/{analysis_id}/globals/{vaddr} | Get one global variable. | +| [**v3GetAnalysisGlobalHistory**](AnalysesCoreApi.md#v3GetAnalysisGlobalHistory) | **GET** /v3/analyses/{analysis_id}/globals/{vaddr}/history | List a global variable's replaced values. | | [**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 | +| [**v3GetDynamicExecutionArtifact**](AnalysesCoreApi.md#v3GetDynamicExecutionArtifact) | **GET** /v3/analyses/{analysis_id}/dynamic-execution/artifacts/{sha256} | Download an artifact. | +| [**v3GetDynamicExecutionLogsDownload**](AnalysesCoreApi.md#v3GetDynamicExecutionLogsDownload) | **GET** /v3/analyses/{analysis_id}/dynamic-execution/logs/download | Download the execution logs archive. | +| [**v3GetDynamicExecutionMemdump**](AnalysesCoreApi.md#v3GetDynamicExecutionMemdump) | **GET** /v3/analyses/{analysis_id}/dynamic-execution/memdumps/{sha256} | Download a memory dump. | +| [**v3GetDynamicExecutionOperation**](AnalysesCoreApi.md#v3GetDynamicExecutionOperation) | **GET** /v3/operations/dynamic-execution/{analysis_id} | Get a dynamic execution operation. | +| [**v3GetDynamicExecutionPcap**](AnalysesCoreApi.md#v3GetDynamicExecutionPcap) | **GET** /v3/analyses/{analysis_id}/dynamic-execution/pcap | Download the network capture. | +| [**v3GetDynamicExecutionReport**](AnalysesCoreApi.md#v3GetDynamicExecutionReport) | **GET** /v3/analyses/{analysis_id}/dynamic-execution/report | Get the dynamic execution report. | +| [**v3GetDynamicExecutionScreenshot**](AnalysesCoreApi.md#v3GetDynamicExecutionScreenshot) | **GET** /v3/analyses/{analysis_id}/dynamic-execution/screenshots/{index} | Download a screenshot. | +| [**v3GetDynamicExecutionSummary**](AnalysesCoreApi.md#v3GetDynamicExecutionSummary) | **GET** /v3/analyses/{analysis_id}/dynamic-execution/summary | Get the dynamic execution summary. | +| [**v3GetDynamicExecutionSummaryOperation**](AnalysesCoreApi.md#v3GetDynamicExecutionSummaryOperation) | **GET** /v3/operations/dynamic-execution-summary/{analysis_id} | Get a dynamic execution summary operation. | +| [**v3GetDynamicExecutionWiresharkKeys**](AnalysesCoreApi.md#v3GetDynamicExecutionWiresharkKeys) | **GET** /v3/analyses/{analysis_id}/dynamic-execution/wireshark-keys | Download Wireshark TLS session keys. | | [**v3ListAnalyses**](AnalysesCoreApi.md#v3ListAnalyses) | **GET** /v3/analyses | List analyses | +| [**v3ListAnalysisGlobals**](AnalysesCoreApi.md#v3ListAnalysisGlobals) | **GET** /v3/analyses/{analysis_id}/globals | List the global variables in an analysis. | +| [**v3ListAnalysisOperations**](AnalysesCoreApi.md#v3ListAnalysisOperations) | **GET** /v3/analyses/{analysis_id}/operations | List the operations run on an analysis. | +| [**v3ListDynamicExecutionScreenshots**](AnalysesCoreApi.md#v3ListDynamicExecutionScreenshots) | **GET** /v3/analyses/{analysis_id}/dynamic-execution/screenshots | List the screenshots captured during execution. | | [**v3ListExampleAnalyses**](AnalysesCoreApi.md#v3ListExampleAnalyses) | **GET** /v3/analyses/examples | List example analyses | +| [**v3ListGlobalFunctions**](AnalysesCoreApi.md#v3ListGlobalFunctions) | **GET** /v3/analyses/{analysis_id}/globals/{vaddr}/functions | List the functions referencing a global variable. | | [**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 | +| [**v3RequeueAnalysis**](AnalysesCoreApi.md#v3RequeueAnalysis) | **POST** /v3/analyses/{analysis_id}/requeue | Requeue an analysis | +| [**v3RunDynamicExecution**](AnalysesCoreApi.md#v3RunDynamicExecution) | **POST** /v3/analyses/{analysis_id}/dynamic-execution:run | Trigger a dynamic execution run. | +| [**v3RunDynamicExecutionSummary**](AnalysesCoreApi.md#v3RunDynamicExecutionSummary) | **POST** /v3/analyses/{analysis_id}/dynamic-execution/summary:run | Regenerate the dynamic execution summary. | | [**v3SearchTags**](AnalysesCoreApi.md#v3SearchTags) | **GET** /v3/tags | Search tags | | [**v3UpdateAnalysis**](AnalysesCoreApi.md#v3UpdateAnalysis) | **PATCH** /v3/analyses/{analysis_id} | Update an analysis. | +| [**v3UpdateAnalysisGlobal**](AnalysesCoreApi.md#v3UpdateAnalysisGlobal) | **PATCH** /v3/analyses/{analysis_id}/globals/{vaddr} | Edit a global variable. | | [**v3UpdateAnalysisTags**](AnalysesCoreApi.md#v3UpdateAnalysisTags) | **PATCH** /v3/analyses/{analysis_id}/tags | Replace an analysis' tags. | | [**v3UpgradeAnalysisModel**](AnalysesCoreApi.md#v3UpgradeAnalysisModel) | **POST** /v3/analyses/{analysis_id}/upgrade-model | Re-analyse on the latest model | @@ -1959,7 +1979,7 @@ public class Example { | Name | Type | Description | Notes | |------------- | ------------- | ------------- | -------------| | **analysisId** | **Long**| Analysis ID | | -| **taskId** | **String**| Task ID returned by queueing the export | [optional] | +| **taskId** | **String**| Task ID returned by queueing the export | | ### Return type @@ -2214,6 +2234,164 @@ public class Example { | **422** | Unprocessable Entity | - | | **500** | Internal Server Error | - | + +# **v3GetAnalysisGlobal** +> GlobalVariable v3GetAnalysisGlobal(analysisId, vaddr) + +Get one global variable. + +Returns the global variable at the given virtual address, or 404 when the analysis has no row for that address. **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 + Long vaddr = 56L; // Long | Virtual address of the global variable. + try { + GlobalVariable result = apiInstance.v3GetAnalysisGlobal(analysisId, vaddr); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling AnalysesCoreApi#v3GetAnalysisGlobal"); + 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 | | +| **vaddr** | **Long**| Virtual address of the global variable. | | + +### Return type + +[**GlobalVariable**](GlobalVariable.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 | - | + + +# **v3GetAnalysisGlobalHistory** +> GetGlobalHistoryOutputBody v3GetAnalysisGlobalHistory(analysisId, vaddr) + +List a global variable's replaced values. + +Returns what the global held before each edit, oldest first. A global nobody has edited returns an empty list. **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 + Long vaddr = 56L; // Long | Virtual address of the global variable. + try { + GetGlobalHistoryOutputBody result = apiInstance.v3GetAnalysisGlobalHistory(analysisId, vaddr); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling AnalysesCoreApi#v3GetAnalysisGlobalHistory"); + 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 | | +| **vaddr** | **Long**| Virtual address of the global variable. | | + +### Return type + +[**GetGlobalHistoryOutputBody**](GetGlobalHistoryOutputBody.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 | - | + # **v3GetAnalysisLogs** > GetAnalysisLogsOutputBody v3GetAnalysisLogs(analysisId) @@ -2613,13 +2791,13 @@ public class Example { | **422** | Unprocessable Entity | - | | **500** | Internal Server Error | - | - -# **v3ListAnalyses** -> ListAnalysesOutputBody v3ListAnalyses(searchTerm, analysisScope, status, modelName, usernames, sha256Hash, binaryId, platform, architecture, pageSize, nextPageToken, orderBy, order) + +# **v3GetDynamicExecutionArtifact** +> v3GetDynamicExecutionArtifact(analysisId, sha256, filename) -List analyses +Download an artifact. -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 +Streams a file extracted during execution (filesystem, memory, or network), addressed by the SHA-256 referenced by `artifacts[].sha256` in the dynamic execution report. The response is a password-protected zip (password: `infected`). **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `409` [`DYNAMIC_EXECUTION_INCOMPLETE`](/errors/DYNAMIC_EXECUTION_INCOMPLETE) — Dynamic Execution Incomplete ### Example ```java @@ -2647,24 +2825,13 @@ public class Example { bearerAuth.setBearerToken("BEARER TOKEN"); AnalysesCoreApi apiInstance = new AnalysesCoreApi(defaultClient); - String searchTerm = "searchTerm_example"; // String | - List analysisScope = Arrays.asList(); // List | Leave empty to search your own, your team's and all public analyses - List status = Arrays.asList(); // List | - 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 | - String nextPageToken = "nextPageToken_example"; // String | Forward-pagination cursor from a prior response. When set, order_by/order are taken from the token (the sort cannot change mid-pagination). - String orderBy = "created"; // String | - String order = "ASC"; // String | + Long analysisId = 56L; // Long | Analysis ID + String sha256 = "sha256_example"; // String | SHA-256 hex digest of the artifact + String filename = "filename_example"; // String | Optional name for the downloaded file (inside the zip and as the download filename). Defaults to the SHA-256 when omitted. try { - ListAnalysesOutputBody result = apiInstance.v3ListAnalyses(searchTerm, analysisScope, status, modelName, usernames, sha256Hash, binaryId, platform, architecture, pageSize, nextPageToken, orderBy, order); - System.out.println(result); + apiInstance.v3GetDynamicExecutionArtifact(analysisId, sha256, filename); } catch (ApiException e) { - System.err.println("Exception when calling AnalysesCoreApi#v3ListAnalyses"); + System.err.println("Exception when calling AnalysesCoreApi#v3GetDynamicExecutionArtifact"); System.err.println("Status code: " + e.getCode()); System.err.println("Reason: " + e.getResponseBody()); System.err.println("Response headers: " + e.getResponseHeaders()); @@ -2678,23 +2845,13 @@ public class Example { | Name | Type | Description | Notes | |------------- | ------------- | ------------- | -------------| -| **searchTerm** | **String**| | [optional] | -| **analysisScope** | [**List<String>**](String.md)| Leave empty to search your own, your team's and all public analyses | [optional] [enum: PRIVATE, PUBLIC, TEAM] | -| **status** | [**List<String>**](String.md)| | [optional] [enum: Uploaded, Queued, Complete, Error, Processing] | -| **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] | -| **nextPageToken** | **String**| Forward-pagination cursor from a prior response. When set, order_by/order are taken from the token (the sort cannot change mid-pagination). | [optional] | -| **orderBy** | **String**| | [optional] [default to created] [enum: created, binary_name, binary_size] | -| **order** | **String**| | [optional] [default to DESC] [enum: ASC, DESC] | +| **analysisId** | **Long**| Analysis ID | | +| **sha256** | **String**| SHA-256 hex digest of the artifact | | +| **filename** | **String**| Optional name for the downloaded file (inside the zip and as the download filename). Defaults to the SHA-256 when omitted. | [optional] | ### Return type -[**ListAnalysesOutputBody**](ListAnalysesOutputBody.md) +null (empty response body) ### Authorization @@ -2709,17 +2866,19 @@ public class Example { | Status code | Description | Response headers | |-------------|-------------|------------------| | **200** | OK | - | -| **400** | Bad Request | - | +| **403** | Forbidden | - | +| **404** | Not Found | - | +| **409** | Conflict | - | | **422** | Unprocessable Entity | - | | **500** | Internal Server Error | - | - -# **v3ListExampleAnalyses** -> ListExampleAnalysesOutputBody v3ListExampleAnalyses() + +# **v3GetDynamicExecutionLogsDownload** +> v3GetDynamicExecutionLogsDownload(analysisId) -List example analyses +Download the execution logs archive. -Returns the curated example Analyses. +Streams a ZIP archive of the sandbox logs collected during execution. Requires the run to be COMPLETED. Returns 404 if no logs were captured. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `409` [`DYNAMIC_EXECUTION_INCOMPLETE`](/errors/DYNAMIC_EXECUTION_INCOMPLETE) — Dynamic Execution Incomplete ### Example ```java @@ -2747,11 +2906,11 @@ public class Example { bearerAuth.setBearerToken("BEARER TOKEN"); AnalysesCoreApi apiInstance = new AnalysesCoreApi(defaultClient); + Long analysisId = 56L; // Long | Analysis ID try { - ListExampleAnalysesOutputBody result = apiInstance.v3ListExampleAnalyses(); - System.out.println(result); + apiInstance.v3GetDynamicExecutionLogsDownload(analysisId); } catch (ApiException e) { - System.err.println("Exception when calling AnalysesCoreApi#v3ListExampleAnalyses"); + System.err.println("Exception when calling AnalysesCoreApi#v3GetDynamicExecutionLogsDownload"); System.err.println("Status code: " + e.getCode()); System.err.println("Reason: " + e.getResponseBody()); System.err.println("Response headers: " + e.getResponseHeaders()); @@ -2762,11 +2921,14 @@ public class Example { ``` ### Parameters -This endpoint does not need any parameter. + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **analysisId** | **Long**| Analysis ID | | ### Return type -[**ListExampleAnalysesOutputBody**](ListExampleAnalysesOutputBody.md) +null (empty response body) ### Authorization @@ -2781,15 +2943,19 @@ This endpoint does not need any parameter. | Status code | Description | Response headers | |-------------|-------------|------------------| | **200** | OK | - | -| **0** | Error | - | +| **403** | Forbidden | - | +| **404** | Not Found | - | +| **409** | Conflict | - | +| **422** | Unprocessable Entity | - | +| **500** | Internal Server Error | - | - -# **v3LookupAnalysisByBinaryId** -> LookupAnalysisByBinaryIDOutputBody v3LookupAnalysisByBinaryId(binaryId) + +# **v3GetDynamicExecutionMemdump** +> v3GetDynamicExecutionMemdump(analysisId, sha256, filename) -Look up the most recent analysis for a binary. +Download a memory dump. -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 +Streams the memory dump for a SHA-256 referenced by `memdumps[].dumps[].sha256` in the dynamic execution report. The response is a password-protected zip (password: `infected`). **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `409` [`DYNAMIC_EXECUTION_INCOMPLETE`](/errors/DYNAMIC_EXECUTION_INCOMPLETE) — Dynamic Execution Incomplete ### Example ```java @@ -2817,12 +2983,13 @@ public class Example { bearerAuth.setBearerToken("BEARER TOKEN"); AnalysesCoreApi apiInstance = new AnalysesCoreApi(defaultClient); - Long binaryId = 56L; // Long | Binary ID + Long analysisId = 56L; // Long | Analysis ID + String sha256 = "sha256_example"; // String | SHA-256 hex digest of the artifact + String filename = "filename_example"; // String | Optional name for the downloaded file (inside the zip and as the download filename). Defaults to the SHA-256 when omitted. try { - LookupAnalysisByBinaryIDOutputBody result = apiInstance.v3LookupAnalysisByBinaryId(binaryId); - System.out.println(result); + apiInstance.v3GetDynamicExecutionMemdump(analysisId, sha256, filename); } catch (ApiException e) { - System.err.println("Exception when calling AnalysesCoreApi#v3LookupAnalysisByBinaryId"); + System.err.println("Exception when calling AnalysesCoreApi#v3GetDynamicExecutionMemdump"); System.err.println("Status code: " + e.getCode()); System.err.println("Reason: " + e.getResponseBody()); System.err.println("Response headers: " + e.getResponseHeaders()); @@ -2836,11 +3003,13 @@ public class Example { | Name | Type | Description | Notes | |------------- | ------------- | ------------- | -------------| -| **binaryId** | **Long**| Binary ID | | +| **analysisId** | **Long**| Analysis ID | | +| **sha256** | **String**| SHA-256 hex digest of the artifact | | +| **filename** | **String**| Optional name for the downloaded file (inside the zip and as the download filename). Defaults to the SHA-256 when omitted. | [optional] | ### Return type -[**LookupAnalysisByBinaryIDOutputBody**](LookupAnalysisByBinaryIDOutputBody.md) +null (empty response body) ### Authorization @@ -2855,17 +3024,19 @@ public class Example { | Status code | Description | Response headers | |-------------|-------------|------------------| | **200** | OK | - | +| **403** | Forbidden | - | | **404** | Not Found | - | +| **409** | Conflict | - | | **422** | Unprocessable Entity | - | | **500** | Internal Server Error | - | - -# **v3QueueBinaryExport** -> OperationBinaryExportMetadataBinaryExportResult v3QueueBinaryExport(analysisId) + +# **v3GetDynamicExecutionOperation** +> OperationDynamicExecutionMetadataDynamicExecutionResult v3GetDynamicExecutionOperation(analysisId) -Queue a binary export +Get a dynamic execution operation. -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 +Returns the current state of the most recently triggered dynamic execution run for this analysis. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied ### Example ```java @@ -2895,10 +3066,10 @@ public class Example { AnalysesCoreApi apiInstance = new AnalysesCoreApi(defaultClient); Long analysisId = 56L; // Long | Analysis ID try { - OperationBinaryExportMetadataBinaryExportResult result = apiInstance.v3QueueBinaryExport(analysisId); + OperationDynamicExecutionMetadataDynamicExecutionResult result = apiInstance.v3GetDynamicExecutionOperation(analysisId); System.out.println(result); } catch (ApiException e) { - System.err.println("Exception when calling AnalysesCoreApi#v3QueueBinaryExport"); + System.err.println("Exception when calling AnalysesCoreApi#v3GetDynamicExecutionOperation"); System.err.println("Status code: " + e.getCode()); System.err.println("Reason: " + e.getResponseBody()); System.err.println("Response headers: " + e.getResponseHeaders()); @@ -2916,7 +3087,7 @@ public class Example { ### Return type -[**OperationBinaryExportMetadataBinaryExportResult**](OperationBinaryExportMetadataBinaryExportResult.md) +[**OperationDynamicExecutionMetadataDynamicExecutionResult**](OperationDynamicExecutionMetadataDynamicExecutionResult.md) ### Authorization @@ -2930,19 +3101,19 @@ public class Example { ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -| **202** | Accepted | - | +| **200** | OK | - | | **403** | Forbidden | - | | **404** | Not Found | - | | **422** | Unprocessable Entity | - | | **500** | Internal Server Error | - | - -# **v3SearchTags** -> SearchTagsOutputBody v3SearchTags(partialName, limit, offset) + +# **v3GetDynamicExecutionPcap** +> v3GetDynamicExecutionPcap(analysisId) -Search tags +Download the network capture. -Searches for tags by name. partial_name is required and must be at least 3 characters. **Error codes:** - `422` [`VALIDATION_FAILED`](/errors/VALIDATION_FAILED) — Validation Failed +Streams the pcap of the analysis VM's traffic. Returns 404 if no pcap was captured. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `409` [`DYNAMIC_EXECUTION_INCOMPLETE`](/errors/DYNAMIC_EXECUTION_INCOMPLETE) — Dynamic Execution Incomplete ### Example ```java @@ -2970,14 +3141,11 @@ public class Example { bearerAuth.setBearerToken("BEARER TOKEN"); AnalysesCoreApi apiInstance = new AnalysesCoreApi(defaultClient); - String partialName = "partialName_example"; // String | Partial or full tag name to search for, at least 3 characters - Long limit = 10L; // Long | Maximum results to return - Long offset = 0L; // Long | Number of results to skip + Long analysisId = 56L; // Long | Analysis ID try { - SearchTagsOutputBody result = apiInstance.v3SearchTags(partialName, limit, offset); - System.out.println(result); + apiInstance.v3GetDynamicExecutionPcap(analysisId); } catch (ApiException e) { - System.err.println("Exception when calling AnalysesCoreApi#v3SearchTags"); + System.err.println("Exception when calling AnalysesCoreApi#v3GetDynamicExecutionPcap"); System.err.println("Status code: " + e.getCode()); System.err.println("Reason: " + e.getResponseBody()); System.err.println("Response headers: " + e.getResponseHeaders()); @@ -2991,13 +3159,11 @@ public class Example { | Name | Type | Description | Notes | |------------- | ------------- | ------------- | -------------| -| **partialName** | **String**| Partial or full tag name to search for, at least 3 characters | [optional] | -| **limit** | **Long**| Maximum results to return | [optional] [default to 10] | -| **offset** | **Long**| Number of results to skip | [optional] [default to 0] | +| **analysisId** | **Long**| Analysis ID | | ### Return type -[**SearchTagsOutputBody**](SearchTagsOutputBody.md) +null (empty response body) ### Authorization @@ -3012,16 +3178,19 @@ public class Example { | Status code | Description | Response headers | |-------------|-------------|------------------| | **200** | OK | - | +| **403** | Forbidden | - | +| **404** | Not Found | - | +| **409** | Conflict | - | | **422** | Unprocessable Entity | - | | **500** | Internal Server Error | - | - -# **v3UpdateAnalysis** -> AnalysisDetailOutputBody v3UpdateAnalysis(analysisId, updateAnalysisInputBody) + +# **v3GetDynamicExecutionReport** +> AnalysisReport v3GetDynamicExecutionReport(analysisId) -Update an analysis. +Get the dynamic execution report. -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 +Returns the dynamic execution report JSON for the analysis. Requires the run to be COMPLETED. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `409` [`DYNAMIC_EXECUTION_INCOMPLETE`](/errors/DYNAMIC_EXECUTION_INCOMPLETE) — Dynamic Execution Incomplete ### Example ```java @@ -3050,7 +3219,1371 @@ public class Example { AnalysesCoreApi apiInstance = new AnalysesCoreApi(defaultClient); Long analysisId = 56L; // Long | Analysis ID - UpdateAnalysisInputBody updateAnalysisInputBody = new UpdateAnalysisInputBody(); // UpdateAnalysisInputBody | + try { + AnalysisReport result = apiInstance.v3GetDynamicExecutionReport(analysisId); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling AnalysesCoreApi#v3GetDynamicExecutionReport"); + 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 + +[**AnalysisReport**](AnalysisReport.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 | - | +| **409** | Conflict | - | +| **422** | Unprocessable Entity | - | +| **500** | Internal Server Error | - | + + +# **v3GetDynamicExecutionScreenshot** +> v3GetDynamicExecutionScreenshot(analysisId, index) + +Download a screenshot. + +Streams one screenshot, 1-indexed as listed by the screenshots endpoint. Requires the run to be COMPLETED. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `409` [`DYNAMIC_EXECUTION_INCOMPLETE`](/errors/DYNAMIC_EXECUTION_INCOMPLETE) — Dynamic Execution Incomplete + +### 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 + Long index = 56L; // Long | Index of the screenshot, as listed by the screenshots endpoint + try { + apiInstance.v3GetDynamicExecutionScreenshot(analysisId, index); + } catch (ApiException e) { + System.err.println("Exception when calling AnalysesCoreApi#v3GetDynamicExecutionScreenshot"); + 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 | | +| **index** | **Long**| Index of the screenshot, as listed by the screenshots endpoint | | + +### 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 | - | +| **409** | Conflict | - | +| **422** | Unprocessable Entity | - | +| **500** | Internal Server Error | - | + + +# **v3GetDynamicExecutionSummary** +> DynamicExecutionSummary v3GetDynamicExecutionSummary(analysisId) + +Get the dynamic execution summary. + +Returns the LLM-generated Markdown summary of the run. Requires the run to be COMPLETED. Returns 404 if no summary has been generated. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `409` [`DYNAMIC_EXECUTION_INCOMPLETE`](/errors/DYNAMIC_EXECUTION_INCOMPLETE) — Dynamic Execution Incomplete + +### 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 { + DynamicExecutionSummary result = apiInstance.v3GetDynamicExecutionSummary(analysisId); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling AnalysesCoreApi#v3GetDynamicExecutionSummary"); + 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 + +[**DynamicExecutionSummary**](DynamicExecutionSummary.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 | - | +| **409** | Conflict | - | +| **422** | Unprocessable Entity | - | +| **500** | Internal Server Error | - | + + +# **v3GetDynamicExecutionSummaryOperation** +> OperationDynamicExecutionSummaryMetadataDynamicExecutionSummaryResult v3GetDynamicExecutionSummaryOperation(analysisId) + +Get a dynamic execution summary operation. + +Returns the state of the most recent summary attempt for this analysis, whether made by its run or by a regenerate. **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 { + OperationDynamicExecutionSummaryMetadataDynamicExecutionSummaryResult result = apiInstance.v3GetDynamicExecutionSummaryOperation(analysisId); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling AnalysesCoreApi#v3GetDynamicExecutionSummaryOperation"); + 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 + +[**OperationDynamicExecutionSummaryMetadataDynamicExecutionSummaryResult**](OperationDynamicExecutionSummaryMetadataDynamicExecutionSummaryResult.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 | - | + + +# **v3GetDynamicExecutionWiresharkKeys** +> v3GetDynamicExecutionWiresharkKeys(analysisId) + +Download Wireshark TLS session keys. + +Returns the Wireshark-format TLS session key log for decrypting HTTPS traffic in the pcap. Returns 404 if no keys were captured. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `409` [`DYNAMIC_EXECUTION_INCOMPLETE`](/errors/DYNAMIC_EXECUTION_INCOMPLETE) — Dynamic Execution Incomplete + +### 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.v3GetDynamicExecutionWiresharkKeys(analysisId); + } catch (ApiException e) { + System.err.println("Exception when calling AnalysesCoreApi#v3GetDynamicExecutionWiresharkKeys"); + 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 | +|-------------|-------------|------------------| +| **200** | OK | - | +| **403** | Forbidden | - | +| **404** | Not Found | - | +| **409** | Conflict | - | +| **422** | Unprocessable Entity | - | +| **500** | Internal Server Error | - | + + +# **v3ListAnalyses** +> ListAnalysesOutputBody v3ListAnalyses(searchTerm, analysisScope, status, modelName, usernames, sha256Hash, binaryId, platform, architecture, pageSize, nextPageToken, orderBy, order) + +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 + +### 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 searchTerm = "searchTerm_example"; // String | + List analysisScope = Arrays.asList(); // List | Leave empty to search your own, your team's and all public analyses + List status = Arrays.asList(); // List | + 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 | + String nextPageToken = "nextPageToken_example"; // String | Forward-pagination cursor from a prior response. When set, order_by/order are taken from the token (the sort cannot change mid-pagination). + String orderBy = "created"; // String | + String order = "ASC"; // String | + try { + 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"); + 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 | +|------------- | ------------- | ------------- | -------------| +| **searchTerm** | **String**| | [optional] | +| **analysisScope** | [**List<String>**](String.md)| Leave empty to search your own, your team's and all public analyses | [optional] [enum: PRIVATE, PUBLIC, TEAM] | +| **status** | [**List<String>**](String.md)| | [optional] [enum: Uploaded, Queued, Complete, Error, Processing] | +| **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] | +| **nextPageToken** | **String**| Forward-pagination cursor from a prior response. When set, order_by/order are taken from the token (the sort cannot change mid-pagination). | [optional] | +| **orderBy** | **String**| | [optional] [default to created] [enum: created, binary_name, binary_size] | +| **order** | **String**| | [optional] [default to DESC] [enum: ASC, DESC] | + +### Return type + +[**ListAnalysesOutputBody**](ListAnalysesOutputBody.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 | - | +| **400** | Bad Request | - | +| **422** | Unprocessable Entity | - | +| **500** | Internal Server Error | - | + + +# **v3ListAnalysisGlobals** +> ListAnalysisGlobalsOutputBody v3ListAnalysisGlobals(analysisId, page, pageSize, search, named, dataTypeId, valueKind, referenced, orderBy, sortOrder) + +List the global variables in an analysis. + +Returns the analysis's global variables as first-class rows, with the recovered name, data type, decoded initial value and the provenance of each. Supports name search, filtering by data type, value kind, named-ness and whether any function references the global, plus sorting and pagination. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `400` [`BAD_REQUEST`](/errors/BAD_REQUEST) — Bad Request + +### 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 + Long page = 1L; // Long | Page number (1-indexed). + Long pageSize = 100L; // Long | Number of results per page. + String search = "search_example"; // String | Filter by name (case-insensitive substring match). + String named = "true"; // String | Keep only globals that have a name (true) or only those that don't (false). Omit for both. + Long dataTypeId = 56L; // Long | Keep only globals carrying this analysis data type. + List valueKind = Arrays.asList(); // List | Keep only globals whose decoded value is of these kinds. + String referenced = "true"; // String | Keep only globals referenced by at least one function (true) or only unreferenced ones (false). Omit for both. + String orderBy = "vaddr"; // String | Field to order results by. + String sortOrder = "ASC"; // String | Sort direction. + try { + ListAnalysisGlobalsOutputBody result = apiInstance.v3ListAnalysisGlobals(analysisId, page, pageSize, search, named, dataTypeId, valueKind, referenced, orderBy, sortOrder); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling AnalysesCoreApi#v3ListAnalysisGlobals"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **analysisId** | **Long**| Analysis ID | | +| **page** | **Long**| Page number (1-indexed). | [optional] [default to 1] | +| **pageSize** | **Long**| Number of results per page. | [optional] [default to 100] | +| **search** | **String**| Filter by name (case-insensitive substring match). | [optional] | +| **named** | **String**| Keep only globals that have a name (true) or only those that don't (false). Omit for both. | [optional] [enum: true, false] | +| **dataTypeId** | **Long**| Keep only globals carrying this analysis data type. | [optional] | +| **valueKind** | [**List<String>**](String.md)| Keep only globals whose decoded value is of these kinds. | [optional] [enum: BSS, STRING, SHORT_STRING, FLOAT, POINTER, DYNAMIC_INIT, HEX, INT, BOOL] | +| **referenced** | **String**| Keep only globals referenced by at least one function (true) or only unreferenced ones (false). Omit for both. | [optional] [enum: true, false] | +| **orderBy** | **String**| Field to order results by. | [optional] [default to vaddr] [enum: vaddr, name, size, ref_count] | +| **sortOrder** | **String**| Sort direction. | [optional] [default to ASC] [enum: ASC, DESC] | + +### Return type + +[**ListAnalysisGlobalsOutputBody**](ListAnalysisGlobalsOutputBody.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 | - | +| **400** | Bad Request | - | +| **403** | Forbidden | - | +| **404** | Not Found | - | +| **422** | Unprocessable Entity | - | +| **500** | Internal Server Error | - | + + +# **v3ListAnalysisOperations** +> AnalysisOperationsOutputBody v3ListAnalysisOperations(analysisId) + +List the operations run on an analysis. + +Returns the analysis' `static-analysis` operation, followed by the latest run of each other operation started on its binary: the binary agents, the script-agent scans and dynamic execution. The `static-analysis` operation is always included, even when no other operations have run. Each entry's `name` is the operation's resource name, polled at `/v3/{name}`. Other operations that have never run are omitted. **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 { + AnalysisOperationsOutputBody result = apiInstance.v3ListAnalysisOperations(analysisId); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling AnalysesCoreApi#v3ListAnalysisOperations"); + 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 + +[**AnalysisOperationsOutputBody**](AnalysisOperationsOutputBody.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 | - | + + +# **v3ListDynamicExecutionScreenshots** +> ScreenshotsIndex v3ListDynamicExecutionScreenshots(analysisId) + +List the screenshots captured during execution. + +Returns the screenshots captured from the analysis VM, in capture order. Requires the run to be COMPLETED. Returns an empty list when the run captured none. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `409` [`DYNAMIC_EXECUTION_INCOMPLETE`](/errors/DYNAMIC_EXECUTION_INCOMPLETE) — Dynamic Execution Incomplete + +### 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 { + ScreenshotsIndex result = apiInstance.v3ListDynamicExecutionScreenshots(analysisId); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling AnalysesCoreApi#v3ListDynamicExecutionScreenshots"); + 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 + +[**ScreenshotsIndex**](ScreenshotsIndex.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 | - | +| **409** | Conflict | - | +| **422** | Unprocessable Entity | - | +| **500** | Internal Server Error | - | + + +# **v3ListExampleAnalyses** +> ListExampleAnalysesOutputBody v3ListExampleAnalyses() + +List example analyses + +Returns the curated example Analyses. + +### 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); + try { + ListExampleAnalysesOutputBody result = apiInstance.v3ListExampleAnalyses(); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling AnalysesCoreApi#v3ListExampleAnalyses"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +[**ListExampleAnalysesOutputBody**](ListExampleAnalysesOutputBody.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 | - | +| **0** | Error | - | + + +# **v3ListGlobalFunctions** +> ListGlobalFunctionsOutputBody v3ListGlobalFunctions(analysisId, vaddr, page, pageSize) + +List the functions referencing a global variable. + +Returns the functions that reference the global at the given virtual address, each with the number of times it is referenced. **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 + Long vaddr = 56L; // Long | Virtual address of the global variable. + Long page = 1L; // Long | Page number (1-indexed). + Long pageSize = 100L; // Long | Number of results per page. + try { + ListGlobalFunctionsOutputBody result = apiInstance.v3ListGlobalFunctions(analysisId, vaddr, page, pageSize); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling AnalysesCoreApi#v3ListGlobalFunctions"); + 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 | | +| **vaddr** | **Long**| Virtual address of the global variable. | | +| **page** | **Long**| Page number (1-indexed). | [optional] [default to 1] | +| **pageSize** | **Long**| Number of results per page. | [optional] [default to 100] | + +### Return type + +[**ListGlobalFunctionsOutputBody**](ListGlobalFunctionsOutputBody.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 | - | + + +# **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 | - | + + +# **v3RequeueAnalysis** +> OperationCreateMetadataCreateResult v3RequeueAnalysis(analysisId, requeueAnalysisRequest) + +Requeue an analysis + +Creates a new Analysis and a new Binary sharing this Analysis's SHA-256, and runs the pipeline against them, leaving this Analysis and its Binary unchanged. Only the owner may call it. Poll the returned Operation for status, same as a normal create. **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 + RequeueAnalysisRequest requeueAnalysisRequest = new RequeueAnalysisRequest(); // RequeueAnalysisRequest | + try { + OperationCreateMetadataCreateResult result = apiInstance.v3RequeueAnalysis(analysisId, requeueAnalysisRequest); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling AnalysesCoreApi#v3RequeueAnalysis"); + 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 | | +| **requeueAnalysisRequest** | [**RequeueAnalysisRequest**](RequeueAnalysisRequest.md)| | | + +### Return type + +[**OperationCreateMetadataCreateResult**](OperationCreateMetadataCreateResult.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 | +|-------------|-------------|------------------| +| **201** | Created | - | +| **403** | Forbidden | - | +| **404** | Not Found | - | +| **422** | Unprocessable Entity | - | +| **500** | Internal Server Error | - | + + +# **v3RunDynamicExecution** +> OperationDynamicExecutionMetadataDynamicExecutionResult v3RunDynamicExecution(analysisId, runDynamicExecutionInputBody) + +Trigger a dynamic execution run. + +Submits the analysis's binary to the sandbox and returns the operation to poll for its outcome. Returns 409 while a run is already in progress for this analysis. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `400` [`BAD_REQUEST`](/errors/BAD_REQUEST) — Bad Request - `409` [`CONFLICT`](/errors/CONFLICT) — Conflict + +### Example +```java +// Import classes: +import ai.reveng.invoker.ApiClient; +import ai.reveng.invoker.ApiException; +import ai.reveng.invoker.Configuration; +import ai.reveng.invoker.auth.*; +import ai.reveng.invoker.models.*; +import ai.reveng.api.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 + RunDynamicExecutionInputBody runDynamicExecutionInputBody = new RunDynamicExecutionInputBody(); // RunDynamicExecutionInputBody | + try { + OperationDynamicExecutionMetadataDynamicExecutionResult result = apiInstance.v3RunDynamicExecution(analysisId, runDynamicExecutionInputBody); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling AnalysesCoreApi#v3RunDynamicExecution"); + 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 | | +| **runDynamicExecutionInputBody** | [**RunDynamicExecutionInputBody**](RunDynamicExecutionInputBody.md)| | [optional] | + +### Return type + +[**OperationDynamicExecutionMetadataDynamicExecutionResult**](OperationDynamicExecutionMetadataDynamicExecutionResult.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 | - | +| **409** | Conflict | - | +| **422** | Unprocessable Entity | - | +| **500** | Internal Server Error | - | + + +# **v3RunDynamicExecutionSummary** +> OperationDynamicExecutionSummaryMetadataDynamicExecutionSummaryResult v3RunDynamicExecutionSummary(analysisId) + +Regenerate the dynamic execution summary. + +Starts a new LLM summary of the analysis's completed run and returns the operation to poll. The new summary replaces the stored one once it succeeds. Only the analysis owner may regenerate. Returns 409 while the run is incomplete or a summary is already in progress. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `400` [`BAD_REQUEST`](/errors/BAD_REQUEST) — Bad Request - `409` [`CONFLICT`](/errors/CONFLICT) — Conflict - `409` [`DYNAMIC_EXECUTION_INCOMPLETE`](/errors/DYNAMIC_EXECUTION_INCOMPLETE) — Dynamic Execution Incomplete + +### 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 { + OperationDynamicExecutionSummaryMetadataDynamicExecutionSummaryResult result = apiInstance.v3RunDynamicExecutionSummary(analysisId); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling AnalysesCoreApi#v3RunDynamicExecutionSummary"); + 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 + +[**OperationDynamicExecutionSummaryMetadataDynamicExecutionSummaryResult**](OperationDynamicExecutionSummaryMetadataDynamicExecutionSummaryResult.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 | - | +| **400** | Bad Request | - | +| **403** | Forbidden | - | +| **404** | Not Found | - | +| **409** | Conflict | - | +| **422** | Unprocessable Entity | - | +| **500** | Internal Server Error | - | + + +# **v3SearchTags** +> SearchTagsOutputBody v3SearchTags(partialName, limit, offset) + +Search tags + +Searches for tags by name. partial_name is required and must be at least 3 characters. **Error codes:** - `422` [`VALIDATION_FAILED`](/errors/VALIDATION_FAILED) — Validation Failed + +### Example +```java +// Import classes: +import ai.reveng.invoker.ApiClient; +import ai.reveng.invoker.ApiException; +import ai.reveng.invoker.Configuration; +import ai.reveng.invoker.auth.*; +import ai.reveng.invoker.models.*; +import ai.reveng.api.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 partialName = "partialName_example"; // String | Partial or full tag name to search for, at least 3 characters + Long limit = 10L; // Long | Maximum results to return + Long offset = 0L; // Long | Number of results to skip + try { + SearchTagsOutputBody result = apiInstance.v3SearchTags(partialName, limit, offset); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling AnalysesCoreApi#v3SearchTags"); + 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 | +|------------- | ------------- | ------------- | -------------| +| **partialName** | **String**| Partial or full tag name to search for, at least 3 characters | [optional] | +| **limit** | **Long**| Maximum results to return | [optional] [default to 10] | +| **offset** | **Long**| Number of results to skip | [optional] [default to 0] | + +### Return type + +[**SearchTagsOutputBody**](SearchTagsOutputBody.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 | - | +| **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); @@ -3095,6 +4628,89 @@ public class Example { | **422** | Unprocessable Entity | - | | **500** | Internal Server Error | - | + +# **v3UpdateAnalysisGlobal** +> GlobalVariable v3UpdateAnalysisGlobal(analysisId, vaddr, updateAnalysisGlobalInputBody) + +Edit a global variable. + +Renames a global, assigns it an analysis data type, or both. Each field the request sets stamps its own provenance `USER`, which a later re-extraction carries forward instead of overwriting. A name another global in the analysis already holds is rejected. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `400` [`BAD_REQUEST`](/errors/BAD_REQUEST) — Bad Request - `409` [`ALREADY_EXISTS`](/errors/ALREADY_EXISTS) — Already Exists + +### 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 + Long vaddr = 56L; // Long | Virtual address of the global variable. + UpdateAnalysisGlobalInputBody updateAnalysisGlobalInputBody = new UpdateAnalysisGlobalInputBody(); // UpdateAnalysisGlobalInputBody | + try { + GlobalVariable result = apiInstance.v3UpdateAnalysisGlobal(analysisId, vaddr, updateAnalysisGlobalInputBody); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling AnalysesCoreApi#v3UpdateAnalysisGlobal"); + 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 | | +| **vaddr** | **Long**| Virtual address of the global variable. | | +| **updateAnalysisGlobalInputBody** | [**UpdateAnalysisGlobalInputBody**](UpdateAnalysisGlobalInputBody.md)| | | + +### Return type + +[**GlobalVariable**](GlobalVariable.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 | - | +| **409** | Conflict | - | +| **422** | Unprocessable Entity | - | +| **500** | Internal Server Error | - | + # **v3UpdateAnalysisTags** > AnalysisTagsOutputBody v3UpdateAnalysisTags(analysisId, updateTagsInputBody) diff --git a/docs/AnalysisBasicInfoOutputBody.md b/docs/AnalysisBasicInfoOutputBody.md index d4614d6..cbf4ca4 100644 --- a/docs/AnalysisBasicInfoOutputBody.md +++ b/docs/AnalysisBasicInfoOutputBody.md @@ -18,6 +18,7 @@ |**detectedArchitecture** | **String** | Detected instruction-set architecture; empty when unavailable | | |**detectedBinaryFormat** | **String** | Detected binary container format; empty when unavailable | | |**detectedBinaryType** | **String** | Detected operating-system platform; empty when unavailable | | +|**detectedLanguage** | **String** | Detected source language; empty when unavailable | | |**functionCount** | **Long** | Number of functions in the binary | | |**isAdvanced** | **Boolean** | True when the analysis was run in advanced mode | | |**isOwner** | **Boolean** | True when the caller is the analysis owner | | diff --git a/docs/AnalysisDetailOutputBody.md b/docs/AnalysisDetailOutputBody.md index 2216a6a..e93b80b 100644 --- a/docs/AnalysisDetailOutputBody.md +++ b/docs/AnalysisDetailOutputBody.md @@ -17,12 +17,15 @@ |**binaryName** | **String** | | | |**binarySize** | **Long** | | | |**binaryType** | **String** | | | +|**capabilityCount** | **Long** | Number of capabilities in the latest capabilities agent result. Null when the agent has not produced a result | | |**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 | | +|**securityFindingCount** | **Long** | Number of HIGH or CRITICAL findings in the latest security scan. Null when the scan has not produced a result | | |**sha256Hash** | **String** | | | +|**threatScore** | **Double** | Software threat score from the latest triage result, from 0 to 1. Null when triage has not produced a result | | diff --git a/docs/AnalysisOperationBody.md b/docs/AnalysisOperationBody.md new file mode 100644 index 0000000..1adb1a1 --- /dev/null +++ b/docs/AnalysisOperationBody.md @@ -0,0 +1,28 @@ + + +# AnalysisOperationBody + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**name** | **String** | Resource name of the operation, polled at /v3/{name} | | +|**operation** | **String** | Operation slug, the collection the operation is polled under | | +|**status** | [**StatusEnum**](#StatusEnum) | Status of the operation's latest run | | + + + +## Enum: StatusEnum + +| Name | Value | +|---- | -----| +| UNINITIALISED | "UNINITIALISED" | +| PENDING | "PENDING" | +| RUNNING | "RUNNING" | +| COMPLETED | "COMPLETED" | +| FAILED | "FAILED" | +| UNKNOWN_DEFAULT_OPEN_API | "unknown_default_open_api" | + + + diff --git a/docs/AnalysisOperationsOutputBody.md b/docs/AnalysisOperationsOutputBody.md new file mode 100644 index 0000000..56bb0c4 --- /dev/null +++ b/docs/AnalysisOperationsOutputBody.md @@ -0,0 +1,13 @@ + + +# AnalysisOperationsOutputBody + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**operations** | **List<AnalysisOperationBody>** | The analysis' static-analysis operation, followed by the latest run of each other operation started on its binary. Operations that have never run are omitted | | + + + diff --git a/docs/AnalysisRecordBody.md b/docs/AnalysisRecordBody.md index 4009e5e..1019ab8 100644 --- a/docs/AnalysisRecordBody.md +++ b/docs/AnalysisRecordBody.md @@ -17,6 +17,7 @@ |**detectedArchitecture** | **String** | Detected instruction-set architecture; empty when unavailable | | |**detectedBinaryFormat** | **String** | Detected binary container format; empty when unavailable | | |**detectedBinaryType** | **String** | Detected operating-system platform; empty when unavailable | | +|**detectedLanguage** | **String** | Detected source language; empty when unavailable | | |**functionBoundariesHash** | **String** | Hash of the binary's provided function boundaries | | |**isOwner** | **Boolean** | True when the caller owns the analysis | | |**modelId** | **Long** | Model ID | | diff --git a/docs/AuthenticationUsersApi.md b/docs/AuthenticationUsersApi.md index 0ab964d..929d728 100644 --- a/docs/AuthenticationUsersApi.md +++ b/docs/AuthenticationUsersApi.md @@ -9,6 +9,7 @@ All URIs are relative to *https://api.reveng.ai* | [**submitUserFeedback**](AuthenticationUsersApi.md#submitUserFeedback) | **POST** /v2/users/feedback | Submit feedback about the application | | [**v3GetUser**](AuthenticationUsersApi.md#v3GetUser) | **GET** /v3/users/{user_id} | Get a user's public information | | [**v3GetUserActivity**](AuthenticationUsersApi.md#v3GetUserActivity) | **GET** /v3/users/activity | Get the caller's activity feed | +| [**v3ListUsers**](AuthenticationUsersApi.md#v3ListUsers) | **GET** /v3/users | Search users | | [**v3SubmitUserFeedback**](AuthenticationUsersApi.md#v3SubmitUserFeedback) | **POST** /v3/users/feedback | Submit feedback | @@ -372,6 +373,80 @@ This endpoint does not need any parameter. | **200** | OK | - | | **0** | Error | - | + +# **v3ListUsers** +> ListPublicUsersOutputBody v3ListUsers(searchTerm) + +Search users + +Returns up to 5 active users whose username contains the search term (case-insensitive), with their ID and username, ordered by username. + +### 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.AuthenticationUsersApi; + +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"); + + AuthenticationUsersApi apiInstance = new AuthenticationUsersApi(defaultClient); + String searchTerm = "searchTerm_example"; // String | Text the username contains (case-insensitive) + try { + ListPublicUsersOutputBody result = apiInstance.v3ListUsers(searchTerm); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling AuthenticationUsersApi#v3ListUsers"); + 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 | +|------------- | ------------- | ------------- | -------------| +| **searchTerm** | **String**| Text the username contains (case-insensitive) | | + +### Return type + +[**ListPublicUsersOutputBody**](ListPublicUsersOutputBody.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 | - | +| **0** | Error | - | + # **v3SubmitUserFeedback** > SubmitFeedbackOutputBody v3SubmitUserFeedback(submitFeedbackBody) diff --git a/docs/Binary.md b/docs/Binary.md index 4b1c358..c492c9a 100644 --- a/docs/Binary.md +++ b/docs/Binary.md @@ -13,6 +13,7 @@ |**createdAt** | **OffsetDateTime** | | | |**detectedArchitecture** | **String** | Detected instruction-set architecture; empty when unavailable | | |**detectedBinaryType** | **String** | Detected operating-system platform; empty when unavailable | | +|**detectedLanguage** | **String** | Detected source language; empty when unavailable | | |**isSystemAnalysis** | **Boolean** | | | |**modelName** | **String** | Name of the model the analysis ran on | | |**ownerId** | **Long** | | | diff --git a/docs/CallChainEvidence.md b/docs/CallChainEvidence.md index a0b0663..79e542e 100644 --- a/docs/CallChainEvidence.md +++ b/docs/CallChainEvidence.md @@ -2,17 +2,26 @@ # CallChainEvidence -A concrete sequence of calls connecting program locations. ## Properties | Name | Type | Description | Notes | |------------ | ------------- | ------------- | -------------| -|**evidenceKind** | [**EvidenceKindEnum**](#EvidenceKindEnum) | | [optional] | -|**kind** | [**KindEnum**](#KindEnum) | | [optional] | -|**effect** | **EvidenceEffect** | | | -|**strength** | [**StrengthEnum**](#StrengthEnum) | | [optional] | -|**callChain** | **List<Integer>** | | | +|**callChain** | **List<Long>** | Addresses along the call chain. | | +|**effect** | [**EffectEnum**](#EffectEnum) | Whether the evidence supports or refutes the finding. | | +|**evidenceKind** | [**EvidenceKindEnum**](#EvidenceKindEnum) | Kind of evidence. | | +|**kind** | [**KindEnum**](#KindEnum) | How the evidence was derived. | | +|**strength** | [**StrengthEnum**](#StrengthEnum) | How directly the evidence bears on the finding. | | + + + +## Enum: EffectEnum + +| Name | Value | +|---- | -----| +| SUPPORTS | "supports" | +| REFUTES | "refutes" | +| UNKNOWN_DEFAULT_OPEN_API | "unknown_default_open_api" | diff --git a/docs/DecompilerSummaryEvidence.md b/docs/DecompilerSummaryEvidence.md index f3d2d18..0359a0e 100644 --- a/docs/DecompilerSummaryEvidence.md +++ b/docs/DecompilerSummaryEvidence.md @@ -2,17 +2,26 @@ # DecompilerSummaryEvidence -Semantic summaries derived from decompiler output. ## Properties | Name | Type | Description | Notes | |------------ | ------------- | ------------- | -------------| -|**evidenceKind** | [**EvidenceKindEnum**](#EvidenceKindEnum) | | [optional] | -|**kind** | [**KindEnum**](#KindEnum) | | [optional] | -|**effect** | **EvidenceEffect** | | | -|**strength** | [**StrengthEnum**](#StrengthEnum) | | [optional] | -|**summaries** | [**List<DecompilerSummary>**](DecompilerSummary.md) | | | +|**effect** | [**EffectEnum**](#EffectEnum) | Whether the evidence supports or refutes the finding. | | +|**evidenceKind** | [**EvidenceKindEnum**](#EvidenceKindEnum) | Kind of evidence. | | +|**kind** | [**KindEnum**](#KindEnum) | How the evidence was derived. | | +|**strength** | [**StrengthEnum**](#StrengthEnum) | How directly the evidence bears on the finding. | | +|**summaries** | **List<ReportCodeSummary>** | Summaries of the decompiled code. | | + + + +## Enum: EffectEnum + +| Name | Value | +|---- | -----| +| SUPPORTS | "supports" | +| REFUTES | "refutes" | +| UNKNOWN_DEFAULT_OPEN_API | "unknown_default_open_api" | diff --git a/docs/DisassemblySummaryEvidence.md b/docs/DisassemblySummaryEvidence.md new file mode 100644 index 0000000..9243dae --- /dev/null +++ b/docs/DisassemblySummaryEvidence.md @@ -0,0 +1,54 @@ + + +# DisassemblySummaryEvidence + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**effect** | [**EffectEnum**](#EffectEnum) | Whether the evidence supports or refutes the finding. | | +|**evidenceKind** | [**EvidenceKindEnum**](#EvidenceKindEnum) | Kind of evidence. | | +|**kind** | [**KindEnum**](#KindEnum) | How the evidence was derived. | | +|**strength** | [**StrengthEnum**](#StrengthEnum) | How directly the evidence bears on the finding. | | +|**summaries** | **List<ReportCodeSummary>** | Summaries of the disassembled code. | | + + + +## Enum: EffectEnum + +| Name | Value | +|---- | -----| +| SUPPORTS | "supports" | +| REFUTES | "refutes" | +| UNKNOWN_DEFAULT_OPEN_API | "unknown_default_open_api" | + + + +## Enum: EvidenceKindEnum + +| Name | Value | +|---- | -----| +| DISASSEMBLY_SUMMARY | "disassembly_summary" | +| UNKNOWN_DEFAULT_OPEN_API | "unknown_default_open_api" | + + + +## Enum: KindEnum + +| Name | Value | +|---- | -----| +| MODEL_INTERPRETATION | "model_interpretation" | +| UNKNOWN_DEFAULT_OPEN_API | "unknown_default_open_api" | + + + +## Enum: StrengthEnum + +| Name | Value | +|---- | -----| +| INDIRECT | "indirect" | +| UNKNOWN_DEFAULT_OPEN_API | "unknown_default_open_api" | + + + diff --git a/docs/DynamicExecutionResult.md b/docs/DynamicExecutionResult.md new file mode 100644 index 0000000..280eac3 --- /dev/null +++ b/docs/DynamicExecutionResult.md @@ -0,0 +1,13 @@ + + +# DynamicExecutionResult + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**reportAvailable** | **Boolean** | Whether the run's report can be fetched from the report endpoint. Always true when the operation succeeded. | | + + + diff --git a/docs/DynamicExecutionSummaryResult.md b/docs/DynamicExecutionSummaryResult.md new file mode 100644 index 0000000..b57068f --- /dev/null +++ b/docs/DynamicExecutionSummaryResult.md @@ -0,0 +1,13 @@ + + +# DynamicExecutionSummaryResult + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**summaryAvailable** | **Boolean** | Whether the summary can be fetched from the summary endpoint. Always true when the operation succeeded. | | + + + diff --git a/docs/ErrorBody.md b/docs/ErrorBody.md index 24217e0..768081c 100644 --- a/docs/ErrorBody.md +++ b/docs/ErrorBody.md @@ -26,6 +26,7 @@ | CLIENT_CLOSED_REQUEST | "CLIENT_CLOSED_REQUEST" | | CONFLICT | "CONFLICT" | | CONVERSATION_NOT_FOUND | "CONVERSATION_NOT_FOUND" | +| DISPOSABLE_EMAIL_NOT_ALLOWED | "DISPOSABLE_EMAIL_NOT_ALLOWED" | | DOMAIN_ALREADY_CLAIMED | "DOMAIN_ALREADY_CLAIMED" | | DOMAIN_VERIFICATION_PENDING | "DOMAIN_VERIFICATION_PENDING" | | DYNAMIC_EXECUTION_INCOMPLETE | "DYNAMIC_EXECUTION_INCOMPLETE" | @@ -53,6 +54,7 @@ | NO_PENDING_CONFIRMATION | "NO_PENDING_CONFIRMATION" | | NO_VIRUSTOTAL_KEY | "NO_VIRUSTOTAL_KEY" | | OIDC_DISCOVERY_FAILED | "OIDC_DISCOVERY_FAILED" | +| OPERATION_PREREQUISITE_NOT_MET | "OPERATION_PREREQUISITE_NOT_MET" | | PASSWORD_RESET_REQUIRED | "PASSWORD_RESET_REQUIRED" | | PAYMENT_REQUIRED | "PAYMENT_REQUIRED" | | PRECONDITION_FAILED | "PRECONDITION_FAILED" | diff --git a/docs/EvidenceInner.md b/docs/EvidenceInner.md index de87d36..bce4c4e 100644 --- a/docs/EvidenceInner.md +++ b/docs/EvidenceInner.md @@ -7,26 +7,35 @@ | Name | Type | Description | Notes | |------------ | ------------- | ------------- | -------------| -|**evidenceKind** | [**EvidenceKindEnum**](#EvidenceKindEnum) | | [optional] | -|**kind** | [**KindEnum**](#KindEnum) | | [optional] | -|**effect** | [**EffectEnum**](#EffectEnum) | | | -|**strength** | **EvidenceStrength** | | | -|**callChain** | **List<Integer>** | | | -|**constants** | [**List<ReferencedConstant>**](ReferencedConstant.md) | | | +|**callChain** | **List<Long>** | Addresses along the call chain. | | +|**effect** | [**EffectEnum**](#EffectEnum) | Whether the evidence supports or refutes the finding. | | +|**evidenceKind** | [**EvidenceKindEnum**](#EvidenceKindEnum) | Kind of evidence. | | +|**kind** | [**KindEnum**](#KindEnum) | How the evidence was derived. | | +|**strength** | [**StrengthEnum**](#StrengthEnum) | How directly the evidence bears on the finding. | | +|**constants** | **List<ReportReferencedConstant>** | The constants and where they are referenced. | | |**calls** | [**List<ImportedApiCall>**](ImportedApiCall.md) | | | -|**strings** | [**List<StringMatch>**](StringMatch.md) | | | -|**similarities** | [**List<FunctionSimilarity>**](FunctionSimilarity.md) | | | +|**strings** | **List<ReportStringMatch>** | The matched strings. | | +|**similarities** | **List<ReportFunctionSimilarity>** | The similar functions. | | |**apis** | [**List<ImportedApi>**](ImportedApi.md) | | | -|**summaries** | [**List<DecompilerSummary>**](DecompilerSummary.md) | | | -|**interpretations** | [**List<ModelInterpretation>**](ModelInterpretation.md) | | | -|**values** | **List<BytesConstant>** | | | -|**ruleId** | **String** | | | -|**description** | **String** | | | -|**secretKind** | **RuleKind** | | | -|**secret** | **String** | | | -|**entropy** | **BigDecimal** | | | -|**size** | **Integer** | | | -|**references** | **List<Integer>** | | | +|**summaries** | **List<ReportCodeSummary>** | Summaries of the decompiled code. | | +|**interpretations** | **List<ReportModelInterpretation>** | Interpretations of the code by an AI model. | | +|**values** | **List<ReportBytesConstant>** | The well-known constants found in the binary. | | +|**description** | **String** | What the rule detects. | | +|**entropy** | **Double** | Shannon entropy of the secret, in bits per byte. | | +|**references** | **List<Long>** | Address of the secret in the binary's data. | | +|**ruleId** | **String** | Identifier of the secret-scanning rule that matched. | | +|**secret** | **String** | The secret as it appears in the binary. | | +|**secretKind** | [**SecretKindEnum**](#SecretKindEnum) | Category of the secret. | | +|**size** | **Long** | Size of the secret in bytes. | | + + + +## Enum: EffectEnum + +| Name | Value | +|---- | -----| +| SUPPORTS | "supports" | +| UNKNOWN_DEFAULT_OPEN_API | "unknown_default_open_api" | @@ -48,11 +57,29 @@ -## Enum: EffectEnum +## Enum: StrengthEnum | Name | Value | |---- | -----| -| SUPPORTS | "supports" | +| DIRECT | "direct" | +| INDIRECT | "indirect" | +| UNKNOWN_DEFAULT_OPEN_API | "unknown_default_open_api" | + + + +## Enum: SecretKindEnum + +| Name | Value | +|---- | -----| +| CREDENTIALS | "credentials" | +| API_CREDENTIALS | "api-credentials" | +| OAUTH_CREDENTIALS | "oauth-credentials" | +| ENCRYPTION_KEY | "encryption-key" | +| JWT_TOKEN | "jwt-token" | +| WEBHOOK_URL | "webhook-url" | +| PRIVATE_KEY | "private-key" | +| SIGNED_URL | "signed-url" | +| GENERIC | "generic" | | UNKNOWN_DEFAULT_OPEN_API | "unknown_default_open_api" | diff --git a/docs/FunctionGlobalVariable.md b/docs/FunctionGlobalVariable.md new file mode 100644 index 0000000..55e561a --- /dev/null +++ b/docs/FunctionGlobalVariable.md @@ -0,0 +1,98 @@ + + +# FunctionGlobalVariable + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**dType** | **String** | Name of the assigned data type. | [optional] | +|**dataTypeId** | **Long** | Analysis data type, when one is assigned. | [optional] | +|**decompLines** | **List<Integer>** | 1-indexed lines of the function's AI decompilation that reference the global. | | +|**functionCount** | **Long** | How many functions' AI decompilations reference the global. | | +|**indirectTarget** | **Long** | Address a pointer slot resolves to. | [optional] | +|**isBss** | **Boolean** | Whether the address falls in a zero-initialised section. | | +|**name** | **String** | Recovered name, absent when nothing named the address. | [optional] | +|**nameSource** | [**NameSourceEnum**](#NameSourceEnum) | What named it. | [optional] | +|**refCount** | **Long** | How many times the function's AI decompilation references the global. | | +|**size** | **Long** | Size in bytes, when known. | [optional] | +|**sourceFunctionId** | **Long** | Function a constructed static was initialised in. | [optional] | +|**totalRefCount** | **Long** | How many times those AI decompilations reference the global, summed across functions. | | +|**typeSource** | [**TypeSourceEnum**](#TypeSourceEnum) | What typed it. | [optional] | +|**vaddr** | **Long** | Virtual address the global lives at. | | +|**value** | **String** | Decoded initial value, rendered for display. | [optional] | +|**valueConfidence** | **String** | How much to trust the decoded value. | [optional] | +|**valueKind** | [**ValueKindEnum**](#ValueKindEnum) | How the value was interpreted. | [optional] | +|**valueSource** | [**ValueSourceEnum**](#ValueSourceEnum) | What produced the value. | [optional] | + + + +## Enum: NameSourceEnum + +| Name | Value | +|---- | -----| +| SYSTEM | "SYSTEM" | +| RESOLVER | "RESOLVER" | +| DEBUG | "DEBUG" | +| CONSTRUCTOR | "CONSTRUCTOR" | +| VALUE | "VALUE" | +| AI_DECOMP | "AI_DECOMP" | +| AI_AGENT | "AI_AGENT" | +| USER | "USER" | +| ACCESS | "ACCESS" | +| UNKNOWN_DEFAULT_OPEN_API | "unknown_default_open_api" | + + + +## Enum: TypeSourceEnum + +| Name | Value | +|---- | -----| +| SYSTEM | "SYSTEM" | +| RESOLVER | "RESOLVER" | +| DEBUG | "DEBUG" | +| CONSTRUCTOR | "CONSTRUCTOR" | +| VALUE | "VALUE" | +| AI_DECOMP | "AI_DECOMP" | +| AI_AGENT | "AI_AGENT" | +| USER | "USER" | +| ACCESS | "ACCESS" | +| UNKNOWN_DEFAULT_OPEN_API | "unknown_default_open_api" | + + + +## Enum: ValueKindEnum + +| Name | Value | +|---- | -----| +| BSS | "BSS" | +| STRING | "STRING" | +| SHORT_STRING | "SHORT_STRING" | +| FLOAT | "FLOAT" | +| POINTER | "POINTER" | +| DYNAMIC_INIT | "DYNAMIC_INIT" | +| HEX | "HEX" | +| INT | "INT" | +| BOOL | "BOOL" | +| UNKNOWN_DEFAULT_OPEN_API | "unknown_default_open_api" | + + + +## Enum: ValueSourceEnum + +| Name | Value | +|---- | -----| +| SYSTEM | "SYSTEM" | +| RESOLVER | "RESOLVER" | +| DEBUG | "DEBUG" | +| CONSTRUCTOR | "CONSTRUCTOR" | +| VALUE | "VALUE" | +| AI_DECOMP | "AI_DECOMP" | +| AI_AGENT | "AI_AGENT" | +| USER | "USER" | +| ACCESS | "ACCESS" | +| UNKNOWN_DEFAULT_OPEN_API | "unknown_default_open_api" | + + + diff --git a/docs/FunctionSimilarityEvidence.md b/docs/FunctionSimilarityEvidence.md index 7a1f565..dd63b97 100644 --- a/docs/FunctionSimilarityEvidence.md +++ b/docs/FunctionSimilarityEvidence.md @@ -2,17 +2,26 @@ # FunctionSimilarityEvidence -Function-similarity results suggestive of a capability. ## Properties | Name | Type | Description | Notes | |------------ | ------------- | ------------- | -------------| -|**evidenceKind** | [**EvidenceKindEnum**](#EvidenceKindEnum) | | [optional] | -|**kind** | [**KindEnum**](#KindEnum) | | [optional] | -|**effect** | **EvidenceEffect** | | | -|**strength** | [**StrengthEnum**](#StrengthEnum) | | [optional] | -|**similarities** | [**List<FunctionSimilarity>**](FunctionSimilarity.md) | | | +|**effect** | [**EffectEnum**](#EffectEnum) | Whether the evidence supports or refutes the finding. | | +|**evidenceKind** | [**EvidenceKindEnum**](#EvidenceKindEnum) | Kind of evidence. | | +|**kind** | [**KindEnum**](#KindEnum) | How the evidence was derived. | | +|**similarities** | **List<ReportFunctionSimilarity>** | The similar functions. | | +|**strength** | [**StrengthEnum**](#StrengthEnum) | How directly the evidence bears on the finding. | | + + + +## Enum: EffectEnum + +| Name | Value | +|---- | -----| +| SUPPORTS | "supports" | +| REFUTES | "refutes" | +| UNKNOWN_DEFAULT_OPEN_API | "unknown_default_open_api" | diff --git a/docs/FunctionUsage.md b/docs/FunctionUsage.md new file mode 100644 index 0000000..798fe5f --- /dev/null +++ b/docs/FunctionUsage.md @@ -0,0 +1,17 @@ + + +# FunctionUsage + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**decompLines** | **List<Integer>** | | | +|**functionId** | **Long** | | | +|**functionName** | **String** | | | +|**functionVaddr** | **Long** | | | +|**refCount** | **Long** | | | + + + diff --git a/docs/FunctionsAiDecompilationApi.md b/docs/FunctionsAiDecompilationApi.md index 132e9fd..9eefe97 100644 --- a/docs/FunctionsAiDecompilationApi.md +++ b/docs/FunctionsAiDecompilationApi.md @@ -31,11 +31,11 @@ All URIs are relative to *https://api.reveng.ai* # **createAiDecompilation** -> CreateAIDecompOutputBody createAiDecompilation(functionId, temperature, typeSuggestions, applyTypes) +> CreateAIDecompOutputBody createAiDecompilation(functionId, temperature, typeSuggestions, naming, applyTypes) Start AI decompilation -Begins the AI decompilation process for a function. Charges team credits and starts the workflow. **Error codes:** - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `400` [`BAD_REQUEST`](/errors/BAD_REQUEST) — Bad Request - `409` [`CONFLICT`](/errors/CONFLICT) — Conflict - `402` [`INSUFFICIENT_CREDITS`](/errors/INSUFFICIENT_CREDITS) — Insufficient Credits +Begins the AI decompilation process for a function. Charges team credits and starts the workflow. Replacing an existing completed decompilation requires write access to the analysis; any caller with read access can decompile a function that has no completed result. **Error codes:** - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `400` [`BAD_REQUEST`](/errors/BAD_REQUEST) — Bad Request - `409` [`CONFLICT`](/errors/CONFLICT) — Conflict - `402` [`INSUFFICIENT_CREDITS`](/errors/INSUFFICIENT_CREDITS) — Insufficient Credits ### Example ```java @@ -66,9 +66,10 @@ public class Example { Long functionId = 56L; // Long | Function ID Double temperature = -1D; // Double | LLM temperature (0.0-1.0). Overrides the server default when set. Omit or set to -1 to use the server default. Boolean typeSuggestions = true; // Boolean | Ask the language model to name the suggested types and their members. Set to false to skip the model call; the statically derived layouts are still computed and stored. Cannot re-enable the pass when the server has it off. + Boolean naming = true; // Boolean | Ask the language model to name the placeholder variables. Set to false to skip the model call; the generic names are kept. Cannot re-enable the pass when the server has it off. Boolean applyTypes = true; // Boolean | Store the suggested types as data types of this function's analysis, with a source_type of AI_DECOMP. Set to false to leave them as suggestions only. Cannot re-enable the pass when the server has it off. try { - CreateAIDecompOutputBody result = apiInstance.createAiDecompilation(functionId, temperature, typeSuggestions, applyTypes); + CreateAIDecompOutputBody result = apiInstance.createAiDecompilation(functionId, temperature, typeSuggestions, naming, applyTypes); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling FunctionsAiDecompilationApi#createAiDecompilation"); @@ -88,6 +89,7 @@ public class Example { | **functionId** | **Long**| Function ID | | | **temperature** | **Double**| LLM temperature (0.0-1.0). Overrides the server default when set. Omit or set to -1 to use the server default. | [optional] [default to -1] | | **typeSuggestions** | **Boolean**| Ask the language model to name the suggested types and their members. Set to false to skip the model call; the statically derived layouts are still computed and stored. Cannot re-enable the pass when the server has it off. | [optional] [default to true] | +| **naming** | **Boolean**| Ask the language model to name the placeholder variables. Set to false to skip the model call; the generic names are kept. Cannot re-enable the pass when the server has it off. | [optional] [default to true] | | **applyTypes** | **Boolean**| Store the suggested types as data types of this function's analysis, with a source_type of AI_DECOMP. Set to false to leave them as suggestions only. Cannot re-enable the pass when the server has it off. | [optional] [default to true] | ### Return type @@ -110,6 +112,7 @@ public class Example { | **400** | Bad Request | - | | **402** | Payment Required | - | | **403** | Forbidden | - | +| **404** | Not Found | - | | **409** | Conflict | - | | **422** | Unprocessable Entity | - | | **500** | Internal Server Error | - | @@ -120,7 +123,7 @@ public class Example { Delete a single inline comment -Removes the comment for the given line number. Requires comments to have been generated first. **Error codes:** - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found +Removes the comment for the given line number. Requires write access to the analysis and comments to have been generated first. **Error codes:** - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found ### Example ```java @@ -733,7 +736,7 @@ public class Example { Update a single inline comment -Merges a single line comment into the existing AI-generated inline comments. Requires comments to have been generated first. **Error codes:** - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found +Merges a single line comment into the existing AI-generated inline comments. Requires write access to the analysis and comments to have been generated first. **Error codes:** - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found ### Example ```java @@ -812,7 +815,7 @@ public class Example { Regenerate AI decompilation inline comments -Starts a new inline comments generation workflow for the function. Requires an existing decompilation with a summary. Rejected while a decompilation is running: its naming and type-suggestion passes are still changing the identifiers the comments would reference. Poll the inline comments status endpoint, which reports PENDING until then. **Error codes:** - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `400` [`BAD_REQUEST`](/errors/BAD_REQUEST) — Bad Request - `409` [`CONFLICT`](/errors/CONFLICT) — Conflict +Starts a new inline comments generation workflow for the function. Requires write access to the analysis and an existing decompilation with a summary. Rejected while a decompilation is running: its naming and type-suggestion passes are still changing the identifiers the comments would reference. Poll the inline comments status endpoint, which reports PENDING until then. **Error codes:** - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `400` [`BAD_REQUEST`](/errors/BAD_REQUEST) — Bad Request - `409` [`CONFLICT`](/errors/CONFLICT) — Conflict ### Example ```java @@ -891,7 +894,7 @@ public class Example { Regenerate AI decompilation summary -Starts a new summary generation workflow for the function. Requires an existing decompilation. Rejected while a decompilation is running: its naming and type-suggestion passes are still changing the identifiers a summary would describe. Poll the summary status endpoint, which reports PENDING until then. **Error codes:** - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `409` [`CONFLICT`](/errors/CONFLICT) — Conflict +Starts a new summary generation workflow for the function. Requires write access to the analysis and an existing decompilation. Rejected while a decompilation is running: its naming and type-suggestion passes are still changing the identifiers a summary would describe. Poll the summary status endpoint, which reports PENDING until then. **Error codes:** - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `409` [`CONFLICT`](/errors/CONFLICT) — Conflict ### Example ```java @@ -1583,7 +1586,7 @@ public class Example { Regenerate AI decompilation type suggestions -Starts a new type suggestion workflow for the function, discarding the suggestions already stored. Requires a successful decompilation; it re-runs only the type-naming pass, so it costs no decompilation credit. The regenerated types are stored as data types of the analysis unless `apply_types=false`; types a previous run stored are not removed. Rejected while a decompilation is running: it runs the same pass itself once its output settles. Poll the type-suggestions status endpoint, which reports PENDING until then, and read the result from the type-suggestions endpoint. **Error codes:** - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `409` [`CONFLICT`](/errors/CONFLICT) — Conflict - `500` [`INTERNAL_ERROR`](/errors/INTERNAL_ERROR) — Internal Server Error +Starts a new type suggestion workflow for the function, discarding the suggestions already stored. Requires write access to the analysis and a successful decompilation; it re-runs only the type-naming pass, so it costs no decompilation credit. The regenerated types are stored as data types of the analysis unless `apply_types=false`; types a previous run stored are not removed. Rejected while a decompilation is running: it runs the same pass itself once its output settles. Poll the type-suggestions status endpoint, which reports PENDING until then, and read the result from the type-suggestions endpoint. **Error codes:** - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `409` [`CONFLICT`](/errors/CONFLICT) — Conflict - `500` [`INTERNAL_ERROR`](/errors/INTERNAL_ERROR) — Internal Server Error ### Example ```java @@ -1663,7 +1666,7 @@ public class Example { Upsert variable/function name overrides -Applies user-provided name overrides to placeholder tokens in the decompilation. **Error codes:** - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `400` [`BAD_REQUEST`](/errors/BAD_REQUEST) — Bad Request - `500` [`INTERNAL_ERROR`](/errors/INTERNAL_ERROR) — Internal Server Error +Applies user-provided name overrides to placeholder tokens in the decompilation. Requires write access to the analysis. **Error codes:** - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `400` [`BAD_REQUEST`](/errors/BAD_REQUEST) — Bad Request - `500` [`INTERNAL_ERROR`](/errors/INTERNAL_ERROR) — Internal Server Error ### Example ```java diff --git a/docs/FunctionsCoreApi.md b/docs/FunctionsCoreApi.md index 313737e..0dfefd1 100644 --- a/docs/FunctionsCoreApi.md +++ b/docs/FunctionsCoreApi.md @@ -29,6 +29,7 @@ All URIs are relative to *https://api.reveng.ai* | [**startFunctionsMatching**](FunctionsCoreApi.md#startFunctionsMatching) | **POST** /v3/functions/matches | Start function matching for an explicit set of functions | | [**v3CanonicalizeFunctionNames**](FunctionsCoreApi.md#v3CanonicalizeFunctionNames) | **POST** /v3/functions/canonical-names | Canonicalize a batch of function names | | [**v3GetAnalysisFuncMaps**](FunctionsCoreApi.md#v3GetAnalysisFuncMaps) | **GET** /v3/analyses/{analysis_id}/func-maps | Get function ID/address maps for an analysis | +| [**v3ListFunctionGlobals**](FunctionsCoreApi.md#v3ListFunctionGlobals) | **GET** /v3/functions/{function_id}/globals | List the global variables a function references. | | [**v3SearchFunctions**](FunctionsCoreApi.md#v3SearchFunctions) | **GET** /v3/functions | Search functions | @@ -1975,6 +1976,83 @@ public class Example { | **422** | Unprocessable Entity | - | | **500** | Internal Server Error | - | + +# **v3ListFunctionGlobals** +> ListFunctionGlobalsOutputBody v3ListFunctionGlobals(functionId) + +List the global variables a function references. + +Returns the global variables referenced by the function, ordered by address. **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.FunctionsCoreApi; + +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"); + + FunctionsCoreApi apiInstance = new FunctionsCoreApi(defaultClient); + Long functionId = 56L; // Long | Function ID + try { + ListFunctionGlobalsOutputBody result = apiInstance.v3ListFunctionGlobals(functionId); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling FunctionsCoreApi#v3ListFunctionGlobals"); + 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 | +|------------- | ------------- | ------------- | -------------| +| **functionId** | **Long**| Function ID | | + +### Return type + +[**ListFunctionGlobalsOutputBody**](ListFunctionGlobalsOutputBody.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 | - | + # **v3SearchFunctions** > SearchFunctionsOutputBody v3SearchFunctions(partialName, modelName, limit, offset) diff --git a/docs/FunctionsRenamingHistoryApi.md b/docs/FunctionsRenamingHistoryApi.md index 774c477..6be7768 100644 --- a/docs/FunctionsRenamingHistoryApi.md +++ b/docs/FunctionsRenamingHistoryApi.md @@ -94,7 +94,7 @@ public class Example { Batch rename functions -Renames multiple functions in a single request. Records name changes in history. **Error codes:** - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `400` [`BAD_REQUEST`](/errors/BAD_REQUEST) — Bad Request +Renames multiple functions in a single request. Records name changes in history. **Error codes:** - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `400` [`BAD_REQUEST`](/errors/BAD_REQUEST) — Bad Request - `422` [`VALIDATION_FAILED`](/errors/VALIDATION_FAILED) — Validation Failed ### Example ```java @@ -322,7 +322,7 @@ public class Example { Rename a function -Renames a single function and records the change in history. `source_type` defaults to USER when omitted. **Error codes:** - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found +Renames a single function and records the change in history. `source_type` defaults to USER when omitted. **Error codes:** - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `422` [`VALIDATION_FAILED`](/errors/VALIDATION_FAILED) — Validation Failed ### Example ```java diff --git a/docs/GetGlobalHistoryOutputBody.md b/docs/GetGlobalHistoryOutputBody.md new file mode 100644 index 0000000..4c2c4c2 --- /dev/null +++ b/docs/GetGlobalHistoryOutputBody.md @@ -0,0 +1,13 @@ + + +# GetGlobalHistoryOutputBody + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**history** | **List<GlobalHistoryEntry>** | Replaced values, oldest first. | | + + + diff --git a/docs/GlobalHistoryEntry.md b/docs/GlobalHistoryEntry.md new file mode 100644 index 0000000..8eff953 --- /dev/null +++ b/docs/GlobalHistoryEntry.md @@ -0,0 +1,15 @@ + + +# GlobalHistoryEntry + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**previous** | **GlobalVariable** | The global as it stood before that edit. | | +|**replacedAt** | **OffsetDateTime** | When the value below was replaced. | | +|**replacedByUserId** | **Long** | Who replaced it. | | + + + diff --git a/docs/GlobalVariable.md b/docs/GlobalVariable.md new file mode 100644 index 0000000..cf78a7d --- /dev/null +++ b/docs/GlobalVariable.md @@ -0,0 +1,96 @@ + + +# GlobalVariable + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**dType** | **String** | Name of the assigned data type. | [optional] | +|**dataTypeId** | **Long** | Analysis data type, when one is assigned. | [optional] | +|**functionCount** | **Long** | How many functions' AI decompilations reference the global. | | +|**indirectTarget** | **Long** | Address a pointer slot resolves to. | [optional] | +|**isBss** | **Boolean** | Whether the address falls in a zero-initialised section. | | +|**name** | **String** | Recovered name, absent when nothing named the address. | [optional] | +|**nameSource** | [**NameSourceEnum**](#NameSourceEnum) | What named it. | [optional] | +|**size** | **Long** | Size in bytes, when known. | [optional] | +|**sourceFunctionId** | **Long** | Function a constructed static was initialised in. | [optional] | +|**totalRefCount** | **Long** | How many times those AI decompilations reference the global, summed across functions. | | +|**typeSource** | [**TypeSourceEnum**](#TypeSourceEnum) | What typed it. | [optional] | +|**vaddr** | **Long** | Virtual address the global lives at. | | +|**value** | **String** | Decoded initial value, rendered for display. | [optional] | +|**valueConfidence** | **String** | How much to trust the decoded value. | [optional] | +|**valueKind** | [**ValueKindEnum**](#ValueKindEnum) | How the value was interpreted. | [optional] | +|**valueSource** | [**ValueSourceEnum**](#ValueSourceEnum) | What produced the value. | [optional] | + + + +## Enum: NameSourceEnum + +| Name | Value | +|---- | -----| +| SYSTEM | "SYSTEM" | +| RESOLVER | "RESOLVER" | +| DEBUG | "DEBUG" | +| CONSTRUCTOR | "CONSTRUCTOR" | +| VALUE | "VALUE" | +| AI_DECOMP | "AI_DECOMP" | +| AI_AGENT | "AI_AGENT" | +| USER | "USER" | +| ACCESS | "ACCESS" | +| UNKNOWN_DEFAULT_OPEN_API | "unknown_default_open_api" | + + + +## Enum: TypeSourceEnum + +| Name | Value | +|---- | -----| +| SYSTEM | "SYSTEM" | +| RESOLVER | "RESOLVER" | +| DEBUG | "DEBUG" | +| CONSTRUCTOR | "CONSTRUCTOR" | +| VALUE | "VALUE" | +| AI_DECOMP | "AI_DECOMP" | +| AI_AGENT | "AI_AGENT" | +| USER | "USER" | +| ACCESS | "ACCESS" | +| UNKNOWN_DEFAULT_OPEN_API | "unknown_default_open_api" | + + + +## Enum: ValueKindEnum + +| Name | Value | +|---- | -----| +| BSS | "BSS" | +| STRING | "STRING" | +| SHORT_STRING | "SHORT_STRING" | +| FLOAT | "FLOAT" | +| POINTER | "POINTER" | +| DYNAMIC_INIT | "DYNAMIC_INIT" | +| HEX | "HEX" | +| INT | "INT" | +| BOOL | "BOOL" | +| UNKNOWN_DEFAULT_OPEN_API | "unknown_default_open_api" | + + + +## Enum: ValueSourceEnum + +| Name | Value | +|---- | -----| +| SYSTEM | "SYSTEM" | +| RESOLVER | "RESOLVER" | +| DEBUG | "DEBUG" | +| CONSTRUCTOR | "CONSTRUCTOR" | +| VALUE | "VALUE" | +| AI_DECOMP | "AI_DECOMP" | +| AI_AGENT | "AI_AGENT" | +| USER | "USER" | +| ACCESS | "ACCESS" | +| UNKNOWN_DEFAULT_OPEN_API | "unknown_default_open_api" | + + + diff --git a/docs/HardcodedSecretEvidence.md b/docs/HardcodedSecretEvidence.md index 7dbe049..50aee7b 100644 --- a/docs/HardcodedSecretEvidence.md +++ b/docs/HardcodedSecretEvidence.md @@ -2,23 +2,31 @@ # HardcodedSecretEvidence -A hard-coded secret identified in the binary's data. ## Properties | Name | Type | Description | Notes | |------------ | ------------- | ------------- | -------------| -|**evidenceKind** | [**EvidenceKindEnum**](#EvidenceKindEnum) | | [optional] | -|**kind** | [**KindEnum**](#KindEnum) | | [optional] | -|**effect** | [**EffectEnum**](#EffectEnum) | | [optional] | -|**strength** | **EvidenceStrength** | | | -|**ruleId** | **String** | | | -|**description** | **String** | | | -|**secretKind** | **RuleKind** | | | -|**secret** | **String** | | | -|**entropy** | **BigDecimal** | | | -|**size** | **Integer** | | | -|**references** | **List<Integer>** | | | +|**description** | **String** | What the rule detects. | | +|**effect** | [**EffectEnum**](#EffectEnum) | Whether the evidence supports or refutes the finding. | | +|**entropy** | **Double** | Shannon entropy of the secret, in bits per byte. | | +|**evidenceKind** | [**EvidenceKindEnum**](#EvidenceKindEnum) | Kind of evidence. | | +|**kind** | [**KindEnum**](#KindEnum) | How the evidence was derived. | | +|**references** | **List<Long>** | Address of the secret in the binary's data. | | +|**ruleId** | **String** | Identifier of the secret-scanning rule that matched. | | +|**secret** | **String** | The secret as it appears in the binary. | | +|**secretKind** | [**SecretKindEnum**](#SecretKindEnum) | Category of the secret. | | +|**size** | **Long** | Size of the secret in bytes. | | +|**strength** | [**StrengthEnum**](#StrengthEnum) | How directly the evidence bears on the finding. | | + + + +## Enum: EffectEnum + +| Name | Value | +|---- | -----| +| SUPPORTS | "supports" | +| UNKNOWN_DEFAULT_OPEN_API | "unknown_default_open_api" | @@ -40,11 +48,29 @@ A hard-coded secret identified in the binary's data. -## Enum: EffectEnum +## Enum: SecretKindEnum | Name | Value | |---- | -----| -| SUPPORTS | "supports" | +| CREDENTIALS | "credentials" | +| API_CREDENTIALS | "api-credentials" | +| OAUTH_CREDENTIALS | "oauth-credentials" | +| ENCRYPTION_KEY | "encryption-key" | +| JWT_TOKEN | "jwt-token" | +| WEBHOOK_URL | "webhook-url" | +| PRIVATE_KEY | "private-key" | +| SIGNED_URL | "signed-url" | +| GENERIC | "generic" | +| UNKNOWN_DEFAULT_OPEN_API | "unknown_default_open_api" | + + + +## Enum: StrengthEnum + +| Name | Value | +|---- | -----| +| DIRECT | "direct" | +| INDIRECT | "indirect" | | UNKNOWN_DEFAULT_OPEN_API | "unknown_default_open_api" | diff --git a/docs/ImportedAPICallEvidence.md b/docs/ImportedAPICallEvidence.md new file mode 100644 index 0000000..09c1787 --- /dev/null +++ b/docs/ImportedAPICallEvidence.md @@ -0,0 +1,54 @@ + + +# ImportedAPICallEvidence + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**calls** | **List<ReportImportedAPICall>** | The observed calls. | | +|**effect** | [**EffectEnum**](#EffectEnum) | Whether the evidence supports or refutes the finding. | | +|**evidenceKind** | [**EvidenceKindEnum**](#EvidenceKindEnum) | Kind of evidence. | | +|**kind** | [**KindEnum**](#KindEnum) | How the evidence was derived. | | +|**strength** | [**StrengthEnum**](#StrengthEnum) | How directly the evidence bears on the finding. | | + + + +## Enum: EffectEnum + +| Name | Value | +|---- | -----| +| SUPPORTS | "supports" | +| REFUTES | "refutes" | +| UNKNOWN_DEFAULT_OPEN_API | "unknown_default_open_api" | + + + +## Enum: EvidenceKindEnum + +| Name | Value | +|---- | -----| +| IMPORTED_API_CALL | "imported_api_call" | +| UNKNOWN_DEFAULT_OPEN_API | "unknown_default_open_api" | + + + +## Enum: KindEnum + +| Name | Value | +|---- | -----| +| DETERMINISTIC_DERIVATION | "deterministic_derivation" | +| UNKNOWN_DEFAULT_OPEN_API | "unknown_default_open_api" | + + + +## Enum: StrengthEnum + +| Name | Value | +|---- | -----| +| DIRECT | "direct" | +| UNKNOWN_DEFAULT_OPEN_API | "unknown_default_open_api" | + + + diff --git a/docs/KnownConstantEvidence.md b/docs/KnownConstantEvidence.md index 165e18f..65a5a76 100644 --- a/docs/KnownConstantEvidence.md +++ b/docs/KnownConstantEvidence.md @@ -2,17 +2,26 @@ # KnownConstantEvidence -A known constant whose semantic use has not been demonstrated. ## Properties | Name | Type | Description | Notes | |------------ | ------------- | ------------- | -------------| -|**evidenceKind** | [**EvidenceKindEnum**](#EvidenceKindEnum) | | [optional] | -|**kind** | [**KindEnum**](#KindEnum) | | [optional] | -|**effect** | **EvidenceEffect** | | | -|**strength** | [**StrengthEnum**](#StrengthEnum) | | [optional] | -|**values** | **List<BytesConstant>** | | | +|**effect** | [**EffectEnum**](#EffectEnum) | Whether the evidence supports or refutes the finding. | | +|**evidenceKind** | [**EvidenceKindEnum**](#EvidenceKindEnum) | Kind of evidence. | | +|**kind** | [**KindEnum**](#KindEnum) | How the evidence was derived. | | +|**strength** | [**StrengthEnum**](#StrengthEnum) | How directly the evidence bears on the finding. | | +|**values** | **List<ReportBytesConstant>** | The well-known constants found in the binary. | | + + + +## Enum: EffectEnum + +| Name | Value | +|---- | -----| +| SUPPORTS | "supports" | +| REFUTES | "refutes" | +| UNKNOWN_DEFAULT_OPEN_API | "unknown_default_open_api" | diff --git a/docs/ListAnalysisGlobalsOutputBody.md b/docs/ListAnalysisGlobalsOutputBody.md new file mode 100644 index 0000000..316a239 --- /dev/null +++ b/docs/ListAnalysisGlobalsOutputBody.md @@ -0,0 +1,15 @@ + + +# ListAnalysisGlobalsOutputBody + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**globals** | **List<GlobalVariable>** | | | +|**total** | **Long** | | | +|**totalUnfiltered** | **Long** | | | + + + diff --git a/docs/ListFunctionGlobalsOutputBody.md b/docs/ListFunctionGlobalsOutputBody.md new file mode 100644 index 0000000..6774097 --- /dev/null +++ b/docs/ListFunctionGlobalsOutputBody.md @@ -0,0 +1,14 @@ + + +# ListFunctionGlobalsOutputBody + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**decompiled** | **Boolean** | Whether the function has a successful AI decompilation. Its globals are recorded from that decompilation, so before one exists the list is empty however many globals the function uses. | | +|**globals** | **List<FunctionGlobalVariable>** | | | + + + diff --git a/docs/ListGlobalFunctionsOutputBody.md b/docs/ListGlobalFunctionsOutputBody.md new file mode 100644 index 0000000..6671243 --- /dev/null +++ b/docs/ListGlobalFunctionsOutputBody.md @@ -0,0 +1,13 @@ + + +# ListGlobalFunctionsOutputBody + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**functions** | **List<FunctionUsage>** | | | + + + diff --git a/docs/ListOperationPrerequisitesOutputBody.md b/docs/ListOperationPrerequisitesOutputBody.md new file mode 100644 index 0000000..f990278 --- /dev/null +++ b/docs/ListOperationPrerequisitesOutputBody.md @@ -0,0 +1,13 @@ + + +# ListOperationPrerequisitesOutputBody + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**operations** | **List<OperationPrerequisitesBody>** | Operations that have prerequisites | | + + + diff --git a/docs/ListPublicUsersOutputBody.md b/docs/ListPublicUsersOutputBody.md new file mode 100644 index 0000000..35beb09 --- /dev/null +++ b/docs/ListPublicUsersOutputBody.md @@ -0,0 +1,13 @@ + + +# ListPublicUsersOutputBody + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**results** | **List<PublicUserBody>** | Up to 5 matching active users, ordered by username | | + + + diff --git a/docs/ModelInterpretation.md b/docs/ModelInterpretation.md index 3685203..49cad19 100644 --- a/docs/ModelInterpretation.md +++ b/docs/ModelInterpretation.md @@ -7,7 +7,7 @@ | Name | Type | Description | Notes | |------------ | ------------- | ------------- | -------------| -|**interpretation** | **String** | | [optional] | +|**interpretation** | **String** | Search is applied to string value | [optional] | diff --git a/docs/ModelInterpretationEvidence.md b/docs/ModelInterpretationEvidence.md index 6b33f7c..1900a4e 100644 --- a/docs/ModelInterpretationEvidence.md +++ b/docs/ModelInterpretationEvidence.md @@ -2,17 +2,26 @@ # ModelInterpretationEvidence -LLM interpretations of observations. ## Properties | Name | Type | Description | Notes | |------------ | ------------- | ------------- | -------------| -|**evidenceKind** | [**EvidenceKindEnum**](#EvidenceKindEnum) | | [optional] | -|**kind** | [**KindEnum**](#KindEnum) | | [optional] | -|**effect** | **EvidenceEffect** | | | -|**strength** | **EvidenceStrength** | | [optional] | -|**interpretations** | [**List<ModelInterpretation>**](ModelInterpretation.md) | | | +|**effect** | [**EffectEnum**](#EffectEnum) | Whether the evidence supports or refutes the finding. | | +|**evidenceKind** | [**EvidenceKindEnum**](#EvidenceKindEnum) | Kind of evidence. | | +|**interpretations** | **List<ReportModelInterpretation>** | Interpretations of the code by an AI model. | | +|**kind** | [**KindEnum**](#KindEnum) | How the evidence was derived. | | +|**strength** | [**StrengthEnum**](#StrengthEnum) | How directly the evidence bears on the finding. | | + + + +## Enum: EffectEnum + +| Name | Value | +|---- | -----| +| SUPPORTS | "supports" | +| REFUTES | "refutes" | +| UNKNOWN_DEFAULT_OPEN_API | "unknown_default_open_api" | @@ -34,3 +43,13 @@ LLM interpretations of observations. +## Enum: StrengthEnum + +| Name | Value | +|---- | -----| +| DIRECT | "direct" | +| INDIRECT | "indirect" | +| UNKNOWN_DEFAULT_OPEN_API | "unknown_default_open_api" | + + + diff --git a/docs/OperationDynamicExecutionMetadataDynamicExecutionResult.md b/docs/OperationDynamicExecutionMetadataDynamicExecutionResult.md index 64e7802..c497931 100644 --- a/docs/OperationDynamicExecutionMetadataDynamicExecutionResult.md +++ b/docs/OperationDynamicExecutionMetadataDynamicExecutionResult.md @@ -11,7 +11,7 @@ |**error** | **Status** | Failure detail, populated only when done is true and the operation failed. | [optional] | |**metadata** | **DynamicExecutionMetadata** | In-flight information and details. | [optional] | |**name** | **String** | API resource name. | | -|**response** | **Object** | Result, set only when done is true and the operation succeeded. | [optional] | +|**response** | **DynamicExecutionResult** | Result, set only when done is true and the operation succeeded. | [optional] | diff --git a/docs/OperationDynamicExecutionSummaryMetadataDynamicExecutionSummaryResult.md b/docs/OperationDynamicExecutionSummaryMetadataDynamicExecutionSummaryResult.md index d2cb0e9..81d327a 100644 --- a/docs/OperationDynamicExecutionSummaryMetadataDynamicExecutionSummaryResult.md +++ b/docs/OperationDynamicExecutionSummaryMetadataDynamicExecutionSummaryResult.md @@ -11,7 +11,7 @@ |**error** | **Status** | Failure detail, populated only when done is true and the operation failed. | [optional] | |**metadata** | **DynamicExecutionSummaryMetadata** | In-flight information and details. | [optional] | |**name** | **String** | API resource name. | | -|**response** | **Object** | Result, set only when done is true and the operation succeeded. | [optional] | +|**response** | **DynamicExecutionSummaryResult** | Result, set only when done is true and the operation succeeded. | [optional] | diff --git a/docs/OperationPrerequisitesBody.md b/docs/OperationPrerequisitesBody.md new file mode 100644 index 0000000..bf0aa48 --- /dev/null +++ b/docs/OperationPrerequisitesBody.md @@ -0,0 +1,14 @@ + + +# OperationPrerequisitesBody + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**operation** | **String** | The operation | | +|**prerequisites** | **List<String>** | Operations that must complete before this operation can start | | + + + diff --git a/docs/OperationRenameUnnamedFunctionsMetadataRenameUnnamedFunctionsResult.md b/docs/OperationRenameUnnamedFunctionsMetadataRenameUnnamedFunctionsResult.md new file mode 100644 index 0000000..cc5bdb4 --- /dev/null +++ b/docs/OperationRenameUnnamedFunctionsMetadataRenameUnnamedFunctionsResult.md @@ -0,0 +1,17 @@ + + +# OperationRenameUnnamedFunctionsMetadataRenameUnnamedFunctionsResult + + +## 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** | **RenameUnnamedFunctionsMetadata** | In-flight information and details. | [optional] | +|**name** | **String** | API resource name. | | +|**response** | **RenameUnnamedFunctionsResult** | Result, set only when done is true and the operation succeeded. | [optional] | + + + diff --git a/docs/PublicUserBody.md b/docs/PublicUserBody.md new file mode 100644 index 0000000..4280e0c --- /dev/null +++ b/docs/PublicUserBody.md @@ -0,0 +1,14 @@ + + +# PublicUserBody + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**userId** | **Long** | The user's ID | | +|**username** | **String** | The user's display name | | + + + diff --git a/docs/ReferencedConstantEvidence.md b/docs/ReferencedConstantEvidence.md index b97581c..01df15a 100644 --- a/docs/ReferencedConstantEvidence.md +++ b/docs/ReferencedConstantEvidence.md @@ -2,17 +2,26 @@ # ReferencedConstantEvidence -Constants and the instructions that reference them. ## Properties | Name | Type | Description | Notes | |------------ | ------------- | ------------- | -------------| -|**evidenceKind** | [**EvidenceKindEnum**](#EvidenceKindEnum) | | [optional] | -|**kind** | [**KindEnum**](#KindEnum) | | [optional] | -|**effect** | **EvidenceEffect** | | | -|**strength** | [**StrengthEnum**](#StrengthEnum) | | [optional] | -|**constants** | [**List<ReferencedConstant>**](ReferencedConstant.md) | | | +|**constants** | **List<ReportReferencedConstant>** | The constants and where they are referenced. | | +|**effect** | [**EffectEnum**](#EffectEnum) | Whether the evidence supports or refutes the finding. | | +|**evidenceKind** | [**EvidenceKindEnum**](#EvidenceKindEnum) | Kind of evidence. | | +|**kind** | [**KindEnum**](#KindEnum) | How the evidence was derived. | | +|**strength** | [**StrengthEnum**](#StrengthEnum) | How directly the evidence bears on the finding. | | + + + +## Enum: EffectEnum + +| Name | Value | +|---- | -----| +| SUPPORTS | "supports" | +| REFUTES | "refutes" | +| UNKNOWN_DEFAULT_OPEN_API | "unknown_default_open_api" | diff --git a/docs/RenameUnnamedFunctionsMetadata.md b/docs/RenameUnnamedFunctionsMetadata.md new file mode 100644 index 0000000..1e56a37 --- /dev/null +++ b/docs/RenameUnnamedFunctionsMetadata.md @@ -0,0 +1,27 @@ + + +# RenameUnnamedFunctionsMetadata + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**logHistory** | **List<List<Object>>** | Progress messages the run recorded, oldest first. | [optional] | +|**status** | [**StatusEnum**](#StatusEnum) | Run status. UNINITIALISED means the agent has never been triggered for this analysis. | | + + + +## Enum: StatusEnum + +| Name | Value | +|---- | -----| +| UNINITIALISED | "UNINITIALISED" | +| PENDING | "PENDING" | +| RUNNING | "RUNNING" | +| COMPLETED | "COMPLETED" | +| FAILED | "FAILED" | +| UNKNOWN_DEFAULT_OPEN_API | "unknown_default_open_api" | + + + diff --git a/docs/ReportBytesConstant.md b/docs/ReportBytesConstant.md new file mode 100644 index 0000000..c6832d3 --- /dev/null +++ b/docs/ReportBytesConstant.md @@ -0,0 +1,41 @@ + + +# ReportBytesConstant + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**display** | [**DisplayEnum**](#DisplayEnum) | Suggested format for displaying the value. | | +|**format** | [**FormatEnum**](#FormatEnum) | Encoding of the value. | | +|**value** | **String** | The bytes of the constant, hex-encoded. | | + + + +## Enum: DisplayEnum + +| Name | Value | +|---- | -----| +| HEX | "hex" | +| UINT8 | "uint8" | +| UINT16 | "uint16" | +| UINT32 | "uint32" | +| UINT64 | "uint64" | +| INT8 | "int8" | +| INT16 | "int16" | +| INT32 | "int32" | +| INT64 | "int64" | +| UNKNOWN_DEFAULT_OPEN_API | "unknown_default_open_api" | + + + +## Enum: FormatEnum + +| Name | Value | +|---- | -----| +| BYTES | "bytes" | +| UNKNOWN_DEFAULT_OPEN_API | "unknown_default_open_api" | + + + diff --git a/docs/ReportCallChain.md b/docs/ReportCallChain.md new file mode 100644 index 0000000..1090295 --- /dev/null +++ b/docs/ReportCallChain.md @@ -0,0 +1,13 @@ + + +# ReportCallChain + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**path** | **List<Long>** | Call addresses along the path, entry point first. | | + + + diff --git a/docs/ReportCodeSummary.md b/docs/ReportCodeSummary.md new file mode 100644 index 0000000..d93ef5d --- /dev/null +++ b/docs/ReportCodeSummary.md @@ -0,0 +1,15 @@ + + +# ReportCodeSummary + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**reachability** | **ReportCallChain** | A call chain reaching the entity, absent when none was found. | [optional] | +|**subject** | **ReportSubject** | The program location whose code is summarised. | | +|**summary** | **String** | What the code does. | | + + + diff --git a/docs/ReportFinding.md b/docs/ReportFinding.md new file mode 100644 index 0000000..9cbb5d0 --- /dev/null +++ b/docs/ReportFinding.md @@ -0,0 +1,26 @@ + + +# ReportFinding + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**evidence** | [**List<ReportFindingEvidenceInner>**](ReportFindingEvidenceInner.md) | The evidence for or against the finding. | | +|**propertyId** | **String** | Identifier of the property the finding asserts. | | +|**reachability** | [**ReachabilityEnum**](#ReachabilityEnum) | Whether the code behind the finding is reachable from an entry point. | | + + + +## Enum: ReachabilityEnum + +| Name | Value | +|---- | -----| +| UNDETERMINED | "undetermined" | +| REACHABLE | "reachable" | +| UNREACHABLE | "unreachable" | +| UNKNOWN_DEFAULT_OPEN_API | "unknown_default_open_api" | + + + diff --git a/docs/ReportFindingEvidenceInner.md b/docs/ReportFindingEvidenceInner.md new file mode 100644 index 0000000..f30ed99 --- /dev/null +++ b/docs/ReportFindingEvidenceInner.md @@ -0,0 +1,86 @@ + + +# ReportFindingEvidenceInner + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**callChain** | **List<Long>** | Addresses along the call chain. | | +|**effect** | [**EffectEnum**](#EffectEnum) | Whether the evidence supports or refutes the finding. | | +|**evidenceKind** | [**EvidenceKindEnum**](#EvidenceKindEnum) | Kind of evidence. | | +|**kind** | [**KindEnum**](#KindEnum) | How the evidence was derived. | | +|**strength** | [**StrengthEnum**](#StrengthEnum) | How directly the evidence bears on the finding. | | +|**constants** | **List<ReportReferencedConstant>** | The constants and where they are referenced. | | +|**calls** | **List<ReportImportedAPICall>** | The observed calls. | | +|**strings** | **List<ReportStringMatch>** | The matched strings. | | +|**similarities** | **List<ReportFunctionSimilarity>** | The similar functions. | | +|**apis** | **List<ReportImportedAPI>** | The APIs in the combination. | | +|**summaries** | **List<ReportCodeSummary>** | Summaries of the disassembled code. | | +|**interpretations** | **List<ReportModelInterpretation>** | Interpretations of the code by an AI model. | | +|**values** | **List<ReportBytesConstant>** | The well-known constants found in the binary. | | +|**description** | **String** | What the rule detects. | | +|**entropy** | **Double** | Shannon entropy of the secret, in bits per byte. | | +|**references** | **List<Long>** | Address of the secret in the binary's data. | | +|**ruleId** | **String** | Identifier of the secret-scanning rule that matched. | | +|**secret** | **String** | The secret as it appears in the binary. | | +|**secretKind** | [**SecretKindEnum**](#SecretKindEnum) | Category of the secret. | | +|**size** | **Long** | Size of the secret in bytes. | | + + + +## Enum: EffectEnum + +| Name | Value | +|---- | -----| +| SUPPORTS | "supports" | +| UNKNOWN_DEFAULT_OPEN_API | "unknown_default_open_api" | + + + +## Enum: EvidenceKindEnum + +| Name | Value | +|---- | -----| +| HARDCODED_SECRET | "hardcoded_secret" | +| UNKNOWN_DEFAULT_OPEN_API | "unknown_default_open_api" | + + + +## Enum: KindEnum + +| Name | Value | +|---- | -----| +| DETERMINISTIC_DERIVATION | "deterministic_derivation" | +| UNKNOWN_DEFAULT_OPEN_API | "unknown_default_open_api" | + + + +## Enum: StrengthEnum + +| Name | Value | +|---- | -----| +| DIRECT | "direct" | +| INDIRECT | "indirect" | +| UNKNOWN_DEFAULT_OPEN_API | "unknown_default_open_api" | + + + +## Enum: SecretKindEnum + +| Name | Value | +|---- | -----| +| CREDENTIALS | "credentials" | +| API_CREDENTIALS | "api-credentials" | +| OAUTH_CREDENTIALS | "oauth-credentials" | +| ENCRYPTION_KEY | "encryption-key" | +| JWT_TOKEN | "jwt-token" | +| WEBHOOK_URL | "webhook-url" | +| PRIVATE_KEY | "private-key" | +| SIGNED_URL | "signed-url" | +| GENERIC | "generic" | +| UNKNOWN_DEFAULT_OPEN_API | "unknown_default_open_api" | + + + diff --git a/docs/ReportFunctionSimilarity.md b/docs/ReportFunctionSimilarity.md new file mode 100644 index 0000000..2b476f0 --- /dev/null +++ b/docs/ReportFunctionSimilarity.md @@ -0,0 +1,15 @@ + + +# ReportFunctionSimilarity + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**name** | **String** | Name of the known function. | | +|**similarity** | **Double** | Similarity score, from 0 to 1. | | +|**subject** | **ReportSubject** | The matching function in the analysed binary. | | + + + diff --git a/docs/ReportImportedAPI.md b/docs/ReportImportedAPI.md new file mode 100644 index 0000000..fcd8071 --- /dev/null +++ b/docs/ReportImportedAPI.md @@ -0,0 +1,14 @@ + + +# ReportImportedAPI + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**api** | **String** | Name of the API. | | +|**module** | **String** | Module the API is imported from, or null when unknown. | | + + + diff --git a/docs/ReportImportedAPICall.md b/docs/ReportImportedAPICall.md new file mode 100644 index 0000000..2005502 --- /dev/null +++ b/docs/ReportImportedAPICall.md @@ -0,0 +1,15 @@ + + +# ReportImportedAPICall + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**importedApi** | **ReportImportedAPI** | The API called. | | +|**reachability** | **ReportCallChain** | A call chain reaching the call, absent when none was found. | [optional] | +|**subject** | **ReportSubject** | Where the call is made. | | + + + diff --git a/docs/ReportMeta.md b/docs/ReportMeta.md new file mode 100644 index 0000000..148ab47 --- /dev/null +++ b/docs/ReportMeta.md @@ -0,0 +1,24 @@ + + +# ReportMeta + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**endianness** | [**EndiannessEnum**](#EndiannessEnum) | Byte order of the analysed binary. | | + + + +## Enum: EndiannessEnum + +| Name | Value | +|---- | -----| +| UNSPECIFIED | "unspecified" | +| LITTLE | "little" | +| BIG | "big" | +| UNKNOWN_DEFAULT_OPEN_API | "unknown_default_open_api" | + + + diff --git a/docs/ReportModelInterpretation.md b/docs/ReportModelInterpretation.md new file mode 100644 index 0000000..84c79e3 --- /dev/null +++ b/docs/ReportModelInterpretation.md @@ -0,0 +1,13 @@ + + +# ReportModelInterpretation + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**interpretation** | **String** | The interpretation, or null when the model did not provide one. | | + + + diff --git a/docs/ReportReferencedConstant.md b/docs/ReportReferencedConstant.md new file mode 100644 index 0000000..369e5d4 --- /dev/null +++ b/docs/ReportReferencedConstant.md @@ -0,0 +1,32 @@ + + +# ReportReferencedConstant + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**display** | [**DisplayEnum**](#DisplayEnum) | Suggested format for displaying the value at this reference, absent to use the constant's own. | [optional] | +|**subject** | **ReportSubject** | Where the constant is referenced. | | +|**value** | **ReportBytesConstant** | The constant. | | + + + +## Enum: DisplayEnum + +| Name | Value | +|---- | -----| +| HEX | "hex" | +| UINT8 | "uint8" | +| UINT16 | "uint16" | +| UINT32 | "uint32" | +| UINT64 | "uint64" | +| INT8 | "int8" | +| INT16 | "int16" | +| INT32 | "int32" | +| INT64 | "int64" | +| UNKNOWN_DEFAULT_OPEN_API | "unknown_default_open_api" | + + + diff --git a/docs/ReportResult.md b/docs/ReportResult.md index 384812a..4434404 100644 --- a/docs/ReportResult.md +++ b/docs/ReportResult.md @@ -7,8 +7,8 @@ | Name | Type | Description | Notes | |------------ | ------------- | ------------- | -------------| -|**findings** | **Object** | | | -|**meta** | **Object** | | | +|**findings** | **List<ReportFinding>** | The findings the agent reported, each with its supporting evidence. | | +|**meta** | **ReportMeta** | Report-level metadata. | | diff --git a/docs/ReportStringMatch.md b/docs/ReportStringMatch.md new file mode 100644 index 0000000..ec4173d --- /dev/null +++ b/docs/ReportStringMatch.md @@ -0,0 +1,14 @@ + + +# ReportStringMatch + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**subject** | **ReportSubject** | Where the string is located, absent when unknown. | [optional] | +|**value** | **String** | The matched string. | | + + + diff --git a/docs/ReportSubject.md b/docs/ReportSubject.md new file mode 100644 index 0000000..a2d0e7e --- /dev/null +++ b/docs/ReportSubject.md @@ -0,0 +1,16 @@ + + +# ReportSubject + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**callSite** | **Long** | Call-site address. | [optional] | +|**data** | **Long** | Data address. | [optional] | +|**function** | **Long** | Function entry address. | [optional] | +|**instruction** | **Long** | Instruction address. | [optional] | + + + diff --git a/docs/RequeueAnalysisRequest.md b/docs/RequeueAnalysisRequest.md new file mode 100644 index 0000000..aff40d8 --- /dev/null +++ b/docs/RequeueAnalysisRequest.md @@ -0,0 +1,18 @@ + + +# RequeueAnalysisRequest + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**commandLineArgs** | **String** | Command-line arguments passed to the sample when enable_dynamic_execution is set | [optional] | +|**enableDynamicExecution** | **Boolean** | Run the new Analysis with dynamic execution (sandbox) enabled | [optional] | +|**generateCapabilities** | **Boolean** | Regenerate capabilities for the new Analysis instead of copying the original Binary's existing ones | [optional] | +|**noCache** | **Boolean** | | [optional] | +|**scrapeTags** | **Boolean** | Re-scrape third-party tags for the new Analysis instead of copying the original Binary's existing ones | [optional] | +|**tags** | **List<String>** | Additional Tags to apply to the requeued Binary, on top of any carried over because generate_capabilities/scrape_tags are false | [optional] | + + + diff --git a/docs/ResolvedEntity.md b/docs/ResolvedEntity.md index 2017719..fa7714a 100644 --- a/docs/ResolvedEntity.md +++ b/docs/ResolvedEntity.md @@ -28,9 +28,11 @@ |**suggestionConfidence** | **String** | | | |**token** | **String** | Search is applied to string value | | |**typeIndex** | **Long** | | | +|**typeSource** | **String** | | | |**vaddr** | **Long** | | | |**value** | **String** | | | |**valueConfidence** | **String** | | | +|**valueKind** | **String** | | | |**valueType** | **String** | | | diff --git a/docs/Status.md b/docs/Status.md index 448c3b0..1f44e29 100644 --- a/docs/Status.md +++ b/docs/Status.md @@ -26,6 +26,7 @@ | CLIENT_CLOSED_REQUEST | "CLIENT_CLOSED_REQUEST" | | CONFLICT | "CONFLICT" | | CONVERSATION_NOT_FOUND | "CONVERSATION_NOT_FOUND" | +| DISPOSABLE_EMAIL_NOT_ALLOWED | "DISPOSABLE_EMAIL_NOT_ALLOWED" | | DOMAIN_ALREADY_CLAIMED | "DOMAIN_ALREADY_CLAIMED" | | DOMAIN_VERIFICATION_PENDING | "DOMAIN_VERIFICATION_PENDING" | | DYNAMIC_EXECUTION_INCOMPLETE | "DYNAMIC_EXECUTION_INCOMPLETE" | @@ -53,6 +54,7 @@ | NO_PENDING_CONFIRMATION | "NO_PENDING_CONFIRMATION" | | NO_VIRUSTOTAL_KEY | "NO_VIRUSTOTAL_KEY" | | OIDC_DISCOVERY_FAILED | "OIDC_DISCOVERY_FAILED" | +| OPERATION_PREREQUISITE_NOT_MET | "OPERATION_PREREQUISITE_NOT_MET" | | PASSWORD_RESET_REQUIRED | "PASSWORD_RESET_REQUIRED" | | PAYMENT_REQUIRED | "PAYMENT_REQUIRED" | | PRECONDITION_FAILED | "PRECONDITION_FAILED" | diff --git a/docs/StringMatchEvidence.md b/docs/StringMatchEvidence.md index b630bbc..d418502 100644 --- a/docs/StringMatchEvidence.md +++ b/docs/StringMatchEvidence.md @@ -2,17 +2,26 @@ # StringMatchEvidence -String matches without demonstrated semantic use. ## Properties | Name | Type | Description | Notes | |------------ | ------------- | ------------- | -------------| -|**evidenceKind** | [**EvidenceKindEnum**](#EvidenceKindEnum) | | [optional] | -|**kind** | [**KindEnum**](#KindEnum) | | [optional] | -|**effect** | **EvidenceEffect** | | | -|**strength** | [**StrengthEnum**](#StrengthEnum) | | [optional] | -|**strings** | [**List<StringMatch>**](StringMatch.md) | | | +|**effect** | [**EffectEnum**](#EffectEnum) | Whether the evidence supports or refutes the finding. | | +|**evidenceKind** | [**EvidenceKindEnum**](#EvidenceKindEnum) | Kind of evidence. | | +|**kind** | [**KindEnum**](#KindEnum) | How the evidence was derived. | | +|**strength** | [**StrengthEnum**](#StrengthEnum) | How directly the evidence bears on the finding. | | +|**strings** | **List<ReportStringMatch>** | The matched strings. | | + + + +## Enum: EffectEnum + +| Name | Value | +|---- | -----| +| SUPPORTS | "supports" | +| REFUTES | "refutes" | +| UNKNOWN_DEFAULT_OPEN_API | "unknown_default_open_api" | diff --git a/docs/UpdateAnalysisGlobalInputBody.md b/docs/UpdateAnalysisGlobalInputBody.md new file mode 100644 index 0000000..06daadc --- /dev/null +++ b/docs/UpdateAnalysisGlobalInputBody.md @@ -0,0 +1,14 @@ + + +# UpdateAnalysisGlobalInputBody + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**dataTypeId** | **Long** | Analysis data type to assign. Omit to leave the type as it is. | [optional] | +|**name** | **String** | New name for the global. Omit to leave the name as it is. | [optional] | + + + diff --git a/pom.xml b/pom.xml index 8bac465..6cb0faf 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ sdk jar sdk - 4.72.2 + 4.73.0 https://github.com/RevEngAI/sdk-java Java SDK for the RevEng.AI API diff --git a/src/main/java/ai/reveng/api/AgentApi.java b/src/main/java/ai/reveng/api/AgentApi.java index 1fd7f49..c7ede99 100644 --- a/src/main/java/ai/reveng/api/AgentApi.java +++ b/src/main/java/ai/reveng/api/AgentApi.java @@ -37,6 +37,7 @@ import ai.reveng.model.BaseResponseTriageReportResponse; import ai.reveng.model.ErrorModel; import ai.reveng.model.FeedbackOutputBody; +import ai.reveng.model.ListOperationPrerequisitesOutputBody; import ai.reveng.model.OperationCryptoExplainMetadataCryptoExplainResult; import ai.reveng.model.OperationCryptoScanMetadataCryptoScanResult; import ai.reveng.model.OperationExecutionExplainMetadataExecutionExplainResult; @@ -50,6 +51,7 @@ import ai.reveng.model.OperationMetadataTriageResult; import ai.reveng.model.OperationNetworkingExplainMetadataNetworkingExplainResult; import ai.reveng.model.OperationNetworkingScanMetadataNetworkingScanResult; +import ai.reveng.model.OperationRenameUnnamedFunctionsMetadataRenameUnnamedFunctionsResult; import ai.reveng.model.OperationSecurityScanMetadataSecurityScanResult; import ai.reveng.model.QueuedWorkflowTaskResponse; import ai.reveng.model.RenameUnnamedFunctionsResult; @@ -3497,6 +3499,153 @@ public okhttp3.Call v3GetCryptoScanOperationAsync(@javax.annotation.Nonnull Long localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } + /** + * Build call for v3GetCryptographyOperation + * @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 -
409 Conflict -
422 Unprocessable Entity -
500 Internal Server Error -
+ */ + public okhttp3.Call v3GetCryptographyOperationCall(@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/cryptography/{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 v3GetCryptographyOperationValidateBeforeCall(@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 v3GetCryptographyOperation(Async)"); + } + + return v3GetCryptographyOperationCall(analysisId, _callback); + + } + + /** + * Get a cryptography operation. + * Polls a cryptography run. `metadata.status` tracks the run and `metadata.log_history` carries its progress messages; `response` is set once the run has completed and holds the findings, each with its supporting evidence. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `409` [`ANALYSIS_NOT_READY`](/errors/ANALYSIS_NOT_READY) — Analysis Not Ready + * @param analysisId Analysis ID (required) + * @return OperationMetadataReportResult + * @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 -
409 Conflict -
422 Unprocessable Entity -
500 Internal Server Error -
+ */ + public OperationMetadataReportResult v3GetCryptographyOperation(@javax.annotation.Nonnull Long analysisId) throws ApiException { + ApiResponse localVarResp = v3GetCryptographyOperationWithHttpInfo(analysisId); + return localVarResp.getData(); + } + + /** + * Get a cryptography operation. + * Polls a cryptography run. `metadata.status` tracks the run and `metadata.log_history` carries its progress messages; `response` is set once the run has completed and holds the findings, each with its supporting evidence. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `409` [`ANALYSIS_NOT_READY`](/errors/ANALYSIS_NOT_READY) — Analysis Not Ready + * @param analysisId Analysis ID (required) + * @return ApiResponse<OperationMetadataReportResult> + * @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 -
409 Conflict -
422 Unprocessable Entity -
500 Internal Server Error -
+ */ + public ApiResponse v3GetCryptographyOperationWithHttpInfo(@javax.annotation.Nonnull Long analysisId) throws ApiException { + okhttp3.Call localVarCall = v3GetCryptographyOperationValidateBeforeCall(analysisId, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Get a cryptography operation. (asynchronously) + * Polls a cryptography run. `metadata.status` tracks the run and `metadata.log_history` carries its progress messages; `response` is set once the run has completed and holds the findings, each with its supporting evidence. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `409` [`ANALYSIS_NOT_READY`](/errors/ANALYSIS_NOT_READY) — Analysis Not Ready + * @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 -
409 Conflict -
422 Unprocessable Entity -
500 Internal Server Error -
+ */ + public okhttp3.Call v3GetCryptographyOperationAsync(@javax.annotation.Nonnull Long analysisId, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = v3GetCryptographyOperationValidateBeforeCall(analysisId, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } /** * Build call for v3GetExecutionExplainOperation * @param functionId Function ID (required) @@ -4431,7 +4580,7 @@ private okhttp3.Call v3GetProtocolsOperationValidateBeforeCall(@javax.annotation /** * Get a protocols operation. - * Polls a protocols run. `metadata.status` tracks the run and `metadata.log_history` carries its progress messages; `response.report` is set once the run has completed and carries the findings document as the agent produced it. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `409` [`ANALYSIS_NOT_READY`](/errors/ANALYSIS_NOT_READY) — Analysis Not Ready + * Polls a protocols run. `metadata.status` tracks the run and `metadata.log_history` carries its progress messages; `response` is set once the run has completed and holds the findings, each with its supporting evidence. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `409` [`ANALYSIS_NOT_READY`](/errors/ANALYSIS_NOT_READY) — Analysis Not Ready * @param analysisId Analysis ID (required) * @return OperationMetadataReportResult * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body @@ -4454,7 +4603,7 @@ public OperationMetadataReportResult v3GetProtocolsOperation(@javax.annotation.N /** * Get a protocols operation. - * Polls a protocols run. `metadata.status` tracks the run and `metadata.log_history` carries its progress messages; `response.report` is set once the run has completed and carries the findings document as the agent produced it. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `409` [`ANALYSIS_NOT_READY`](/errors/ANALYSIS_NOT_READY) — Analysis Not Ready + * Polls a protocols run. `metadata.status` tracks the run and `metadata.log_history` carries its progress messages; `response` is set once the run has completed and holds the findings, each with its supporting evidence. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `409` [`ANALYSIS_NOT_READY`](/errors/ANALYSIS_NOT_READY) — Analysis Not Ready * @param analysisId Analysis ID (required) * @return ApiResponse<OperationMetadataReportResult> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body @@ -4478,7 +4627,7 @@ public ApiResponse v3GetProtocolsOperationWithHtt /** * Get a protocols operation. (asynchronously) - * Polls a protocols run. `metadata.status` tracks the run and `metadata.log_history` carries its progress messages; `response.report` is set once the run has completed and carries the findings document as the agent produced it. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `409` [`ANALYSIS_NOT_READY`](/errors/ANALYSIS_NOT_READY) — Analysis Not Ready + * Polls a protocols run. `metadata.status` tracks the run and `metadata.log_history` carries its progress messages; `response` is set once the run has completed and holds the findings, each with its supporting evidence. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `409` [`ANALYSIS_NOT_READY`](/errors/ANALYSIS_NOT_READY) — Analysis Not Ready * @param analysisId Analysis ID (required) * @param _callback The callback to be executed when the API call finishes * @return The request call @@ -4649,6 +4798,149 @@ public okhttp3.Call v3GetRemediationOperationAsync(@javax.annotation.Nonnull Lon localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } + /** + * Build call for v3GetRenameUnnamedFunctionsOperation + * @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 v3GetRenameUnnamedFunctionsOperationCall(@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/rename-unnamed-functions/{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 v3GetRenameUnnamedFunctionsOperationValidateBeforeCall(@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 v3GetRenameUnnamedFunctionsOperation(Async)"); + } + + return v3GetRenameUnnamedFunctionsOperationCall(analysisId, _callback); + + } + + /** + * Get a rename-unnamed-functions operation. + * Returns the current state of the rename-unnamed-functions run for this analysis. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied + * @param analysisId Analysis ID (required) + * @return OperationRenameUnnamedFunctionsMetadataRenameUnnamedFunctionsResult + * @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 OperationRenameUnnamedFunctionsMetadataRenameUnnamedFunctionsResult v3GetRenameUnnamedFunctionsOperation(@javax.annotation.Nonnull Long analysisId) throws ApiException { + ApiResponse localVarResp = v3GetRenameUnnamedFunctionsOperationWithHttpInfo(analysisId); + return localVarResp.getData(); + } + + /** + * Get a rename-unnamed-functions operation. + * Returns the current state of the rename-unnamed-functions run for this analysis. **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<OperationRenameUnnamedFunctionsMetadataRenameUnnamedFunctionsResult> + * @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 v3GetRenameUnnamedFunctionsOperationWithHttpInfo(@javax.annotation.Nonnull Long analysisId) throws ApiException { + okhttp3.Call localVarCall = v3GetRenameUnnamedFunctionsOperationValidateBeforeCall(analysisId, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Get a rename-unnamed-functions operation. (asynchronously) + * Returns the current state of the rename-unnamed-functions run for this analysis. **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 v3GetRenameUnnamedFunctionsOperationAsync(@javax.annotation.Nonnull Long analysisId, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = v3GetRenameUnnamedFunctionsOperationValidateBeforeCall(analysisId, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } /** * Build call for v3GetRenameUnnamedFunctionsResult * @param analysisId Analysis ID (required) @@ -5162,7 +5454,7 @@ private okhttp3.Call v3GetSecretsOperationValidateBeforeCall(@javax.annotation.N /** * Get a secrets operation. - * Polls a secrets run. `metadata.status` tracks the run and `metadata.log_history` carries its progress messages; `response.report` is set once the run has completed and carries the findings document as the agent produced it. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `409` [`ANALYSIS_NOT_READY`](/errors/ANALYSIS_NOT_READY) — Analysis Not Ready + * Polls a secrets run. `metadata.status` tracks the run and `metadata.log_history` carries its progress messages; `response` is set once the run has completed and holds the findings, each with its supporting evidence. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `409` [`ANALYSIS_NOT_READY`](/errors/ANALYSIS_NOT_READY) — Analysis Not Ready * @param analysisId Analysis ID (required) * @return OperationMetadataReportResult * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body @@ -5185,7 +5477,7 @@ public OperationMetadataReportResult v3GetSecretsOperation(@javax.annotation.Non /** * Get a secrets operation. - * Polls a secrets run. `metadata.status` tracks the run and `metadata.log_history` carries its progress messages; `response.report` is set once the run has completed and carries the findings document as the agent produced it. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `409` [`ANALYSIS_NOT_READY`](/errors/ANALYSIS_NOT_READY) — Analysis Not Ready + * Polls a secrets run. `metadata.status` tracks the run and `metadata.log_history` carries its progress messages; `response` is set once the run has completed and holds the findings, each with its supporting evidence. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `409` [`ANALYSIS_NOT_READY`](/errors/ANALYSIS_NOT_READY) — Analysis Not Ready * @param analysisId Analysis ID (required) * @return ApiResponse<OperationMetadataReportResult> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body @@ -5209,7 +5501,7 @@ public ApiResponse v3GetSecretsOperationWithHttpI /** * Get a secrets operation. (asynchronously) - * Polls a secrets run. `metadata.status` tracks the run and `metadata.log_history` carries its progress messages; `response.report` is set once the run has completed and carries the findings document as the agent produced it. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `409` [`ANALYSIS_NOT_READY`](/errors/ANALYSIS_NOT_READY) — Analysis Not Ready + * Polls a secrets run. `metadata.status` tracks the run and `metadata.log_history` carries its progress messages; `response` is set once the run has completed and holds the findings, each with its supporting evidence. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `409` [`ANALYSIS_NOT_READY`](/errors/ANALYSIS_NOT_READY) — Analysis Not Ready * @param analysisId Analysis ID (required) * @param _callback The callback to be executed when the API call finishes * @return The request call @@ -5523,6 +5815,127 @@ public okhttp3.Call v3GetTriageOperationAsync(@javax.annotation.Nonnull Long ana localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } + /** + * Build call for v3ListOperationPrerequisites + * @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 v3ListOperationPrerequisitesCall(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 = "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/v3/operation-prerequisites"; + + 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 v3ListOperationPrerequisitesValidateBeforeCall(final ApiCallback _callback) throws ApiException { + return v3ListOperationPrerequisitesCall(_callback); + + } + + /** + * List operation prerequisites. + * Lists the operations that can only start once other operations have completed on the same analysis. To check whether an analysis has completed them, use `/v3/analyses/{analysis_id}/operations`. + * @return ListOperationPrerequisitesOutputBody + * @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 ListOperationPrerequisitesOutputBody v3ListOperationPrerequisites() throws ApiException { + ApiResponse localVarResp = v3ListOperationPrerequisitesWithHttpInfo(); + return localVarResp.getData(); + } + + /** + * List operation prerequisites. + * Lists the operations that can only start once other operations have completed on the same analysis. To check whether an analysis has completed them, use `/v3/analyses/{analysis_id}/operations`. + * @return ApiResponse<ListOperationPrerequisitesOutputBody> + * @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 v3ListOperationPrerequisitesWithHttpInfo() throws ApiException { + okhttp3.Call localVarCall = v3ListOperationPrerequisitesValidateBeforeCall(null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * List operation prerequisites. (asynchronously) + * Lists the operations that can only start once other operations have completed on the same analysis. To check whether an analysis has completed them, use `/v3/analyses/{analysis_id}/operations`. + * @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 v3ListOperationPrerequisitesAsync(final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = v3ListOperationPrerequisitesValidateBeforeCall(_callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } /** * Build call for v3RunCapabilities * @param analysisId Analysis ID (required) @@ -5600,7 +6013,7 @@ private okhttp3.Call v3RunCapabilitiesValidateBeforeCall(@javax.annotation.Nonnu /** * Run the capabilities agent. - * Starts the capabilities agent, which attributes behavioural capabilities to individual functions, and returns the operation to poll for its outcome. Returns 409 while a run is already in progress for this analysis. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `409` [`CONFLICT`](/errors/CONFLICT) — Conflict - `402` [`INSUFFICIENT_CREDITS`](/errors/INSUFFICIENT_CREDITS) — Insufficient Credits + * Starts the capabilities agent, which attributes behavioural capabilities to individual functions, and returns the operation to poll for its outcome. Returns 409 while a run is already in progress for this analysis. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `409` [`CONFLICT`](/errors/CONFLICT) — Conflict - `402` [`INSUFFICIENT_CREDITS`](/errors/INSUFFICIENT_CREDITS) — Insufficient Credits - `409` [`OPERATION_PREREQUISITE_NOT_MET`](/errors/OPERATION_PREREQUISITE_NOT_MET) — Operation Prerequisite Not Met * @param analysisId Analysis ID (required) * @return OperationMetadataCapabilitiesResult * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body @@ -5624,7 +6037,7 @@ public OperationMetadataCapabilitiesResult v3RunCapabilities(@javax.annotation.N /** * Run the capabilities agent. - * Starts the capabilities agent, which attributes behavioural capabilities to individual functions, and returns the operation to poll for its outcome. Returns 409 while a run is already in progress for this analysis. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `409` [`CONFLICT`](/errors/CONFLICT) — Conflict - `402` [`INSUFFICIENT_CREDITS`](/errors/INSUFFICIENT_CREDITS) — Insufficient Credits + * Starts the capabilities agent, which attributes behavioural capabilities to individual functions, and returns the operation to poll for its outcome. Returns 409 while a run is already in progress for this analysis. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `409` [`CONFLICT`](/errors/CONFLICT) — Conflict - `402` [`INSUFFICIENT_CREDITS`](/errors/INSUFFICIENT_CREDITS) — Insufficient Credits - `409` [`OPERATION_PREREQUISITE_NOT_MET`](/errors/OPERATION_PREREQUISITE_NOT_MET) — Operation Prerequisite Not Met * @param analysisId Analysis ID (required) * @return ApiResponse<OperationMetadataCapabilitiesResult> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body @@ -5649,7 +6062,7 @@ public ApiResponse v3RunCapabilitiesWithHtt /** * Run the capabilities agent. (asynchronously) - * Starts the capabilities agent, which attributes behavioural capabilities to individual functions, and returns the operation to poll for its outcome. Returns 409 while a run is already in progress for this analysis. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `409` [`CONFLICT`](/errors/CONFLICT) — Conflict - `402` [`INSUFFICIENT_CREDITS`](/errors/INSUFFICIENT_CREDITS) — Insufficient Credits + * Starts the capabilities agent, which attributes behavioural capabilities to individual functions, and returns the operation to poll for its outcome. Returns 409 while a run is already in progress for this analysis. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `409` [`CONFLICT`](/errors/CONFLICT) — Conflict - `402` [`INSUFFICIENT_CREDITS`](/errors/INSUFFICIENT_CREDITS) — Insufficient Credits - `409` [`OPERATION_PREREQUISITE_NOT_MET`](/errors/OPERATION_PREREQUISITE_NOT_MET) — Operation Prerequisite Not Met * @param analysisId Analysis ID (required) * @param _callback The callback to be executed when the API call finishes * @return The request call @@ -5908,7 +6321,7 @@ private okhttp3.Call v3RunCryptoScanValidateBeforeCall(@javax.annotation.Nonnull /** * Run the crypto-scan agent. - * Starts an agent that name-matches the analysis' functions and their callees against known crypto-library APIs, and returns the operation to poll for its outcome. Purely name-based — never triggers AI decompilation, so it costs no credits and runs in seconds. Returns 409 while a run is already in progress for this analysis. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `409` [`CONFLICT`](/errors/CONFLICT) — Conflict + * Starts an agent that name-matches the analysis' functions and their callees against known crypto-library APIs, and returns the operation to poll for its outcome. Purely name-based — never triggers AI decompilation, so it costs no credits and runs in seconds. Returns 409 while a run is already in progress for this analysis. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `409` [`CONFLICT`](/errors/CONFLICT) — Conflict - `409` [`OPERATION_PREREQUISITE_NOT_MET`](/errors/OPERATION_PREREQUISITE_NOT_MET) — Operation Prerequisite Not Met * @param analysisId Analysis ID (required) * @param triggerCryptoScanInputBody (required) * @return OperationCryptoScanMetadataCryptoScanResult @@ -5932,7 +6345,7 @@ public OperationCryptoScanMetadataCryptoScanResult v3RunCryptoScan(@javax.annota /** * Run the crypto-scan agent. - * Starts an agent that name-matches the analysis' functions and their callees against known crypto-library APIs, and returns the operation to poll for its outcome. Purely name-based — never triggers AI decompilation, so it costs no credits and runs in seconds. Returns 409 while a run is already in progress for this analysis. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `409` [`CONFLICT`](/errors/CONFLICT) — Conflict + * Starts an agent that name-matches the analysis' functions and their callees against known crypto-library APIs, and returns the operation to poll for its outcome. Purely name-based — never triggers AI decompilation, so it costs no credits and runs in seconds. Returns 409 while a run is already in progress for this analysis. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `409` [`CONFLICT`](/errors/CONFLICT) — Conflict - `409` [`OPERATION_PREREQUISITE_NOT_MET`](/errors/OPERATION_PREREQUISITE_NOT_MET) — Operation Prerequisite Not Met * @param analysisId Analysis ID (required) * @param triggerCryptoScanInputBody (required) * @return ApiResponse<OperationCryptoScanMetadataCryptoScanResult> @@ -5957,7 +6370,7 @@ public ApiResponse v3RunCryptoScanW /** * Run the crypto-scan agent. (asynchronously) - * Starts an agent that name-matches the analysis' functions and their callees against known crypto-library APIs, and returns the operation to poll for its outcome. Purely name-based — never triggers AI decompilation, so it costs no credits and runs in seconds. Returns 409 while a run is already in progress for this analysis. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `409` [`CONFLICT`](/errors/CONFLICT) — Conflict + * Starts an agent that name-matches the analysis' functions and their callees against known crypto-library APIs, and returns the operation to poll for its outcome. Purely name-based — never triggers AI decompilation, so it costs no credits and runs in seconds. Returns 409 while a run is already in progress for this analysis. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `409` [`CONFLICT`](/errors/CONFLICT) — Conflict - `409` [`OPERATION_PREREQUISITE_NOT_MET`](/errors/OPERATION_PREREQUISITE_NOT_MET) — Operation Prerequisite Not Met * @param analysisId Analysis ID (required) * @param triggerCryptoScanInputBody (required) * @param _callback The callback to be executed when the API call finishes @@ -5982,6 +6395,157 @@ public okhttp3.Call v3RunCryptoScanAsync(@javax.annotation.Nonnull Long analysis localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } + /** + * Build call for v3RunCryptography + * @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 -
402 Payment Required -
403 Forbidden -
404 Not Found -
409 Conflict -
422 Unprocessable Entity -
500 Internal Server Error -
+ */ + public okhttp3.Call v3RunCryptographyCall(@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}/cryptography:run" + .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, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call v3RunCryptographyValidateBeforeCall(@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 v3RunCryptography(Async)"); + } + + return v3RunCryptographyCall(analysisId, _callback); + + } + + /** + * Run the cryptography agent. + * Starts the cryptography agent, which identifies cryptographic operations in the binary and reports its findings, and returns the operation to poll for its outcome. Returns 409 while a run is already in progress for this analysis. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `409` [`CONFLICT`](/errors/CONFLICT) — Conflict - `402` [`INSUFFICIENT_CREDITS`](/errors/INSUFFICIENT_CREDITS) — Insufficient Credits - `409` [`OPERATION_PREREQUISITE_NOT_MET`](/errors/OPERATION_PREREQUISITE_NOT_MET) — Operation Prerequisite Not Met + * @param analysisId Analysis ID (required) + * @return OperationMetadataReportResult + * @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 -
402 Payment Required -
403 Forbidden -
404 Not Found -
409 Conflict -
422 Unprocessable Entity -
500 Internal Server Error -
+ */ + public OperationMetadataReportResult v3RunCryptography(@javax.annotation.Nonnull Long analysisId) throws ApiException { + ApiResponse localVarResp = v3RunCryptographyWithHttpInfo(analysisId); + return localVarResp.getData(); + } + + /** + * Run the cryptography agent. + * Starts the cryptography agent, which identifies cryptographic operations in the binary and reports its findings, and returns the operation to poll for its outcome. Returns 409 while a run is already in progress for this analysis. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `409` [`CONFLICT`](/errors/CONFLICT) — Conflict - `402` [`INSUFFICIENT_CREDITS`](/errors/INSUFFICIENT_CREDITS) — Insufficient Credits - `409` [`OPERATION_PREREQUISITE_NOT_MET`](/errors/OPERATION_PREREQUISITE_NOT_MET) — Operation Prerequisite Not Met + * @param analysisId Analysis ID (required) + * @return ApiResponse<OperationMetadataReportResult> + * @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 -
402 Payment Required -
403 Forbidden -
404 Not Found -
409 Conflict -
422 Unprocessable Entity -
500 Internal Server Error -
+ */ + public ApiResponse v3RunCryptographyWithHttpInfo(@javax.annotation.Nonnull Long analysisId) throws ApiException { + okhttp3.Call localVarCall = v3RunCryptographyValidateBeforeCall(analysisId, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Run the cryptography agent. (asynchronously) + * Starts the cryptography agent, which identifies cryptographic operations in the binary and reports its findings, and returns the operation to poll for its outcome. Returns 409 while a run is already in progress for this analysis. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `409` [`CONFLICT`](/errors/CONFLICT) — Conflict - `402` [`INSUFFICIENT_CREDITS`](/errors/INSUFFICIENT_CREDITS) — Insufficient Credits - `409` [`OPERATION_PREREQUISITE_NOT_MET`](/errors/OPERATION_PREREQUISITE_NOT_MET) — Operation Prerequisite Not Met + * @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 -
402 Payment Required -
403 Forbidden -
404 Not Found -
409 Conflict -
422 Unprocessable Entity -
500 Internal Server Error -
+ */ + public okhttp3.Call v3RunCryptographyAsync(@javax.annotation.Nonnull Long analysisId, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = v3RunCryptographyValidateBeforeCall(analysisId, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } /** * Build call for v3RunExecutionExplain * @param functionId Function ID (required) @@ -6226,7 +6790,7 @@ private okhttp3.Call v3RunExecutionScanValidateBeforeCall(@javax.annotation.Nonn /** * Run the execution-scan agent. - * Starts an agent that name-matches the analysis' functions and their callees against known code-execution APIs, and returns the operation to poll for its outcome. Returns 409 while a run is already in progress for this analysis. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `409` [`CONFLICT`](/errors/CONFLICT) — Conflict + * Starts an agent that name-matches the analysis' functions and their callees against known code-execution APIs, and returns the operation to poll for its outcome. Returns 409 while a run is already in progress for this analysis. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `409` [`CONFLICT`](/errors/CONFLICT) — Conflict - `409` [`OPERATION_PREREQUISITE_NOT_MET`](/errors/OPERATION_PREREQUISITE_NOT_MET) — Operation Prerequisite Not Met * @param analysisId Analysis ID (required) * @param triggerExecutionScanInputBody (required) * @return OperationExecutionScanMetadataExecutionScanResult @@ -6250,7 +6814,7 @@ public OperationExecutionScanMetadataExecutionScanResult v3RunExecutionScan(@jav /** * Run the execution-scan agent. - * Starts an agent that name-matches the analysis' functions and their callees against known code-execution APIs, and returns the operation to poll for its outcome. Returns 409 while a run is already in progress for this analysis. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `409` [`CONFLICT`](/errors/CONFLICT) — Conflict + * Starts an agent that name-matches the analysis' functions and their callees against known code-execution APIs, and returns the operation to poll for its outcome. Returns 409 while a run is already in progress for this analysis. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `409` [`CONFLICT`](/errors/CONFLICT) — Conflict - `409` [`OPERATION_PREREQUISITE_NOT_MET`](/errors/OPERATION_PREREQUISITE_NOT_MET) — Operation Prerequisite Not Met * @param analysisId Analysis ID (required) * @param triggerExecutionScanInputBody (required) * @return ApiResponse<OperationExecutionScanMetadataExecutionScanResult> @@ -6275,7 +6839,7 @@ public ApiResponse v3RunExecu /** * Run the execution-scan agent. (asynchronously) - * Starts an agent that name-matches the analysis' functions and their callees against known code-execution APIs, and returns the operation to poll for its outcome. Returns 409 while a run is already in progress for this analysis. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `409` [`CONFLICT`](/errors/CONFLICT) — Conflict + * Starts an agent that name-matches the analysis' functions and their callees against known code-execution APIs, and returns the operation to poll for its outcome. Returns 409 while a run is already in progress for this analysis. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `409` [`CONFLICT`](/errors/CONFLICT) — Conflict - `409` [`OPERATION_PREREQUISITE_NOT_MET`](/errors/OPERATION_PREREQUISITE_NOT_MET) — Operation Prerequisite Not Met * @param analysisId Analysis ID (required) * @param triggerExecutionScanInputBody (required) * @param _callback The callback to be executed when the API call finishes @@ -6544,7 +7108,7 @@ private okhttp3.Call v3RunFilesystemScanValidateBeforeCall(@javax.annotation.Non /** * Run the filesystem-scan agent. - * Starts an agent that name-matches the analysis' functions and their callees against known filesystem/system APIs, and returns the operation to poll for its outcome. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `409` [`CONFLICT`](/errors/CONFLICT) — Conflict + * Starts an agent that name-matches the analysis' functions and their callees against known filesystem/system APIs, and returns the operation to poll for its outcome. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `409` [`CONFLICT`](/errors/CONFLICT) — Conflict - `409` [`OPERATION_PREREQUISITE_NOT_MET`](/errors/OPERATION_PREREQUISITE_NOT_MET) — Operation Prerequisite Not Met * @param analysisId Analysis ID (required) * @param triggerFilesystemScanInputBody (required) * @return OperationFilesystemScanMetadataFilesystemScanResult @@ -6568,7 +7132,7 @@ public OperationFilesystemScanMetadataFilesystemScanResult v3RunFilesystemScan(@ /** * Run the filesystem-scan agent. - * Starts an agent that name-matches the analysis' functions and their callees against known filesystem/system APIs, and returns the operation to poll for its outcome. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `409` [`CONFLICT`](/errors/CONFLICT) — Conflict + * Starts an agent that name-matches the analysis' functions and their callees against known filesystem/system APIs, and returns the operation to poll for its outcome. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `409` [`CONFLICT`](/errors/CONFLICT) — Conflict - `409` [`OPERATION_PREREQUISITE_NOT_MET`](/errors/OPERATION_PREREQUISITE_NOT_MET) — Operation Prerequisite Not Met * @param analysisId Analysis ID (required) * @param triggerFilesystemScanInputBody (required) * @return ApiResponse<OperationFilesystemScanMetadataFilesystemScanResult> @@ -6593,7 +7157,7 @@ public ApiResponse v3RunFil /** * Run the filesystem-scan agent. (asynchronously) - * Starts an agent that name-matches the analysis' functions and their callees against known filesystem/system APIs, and returns the operation to poll for its outcome. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `409` [`CONFLICT`](/errors/CONFLICT) — Conflict + * Starts an agent that name-matches the analysis' functions and their callees against known filesystem/system APIs, and returns the operation to poll for its outcome. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `409` [`CONFLICT`](/errors/CONFLICT) — Conflict - `409` [`OPERATION_PREREQUISITE_NOT_MET`](/errors/OPERATION_PREREQUISITE_NOT_MET) — Operation Prerequisite Not Met * @param analysisId Analysis ID (required) * @param triggerFilesystemScanInputBody (required) * @param _callback The callback to be executed when the API call finishes @@ -6862,7 +7426,7 @@ private okhttp3.Call v3RunNetworkingScanValidateBeforeCall(@javax.annotation.Non /** * Run the networking-scan agent. - * Starts an agent that name-matches the analysis' functions and their callees against known networking APIs, and returns the operation to poll for its outcome. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `409` [`CONFLICT`](/errors/CONFLICT) — Conflict + * Starts an agent that name-matches the analysis' functions and their callees against known networking APIs, and returns the operation to poll for its outcome. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `409` [`CONFLICT`](/errors/CONFLICT) — Conflict - `409` [`OPERATION_PREREQUISITE_NOT_MET`](/errors/OPERATION_PREREQUISITE_NOT_MET) — Operation Prerequisite Not Met * @param analysisId Analysis ID (required) * @param triggerNetworkingScanInputBody (required) * @return OperationNetworkingScanMetadataNetworkingScanResult @@ -6886,7 +7450,7 @@ public OperationNetworkingScanMetadataNetworkingScanResult v3RunNetworkingScan(@ /** * Run the networking-scan agent. - * Starts an agent that name-matches the analysis' functions and their callees against known networking APIs, and returns the operation to poll for its outcome. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `409` [`CONFLICT`](/errors/CONFLICT) — Conflict + * Starts an agent that name-matches the analysis' functions and their callees against known networking APIs, and returns the operation to poll for its outcome. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `409` [`CONFLICT`](/errors/CONFLICT) — Conflict - `409` [`OPERATION_PREREQUISITE_NOT_MET`](/errors/OPERATION_PREREQUISITE_NOT_MET) — Operation Prerequisite Not Met * @param analysisId Analysis ID (required) * @param triggerNetworkingScanInputBody (required) * @return ApiResponse<OperationNetworkingScanMetadataNetworkingScanResult> @@ -6911,7 +7475,7 @@ public ApiResponse v3RunNet /** * Run the networking-scan agent. (asynchronously) - * Starts an agent that name-matches the analysis' functions and their callees against known networking APIs, and returns the operation to poll for its outcome. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `409` [`CONFLICT`](/errors/CONFLICT) — Conflict + * Starts an agent that name-matches the analysis' functions and their callees against known networking APIs, and returns the operation to poll for its outcome. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `409` [`CONFLICT`](/errors/CONFLICT) — Conflict - `409` [`OPERATION_PREREQUISITE_NOT_MET`](/errors/OPERATION_PREREQUISITE_NOT_MET) — Operation Prerequisite Not Met * @param analysisId Analysis ID (required) * @param triggerNetworkingScanInputBody (required) * @param _callback The callback to be executed when the API call finishes @@ -7013,7 +7577,7 @@ private okhttp3.Call v3RunProtocolsValidateBeforeCall(@javax.annotation.Nonnull /** * Run the protocols agent. - * Starts the protocols agent, which identifies the network and data protocols the binary implements, and returns the operation to poll for its outcome. Returns 409 while a run is already in progress for this analysis. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `409` [`CONFLICT`](/errors/CONFLICT) — Conflict - `402` [`INSUFFICIENT_CREDITS`](/errors/INSUFFICIENT_CREDITS) — Insufficient Credits + * Starts the protocols agent, which identifies the network and data protocols the binary implements, and returns the operation to poll for its outcome. Returns 409 while a run is already in progress for this analysis. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `409` [`CONFLICT`](/errors/CONFLICT) — Conflict - `402` [`INSUFFICIENT_CREDITS`](/errors/INSUFFICIENT_CREDITS) — Insufficient Credits - `409` [`OPERATION_PREREQUISITE_NOT_MET`](/errors/OPERATION_PREREQUISITE_NOT_MET) — Operation Prerequisite Not Met * @param analysisId Analysis ID (required) * @return OperationMetadataReportResult * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body @@ -7037,7 +7601,7 @@ public OperationMetadataReportResult v3RunProtocols(@javax.annotation.Nonnull Lo /** * Run the protocols agent. - * Starts the protocols agent, which identifies the network and data protocols the binary implements, and returns the operation to poll for its outcome. Returns 409 while a run is already in progress for this analysis. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `409` [`CONFLICT`](/errors/CONFLICT) — Conflict - `402` [`INSUFFICIENT_CREDITS`](/errors/INSUFFICIENT_CREDITS) — Insufficient Credits + * Starts the protocols agent, which identifies the network and data protocols the binary implements, and returns the operation to poll for its outcome. Returns 409 while a run is already in progress for this analysis. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `409` [`CONFLICT`](/errors/CONFLICT) — Conflict - `402` [`INSUFFICIENT_CREDITS`](/errors/INSUFFICIENT_CREDITS) — Insufficient Credits - `409` [`OPERATION_PREREQUISITE_NOT_MET`](/errors/OPERATION_PREREQUISITE_NOT_MET) — Operation Prerequisite Not Met * @param analysisId Analysis ID (required) * @return ApiResponse<OperationMetadataReportResult> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body @@ -7062,7 +7626,7 @@ public ApiResponse v3RunProtocolsWithHttpInfo(@ja /** * Run the protocols agent. (asynchronously) - * Starts the protocols agent, which identifies the network and data protocols the binary implements, and returns the operation to poll for its outcome. Returns 409 while a run is already in progress for this analysis. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `409` [`CONFLICT`](/errors/CONFLICT) — Conflict - `402` [`INSUFFICIENT_CREDITS`](/errors/INSUFFICIENT_CREDITS) — Insufficient Credits + * Starts the protocols agent, which identifies the network and data protocols the binary implements, and returns the operation to poll for its outcome. Returns 409 while a run is already in progress for this analysis. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `409` [`CONFLICT`](/errors/CONFLICT) — Conflict - `402` [`INSUFFICIENT_CREDITS`](/errors/INSUFFICIENT_CREDITS) — Insufficient Credits - `409` [`OPERATION_PREREQUISITE_NOT_MET`](/errors/OPERATION_PREREQUISITE_NOT_MET) — Operation Prerequisite Not Met * @param analysisId Analysis ID (required) * @param _callback The callback to be executed when the API call finishes * @return The request call @@ -7164,7 +7728,7 @@ private okhttp3.Call v3RunRemediationValidateBeforeCall(@javax.annotation.Nonnul /** * Run the remediation agent. - * Starts the remediation agent, which generates YARA, Snort and STIX detection rules for the binary, and returns the operation to poll for its outcome. Returns 409 while a run is already in progress for this analysis. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `409` [`CONFLICT`](/errors/CONFLICT) — Conflict - `402` [`INSUFFICIENT_CREDITS`](/errors/INSUFFICIENT_CREDITS) — Insufficient Credits + * Starts the remediation agent, which generates YARA, Snort and STIX detection rules for the binary, and returns the operation to poll for its outcome. Returns 409 while a run is already in progress for this analysis. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `409` [`CONFLICT`](/errors/CONFLICT) — Conflict - `402` [`INSUFFICIENT_CREDITS`](/errors/INSUFFICIENT_CREDITS) — Insufficient Credits - `409` [`OPERATION_PREREQUISITE_NOT_MET`](/errors/OPERATION_PREREQUISITE_NOT_MET) — Operation Prerequisite Not Met * @param analysisId Analysis ID (required) * @return OperationMetadataRemediationResult * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body @@ -7188,7 +7752,7 @@ public OperationMetadataRemediationResult v3RunRemediation(@javax.annotation.Non /** * Run the remediation agent. - * Starts the remediation agent, which generates YARA, Snort and STIX detection rules for the binary, and returns the operation to poll for its outcome. Returns 409 while a run is already in progress for this analysis. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `409` [`CONFLICT`](/errors/CONFLICT) — Conflict - `402` [`INSUFFICIENT_CREDITS`](/errors/INSUFFICIENT_CREDITS) — Insufficient Credits + * Starts the remediation agent, which generates YARA, Snort and STIX detection rules for the binary, and returns the operation to poll for its outcome. Returns 409 while a run is already in progress for this analysis. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `409` [`CONFLICT`](/errors/CONFLICT) — Conflict - `402` [`INSUFFICIENT_CREDITS`](/errors/INSUFFICIENT_CREDITS) — Insufficient Credits - `409` [`OPERATION_PREREQUISITE_NOT_MET`](/errors/OPERATION_PREREQUISITE_NOT_MET) — Operation Prerequisite Not Met * @param analysisId Analysis ID (required) * @return ApiResponse<OperationMetadataRemediationResult> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body @@ -7213,7 +7777,7 @@ public ApiResponse v3RunRemediationWithHttpI /** * Run the remediation agent. (asynchronously) - * Starts the remediation agent, which generates YARA, Snort and STIX detection rules for the binary, and returns the operation to poll for its outcome. Returns 409 while a run is already in progress for this analysis. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `409` [`CONFLICT`](/errors/CONFLICT) — Conflict - `402` [`INSUFFICIENT_CREDITS`](/errors/INSUFFICIENT_CREDITS) — Insufficient Credits + * Starts the remediation agent, which generates YARA, Snort and STIX detection rules for the binary, and returns the operation to poll for its outcome. Returns 409 while a run is already in progress for this analysis. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `409` [`CONFLICT`](/errors/CONFLICT) — Conflict - `402` [`INSUFFICIENT_CREDITS`](/errors/INSUFFICIENT_CREDITS) — Insufficient Credits - `409` [`OPERATION_PREREQUISITE_NOT_MET`](/errors/OPERATION_PREREQUISITE_NOT_MET) — Operation Prerequisite Not Met * @param analysisId Analysis ID (required) * @param _callback The callback to be executed when the API call finishes * @return The request call @@ -7315,7 +7879,7 @@ private okhttp3.Call v3RunReportAnalysisValidateBeforeCall(@javax.annotation.Non /** * Run the report-analysis agent. - * Starts the report-analysis agent, which produces a combined threat report — summary, software type, attack flow, indicators of compromise, MITRE ATT&CK techniques and a YARA rule — and returns the operation to poll for its outcome. Returns 409 while a run is already in progress for this analysis. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `409` [`CONFLICT`](/errors/CONFLICT) — Conflict - `402` [`INSUFFICIENT_CREDITS`](/errors/INSUFFICIENT_CREDITS) — Insufficient Credits + * Starts the report-analysis agent, which produces a combined threat report — summary, software type, attack flow, indicators of compromise, MITRE ATT&CK techniques and a YARA rule — and returns the operation to poll for its outcome. Returns 409 while a run is already in progress for this analysis. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `409` [`CONFLICT`](/errors/CONFLICT) — Conflict - `402` [`INSUFFICIENT_CREDITS`](/errors/INSUFFICIENT_CREDITS) — Insufficient Credits - `409` [`OPERATION_PREREQUISITE_NOT_MET`](/errors/OPERATION_PREREQUISITE_NOT_MET) — Operation Prerequisite Not Met * @param analysisId Analysis ID (required) * @return OperationMetadataThreatReportResult * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body @@ -7339,7 +7903,7 @@ public OperationMetadataThreatReportResult v3RunReportAnalysis(@javax.annotation /** * Run the report-analysis agent. - * Starts the report-analysis agent, which produces a combined threat report — summary, software type, attack flow, indicators of compromise, MITRE ATT&CK techniques and a YARA rule — and returns the operation to poll for its outcome. Returns 409 while a run is already in progress for this analysis. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `409` [`CONFLICT`](/errors/CONFLICT) — Conflict - `402` [`INSUFFICIENT_CREDITS`](/errors/INSUFFICIENT_CREDITS) — Insufficient Credits + * Starts the report-analysis agent, which produces a combined threat report — summary, software type, attack flow, indicators of compromise, MITRE ATT&CK techniques and a YARA rule — and returns the operation to poll for its outcome. Returns 409 while a run is already in progress for this analysis. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `409` [`CONFLICT`](/errors/CONFLICT) — Conflict - `402` [`INSUFFICIENT_CREDITS`](/errors/INSUFFICIENT_CREDITS) — Insufficient Credits - `409` [`OPERATION_PREREQUISITE_NOT_MET`](/errors/OPERATION_PREREQUISITE_NOT_MET) — Operation Prerequisite Not Met * @param analysisId Analysis ID (required) * @return ApiResponse<OperationMetadataThreatReportResult> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body @@ -7364,7 +7928,7 @@ public ApiResponse v3RunReportAnalysisWithH /** * Run the report-analysis agent. (asynchronously) - * Starts the report-analysis agent, which produces a combined threat report — summary, software type, attack flow, indicators of compromise, MITRE ATT&CK techniques and a YARA rule — and returns the operation to poll for its outcome. Returns 409 while a run is already in progress for this analysis. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `409` [`CONFLICT`](/errors/CONFLICT) — Conflict - `402` [`INSUFFICIENT_CREDITS`](/errors/INSUFFICIENT_CREDITS) — Insufficient Credits + * Starts the report-analysis agent, which produces a combined threat report — summary, software type, attack flow, indicators of compromise, MITRE ATT&CK techniques and a YARA rule — and returns the operation to poll for its outcome. Returns 409 while a run is already in progress for this analysis. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `409` [`CONFLICT`](/errors/CONFLICT) — Conflict - `402` [`INSUFFICIENT_CREDITS`](/errors/INSUFFICIENT_CREDITS) — Insufficient Credits - `409` [`OPERATION_PREREQUISITE_NOT_MET`](/errors/OPERATION_PREREQUISITE_NOT_MET) — Operation Prerequisite Not Met * @param analysisId Analysis ID (required) * @param _callback The callback to be executed when the API call finishes * @return The request call @@ -7466,7 +8030,7 @@ private okhttp3.Call v3RunSecretsValidateBeforeCall(@javax.annotation.Nonnull Lo /** * Run the secrets agent. - * Starts the secrets agent, which finds credentials and other hardcoded secrets in the binary, and returns the operation to poll for its outcome. Returns 409 while a run is already in progress for this analysis. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `409` [`CONFLICT`](/errors/CONFLICT) — Conflict - `402` [`INSUFFICIENT_CREDITS`](/errors/INSUFFICIENT_CREDITS) — Insufficient Credits + * Starts the secrets agent, which finds credentials and other hardcoded secrets in the binary, and returns the operation to poll for its outcome. Returns 409 while a run is already in progress for this analysis. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `409` [`CONFLICT`](/errors/CONFLICT) — Conflict - `402` [`INSUFFICIENT_CREDITS`](/errors/INSUFFICIENT_CREDITS) — Insufficient Credits - `409` [`OPERATION_PREREQUISITE_NOT_MET`](/errors/OPERATION_PREREQUISITE_NOT_MET) — Operation Prerequisite Not Met * @param analysisId Analysis ID (required) * @return OperationMetadataReportResult * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body @@ -7490,7 +8054,7 @@ public OperationMetadataReportResult v3RunSecrets(@javax.annotation.Nonnull Long /** * Run the secrets agent. - * Starts the secrets agent, which finds credentials and other hardcoded secrets in the binary, and returns the operation to poll for its outcome. Returns 409 while a run is already in progress for this analysis. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `409` [`CONFLICT`](/errors/CONFLICT) — Conflict - `402` [`INSUFFICIENT_CREDITS`](/errors/INSUFFICIENT_CREDITS) — Insufficient Credits + * Starts the secrets agent, which finds credentials and other hardcoded secrets in the binary, and returns the operation to poll for its outcome. Returns 409 while a run is already in progress for this analysis. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `409` [`CONFLICT`](/errors/CONFLICT) — Conflict - `402` [`INSUFFICIENT_CREDITS`](/errors/INSUFFICIENT_CREDITS) — Insufficient Credits - `409` [`OPERATION_PREREQUISITE_NOT_MET`](/errors/OPERATION_PREREQUISITE_NOT_MET) — Operation Prerequisite Not Met * @param analysisId Analysis ID (required) * @return ApiResponse<OperationMetadataReportResult> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body @@ -7515,7 +8079,7 @@ public ApiResponse v3RunSecretsWithHttpInfo(@java /** * Run the secrets agent. (asynchronously) - * Starts the secrets agent, which finds credentials and other hardcoded secrets in the binary, and returns the operation to poll for its outcome. Returns 409 while a run is already in progress for this analysis. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `409` [`CONFLICT`](/errors/CONFLICT) — Conflict - `402` [`INSUFFICIENT_CREDITS`](/errors/INSUFFICIENT_CREDITS) — Insufficient Credits + * Starts the secrets agent, which finds credentials and other hardcoded secrets in the binary, and returns the operation to poll for its outcome. Returns 409 while a run is already in progress for this analysis. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `409` [`CONFLICT`](/errors/CONFLICT) — Conflict - `402` [`INSUFFICIENT_CREDITS`](/errors/INSUFFICIENT_CREDITS) — Insufficient Credits - `409` [`OPERATION_PREREQUISITE_NOT_MET`](/errors/OPERATION_PREREQUISITE_NOT_MET) — Operation Prerequisite Not Met * @param analysisId Analysis ID (required) * @param _callback The callback to be executed when the API call finishes * @return The request call @@ -7778,7 +8342,7 @@ private okhttp3.Call v3RunTriageValidateBeforeCall(@javax.annotation.Nonnull Lon /** * Run the triage agent. - * Starts the triage agent, which scores the binary and each of its functions for maliciousness, and returns the operation to poll for its outcome. Unlike the other binary agents this one is not gated on subscription tier. Returns 409 while a run is already in progress for this analysis. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `409` [`CONFLICT`](/errors/CONFLICT) — Conflict - `402` [`INSUFFICIENT_CREDITS`](/errors/INSUFFICIENT_CREDITS) — Insufficient Credits + * Starts the triage agent, which scores the binary and each of its functions for maliciousness, and returns the operation to poll for its outcome. Unlike the other binary agents this one is not gated on subscription tier. Returns 409 while a run is already in progress for this analysis. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `409` [`CONFLICT`](/errors/CONFLICT) — Conflict - `402` [`INSUFFICIENT_CREDITS`](/errors/INSUFFICIENT_CREDITS) — Insufficient Credits - `409` [`OPERATION_PREREQUISITE_NOT_MET`](/errors/OPERATION_PREREQUISITE_NOT_MET) — Operation Prerequisite Not Met * @param analysisId Analysis ID (required) * @return OperationMetadataTriageResult * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body @@ -7802,7 +8366,7 @@ public OperationMetadataTriageResult v3RunTriage(@javax.annotation.Nonnull Long /** * Run the triage agent. - * Starts the triage agent, which scores the binary and each of its functions for maliciousness, and returns the operation to poll for its outcome. Unlike the other binary agents this one is not gated on subscription tier. Returns 409 while a run is already in progress for this analysis. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `409` [`CONFLICT`](/errors/CONFLICT) — Conflict - `402` [`INSUFFICIENT_CREDITS`](/errors/INSUFFICIENT_CREDITS) — Insufficient Credits + * Starts the triage agent, which scores the binary and each of its functions for maliciousness, and returns the operation to poll for its outcome. Unlike the other binary agents this one is not gated on subscription tier. Returns 409 while a run is already in progress for this analysis. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `409` [`CONFLICT`](/errors/CONFLICT) — Conflict - `402` [`INSUFFICIENT_CREDITS`](/errors/INSUFFICIENT_CREDITS) — Insufficient Credits - `409` [`OPERATION_PREREQUISITE_NOT_MET`](/errors/OPERATION_PREREQUISITE_NOT_MET) — Operation Prerequisite Not Met * @param analysisId Analysis ID (required) * @return ApiResponse<OperationMetadataTriageResult> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body @@ -7827,7 +8391,7 @@ public ApiResponse v3RunTriageWithHttpInfo(@javax /** * Run the triage agent. (asynchronously) - * Starts the triage agent, which scores the binary and each of its functions for maliciousness, and returns the operation to poll for its outcome. Unlike the other binary agents this one is not gated on subscription tier. Returns 409 while a run is already in progress for this analysis. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `409` [`CONFLICT`](/errors/CONFLICT) — Conflict - `402` [`INSUFFICIENT_CREDITS`](/errors/INSUFFICIENT_CREDITS) — Insufficient Credits + * Starts the triage agent, which scores the binary and each of its functions for maliciousness, and returns the operation to poll for its outcome. Unlike the other binary agents this one is not gated on subscription tier. Returns 409 while a run is already in progress for this analysis. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `409` [`CONFLICT`](/errors/CONFLICT) — Conflict - `402` [`INSUFFICIENT_CREDITS`](/errors/INSUFFICIENT_CREDITS) — Insufficient Credits - `409` [`OPERATION_PREREQUISITE_NOT_MET`](/errors/OPERATION_PREREQUISITE_NOT_MET) — Operation Prerequisite Not Met * @param analysisId Analysis ID (required) * @param _callback The callback to be executed when the API call finishes * @return The request call diff --git a/src/main/java/ai/reveng/api/AnalysesCoreApi.java b/src/main/java/ai/reveng/api/AnalysesCoreApi.java index f9069e1..e57a0bf 100644 --- a/src/main/java/ai/reveng/api/AnalysesCoreApi.java +++ b/src/main/java/ai/reveng/api/AnalysesCoreApi.java @@ -31,6 +31,7 @@ import ai.reveng.model.AnalysisBasicInfoOutputBody; import ai.reveng.model.AnalysisCreateRequest; import ai.reveng.model.AnalysisDetailOutputBody; +import ai.reveng.model.AnalysisOperationsOutputBody; import ai.reveng.model.AnalysisReport; import ai.reveng.model.AnalysisTagsOutputBody; import ai.reveng.model.AnalysisUpdateRequest; @@ -52,27 +53,38 @@ import ai.reveng.model.BaseResponseUploadResponse; import ai.reveng.model.DynamicExecutionStatus; import ai.reveng.model.DynamicExecutionStatusResponse; +import ai.reveng.model.DynamicExecutionSummary; import java.io.File; import ai.reveng.model.FunctionsProgressOutputBody; import ai.reveng.model.GetAnalysisLogsOutputBody; import ai.reveng.model.GetAnalysisStringsStatusOutputBody; +import ai.reveng.model.GetGlobalHistoryOutputBody; import ai.reveng.model.GetMatchesOutputBody; import ai.reveng.model.GetMatchesStatusOutputBody; +import ai.reveng.model.GlobalVariable; import ai.reveng.model.InsertAnalysisLogRequest; import ai.reveng.model.ListAnalysesOutputBody; +import ai.reveng.model.ListAnalysisGlobalsOutputBody; import ai.reveng.model.ListAnalysisStringsOutputBody; import ai.reveng.model.ListExampleAnalysesOutputBody; +import ai.reveng.model.ListGlobalFunctionsOutputBody; import ai.reveng.model.LookupAnalysisByBinaryIDOutputBody; import ai.reveng.model.ModelName; import ai.reveng.model.OperationBinaryExportMetadataBinaryExportResult; import ai.reveng.model.OperationCreateMetadataCreateResult; +import ai.reveng.model.OperationDynamicExecutionMetadataDynamicExecutionResult; +import ai.reveng.model.OperationDynamicExecutionSummaryMetadataDynamicExecutionSummaryResult; import ai.reveng.model.Order; import ai.reveng.model.PutAnalysisStringsRequest; import ai.reveng.model.ReAnalysisForm; +import ai.reveng.model.RequeueAnalysisRequest; +import ai.reveng.model.RunDynamicExecutionInputBody; +import ai.reveng.model.ScreenshotsIndex; import ai.reveng.model.SearchTagsOutputBody; import ai.reveng.model.StartMatchingForAnalysisInputBody; import ai.reveng.model.StartMatchingOutputBody; import ai.reveng.model.StatusInput; +import ai.reveng.model.UpdateAnalysisGlobalInputBody; import ai.reveng.model.UpdateAnalysisInputBody; import ai.reveng.model.UpdateTagsInputBody; import ai.reveng.model.UpgradeAnalysisModelOutputBody; @@ -3772,7 +3784,7 @@ public okhttp3.Call v3DeleteAnalysisAsync(@javax.annotation.Nonnull Long analysi /** * Build call for v3DownloadBinaryExport * @param analysisId Analysis ID (required) - * @param taskId Task ID returned by queueing the export (optional) + * @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 @@ -3787,7 +3799,7 @@ public okhttp3.Call v3DeleteAnalysisAsync(@javax.annotation.Nonnull Long analysi 500 Internal Server Error - */ - public okhttp3.Call v3DownloadBinaryExportCall(@javax.annotation.Nonnull Long analysisId, @javax.annotation.Nullable String taskId, final ApiCallback _callback) throws ApiException { + public okhttp3.Call v3DownloadBinaryExportCall(@javax.annotation.Nonnull Long analysisId, @javax.annotation.Nonnull String taskId, final ApiCallback _callback) throws ApiException { String basePath = null; // Operation Servers String[] localBasePaths = new String[] { }; @@ -3837,12 +3849,17 @@ public okhttp3.Call v3DownloadBinaryExportCall(@javax.annotation.Nonnull Long an } @SuppressWarnings("rawtypes") - private okhttp3.Call v3DownloadBinaryExportValidateBeforeCall(@javax.annotation.Nonnull Long analysisId, @javax.annotation.Nullable String taskId, final ApiCallback _callback) throws ApiException { + private okhttp3.Call v3DownloadBinaryExportValidateBeforeCall(@javax.annotation.Nonnull Long analysisId, @javax.annotation.Nonnull 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 v3DownloadBinaryExport(Async)"); } + // verify the required parameter 'taskId' is set + if (taskId == null) { + throw new ApiException("Missing the required parameter 'taskId' when calling v3DownloadBinaryExport(Async)"); + } + return v3DownloadBinaryExportCall(analysisId, taskId, _callback); } @@ -3851,7 +3868,7 @@ private okhttp3.Call v3DownloadBinaryExportValidateBeforeCall(@javax.annotation. * 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) - * @param taskId Task ID returned by queueing the export (optional) + * @param taskId Task ID returned by queueing the export (required) * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details @@ -3864,7 +3881,7 @@ private okhttp3.Call v3DownloadBinaryExportValidateBeforeCall(@javax.annotation.
500 Internal Server Error -
*/ - public void v3DownloadBinaryExport(@javax.annotation.Nonnull Long analysisId, @javax.annotation.Nullable String taskId) throws ApiException { + public void v3DownloadBinaryExport(@javax.annotation.Nonnull Long analysisId, @javax.annotation.Nonnull String taskId) throws ApiException { v3DownloadBinaryExportWithHttpInfo(analysisId, taskId); } @@ -3872,7 +3889,7 @@ public void v3DownloadBinaryExport(@javax.annotation.Nonnull Long analysisId, @j * 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) - * @param taskId Task ID returned by queueing the export (optional) + * @param taskId Task ID returned by queueing the export (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 @@ -3886,7 +3903,7 @@ public void v3DownloadBinaryExport(@javax.annotation.Nonnull Long analysisId, @j 500 Internal Server Error - */ - public ApiResponse v3DownloadBinaryExportWithHttpInfo(@javax.annotation.Nonnull Long analysisId, @javax.annotation.Nullable String taskId) throws ApiException { + public ApiResponse v3DownloadBinaryExportWithHttpInfo(@javax.annotation.Nonnull Long analysisId, @javax.annotation.Nonnull String taskId) throws ApiException { okhttp3.Call localVarCall = v3DownloadBinaryExportValidateBeforeCall(analysisId, taskId, null); return localVarApiClient.execute(localVarCall); } @@ -3895,7 +3912,7 @@ public ApiResponse v3DownloadBinaryExportWithHttpInfo(@javax.annotation.No * 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 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 @@ -3910,7 +3927,7 @@ public ApiResponse v3DownloadBinaryExportWithHttpInfo(@javax.annotation.No 500 Internal Server Error - */ - public okhttp3.Call v3DownloadBinaryExportAsync(@javax.annotation.Nonnull Long analysisId, @javax.annotation.Nullable String taskId, final ApiCallback _callback) throws ApiException { + public okhttp3.Call v3DownloadBinaryExportAsync(@javax.annotation.Nonnull Long analysisId, @javax.annotation.Nonnull String taskId, final ApiCallback _callback) throws ApiException { okhttp3.Call localVarCall = v3DownloadBinaryExportValidateBeforeCall(analysisId, taskId, _callback); localVarApiClient.executeAsync(localVarCall, _callback); @@ -4345,6 +4362,312 @@ public okhttp3.Call v3GetAnalysisFunctionsProgressAsync(@javax.annotation.Nonnul localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } + /** + * Build call for v3GetAnalysisGlobal + * @param analysisId Analysis ID (required) + * @param vaddr Virtual address of the global variable. (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 v3GetAnalysisGlobalCall(@javax.annotation.Nonnull Long analysisId, @javax.annotation.Nonnull Long vaddr, 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}/globals/{vaddr}" + .replace("{" + "analysis_id" + "}", localVarApiClient.escapeString(analysisId.toString())) + .replace("{" + "vaddr" + "}", localVarApiClient.escapeString(vaddr.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 v3GetAnalysisGlobalValidateBeforeCall(@javax.annotation.Nonnull Long analysisId, @javax.annotation.Nonnull Long vaddr, 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 v3GetAnalysisGlobal(Async)"); + } + + // verify the required parameter 'vaddr' is set + if (vaddr == null) { + throw new ApiException("Missing the required parameter 'vaddr' when calling v3GetAnalysisGlobal(Async)"); + } + + return v3GetAnalysisGlobalCall(analysisId, vaddr, _callback); + + } + + /** + * Get one global variable. + * Returns the global variable at the given virtual address, or 404 when the analysis has no row for that address. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied + * @param analysisId Analysis ID (required) + * @param vaddr Virtual address of the global variable. (required) + * @return GlobalVariable + * @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 GlobalVariable v3GetAnalysisGlobal(@javax.annotation.Nonnull Long analysisId, @javax.annotation.Nonnull Long vaddr) throws ApiException { + ApiResponse localVarResp = v3GetAnalysisGlobalWithHttpInfo(analysisId, vaddr); + return localVarResp.getData(); + } + + /** + * Get one global variable. + * Returns the global variable at the given virtual address, or 404 when the analysis has no row for that address. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied + * @param analysisId Analysis ID (required) + * @param vaddr Virtual address of the global variable. (required) + * @return ApiResponse<GlobalVariable> + * @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 v3GetAnalysisGlobalWithHttpInfo(@javax.annotation.Nonnull Long analysisId, @javax.annotation.Nonnull Long vaddr) throws ApiException { + okhttp3.Call localVarCall = v3GetAnalysisGlobalValidateBeforeCall(analysisId, vaddr, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Get one global variable. (asynchronously) + * Returns the global variable at the given virtual address, or 404 when the analysis has no row for that address. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied + * @param analysisId Analysis ID (required) + * @param vaddr Virtual address of the global variable. (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 v3GetAnalysisGlobalAsync(@javax.annotation.Nonnull Long analysisId, @javax.annotation.Nonnull Long vaddr, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = v3GetAnalysisGlobalValidateBeforeCall(analysisId, vaddr, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for v3GetAnalysisGlobalHistory + * @param analysisId Analysis ID (required) + * @param vaddr Virtual address of the global variable. (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 v3GetAnalysisGlobalHistoryCall(@javax.annotation.Nonnull Long analysisId, @javax.annotation.Nonnull Long vaddr, 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}/globals/{vaddr}/history" + .replace("{" + "analysis_id" + "}", localVarApiClient.escapeString(analysisId.toString())) + .replace("{" + "vaddr" + "}", localVarApiClient.escapeString(vaddr.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 v3GetAnalysisGlobalHistoryValidateBeforeCall(@javax.annotation.Nonnull Long analysisId, @javax.annotation.Nonnull Long vaddr, 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 v3GetAnalysisGlobalHistory(Async)"); + } + + // verify the required parameter 'vaddr' is set + if (vaddr == null) { + throw new ApiException("Missing the required parameter 'vaddr' when calling v3GetAnalysisGlobalHistory(Async)"); + } + + return v3GetAnalysisGlobalHistoryCall(analysisId, vaddr, _callback); + + } + + /** + * List a global variable's replaced values. + * Returns what the global held before each edit, oldest first. A global nobody has edited returns an empty list. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied + * @param analysisId Analysis ID (required) + * @param vaddr Virtual address of the global variable. (required) + * @return GetGlobalHistoryOutputBody + * @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 GetGlobalHistoryOutputBody v3GetAnalysisGlobalHistory(@javax.annotation.Nonnull Long analysisId, @javax.annotation.Nonnull Long vaddr) throws ApiException { + ApiResponse localVarResp = v3GetAnalysisGlobalHistoryWithHttpInfo(analysisId, vaddr); + return localVarResp.getData(); + } + + /** + * List a global variable's replaced values. + * Returns what the global held before each edit, oldest first. A global nobody has edited returns an empty list. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied + * @param analysisId Analysis ID (required) + * @param vaddr Virtual address of the global variable. (required) + * @return ApiResponse<GetGlobalHistoryOutputBody> + * @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 v3GetAnalysisGlobalHistoryWithHttpInfo(@javax.annotation.Nonnull Long analysisId, @javax.annotation.Nonnull Long vaddr) throws ApiException { + okhttp3.Call localVarCall = v3GetAnalysisGlobalHistoryValidateBeforeCall(analysisId, vaddr, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * List a global variable's replaced values. (asynchronously) + * Returns what the global held before each edit, oldest first. A global nobody has edited returns an empty list. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied + * @param analysisId Analysis ID (required) + * @param vaddr Virtual address of the global variable. (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 v3GetAnalysisGlobalHistoryAsync(@javax.annotation.Nonnull Long analysisId, @javax.annotation.Nonnull Long vaddr, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = v3GetAnalysisGlobalHistoryValidateBeforeCall(analysisId, vaddr, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } /** * Build call for v3GetAnalysisLogs * @param analysisId Analysis ID (required) @@ -5117,20 +5440,10 @@ public okhttp3.Call v3GetBinaryExportOperationAsync(@javax.annotation.Nonnull St 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) + * Build call for v3GetDynamicExecutionArtifact + * @param analysisId Analysis ID (required) + * @param sha256 SHA-256 hex digest of the artifact (required) + * @param filename Optional name for the downloaded file (inside the zip and as the download filename). Defaults to the SHA-256 when omitted. (optional) * @param _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object @@ -5139,12 +5452,14 @@ public okhttp3.Call v3GetBinaryExportOperationAsync(@javax.annotation.Nonnull St Response Details Status Code Description Response Headers 200 OK - - 400 Bad Request - + 403 Forbidden - + 404 Not Found - + 409 Conflict - 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 { + public okhttp3.Call v3GetDynamicExecutionArtifactCall(@javax.annotation.Nonnull Long analysisId, @javax.annotation.Nonnull String sha256, @javax.annotation.Nullable String filename, final ApiCallback _callback) throws ApiException { String basePath = null; // Operation Servers String[] localBasePaths = new String[] { }; @@ -5161,7 +5476,9 @@ public okhttp3.Call v3ListAnalysesCall(@javax.annotation.Nullable String searchT Object localVarPostBody = null; // create path and map variables - String localVarPath = "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/v3/analyses"; + String localVarPath = "/v3/analyses/{analysis_id}/dynamic-execution/artifacts/{sha256}" + .replace("{" + "analysis_id" + "}", localVarApiClient.escapeString(analysisId.toString())) + .replace("{" + "sha256" + "}", localVarApiClient.escapeString(sha256.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -5169,58 +5486,164 @@ 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 (filename != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("filename", filename)); } - if (analysisScope != null) { - localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "analysis_scope", analysisScope)); + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); } - if (status != null) { - localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "status", status)); + final String[] localVarContentTypes = { + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); } - if (modelName != null) { - localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("csv", "model_name", modelName)); - } + String[] localVarAuthNames = new String[] { "APIKey", "bearerAuth" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } - if (usernames != null) { - localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("csv", "usernames", usernames)); + @SuppressWarnings("rawtypes") + private okhttp3.Call v3GetDynamicExecutionArtifactValidateBeforeCall(@javax.annotation.Nonnull Long analysisId, @javax.annotation.Nonnull String sha256, @javax.annotation.Nullable String filename, 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 v3GetDynamicExecutionArtifact(Async)"); } - if (sha256Hash != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("sha256_hash", sha256Hash)); + // verify the required parameter 'sha256' is set + if (sha256 == null) { + throw new ApiException("Missing the required parameter 'sha256' when calling v3GetDynamicExecutionArtifact(Async)"); } - if (binaryId != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("binary_id", binaryId)); - } + return v3GetDynamicExecutionArtifactCall(analysisId, sha256, filename, _callback); - if (platform != null) { - localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("csv", "platform", platform)); - } + } - if (architecture != null) { - localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("csv", "architecture", architecture)); - } + /** + * Download an artifact. + * Streams a file extracted during execution (filesystem, memory, or network), addressed by the SHA-256 referenced by `artifacts[].sha256` in the dynamic execution report. The response is a password-protected zip (password: `infected`). **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `409` [`DYNAMIC_EXECUTION_INCOMPLETE`](/errors/DYNAMIC_EXECUTION_INCOMPLETE) — Dynamic Execution Incomplete + * @param analysisId Analysis ID (required) + * @param sha256 SHA-256 hex digest of the artifact (required) + * @param filename Optional name for the downloaded file (inside the zip and as the download filename). Defaults to the SHA-256 when omitted. (optional) + * @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 -
409 Conflict -
422 Unprocessable Entity -
500 Internal Server Error -
+ */ + public void v3GetDynamicExecutionArtifact(@javax.annotation.Nonnull Long analysisId, @javax.annotation.Nonnull String sha256, @javax.annotation.Nullable String filename) throws ApiException { + v3GetDynamicExecutionArtifactWithHttpInfo(analysisId, sha256, filename); + } - if (pageSize != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("page_size", pageSize)); - } + /** + * Download an artifact. + * Streams a file extracted during execution (filesystem, memory, or network), addressed by the SHA-256 referenced by `artifacts[].sha256` in the dynamic execution report. The response is a password-protected zip (password: `infected`). **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `409` [`DYNAMIC_EXECUTION_INCOMPLETE`](/errors/DYNAMIC_EXECUTION_INCOMPLETE) — Dynamic Execution Incomplete + * @param analysisId Analysis ID (required) + * @param sha256 SHA-256 hex digest of the artifact (required) + * @param filename Optional name for the downloaded file (inside the zip and as the download filename). Defaults to the SHA-256 when omitted. (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 + + + + + + + + + +
Response Details
Status Code Description Response Headers
200 OK -
403 Forbidden -
404 Not Found -
409 Conflict -
422 Unprocessable Entity -
500 Internal Server Error -
+ */ + public ApiResponse v3GetDynamicExecutionArtifactWithHttpInfo(@javax.annotation.Nonnull Long analysisId, @javax.annotation.Nonnull String sha256, @javax.annotation.Nullable String filename) throws ApiException { + okhttp3.Call localVarCall = v3GetDynamicExecutionArtifactValidateBeforeCall(analysisId, sha256, filename, null); + return localVarApiClient.execute(localVarCall); + } - if (nextPageToken != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("next_page_token", nextPageToken)); - } + /** + * Download an artifact. (asynchronously) + * Streams a file extracted during execution (filesystem, memory, or network), addressed by the SHA-256 referenced by `artifacts[].sha256` in the dynamic execution report. The response is a password-protected zip (password: `infected`). **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `409` [`DYNAMIC_EXECUTION_INCOMPLETE`](/errors/DYNAMIC_EXECUTION_INCOMPLETE) — Dynamic Execution Incomplete + * @param analysisId Analysis ID (required) + * @param sha256 SHA-256 hex digest of the artifact (required) + * @param filename Optional name for the downloaded file (inside the zip and as the download filename). Defaults to the SHA-256 when omitted. (optional) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + + + + + + +
Response Details
Status Code Description Response Headers
200 OK -
403 Forbidden -
404 Not Found -
409 Conflict -
422 Unprocessable Entity -
500 Internal Server Error -
+ */ + public okhttp3.Call v3GetDynamicExecutionArtifactAsync(@javax.annotation.Nonnull Long analysisId, @javax.annotation.Nonnull String sha256, @javax.annotation.Nullable String filename, final ApiCallback _callback) throws ApiException { - if (orderBy != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("order_by", orderBy)); - } + okhttp3.Call localVarCall = v3GetDynamicExecutionArtifactValidateBeforeCall(analysisId, sha256, filename, _callback); + localVarApiClient.executeAsync(localVarCall, _callback); + return localVarCall; + } + /** + * Build call for v3GetDynamicExecutionLogsDownload + * @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 -
409 Conflict -
422 Unprocessable Entity -
500 Internal Server Error -
+ */ + public okhttp3.Call v3GetDynamicExecutionLogsDownloadCall(@javax.annotation.Nonnull Long analysisId, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; - if (order != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("order", order)); + // 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}/dynamic-execution/logs/download" + .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" }; @@ -5241,94 +5664,64 @@ public okhttp3.Call v3ListAnalysesCall(@javax.annotation.Nullable String searchT } @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); + private okhttp3.Call v3GetDynamicExecutionLogsDownloadValidateBeforeCall(@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 v3GetDynamicExecutionLogsDownload(Async)"); + } + + return v3GetDynamicExecutionLogsDownloadCall(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 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 + * Download the execution logs archive. + * Streams a ZIP archive of the sandbox logs collected during execution. Requires the run to be COMPLETED. Returns 404 if no logs were captured. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `409` [`DYNAMIC_EXECUTION_INCOMPLETE`](/errors/DYNAMIC_EXECUTION_INCOMPLETE) — Dynamic Execution Incomplete + * @param analysisId Analysis ID (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
200 OK -
400 Bad Request -
403 Forbidden -
404 Not Found -
409 Conflict -
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(); + public void v3GetDynamicExecutionLogsDownload(@javax.annotation.Nonnull Long analysisId) throws ApiException { + v3GetDynamicExecutionLogsDownloadWithHttpInfo(analysisId); } /** - * 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> + * Download the execution logs archive. + * Streams a ZIP archive of the sandbox logs collected during execution. Requires the run to be COMPLETED. Returns 404 if no logs were captured. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `409` [`DYNAMIC_EXECUTION_INCOMPLETE`](/errors/DYNAMIC_EXECUTION_INCOMPLETE) — Dynamic Execution Incomplete + * @param analysisId Analysis ID (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
200 OK -
400 Bad Request -
403 Forbidden -
404 Not Found -
409 Conflict -
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); + public ApiResponse v3GetDynamicExecutionLogsDownloadWithHttpInfo(@javax.annotation.Nonnull Long analysisId) throws ApiException { + okhttp3.Call localVarCall = v3GetDynamicExecutionLogsDownloadValidateBeforeCall(analysisId, null); + return localVarApiClient.execute(localVarCall); } /** - * 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) + * Download the execution logs archive. (asynchronously) + * Streams a ZIP archive of the sandbox logs collected during execution. Requires the run to be COMPLETED. Returns 404 if no logs were captured. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `409` [`DYNAMIC_EXECUTION_INCOMPLETE`](/errors/DYNAMIC_EXECUTION_INCOMPLETE) — Dynamic Execution Incomplete + * @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 @@ -5337,20 +5730,24 @@ public ApiResponse v3ListAnalysesWithHttpInfo(@javax.ann Response Details Status Code Description Response Headers 200 OK - - 400 Bad Request - + 403 Forbidden - + 404 Not Found - + 409 Conflict - 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 { + public okhttp3.Call v3GetDynamicExecutionLogsDownloadAsync(@javax.annotation.Nonnull Long analysisId, 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); + okhttp3.Call localVarCall = v3GetDynamicExecutionLogsDownloadValidateBeforeCall(analysisId, _callback); + localVarApiClient.executeAsync(localVarCall, _callback); return localVarCall; } /** - * Build call for v3ListExampleAnalyses + * Build call for v3GetDynamicExecutionMemdump + * @param analysisId Analysis ID (required) + * @param sha256 SHA-256 hex digest of the artifact (required) + * @param filename Optional name for the downloaded file (inside the zip and as the download filename). Defaults to the SHA-256 when omitted. (optional) * @param _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object @@ -5359,10 +5756,14 @@ public okhttp3.Call v3ListAnalysesAsync(@javax.annotation.Nullable String search Response Details Status Code Description Response Headers 200 OK - - 0 Error - + 403 Forbidden - + 404 Not Found - + 409 Conflict - + 422 Unprocessable Entity - + 500 Internal Server Error - */ - public okhttp3.Call v3ListExampleAnalysesCall(final ApiCallback _callback) throws ApiException { + public okhttp3.Call v3GetDynamicExecutionMemdumpCall(@javax.annotation.Nonnull Long analysisId, @javax.annotation.Nonnull String sha256, @javax.annotation.Nullable String filename, final ApiCallback _callback) throws ApiException { String basePath = null; // Operation Servers String[] localBasePaths = new String[] { }; @@ -5379,7 +5780,9 @@ public okhttp3.Call v3ListExampleAnalysesCall(final ApiCallback _callback) throw Object localVarPostBody = null; // create path and map variables - String localVarPath = "/v3/analyses/examples"; + String localVarPath = "/v3/analyses/{analysis_id}/dynamic-execution/memdumps/{sha256}" + .replace("{" + "analysis_id" + "}", localVarApiClient.escapeString(analysisId.toString())) + .replace("{" + "sha256" + "}", localVarApiClient.escapeString(sha256.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -5387,6 +5790,10 @@ public okhttp3.Call v3ListExampleAnalysesCall(final ApiCallback _callback) throw Map localVarCookieParams = new HashMap(); Map localVarFormParams = new HashMap(); + if (filename != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("filename", filename)); + } + final String[] localVarAccepts = { "application/json" }; @@ -5407,51 +5814,2561 @@ public okhttp3.Call v3ListExampleAnalysesCall(final ApiCallback _callback) throw } @SuppressWarnings("rawtypes") - private okhttp3.Call v3ListExampleAnalysesValidateBeforeCall(final ApiCallback _callback) throws ApiException { - return v3ListExampleAnalysesCall(_callback); + private okhttp3.Call v3GetDynamicExecutionMemdumpValidateBeforeCall(@javax.annotation.Nonnull Long analysisId, @javax.annotation.Nonnull String sha256, @javax.annotation.Nullable String filename, 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 v3GetDynamicExecutionMemdump(Async)"); + } + + // verify the required parameter 'sha256' is set + if (sha256 == null) { + throw new ApiException("Missing the required parameter 'sha256' when calling v3GetDynamicExecutionMemdump(Async)"); + } + + return v3GetDynamicExecutionMemdumpCall(analysisId, sha256, filename, _callback); } /** - * List example analyses - * Returns the curated example Analyses. - * @return ListExampleAnalysesOutputBody + * Download a memory dump. + * Streams the memory dump for a SHA-256 referenced by `memdumps[].dumps[].sha256` in the dynamic execution report. The response is a password-protected zip (password: `infected`). **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `409` [`DYNAMIC_EXECUTION_INCOMPLETE`](/errors/DYNAMIC_EXECUTION_INCOMPLETE) — Dynamic Execution Incomplete + * @param analysisId Analysis ID (required) + * @param sha256 SHA-256 hex digest of the artifact (required) + * @param filename Optional name for the downloaded file (inside the zip and as the download filename). Defaults to the SHA-256 when omitted. (optional) * @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 -
403 Forbidden -
404 Not Found -
409 Conflict -
422 Unprocessable Entity -
500 Internal Server Error -
+ */ + public void v3GetDynamicExecutionMemdump(@javax.annotation.Nonnull Long analysisId, @javax.annotation.Nonnull String sha256, @javax.annotation.Nullable String filename) throws ApiException { + v3GetDynamicExecutionMemdumpWithHttpInfo(analysisId, sha256, filename); + } + + /** + * Download a memory dump. + * Streams the memory dump for a SHA-256 referenced by `memdumps[].dumps[].sha256` in the dynamic execution report. The response is a password-protected zip (password: `infected`). **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `409` [`DYNAMIC_EXECUTION_INCOMPLETE`](/errors/DYNAMIC_EXECUTION_INCOMPLETE) — Dynamic Execution Incomplete + * @param analysisId Analysis ID (required) + * @param sha256 SHA-256 hex digest of the artifact (required) + * @param filename Optional name for the downloaded file (inside the zip and as the download filename). Defaults to the SHA-256 when omitted. (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 + + + + + + + + + +
Response Details
Status Code Description Response Headers
200 OK -
403 Forbidden -
404 Not Found -
409 Conflict -
422 Unprocessable Entity -
500 Internal Server Error -
+ */ + public ApiResponse v3GetDynamicExecutionMemdumpWithHttpInfo(@javax.annotation.Nonnull Long analysisId, @javax.annotation.Nonnull String sha256, @javax.annotation.Nullable String filename) throws ApiException { + okhttp3.Call localVarCall = v3GetDynamicExecutionMemdumpValidateBeforeCall(analysisId, sha256, filename, null); + return localVarApiClient.execute(localVarCall); + } + + /** + * Download a memory dump. (asynchronously) + * Streams the memory dump for a SHA-256 referenced by `memdumps[].dumps[].sha256` in the dynamic execution report. The response is a password-protected zip (password: `infected`). **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `409` [`DYNAMIC_EXECUTION_INCOMPLETE`](/errors/DYNAMIC_EXECUTION_INCOMPLETE) — Dynamic Execution Incomplete + * @param analysisId Analysis ID (required) + * @param sha256 SHA-256 hex digest of the artifact (required) + * @param filename Optional name for the downloaded file (inside the zip and as the download filename). Defaults to the SHA-256 when omitted. (optional) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + + + + + + +
Response Details
Status Code Description Response Headers
200 OK -
403 Forbidden -
404 Not Found -
409 Conflict -
422 Unprocessable Entity -
500 Internal Server Error -
+ */ + public okhttp3.Call v3GetDynamicExecutionMemdumpAsync(@javax.annotation.Nonnull Long analysisId, @javax.annotation.Nonnull String sha256, @javax.annotation.Nullable String filename, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = v3GetDynamicExecutionMemdumpValidateBeforeCall(analysisId, sha256, filename, _callback); + localVarApiClient.executeAsync(localVarCall, _callback); + return localVarCall; + } + /** + * Build call for v3GetDynamicExecutionOperation + * @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 v3GetDynamicExecutionOperationCall(@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/dynamic-execution/{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 v3GetDynamicExecutionOperationValidateBeforeCall(@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 v3GetDynamicExecutionOperation(Async)"); + } + + return v3GetDynamicExecutionOperationCall(analysisId, _callback); + + } + + /** + * Get a dynamic execution operation. + * Returns the current state of the most recently triggered dynamic execution run for this analysis. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied + * @param analysisId Analysis ID (required) + * @return OperationDynamicExecutionMetadataDynamicExecutionResult + * @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 OperationDynamicExecutionMetadataDynamicExecutionResult v3GetDynamicExecutionOperation(@javax.annotation.Nonnull Long analysisId) throws ApiException { + ApiResponse localVarResp = v3GetDynamicExecutionOperationWithHttpInfo(analysisId); + return localVarResp.getData(); + } + + /** + * Get a dynamic execution operation. + * Returns the current state of the most recently triggered dynamic execution run for this analysis. **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<OperationDynamicExecutionMetadataDynamicExecutionResult> + * @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 v3GetDynamicExecutionOperationWithHttpInfo(@javax.annotation.Nonnull Long analysisId) throws ApiException { + okhttp3.Call localVarCall = v3GetDynamicExecutionOperationValidateBeforeCall(analysisId, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Get a dynamic execution operation. (asynchronously) + * Returns the current state of the most recently triggered dynamic execution run for this analysis. **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 v3GetDynamicExecutionOperationAsync(@javax.annotation.Nonnull Long analysisId, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = v3GetDynamicExecutionOperationValidateBeforeCall(analysisId, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for v3GetDynamicExecutionPcap + * @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 -
409 Conflict -
422 Unprocessable Entity -
500 Internal Server Error -
+ */ + public okhttp3.Call v3GetDynamicExecutionPcapCall(@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}/dynamic-execution/pcap" + .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 v3GetDynamicExecutionPcapValidateBeforeCall(@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 v3GetDynamicExecutionPcap(Async)"); + } + + return v3GetDynamicExecutionPcapCall(analysisId, _callback); + + } + + /** + * Download the network capture. + * Streams the pcap of the analysis VM's traffic. Returns 404 if no pcap was captured. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `409` [`DYNAMIC_EXECUTION_INCOMPLETE`](/errors/DYNAMIC_EXECUTION_INCOMPLETE) — Dynamic Execution Incomplete + * @param analysisId Analysis ID (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
200 OK -
403 Forbidden -
404 Not Found -
409 Conflict -
422 Unprocessable Entity -
500 Internal Server Error -
+ */ + public void v3GetDynamicExecutionPcap(@javax.annotation.Nonnull Long analysisId) throws ApiException { + v3GetDynamicExecutionPcapWithHttpInfo(analysisId); + } + + /** + * Download the network capture. + * Streams the pcap of the analysis VM's traffic. Returns 404 if no pcap was captured. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `409` [`DYNAMIC_EXECUTION_INCOMPLETE`](/errors/DYNAMIC_EXECUTION_INCOMPLETE) — Dynamic Execution Incomplete + * @param analysisId Analysis ID (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
200 OK -
403 Forbidden -
404 Not Found -
409 Conflict -
422 Unprocessable Entity -
500 Internal Server Error -
+ */ + public ApiResponse v3GetDynamicExecutionPcapWithHttpInfo(@javax.annotation.Nonnull Long analysisId) throws ApiException { + okhttp3.Call localVarCall = v3GetDynamicExecutionPcapValidateBeforeCall(analysisId, null); + return localVarApiClient.execute(localVarCall); + } + + /** + * Download the network capture. (asynchronously) + * Streams the pcap of the analysis VM's traffic. Returns 404 if no pcap was captured. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `409` [`DYNAMIC_EXECUTION_INCOMPLETE`](/errors/DYNAMIC_EXECUTION_INCOMPLETE) — Dynamic Execution Incomplete + * @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 -
409 Conflict -
422 Unprocessable Entity -
500 Internal Server Error -
+ */ + public okhttp3.Call v3GetDynamicExecutionPcapAsync(@javax.annotation.Nonnull Long analysisId, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = v3GetDynamicExecutionPcapValidateBeforeCall(analysisId, _callback); + localVarApiClient.executeAsync(localVarCall, _callback); + return localVarCall; + } + /** + * Build call for v3GetDynamicExecutionReport + * @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 -
409 Conflict -
422 Unprocessable Entity -
500 Internal Server Error -
+ */ + public okhttp3.Call v3GetDynamicExecutionReportCall(@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}/dynamic-execution/report" + .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 v3GetDynamicExecutionReportValidateBeforeCall(@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 v3GetDynamicExecutionReport(Async)"); + } + + return v3GetDynamicExecutionReportCall(analysisId, _callback); + + } + + /** + * Get the dynamic execution report. + * Returns the dynamic execution report JSON for the analysis. Requires the run to be COMPLETED. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `409` [`DYNAMIC_EXECUTION_INCOMPLETE`](/errors/DYNAMIC_EXECUTION_INCOMPLETE) — Dynamic Execution Incomplete + * @param analysisId Analysis ID (required) + * @return AnalysisReport + * @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 -
409 Conflict -
422 Unprocessable Entity -
500 Internal Server Error -
+ */ + public AnalysisReport v3GetDynamicExecutionReport(@javax.annotation.Nonnull Long analysisId) throws ApiException { + ApiResponse localVarResp = v3GetDynamicExecutionReportWithHttpInfo(analysisId); + return localVarResp.getData(); + } + + /** + * Get the dynamic execution report. + * Returns the dynamic execution report JSON for the analysis. Requires the run to be COMPLETED. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `409` [`DYNAMIC_EXECUTION_INCOMPLETE`](/errors/DYNAMIC_EXECUTION_INCOMPLETE) — Dynamic Execution Incomplete + * @param analysisId Analysis ID (required) + * @return ApiResponse<AnalysisReport> + * @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 -
409 Conflict -
422 Unprocessable Entity -
500 Internal Server Error -
+ */ + public ApiResponse v3GetDynamicExecutionReportWithHttpInfo(@javax.annotation.Nonnull Long analysisId) throws ApiException { + okhttp3.Call localVarCall = v3GetDynamicExecutionReportValidateBeforeCall(analysisId, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Get the dynamic execution report. (asynchronously) + * Returns the dynamic execution report JSON for the analysis. Requires the run to be COMPLETED. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `409` [`DYNAMIC_EXECUTION_INCOMPLETE`](/errors/DYNAMIC_EXECUTION_INCOMPLETE) — Dynamic Execution Incomplete + * @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 -
409 Conflict -
422 Unprocessable Entity -
500 Internal Server Error -
+ */ + public okhttp3.Call v3GetDynamicExecutionReportAsync(@javax.annotation.Nonnull Long analysisId, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = v3GetDynamicExecutionReportValidateBeforeCall(analysisId, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for v3GetDynamicExecutionScreenshot + * @param analysisId Analysis ID (required) + * @param index Index of the screenshot, as listed by the screenshots endpoint (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 -
409 Conflict -
422 Unprocessable Entity -
500 Internal Server Error -
+ */ + public okhttp3.Call v3GetDynamicExecutionScreenshotCall(@javax.annotation.Nonnull Long analysisId, @javax.annotation.Nonnull Long index, 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}/dynamic-execution/screenshots/{index}" + .replace("{" + "analysis_id" + "}", localVarApiClient.escapeString(analysisId.toString())) + .replace("{" + "index" + "}", localVarApiClient.escapeString(index.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 v3GetDynamicExecutionScreenshotValidateBeforeCall(@javax.annotation.Nonnull Long analysisId, @javax.annotation.Nonnull Long index, 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 v3GetDynamicExecutionScreenshot(Async)"); + } + + // verify the required parameter 'index' is set + if (index == null) { + throw new ApiException("Missing the required parameter 'index' when calling v3GetDynamicExecutionScreenshot(Async)"); + } + + return v3GetDynamicExecutionScreenshotCall(analysisId, index, _callback); + + } + + /** + * Download a screenshot. + * Streams one screenshot, 1-indexed as listed by the screenshots endpoint. Requires the run to be COMPLETED. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `409` [`DYNAMIC_EXECUTION_INCOMPLETE`](/errors/DYNAMIC_EXECUTION_INCOMPLETE) — Dynamic Execution Incomplete + * @param analysisId Analysis ID (required) + * @param index Index of the screenshot, as listed by the screenshots endpoint (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
200 OK -
403 Forbidden -
404 Not Found -
409 Conflict -
422 Unprocessable Entity -
500 Internal Server Error -
+ */ + public void v3GetDynamicExecutionScreenshot(@javax.annotation.Nonnull Long analysisId, @javax.annotation.Nonnull Long index) throws ApiException { + v3GetDynamicExecutionScreenshotWithHttpInfo(analysisId, index); + } + + /** + * Download a screenshot. + * Streams one screenshot, 1-indexed as listed by the screenshots endpoint. Requires the run to be COMPLETED. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `409` [`DYNAMIC_EXECUTION_INCOMPLETE`](/errors/DYNAMIC_EXECUTION_INCOMPLETE) — Dynamic Execution Incomplete + * @param analysisId Analysis ID (required) + * @param index Index of the screenshot, as listed by the screenshots endpoint (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
200 OK -
403 Forbidden -
404 Not Found -
409 Conflict -
422 Unprocessable Entity -
500 Internal Server Error -
+ */ + public ApiResponse v3GetDynamicExecutionScreenshotWithHttpInfo(@javax.annotation.Nonnull Long analysisId, @javax.annotation.Nonnull Long index) throws ApiException { + okhttp3.Call localVarCall = v3GetDynamicExecutionScreenshotValidateBeforeCall(analysisId, index, null); + return localVarApiClient.execute(localVarCall); + } + + /** + * Download a screenshot. (asynchronously) + * Streams one screenshot, 1-indexed as listed by the screenshots endpoint. Requires the run to be COMPLETED. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `409` [`DYNAMIC_EXECUTION_INCOMPLETE`](/errors/DYNAMIC_EXECUTION_INCOMPLETE) — Dynamic Execution Incomplete + * @param analysisId Analysis ID (required) + * @param index Index of the screenshot, as listed by the screenshots endpoint (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 -
409 Conflict -
422 Unprocessable Entity -
500 Internal Server Error -
+ */ + public okhttp3.Call v3GetDynamicExecutionScreenshotAsync(@javax.annotation.Nonnull Long analysisId, @javax.annotation.Nonnull Long index, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = v3GetDynamicExecutionScreenshotValidateBeforeCall(analysisId, index, _callback); + localVarApiClient.executeAsync(localVarCall, _callback); + return localVarCall; + } + /** + * Build call for v3GetDynamicExecutionSummary + * @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 -
409 Conflict -
422 Unprocessable Entity -
500 Internal Server Error -
+ */ + public okhttp3.Call v3GetDynamicExecutionSummaryCall(@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}/dynamic-execution/summary" + .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 v3GetDynamicExecutionSummaryValidateBeforeCall(@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 v3GetDynamicExecutionSummary(Async)"); + } + + return v3GetDynamicExecutionSummaryCall(analysisId, _callback); + + } + + /** + * Get the dynamic execution summary. + * Returns the LLM-generated Markdown summary of the run. Requires the run to be COMPLETED. Returns 404 if no summary has been generated. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `409` [`DYNAMIC_EXECUTION_INCOMPLETE`](/errors/DYNAMIC_EXECUTION_INCOMPLETE) — Dynamic Execution Incomplete + * @param analysisId Analysis ID (required) + * @return DynamicExecutionSummary + * @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 -
409 Conflict -
422 Unprocessable Entity -
500 Internal Server Error -
+ */ + public DynamicExecutionSummary v3GetDynamicExecutionSummary(@javax.annotation.Nonnull Long analysisId) throws ApiException { + ApiResponse localVarResp = v3GetDynamicExecutionSummaryWithHttpInfo(analysisId); + return localVarResp.getData(); + } + + /** + * Get the dynamic execution summary. + * Returns the LLM-generated Markdown summary of the run. Requires the run to be COMPLETED. Returns 404 if no summary has been generated. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `409` [`DYNAMIC_EXECUTION_INCOMPLETE`](/errors/DYNAMIC_EXECUTION_INCOMPLETE) — Dynamic Execution Incomplete + * @param analysisId Analysis ID (required) + * @return ApiResponse<DynamicExecutionSummary> + * @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 -
409 Conflict -
422 Unprocessable Entity -
500 Internal Server Error -
+ */ + public ApiResponse v3GetDynamicExecutionSummaryWithHttpInfo(@javax.annotation.Nonnull Long analysisId) throws ApiException { + okhttp3.Call localVarCall = v3GetDynamicExecutionSummaryValidateBeforeCall(analysisId, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Get the dynamic execution summary. (asynchronously) + * Returns the LLM-generated Markdown summary of the run. Requires the run to be COMPLETED. Returns 404 if no summary has been generated. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `409` [`DYNAMIC_EXECUTION_INCOMPLETE`](/errors/DYNAMIC_EXECUTION_INCOMPLETE) — Dynamic Execution Incomplete + * @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 -
409 Conflict -
422 Unprocessable Entity -
500 Internal Server Error -
+ */ + public okhttp3.Call v3GetDynamicExecutionSummaryAsync(@javax.annotation.Nonnull Long analysisId, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = v3GetDynamicExecutionSummaryValidateBeforeCall(analysisId, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for v3GetDynamicExecutionSummaryOperation + * @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 v3GetDynamicExecutionSummaryOperationCall(@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/dynamic-execution-summary/{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 v3GetDynamicExecutionSummaryOperationValidateBeforeCall(@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 v3GetDynamicExecutionSummaryOperation(Async)"); + } + + return v3GetDynamicExecutionSummaryOperationCall(analysisId, _callback); + + } + + /** + * Get a dynamic execution summary operation. + * Returns the state of the most recent summary attempt for this analysis, whether made by its run or by a regenerate. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied + * @param analysisId Analysis ID (required) + * @return OperationDynamicExecutionSummaryMetadataDynamicExecutionSummaryResult + * @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 OperationDynamicExecutionSummaryMetadataDynamicExecutionSummaryResult v3GetDynamicExecutionSummaryOperation(@javax.annotation.Nonnull Long analysisId) throws ApiException { + ApiResponse localVarResp = v3GetDynamicExecutionSummaryOperationWithHttpInfo(analysisId); + return localVarResp.getData(); + } + + /** + * Get a dynamic execution summary operation. + * Returns the state of the most recent summary attempt for this analysis, whether made by its run or by a regenerate. **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<OperationDynamicExecutionSummaryMetadataDynamicExecutionSummaryResult> + * @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 v3GetDynamicExecutionSummaryOperationWithHttpInfo(@javax.annotation.Nonnull Long analysisId) throws ApiException { + okhttp3.Call localVarCall = v3GetDynamicExecutionSummaryOperationValidateBeforeCall(analysisId, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Get a dynamic execution summary operation. (asynchronously) + * Returns the state of the most recent summary attempt for this analysis, whether made by its run or by a regenerate. **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 v3GetDynamicExecutionSummaryOperationAsync(@javax.annotation.Nonnull Long analysisId, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = v3GetDynamicExecutionSummaryOperationValidateBeforeCall(analysisId, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for v3GetDynamicExecutionWiresharkKeys + * @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 -
409 Conflict -
422 Unprocessable Entity -
500 Internal Server Error -
+ */ + public okhttp3.Call v3GetDynamicExecutionWiresharkKeysCall(@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}/dynamic-execution/wireshark-keys" + .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 v3GetDynamicExecutionWiresharkKeysValidateBeforeCall(@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 v3GetDynamicExecutionWiresharkKeys(Async)"); + } + + return v3GetDynamicExecutionWiresharkKeysCall(analysisId, _callback); + + } + + /** + * Download Wireshark TLS session keys. + * Returns the Wireshark-format TLS session key log for decrypting HTTPS traffic in the pcap. Returns 404 if no keys were captured. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `409` [`DYNAMIC_EXECUTION_INCOMPLETE`](/errors/DYNAMIC_EXECUTION_INCOMPLETE) — Dynamic Execution Incomplete + * @param analysisId Analysis ID (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
200 OK -
403 Forbidden -
404 Not Found -
409 Conflict -
422 Unprocessable Entity -
500 Internal Server Error -
+ */ + public void v3GetDynamicExecutionWiresharkKeys(@javax.annotation.Nonnull Long analysisId) throws ApiException { + v3GetDynamicExecutionWiresharkKeysWithHttpInfo(analysisId); + } + + /** + * Download Wireshark TLS session keys. + * Returns the Wireshark-format TLS session key log for decrypting HTTPS traffic in the pcap. Returns 404 if no keys were captured. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `409` [`DYNAMIC_EXECUTION_INCOMPLETE`](/errors/DYNAMIC_EXECUTION_INCOMPLETE) — Dynamic Execution Incomplete + * @param analysisId Analysis ID (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
200 OK -
403 Forbidden -
404 Not Found -
409 Conflict -
422 Unprocessable Entity -
500 Internal Server Error -
+ */ + public ApiResponse v3GetDynamicExecutionWiresharkKeysWithHttpInfo(@javax.annotation.Nonnull Long analysisId) throws ApiException { + okhttp3.Call localVarCall = v3GetDynamicExecutionWiresharkKeysValidateBeforeCall(analysisId, null); + return localVarApiClient.execute(localVarCall); + } + + /** + * Download Wireshark TLS session keys. (asynchronously) + * Returns the Wireshark-format TLS session key log for decrypting HTTPS traffic in the pcap. Returns 404 if no keys were captured. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `409` [`DYNAMIC_EXECUTION_INCOMPLETE`](/errors/DYNAMIC_EXECUTION_INCOMPLETE) — Dynamic Execution Incomplete + * @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 -
409 Conflict -
422 Unprocessable Entity -
500 Internal Server Error -
+ */ + public okhttp3.Call v3GetDynamicExecutionWiresharkKeysAsync(@javax.annotation.Nonnull Long analysisId, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = v3GetDynamicExecutionWiresharkKeysValidateBeforeCall(analysisId, _callback); + localVarApiClient.executeAsync(localVarCall, _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 = "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/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 v3ListAnalysisGlobals + * @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 name (case-insensitive substring match). (optional) + * @param named Keep only globals that have a name (true) or only those that don't (false). Omit for both. (optional) + * @param dataTypeId Keep only globals carrying this analysis data type. (optional) + * @param valueKind Keep only globals whose decoded value is of these kinds. (optional) + * @param referenced Keep only globals referenced by at least one function (true) or only unreferenced ones (false). Omit for both. (optional) + * @param orderBy Field to order results by. (optional, default to vaddr) + * @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 -
400 Bad Request -
403 Forbidden -
404 Not Found -
422 Unprocessable Entity -
500 Internal Server Error -
+ */ + public okhttp3.Call v3ListAnalysisGlobalsCall(@javax.annotation.Nonnull Long analysisId, @javax.annotation.Nullable Long page, @javax.annotation.Nullable Long pageSize, @javax.annotation.Nullable String search, @javax.annotation.Nullable String named, @javax.annotation.Nullable Long dataTypeId, @javax.annotation.Nullable List valueKind, @javax.annotation.Nullable String referenced, @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}/globals" + .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 (named != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("named", named)); + } + + if (dataTypeId != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("data_type_id", dataTypeId)); + } + + if (valueKind != null) { + localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("csv", "value_kind", valueKind)); + } + + if (referenced != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("referenced", referenced)); + } + + 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 v3ListAnalysisGlobalsValidateBeforeCall(@javax.annotation.Nonnull Long analysisId, @javax.annotation.Nullable Long page, @javax.annotation.Nullable Long pageSize, @javax.annotation.Nullable String search, @javax.annotation.Nullable String named, @javax.annotation.Nullable Long dataTypeId, @javax.annotation.Nullable List valueKind, @javax.annotation.Nullable String referenced, @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 v3ListAnalysisGlobals(Async)"); + } + + return v3ListAnalysisGlobalsCall(analysisId, page, pageSize, search, named, dataTypeId, valueKind, referenced, orderBy, sortOrder, _callback); + + } + + /** + * List the global variables in an analysis. + * Returns the analysis's global variables as first-class rows, with the recovered name, data type, decoded initial value and the provenance of each. Supports name search, filtering by data type, value kind, named-ness and whether any function references the global, plus sorting and pagination. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `400` [`BAD_REQUEST`](/errors/BAD_REQUEST) — Bad Request + * @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 name (case-insensitive substring match). (optional) + * @param named Keep only globals that have a name (true) or only those that don't (false). Omit for both. (optional) + * @param dataTypeId Keep only globals carrying this analysis data type. (optional) + * @param valueKind Keep only globals whose decoded value is of these kinds. (optional) + * @param referenced Keep only globals referenced by at least one function (true) or only unreferenced ones (false). Omit for both. (optional) + * @param orderBy Field to order results by. (optional, default to vaddr) + * @param sortOrder Sort direction. (optional, default to ASC) + * @return ListAnalysisGlobalsOutputBody + * @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 -
403 Forbidden -
404 Not Found -
422 Unprocessable Entity -
500 Internal Server Error -
+ */ + public ListAnalysisGlobalsOutputBody v3ListAnalysisGlobals(@javax.annotation.Nonnull Long analysisId, @javax.annotation.Nullable Long page, @javax.annotation.Nullable Long pageSize, @javax.annotation.Nullable String search, @javax.annotation.Nullable String named, @javax.annotation.Nullable Long dataTypeId, @javax.annotation.Nullable List valueKind, @javax.annotation.Nullable String referenced, @javax.annotation.Nullable String orderBy, @javax.annotation.Nullable String sortOrder) throws ApiException { + ApiResponse localVarResp = v3ListAnalysisGlobalsWithHttpInfo(analysisId, page, pageSize, search, named, dataTypeId, valueKind, referenced, orderBy, sortOrder); + return localVarResp.getData(); + } + + /** + * List the global variables in an analysis. + * Returns the analysis's global variables as first-class rows, with the recovered name, data type, decoded initial value and the provenance of each. Supports name search, filtering by data type, value kind, named-ness and whether any function references the global, plus sorting and pagination. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `400` [`BAD_REQUEST`](/errors/BAD_REQUEST) — Bad Request + * @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 name (case-insensitive substring match). (optional) + * @param named Keep only globals that have a name (true) or only those that don't (false). Omit for both. (optional) + * @param dataTypeId Keep only globals carrying this analysis data type. (optional) + * @param valueKind Keep only globals whose decoded value is of these kinds. (optional) + * @param referenced Keep only globals referenced by at least one function (true) or only unreferenced ones (false). Omit for both. (optional) + * @param orderBy Field to order results by. (optional, default to vaddr) + * @param sortOrder Sort direction. (optional, default to ASC) + * @return ApiResponse<ListAnalysisGlobalsOutputBody> + * @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 -
403 Forbidden -
404 Not Found -
422 Unprocessable Entity -
500 Internal Server Error -
+ */ + public ApiResponse v3ListAnalysisGlobalsWithHttpInfo(@javax.annotation.Nonnull Long analysisId, @javax.annotation.Nullable Long page, @javax.annotation.Nullable Long pageSize, @javax.annotation.Nullable String search, @javax.annotation.Nullable String named, @javax.annotation.Nullable Long dataTypeId, @javax.annotation.Nullable List valueKind, @javax.annotation.Nullable String referenced, @javax.annotation.Nullable String orderBy, @javax.annotation.Nullable String sortOrder) throws ApiException { + okhttp3.Call localVarCall = v3ListAnalysisGlobalsValidateBeforeCall(analysisId, page, pageSize, search, named, dataTypeId, valueKind, referenced, orderBy, sortOrder, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * List the global variables in an analysis. (asynchronously) + * Returns the analysis's global variables as first-class rows, with the recovered name, data type, decoded initial value and the provenance of each. Supports name search, filtering by data type, value kind, named-ness and whether any function references the global, plus sorting and pagination. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `400` [`BAD_REQUEST`](/errors/BAD_REQUEST) — Bad Request + * @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 name (case-insensitive substring match). (optional) + * @param named Keep only globals that have a name (true) or only those that don't (false). Omit for both. (optional) + * @param dataTypeId Keep only globals carrying this analysis data type. (optional) + * @param valueKind Keep only globals whose decoded value is of these kinds. (optional) + * @param referenced Keep only globals referenced by at least one function (true) or only unreferenced ones (false). Omit for both. (optional) + * @param orderBy Field to order results by. (optional, default to vaddr) + * @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 -
400 Bad Request -
403 Forbidden -
404 Not Found -
422 Unprocessable Entity -
500 Internal Server Error -
+ */ + public okhttp3.Call v3ListAnalysisGlobalsAsync(@javax.annotation.Nonnull Long analysisId, @javax.annotation.Nullable Long page, @javax.annotation.Nullable Long pageSize, @javax.annotation.Nullable String search, @javax.annotation.Nullable String named, @javax.annotation.Nullable Long dataTypeId, @javax.annotation.Nullable List valueKind, @javax.annotation.Nullable String referenced, @javax.annotation.Nullable String orderBy, @javax.annotation.Nullable String sortOrder, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = v3ListAnalysisGlobalsValidateBeforeCall(analysisId, page, pageSize, search, named, dataTypeId, valueKind, referenced, orderBy, sortOrder, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for v3ListAnalysisOperations + * @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 v3ListAnalysisOperationsCall(@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}/operations" + .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 v3ListAnalysisOperationsValidateBeforeCall(@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 v3ListAnalysisOperations(Async)"); + } + + return v3ListAnalysisOperationsCall(analysisId, _callback); + + } + + /** + * List the operations run on an analysis. + * Returns the analysis' `static-analysis` operation, followed by the latest run of each other operation started on its binary: the binary agents, the script-agent scans and dynamic execution. The `static-analysis` operation is always included, even when no other operations have run. Each entry's `name` is the operation's resource name, polled at `/v3/{name}`. Other operations that have never run are omitted. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied + * @param analysisId Analysis ID (required) + * @return AnalysisOperationsOutputBody + * @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 AnalysisOperationsOutputBody v3ListAnalysisOperations(@javax.annotation.Nonnull Long analysisId) throws ApiException { + ApiResponse localVarResp = v3ListAnalysisOperationsWithHttpInfo(analysisId); + return localVarResp.getData(); + } + + /** + * List the operations run on an analysis. + * Returns the analysis' `static-analysis` operation, followed by the latest run of each other operation started on its binary: the binary agents, the script-agent scans and dynamic execution. The `static-analysis` operation is always included, even when no other operations have run. Each entry's `name` is the operation's resource name, polled at `/v3/{name}`. Other operations that have never run are omitted. **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<AnalysisOperationsOutputBody> + * @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 v3ListAnalysisOperationsWithHttpInfo(@javax.annotation.Nonnull Long analysisId) throws ApiException { + okhttp3.Call localVarCall = v3ListAnalysisOperationsValidateBeforeCall(analysisId, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * List the operations run on an analysis. (asynchronously) + * Returns the analysis' `static-analysis` operation, followed by the latest run of each other operation started on its binary: the binary agents, the script-agent scans and dynamic execution. The `static-analysis` operation is always included, even when no other operations have run. Each entry's `name` is the operation's resource name, polled at `/v3/{name}`. Other operations that have never run are omitted. **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 v3ListAnalysisOperationsAsync(@javax.annotation.Nonnull Long analysisId, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = v3ListAnalysisOperationsValidateBeforeCall(analysisId, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for v3ListDynamicExecutionScreenshots + * @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 -
409 Conflict -
422 Unprocessable Entity -
500 Internal Server Error -
+ */ + public okhttp3.Call v3ListDynamicExecutionScreenshotsCall(@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}/dynamic-execution/screenshots" + .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 v3ListDynamicExecutionScreenshotsValidateBeforeCall(@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 v3ListDynamicExecutionScreenshots(Async)"); + } + + return v3ListDynamicExecutionScreenshotsCall(analysisId, _callback); + + } + + /** + * List the screenshots captured during execution. + * Returns the screenshots captured from the analysis VM, in capture order. Requires the run to be COMPLETED. Returns an empty list when the run captured none. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `409` [`DYNAMIC_EXECUTION_INCOMPLETE`](/errors/DYNAMIC_EXECUTION_INCOMPLETE) — Dynamic Execution Incomplete + * @param analysisId Analysis ID (required) + * @return ScreenshotsIndex + * @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 -
409 Conflict -
422 Unprocessable Entity -
500 Internal Server Error -
+ */ + public ScreenshotsIndex v3ListDynamicExecutionScreenshots(@javax.annotation.Nonnull Long analysisId) throws ApiException { + ApiResponse localVarResp = v3ListDynamicExecutionScreenshotsWithHttpInfo(analysisId); + return localVarResp.getData(); + } + + /** + * List the screenshots captured during execution. + * Returns the screenshots captured from the analysis VM, in capture order. Requires the run to be COMPLETED. Returns an empty list when the run captured none. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `409` [`DYNAMIC_EXECUTION_INCOMPLETE`](/errors/DYNAMIC_EXECUTION_INCOMPLETE) — Dynamic Execution Incomplete + * @param analysisId Analysis ID (required) + * @return ApiResponse<ScreenshotsIndex> + * @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 -
409 Conflict -
422 Unprocessable Entity -
500 Internal Server Error -
+ */ + public ApiResponse v3ListDynamicExecutionScreenshotsWithHttpInfo(@javax.annotation.Nonnull Long analysisId) throws ApiException { + okhttp3.Call localVarCall = v3ListDynamicExecutionScreenshotsValidateBeforeCall(analysisId, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * List the screenshots captured during execution. (asynchronously) + * Returns the screenshots captured from the analysis VM, in capture order. Requires the run to be COMPLETED. Returns an empty list when the run captured none. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `409` [`DYNAMIC_EXECUTION_INCOMPLETE`](/errors/DYNAMIC_EXECUTION_INCOMPLETE) — Dynamic Execution Incomplete + * @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 -
409 Conflict -
422 Unprocessable Entity -
500 Internal Server Error -
+ */ + public okhttp3.Call v3ListDynamicExecutionScreenshotsAsync(@javax.annotation.Nonnull Long analysisId, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = v3ListDynamicExecutionScreenshotsValidateBeforeCall(analysisId, _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 v3ListGlobalFunctions + * @param analysisId Analysis ID (required) + * @param vaddr Virtual address of the global variable. (required) + * @param page Page number (1-indexed). (optional, default to 1) + * @param pageSize Number of results per page. (optional, default to 100) + * @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 v3ListGlobalFunctionsCall(@javax.annotation.Nonnull Long analysisId, @javax.annotation.Nonnull Long vaddr, @javax.annotation.Nullable Long page, @javax.annotation.Nullable Long pageSize, 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}/globals/{vaddr}/functions" + .replace("{" + "analysis_id" + "}", localVarApiClient.escapeString(analysisId.toString())) + .replace("{" + "vaddr" + "}", localVarApiClient.escapeString(vaddr.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)); + } + + 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 v3ListGlobalFunctionsValidateBeforeCall(@javax.annotation.Nonnull Long analysisId, @javax.annotation.Nonnull Long vaddr, @javax.annotation.Nullable Long page, @javax.annotation.Nullable Long pageSize, 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 v3ListGlobalFunctions(Async)"); + } + + // verify the required parameter 'vaddr' is set + if (vaddr == null) { + throw new ApiException("Missing the required parameter 'vaddr' when calling v3ListGlobalFunctions(Async)"); + } + + return v3ListGlobalFunctionsCall(analysisId, vaddr, page, pageSize, _callback); + + } + + /** + * List the functions referencing a global variable. + * Returns the functions that reference the global at the given virtual address, each with the number of times it is referenced. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied + * @param analysisId Analysis ID (required) + * @param vaddr Virtual address of the global variable. (required) + * @param page Page number (1-indexed). (optional, default to 1) + * @param pageSize Number of results per page. (optional, default to 100) + * @return ListGlobalFunctionsOutputBody + * @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 ListGlobalFunctionsOutputBody v3ListGlobalFunctions(@javax.annotation.Nonnull Long analysisId, @javax.annotation.Nonnull Long vaddr, @javax.annotation.Nullable Long page, @javax.annotation.Nullable Long pageSize) throws ApiException { + ApiResponse localVarResp = v3ListGlobalFunctionsWithHttpInfo(analysisId, vaddr, page, pageSize); + return localVarResp.getData(); + } + + /** + * List the functions referencing a global variable. + * Returns the functions that reference the global at the given virtual address, each with the number of times it is referenced. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied + * @param analysisId Analysis ID (required) + * @param vaddr Virtual address of the global variable. (required) + * @param page Page number (1-indexed). (optional, default to 1) + * @param pageSize Number of results per page. (optional, default to 100) + * @return ApiResponse<ListGlobalFunctionsOutputBody> + * @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 v3ListGlobalFunctionsWithHttpInfo(@javax.annotation.Nonnull Long analysisId, @javax.annotation.Nonnull Long vaddr, @javax.annotation.Nullable Long page, @javax.annotation.Nullable Long pageSize) throws ApiException { + okhttp3.Call localVarCall = v3ListGlobalFunctionsValidateBeforeCall(analysisId, vaddr, page, pageSize, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * List the functions referencing a global variable. (asynchronously) + * Returns the functions that reference the global at the given virtual address, each with the number of times it is referenced. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied + * @param analysisId Analysis ID (required) + * @param vaddr Virtual address of the global variable. (required) + * @param page Page number (1-indexed). (optional, default to 1) + * @param pageSize Number of results per page. (optional, default to 100) + * @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 v3ListGlobalFunctionsAsync(@javax.annotation.Nonnull Long analysisId, @javax.annotation.Nonnull Long vaddr, @javax.annotation.Nullable Long page, @javax.annotation.Nullable Long pageSize, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = v3ListGlobalFunctionsValidateBeforeCall(analysisId, vaddr, page, pageSize, _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 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); + } + + /** + * 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 + * @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 v3LookupAnalysisByBinaryIdAsync(@javax.annotation.Nonnull Long binaryId, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = v3LookupAnalysisByBinaryIdValidateBeforeCall(binaryId, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * 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 + * @http.response.details + + + + + + + + +
Response Details
Status Code Description Response Headers
202 Accepted -
403 Forbidden -
404 Not Found -
422 Unprocessable Entity -
500 Internal Server Error -
+ */ + public okhttp3.Call v3QueueBinaryExportCall(@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}/binary-export" + .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, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + 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); + + } + + /** + * 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
202 Accepted -
403 Forbidden -
404 Not Found -
422 Unprocessable Entity -
500 Internal Server Error -
+ */ + public OperationBinaryExportMetadataBinaryExportResult v3QueueBinaryExport(@javax.annotation.Nonnull Long analysisId) throws ApiException { + ApiResponse localVarResp = v3QueueBinaryExportWithHttpInfo(analysisId); + return localVarResp.getData(); + } + + /** + * 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
202 Accepted -
403 Forbidden -
404 Not Found -
422 Unprocessable Entity -
500 Internal Server Error -
+ */ + 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); + } + + /** + * 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 + * @http.response.details + + + + + + + + +
Response Details
Status Code Description Response Headers
202 Accepted -
403 Forbidden -
404 Not Found -
422 Unprocessable Entity -
500 Internal Server Error -
+ */ + public okhttp3.Call v3QueueBinaryExportAsync(@javax.annotation.Nonnull Long analysisId, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = v3QueueBinaryExportValidateBeforeCall(analysisId, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for v3RequeueAnalysis + * @param analysisId Analysis ID (required) + * @param requeueAnalysisRequest (required) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + + + + +
Response Details
Status Code Description Response Headers
201 Created -
403 Forbidden -
404 Not Found -
422 Unprocessable Entity -
500 Internal Server Error -
+ */ + public okhttp3.Call v3RequeueAnalysisCall(@javax.annotation.Nonnull Long analysisId, @javax.annotation.Nonnull RequeueAnalysisRequest requeueAnalysisRequest, 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 = requeueAnalysisRequest; + + // create path and map variables + String localVarPath = "/v3/analyses/{analysis_id}/requeue" + .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 = { + "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 v3RequeueAnalysisValidateBeforeCall(@javax.annotation.Nonnull Long analysisId, @javax.annotation.Nonnull RequeueAnalysisRequest requeueAnalysisRequest, 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 v3RequeueAnalysis(Async)"); + } + + // verify the required parameter 'requeueAnalysisRequest' is set + if (requeueAnalysisRequest == null) { + throw new ApiException("Missing the required parameter 'requeueAnalysisRequest' when calling v3RequeueAnalysis(Async)"); + } + + return v3RequeueAnalysisCall(analysisId, requeueAnalysisRequest, _callback); + + } + + /** + * Requeue an analysis + * Creates a new Analysis and a new Binary sharing this Analysis's SHA-256, and runs the pipeline against them, leaving this Analysis and its Binary unchanged. Only the owner may call it. Poll the returned Operation for status, same as a normal create. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied + * @param analysisId Analysis ID (required) + * @param requeueAnalysisRequest (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
201 Created -
403 Forbidden -
404 Not Found -
422 Unprocessable Entity -
500 Internal Server Error -
*/ - public ListExampleAnalysesOutputBody v3ListExampleAnalyses() throws ApiException { - ApiResponse localVarResp = v3ListExampleAnalysesWithHttpInfo(); + public OperationCreateMetadataCreateResult v3RequeueAnalysis(@javax.annotation.Nonnull Long analysisId, @javax.annotation.Nonnull RequeueAnalysisRequest requeueAnalysisRequest) throws ApiException { + ApiResponse localVarResp = v3RequeueAnalysisWithHttpInfo(analysisId, requeueAnalysisRequest); return localVarResp.getData(); } /** - * List example analyses - * Returns the curated example Analyses. - * @return ApiResponse<ListExampleAnalysesOutputBody> + * Requeue an analysis + * Creates a new Analysis and a new Binary sharing this Analysis's SHA-256, and runs the pipeline against them, leaving this Analysis and its Binary unchanged. Only the owner may call it. Poll the returned Operation for status, same as a normal create. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied + * @param analysisId Analysis ID (required) + * @param requeueAnalysisRequest (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 -
0 Error -
201 Created -
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 v3RequeueAnalysisWithHttpInfo(@javax.annotation.Nonnull Long analysisId, @javax.annotation.Nonnull RequeueAnalysisRequest requeueAnalysisRequest) throws ApiException { + okhttp3.Call localVarCall = v3RequeueAnalysisValidateBeforeCall(analysisId, requeueAnalysisRequest, null); + Type localVarReturnType = new TypeToken(){}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } /** - * List example analyses (asynchronously) - * Returns the curated example Analyses. + * Requeue an analysis (asynchronously) + * Creates a new Analysis and a new Binary sharing this Analysis's SHA-256, and runs the pipeline against them, leaving this Analysis and its Binary unchanged. Only the owner may call it. Poll the returned Operation for status, same as a normal create. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied + * @param analysisId Analysis ID (required) + * @param requeueAnalysisRequest (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 @@ -5459,20 +8376,24 @@ public ApiResponse v3ListExampleAnalysesWithHttpI - - + + + + +
Response Details
Status Code Description Response Headers
200 OK -
0 Error -
201 Created -
403 Forbidden -
404 Not Found -
422 Unprocessable Entity -
500 Internal Server Error -
*/ - public okhttp3.Call v3ListExampleAnalysesAsync(final ApiCallback _callback) throws ApiException { + public okhttp3.Call v3RequeueAnalysisAsync(@javax.annotation.Nonnull Long analysisId, @javax.annotation.Nonnull RequeueAnalysisRequest requeueAnalysisRequest, final ApiCallback _callback) throws ApiException { - okhttp3.Call localVarCall = v3ListExampleAnalysesValidateBeforeCall(_callback); - Type localVarReturnType = new TypeToken(){}.getType(); + okhttp3.Call localVarCall = v3RequeueAnalysisValidateBeforeCall(analysisId, requeueAnalysisRequest, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } /** - * Build call for v3LookupAnalysisByBinaryId - * @param binaryId Binary ID (required) + * Build call for v3RunDynamicExecution + * @param analysisId Analysis ID (required) + * @param runDynamicExecutionInputBody (optional) * @param _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object @@ -5481,12 +8402,15 @@ public okhttp3.Call v3ListExampleAnalysesAsync(final ApiCallbackResponse Details Status Code Description Response Headers 200 OK - + 400 Bad Request - + 403 Forbidden - 404 Not Found - + 409 Conflict - 422 Unprocessable Entity - 500 Internal Server Error - */ - public okhttp3.Call v3LookupAnalysisByBinaryIdCall(@javax.annotation.Nonnull Long binaryId, final ApiCallback _callback) throws ApiException { + public okhttp3.Call v3RunDynamicExecutionCall(@javax.annotation.Nonnull Long analysisId, @javax.annotation.Nullable RunDynamicExecutionInputBody runDynamicExecutionInputBody, final ApiCallback _callback) throws ApiException { String basePath = null; // Operation Servers String[] localBasePaths = new String[] { }; @@ -5500,11 +8424,11 @@ public okhttp3.Call v3LookupAnalysisByBinaryIdCall(@javax.annotation.Nonnull Lon basePath = null; } - Object localVarPostBody = null; + Object localVarPostBody = runDynamicExecutionInputBody; // create path and map variables - String localVarPath = "/v3/analyses/lookup/{binary_id}" - .replace("{" + "binary_id" + "}", localVarApiClient.escapeString(binaryId.toString())); + String localVarPath = "/v3/analyses/{analysis_id}/dynamic-execution:run" + .replace("{" + "analysis_id" + "}", localVarApiClient.escapeString(analysisId.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -5521,6 +8445,7 @@ public okhttp3.Call v3LookupAnalysisByBinaryIdCall(@javax.annotation.Nonnull Lon } final String[] localVarContentTypes = { + "application/json" }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { @@ -5528,67 +8453,76 @@ public okhttp3.Call v3LookupAnalysisByBinaryIdCall(@javax.annotation.Nonnull Lon } 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 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)"); + private okhttp3.Call v3RunDynamicExecutionValidateBeforeCall(@javax.annotation.Nonnull Long analysisId, @javax.annotation.Nullable RunDynamicExecutionInputBody runDynamicExecutionInputBody, 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 v3RunDynamicExecution(Async)"); } - return v3LookupAnalysisByBinaryIdCall(binaryId, _callback); + return v3RunDynamicExecutionCall(analysisId, runDynamicExecutionInputBody, _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 + * Trigger a dynamic execution run. + * Submits the analysis's binary to the sandbox and returns the operation to poll for its outcome. Returns 409 while a run is already in progress for this analysis. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `400` [`BAD_REQUEST`](/errors/BAD_REQUEST) — Bad Request - `409` [`CONFLICT`](/errors/CONFLICT) — Conflict + * @param analysisId Analysis ID (required) + * @param runDynamicExecutionInputBody (optional) + * @return OperationDynamicExecutionMetadataDynamicExecutionResult * @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 -
403 Forbidden -
404 Not Found -
409 Conflict -
422 Unprocessable Entity -
500 Internal Server Error -
*/ - public LookupAnalysisByBinaryIDOutputBody v3LookupAnalysisByBinaryId(@javax.annotation.Nonnull Long binaryId) throws ApiException { - ApiResponse localVarResp = v3LookupAnalysisByBinaryIdWithHttpInfo(binaryId); + public OperationDynamicExecutionMetadataDynamicExecutionResult v3RunDynamicExecution(@javax.annotation.Nonnull Long analysisId, @javax.annotation.Nullable RunDynamicExecutionInputBody runDynamicExecutionInputBody) throws ApiException { + ApiResponse localVarResp = v3RunDynamicExecutionWithHttpInfo(analysisId, runDynamicExecutionInputBody); 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> + * Trigger a dynamic execution run. + * Submits the analysis's binary to the sandbox and returns the operation to poll for its outcome. Returns 409 while a run is already in progress for this analysis. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `400` [`BAD_REQUEST`](/errors/BAD_REQUEST) — Bad Request - `409` [`CONFLICT`](/errors/CONFLICT) — Conflict + * @param analysisId Analysis ID (required) + * @param runDynamicExecutionInputBody (optional) + * @return ApiResponse<OperationDynamicExecutionMetadataDynamicExecutionResult> * @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 -
403 Forbidden -
404 Not Found -
409 Conflict -
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(); + public ApiResponse v3RunDynamicExecutionWithHttpInfo(@javax.annotation.Nonnull Long analysisId, @javax.annotation.Nullable RunDynamicExecutionInputBody runDynamicExecutionInputBody) throws ApiException { + okhttp3.Call localVarCall = v3RunDynamicExecutionValidateBeforeCall(analysisId, runDynamicExecutionInputBody, null); + Type localVarReturnType = new TypeToken(){}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } /** - * 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) + * Trigger a dynamic execution run. (asynchronously) + * Submits the analysis's binary to the sandbox and returns the operation to poll for its outcome. Returns 409 while a run is already in progress for this analysis. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `400` [`BAD_REQUEST`](/errors/BAD_REQUEST) — Bad Request - `409` [`CONFLICT`](/errors/CONFLICT) — Conflict + * @param analysisId Analysis ID (required) + * @param runDynamicExecutionInputBody (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 @@ -5597,20 +8531,23 @@ public ApiResponse v3LookupAnalysisByBinaryI Response Details Status Code Description Response Headers 200 OK - + 400 Bad Request - + 403 Forbidden - 404 Not Found - + 409 Conflict - 422 Unprocessable Entity - 500 Internal Server Error - */ - public okhttp3.Call v3LookupAnalysisByBinaryIdAsync(@javax.annotation.Nonnull Long binaryId, final ApiCallback _callback) throws ApiException { + public okhttp3.Call v3RunDynamicExecutionAsync(@javax.annotation.Nonnull Long analysisId, @javax.annotation.Nullable RunDynamicExecutionInputBody runDynamicExecutionInputBody, final ApiCallback _callback) throws ApiException { - okhttp3.Call localVarCall = v3LookupAnalysisByBinaryIdValidateBeforeCall(binaryId, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); + okhttp3.Call localVarCall = v3RunDynamicExecutionValidateBeforeCall(analysisId, runDynamicExecutionInputBody, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } /** - * Build call for v3QueueBinaryExport + * Build call for v3RunDynamicExecutionSummary * @param analysisId Analysis ID (required) * @param _callback Callback for upload/download progress * @return Call to execute @@ -5619,14 +8556,16 @@ public okhttp3.Call v3LookupAnalysisByBinaryIdAsync(@javax.annotation.Nonnull Lo - + + +
Response Details
Status Code Description Response Headers
202 Accepted -
200 OK -
400 Bad Request -
403 Forbidden -
404 Not Found -
409 Conflict -
422 Unprocessable Entity -
500 Internal Server Error -
*/ - public okhttp3.Call v3QueueBinaryExportCall(@javax.annotation.Nonnull Long analysisId, final ApiCallback _callback) throws ApiException { + public okhttp3.Call v3RunDynamicExecutionSummaryCall(@javax.annotation.Nonnull Long analysisId, final ApiCallback _callback) throws ApiException { String basePath = null; // Operation Servers String[] localBasePaths = new String[] { }; @@ -5643,7 +8582,7 @@ public okhttp3.Call v3QueueBinaryExportCall(@javax.annotation.Nonnull Long analy Object localVarPostBody = null; // create path and map variables - String localVarPath = "/v3/analyses/{analysis_id}/binary-export" + String localVarPath = "/v3/analyses/{analysis_id}/dynamic-execution/summary:run" .replace("{" + "analysis_id" + "}", localVarApiClient.escapeString(analysisId.toString())); List localVarQueryParams = new ArrayList(); @@ -5672,64 +8611,68 @@ public okhttp3.Call v3QueueBinaryExportCall(@javax.annotation.Nonnull Long analy } @SuppressWarnings("rawtypes") - private okhttp3.Call v3QueueBinaryExportValidateBeforeCall(@javax.annotation.Nonnull Long analysisId, final ApiCallback _callback) throws ApiException { + private okhttp3.Call v3RunDynamicExecutionSummaryValidateBeforeCall(@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)"); + throw new ApiException("Missing the required parameter 'analysisId' when calling v3RunDynamicExecutionSummary(Async)"); } - return v3QueueBinaryExportCall(analysisId, _callback); + return v3RunDynamicExecutionSummaryCall(analysisId, _callback); } /** - * 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 + * Regenerate the dynamic execution summary. + * Starts a new LLM summary of the analysis's completed run and returns the operation to poll. The new summary replaces the stored one once it succeeds. Only the analysis owner may regenerate. Returns 409 while the run is incomplete or a summary is already in progress. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `400` [`BAD_REQUEST`](/errors/BAD_REQUEST) — Bad Request - `409` [`CONFLICT`](/errors/CONFLICT) — Conflict - `409` [`DYNAMIC_EXECUTION_INCOMPLETE`](/errors/DYNAMIC_EXECUTION_INCOMPLETE) — Dynamic Execution Incomplete * @param analysisId Analysis ID (required) - * @return OperationBinaryExportMetadataBinaryExportResult + * @return OperationDynamicExecutionSummaryMetadataDynamicExecutionSummaryResult * @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
202 Accepted -
200 OK -
400 Bad Request -
403 Forbidden -
404 Not Found -
409 Conflict -
422 Unprocessable Entity -
500 Internal Server Error -
*/ - public OperationBinaryExportMetadataBinaryExportResult v3QueueBinaryExport(@javax.annotation.Nonnull Long analysisId) throws ApiException { - ApiResponse localVarResp = v3QueueBinaryExportWithHttpInfo(analysisId); + public OperationDynamicExecutionSummaryMetadataDynamicExecutionSummaryResult v3RunDynamicExecutionSummary(@javax.annotation.Nonnull Long analysisId) throws ApiException { + ApiResponse localVarResp = v3RunDynamicExecutionSummaryWithHttpInfo(analysisId); return localVarResp.getData(); } /** - * 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 + * Regenerate the dynamic execution summary. + * Starts a new LLM summary of the analysis's completed run and returns the operation to poll. The new summary replaces the stored one once it succeeds. Only the analysis owner may regenerate. Returns 409 while the run is incomplete or a summary is already in progress. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `400` [`BAD_REQUEST`](/errors/BAD_REQUEST) — Bad Request - `409` [`CONFLICT`](/errors/CONFLICT) — Conflict - `409` [`DYNAMIC_EXECUTION_INCOMPLETE`](/errors/DYNAMIC_EXECUTION_INCOMPLETE) — Dynamic Execution Incomplete * @param analysisId Analysis ID (required) - * @return ApiResponse<OperationBinaryExportMetadataBinaryExportResult> + * @return ApiResponse<OperationDynamicExecutionSummaryMetadataDynamicExecutionSummaryResult> * @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
202 Accepted -
200 OK -
400 Bad Request -
403 Forbidden -
404 Not Found -
409 Conflict -
422 Unprocessable Entity -
500 Internal Server Error -
*/ - public ApiResponse v3QueueBinaryExportWithHttpInfo(@javax.annotation.Nonnull Long analysisId) throws ApiException { - okhttp3.Call localVarCall = v3QueueBinaryExportValidateBeforeCall(analysisId, null); - Type localVarReturnType = new TypeToken(){}.getType(); + public ApiResponse v3RunDynamicExecutionSummaryWithHttpInfo(@javax.annotation.Nonnull Long analysisId) throws ApiException { + okhttp3.Call localVarCall = v3RunDynamicExecutionSummaryValidateBeforeCall(analysisId, null); + Type localVarReturnType = new TypeToken(){}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } /** - * 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 + * Regenerate the dynamic execution summary. (asynchronously) + * Starts a new LLM summary of the analysis's completed run and returns the operation to poll. The new summary replaces the stored one once it succeeds. Only the analysis owner may regenerate. Returns 409 while the run is incomplete or a summary is already in progress. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `400` [`BAD_REQUEST`](/errors/BAD_REQUEST) — Bad Request - `409` [`CONFLICT`](/errors/CONFLICT) — Conflict - `409` [`DYNAMIC_EXECUTION_INCOMPLETE`](/errors/DYNAMIC_EXECUTION_INCOMPLETE) — Dynamic Execution Incomplete * @param analysisId Analysis ID (required) * @param _callback The callback to be executed when the API call finishes * @return The request call @@ -5738,17 +8681,19 @@ public ApiResponse v3QueueBinar - + + +
Response Details
Status Code Description Response Headers
202 Accepted -
200 OK -
400 Bad Request -
403 Forbidden -
404 Not Found -
409 Conflict -
422 Unprocessable Entity -
500 Internal Server Error -
*/ - public okhttp3.Call v3QueueBinaryExportAsync(@javax.annotation.Nonnull Long analysisId, final ApiCallback _callback) throws ApiException { + public okhttp3.Call v3RunDynamicExecutionSummaryAsync(@javax.annotation.Nonnull Long analysisId, final ApiCallback _callback) throws ApiException { - okhttp3.Call localVarCall = v3QueueBinaryExportValidateBeforeCall(analysisId, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); + okhttp3.Call localVarCall = v3RunDynamicExecutionSummaryValidateBeforeCall(analysisId, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } @@ -6058,6 +9003,177 @@ public okhttp3.Call v3UpdateAnalysisAsync(@javax.annotation.Nonnull Long analysi localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } + /** + * Build call for v3UpdateAnalysisGlobal + * @param analysisId Analysis ID (required) + * @param vaddr Virtual address of the global variable. (required) + * @param updateAnalysisGlobalInputBody (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 -
400 Bad Request -
403 Forbidden -
404 Not Found -
409 Conflict -
422 Unprocessable Entity -
500 Internal Server Error -
+ */ + public okhttp3.Call v3UpdateAnalysisGlobalCall(@javax.annotation.Nonnull Long analysisId, @javax.annotation.Nonnull Long vaddr, @javax.annotation.Nonnull UpdateAnalysisGlobalInputBody updateAnalysisGlobalInputBody, 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 = updateAnalysisGlobalInputBody; + + // create path and map variables + String localVarPath = "/v3/analyses/{analysis_id}/globals/{vaddr}" + .replace("{" + "analysis_id" + "}", localVarApiClient.escapeString(analysisId.toString())) + .replace("{" + "vaddr" + "}", localVarApiClient.escapeString(vaddr.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "APIKey", "bearerAuth" }; + return localVarApiClient.buildCall(basePath, localVarPath, "PATCH", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call v3UpdateAnalysisGlobalValidateBeforeCall(@javax.annotation.Nonnull Long analysisId, @javax.annotation.Nonnull Long vaddr, @javax.annotation.Nonnull UpdateAnalysisGlobalInputBody updateAnalysisGlobalInputBody, 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 v3UpdateAnalysisGlobal(Async)"); + } + + // verify the required parameter 'vaddr' is set + if (vaddr == null) { + throw new ApiException("Missing the required parameter 'vaddr' when calling v3UpdateAnalysisGlobal(Async)"); + } + + // verify the required parameter 'updateAnalysisGlobalInputBody' is set + if (updateAnalysisGlobalInputBody == null) { + throw new ApiException("Missing the required parameter 'updateAnalysisGlobalInputBody' when calling v3UpdateAnalysisGlobal(Async)"); + } + + return v3UpdateAnalysisGlobalCall(analysisId, vaddr, updateAnalysisGlobalInputBody, _callback); + + } + + /** + * Edit a global variable. + * Renames a global, assigns it an analysis data type, or both. Each field the request sets stamps its own provenance `USER`, which a later re-extraction carries forward instead of overwriting. A name another global in the analysis already holds is rejected. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `400` [`BAD_REQUEST`](/errors/BAD_REQUEST) — Bad Request - `409` [`ALREADY_EXISTS`](/errors/ALREADY_EXISTS) — Already Exists + * @param analysisId Analysis ID (required) + * @param vaddr Virtual address of the global variable. (required) + * @param updateAnalysisGlobalInputBody (required) + * @return GlobalVariable + * @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 -
403 Forbidden -
404 Not Found -
409 Conflict -
422 Unprocessable Entity -
500 Internal Server Error -
+ */ + public GlobalVariable v3UpdateAnalysisGlobal(@javax.annotation.Nonnull Long analysisId, @javax.annotation.Nonnull Long vaddr, @javax.annotation.Nonnull UpdateAnalysisGlobalInputBody updateAnalysisGlobalInputBody) throws ApiException { + ApiResponse localVarResp = v3UpdateAnalysisGlobalWithHttpInfo(analysisId, vaddr, updateAnalysisGlobalInputBody); + return localVarResp.getData(); + } + + /** + * Edit a global variable. + * Renames a global, assigns it an analysis data type, or both. Each field the request sets stamps its own provenance `USER`, which a later re-extraction carries forward instead of overwriting. A name another global in the analysis already holds is rejected. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `400` [`BAD_REQUEST`](/errors/BAD_REQUEST) — Bad Request - `409` [`ALREADY_EXISTS`](/errors/ALREADY_EXISTS) — Already Exists + * @param analysisId Analysis ID (required) + * @param vaddr Virtual address of the global variable. (required) + * @param updateAnalysisGlobalInputBody (required) + * @return ApiResponse<GlobalVariable> + * @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 -
403 Forbidden -
404 Not Found -
409 Conflict -
422 Unprocessable Entity -
500 Internal Server Error -
+ */ + public ApiResponse v3UpdateAnalysisGlobalWithHttpInfo(@javax.annotation.Nonnull Long analysisId, @javax.annotation.Nonnull Long vaddr, @javax.annotation.Nonnull UpdateAnalysisGlobalInputBody updateAnalysisGlobalInputBody) throws ApiException { + okhttp3.Call localVarCall = v3UpdateAnalysisGlobalValidateBeforeCall(analysisId, vaddr, updateAnalysisGlobalInputBody, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Edit a global variable. (asynchronously) + * Renames a global, assigns it an analysis data type, or both. Each field the request sets stamps its own provenance `USER`, which a later re-extraction carries forward instead of overwriting. A name another global in the analysis already holds is rejected. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `400` [`BAD_REQUEST`](/errors/BAD_REQUEST) — Bad Request - `409` [`ALREADY_EXISTS`](/errors/ALREADY_EXISTS) — Already Exists + * @param analysisId Analysis ID (required) + * @param vaddr Virtual address of the global variable. (required) + * @param updateAnalysisGlobalInputBody (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 -
400 Bad Request -
403 Forbidden -
404 Not Found -
409 Conflict -
422 Unprocessable Entity -
500 Internal Server Error -
+ */ + public okhttp3.Call v3UpdateAnalysisGlobalAsync(@javax.annotation.Nonnull Long analysisId, @javax.annotation.Nonnull Long vaddr, @javax.annotation.Nonnull UpdateAnalysisGlobalInputBody updateAnalysisGlobalInputBody, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = v3UpdateAnalysisGlobalValidateBeforeCall(analysisId, vaddr, updateAnalysisGlobalInputBody, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } /** * Build call for v3UpdateAnalysisTags * @param analysisId Analysis ID (required) diff --git a/src/main/java/ai/reveng/api/AuthenticationUsersApi.java b/src/main/java/ai/reveng/api/AuthenticationUsersApi.java index e33fdee..d47cb91 100644 --- a/src/main/java/ai/reveng/api/AuthenticationUsersApi.java +++ b/src/main/java/ai/reveng/api/AuthenticationUsersApi.java @@ -32,6 +32,7 @@ import ai.reveng.model.BaseResponseListUserActivityResponse; import ai.reveng.model.GetPublicUserOutputBody; import ai.reveng.model.GetUserActivityOutputBody; +import ai.reveng.model.ListPublicUsersOutputBody; import ai.reveng.model.SubmitFeedbackBody; import ai.reveng.model.SubmitFeedbackOutputBody; import ai.reveng.model.SubmitUserFeedbackRequest; @@ -749,6 +750,140 @@ public okhttp3.Call v3GetUserActivityAsync(final ApiCallback + Response Details + Status Code Description Response Headers + 200 OK - + 0 Error - + + */ + public okhttp3.Call v3ListUsersCall(@javax.annotation.Nonnull String searchTerm, 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 = "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/v3/users"; + + 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)); + } + + 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 v3ListUsersValidateBeforeCall(@javax.annotation.Nonnull String searchTerm, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'searchTerm' is set + if (searchTerm == null) { + throw new ApiException("Missing the required parameter 'searchTerm' when calling v3ListUsers(Async)"); + } + + return v3ListUsersCall(searchTerm, _callback); + + } + + /** + * Search users + * Returns up to 5 active users whose username contains the search term (case-insensitive), with their ID and username, ordered by username. + * @param searchTerm Text the username contains (case-insensitive) (required) + * @return ListPublicUsersOutputBody + * @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 ListPublicUsersOutputBody v3ListUsers(@javax.annotation.Nonnull String searchTerm) throws ApiException { + ApiResponse localVarResp = v3ListUsersWithHttpInfo(searchTerm); + return localVarResp.getData(); + } + + /** + * Search users + * Returns up to 5 active users whose username contains the search term (case-insensitive), with their ID and username, ordered by username. + * @param searchTerm Text the username contains (case-insensitive) (required) + * @return ApiResponse<ListPublicUsersOutputBody> + * @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 v3ListUsersWithHttpInfo(@javax.annotation.Nonnull String searchTerm) throws ApiException { + okhttp3.Call localVarCall = v3ListUsersValidateBeforeCall(searchTerm, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Search users (asynchronously) + * Returns up to 5 active users whose username contains the search term (case-insensitive), with their ID and username, ordered by username. + * @param searchTerm Text the username contains (case-insensitive) (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 -
0 Error -
+ */ + public okhttp3.Call v3ListUsersAsync(@javax.annotation.Nonnull String searchTerm, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = v3ListUsersValidateBeforeCall(searchTerm, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } /** * Build call for v3SubmitUserFeedback * @param submitFeedbackBody (required) diff --git a/src/main/java/ai/reveng/api/FunctionsAiDecompilationApi.java b/src/main/java/ai/reveng/api/FunctionsAiDecompilationApi.java index ee23157..4e84bb5 100644 --- a/src/main/java/ai/reveng/api/FunctionsAiDecompilationApi.java +++ b/src/main/java/ai/reveng/api/FunctionsAiDecompilationApi.java @@ -96,6 +96,7 @@ public void setCustomBaseUrl(String customBaseUrl) { * @param functionId Function ID (required) * @param temperature LLM temperature (0.0-1.0). Overrides the server default when set. Omit or set to -1 to use the server default. (optional, default to -1) * @param typeSuggestions Ask the language model to name the suggested types and their members. Set to false to skip the model call; the statically derived layouts are still computed and stored. Cannot re-enable the pass when the server has it off. (optional, default to true) + * @param naming Ask the language model to name the placeholder variables. Set to false to skip the model call; the generic names are kept. Cannot re-enable the pass when the server has it off. (optional, default to true) * @param applyTypes Store the suggested types as data types of this function's analysis, with a source_type of AI_DECOMP. Set to false to leave them as suggestions only. Cannot re-enable the pass when the server has it off. (optional, default to true) * @param _callback Callback for upload/download progress * @return Call to execute @@ -108,12 +109,13 @@ public void setCustomBaseUrl(String customBaseUrl) { 400 Bad Request - 402 Payment Required - 403 Forbidden - + 404 Not Found - 409 Conflict - 422 Unprocessable Entity - 500 Internal Server Error - */ - public okhttp3.Call createAiDecompilationCall(@javax.annotation.Nonnull Long functionId, @javax.annotation.Nullable Double temperature, @javax.annotation.Nullable Boolean typeSuggestions, @javax.annotation.Nullable Boolean applyTypes, final ApiCallback _callback) throws ApiException { + public okhttp3.Call createAiDecompilationCall(@javax.annotation.Nonnull Long functionId, @javax.annotation.Nullable Double temperature, @javax.annotation.Nullable Boolean typeSuggestions, @javax.annotation.Nullable Boolean naming, @javax.annotation.Nullable Boolean applyTypes, final ApiCallback _callback) throws ApiException { String basePath = null; // Operation Servers String[] localBasePaths = new String[] { }; @@ -147,6 +149,10 @@ public okhttp3.Call createAiDecompilationCall(@javax.annotation.Nonnull Long fun localVarQueryParams.addAll(localVarApiClient.parameterToPair("type_suggestions", typeSuggestions)); } + if (naming != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("naming", naming)); + } + if (applyTypes != null) { localVarQueryParams.addAll(localVarApiClient.parameterToPair("apply_types", applyTypes)); } @@ -171,22 +177,23 @@ public okhttp3.Call createAiDecompilationCall(@javax.annotation.Nonnull Long fun } @SuppressWarnings("rawtypes") - private okhttp3.Call createAiDecompilationValidateBeforeCall(@javax.annotation.Nonnull Long functionId, @javax.annotation.Nullable Double temperature, @javax.annotation.Nullable Boolean typeSuggestions, @javax.annotation.Nullable Boolean applyTypes, final ApiCallback _callback) throws ApiException { + private okhttp3.Call createAiDecompilationValidateBeforeCall(@javax.annotation.Nonnull Long functionId, @javax.annotation.Nullable Double temperature, @javax.annotation.Nullable Boolean typeSuggestions, @javax.annotation.Nullable Boolean naming, @javax.annotation.Nullable Boolean applyTypes, final ApiCallback _callback) throws ApiException { // verify the required parameter 'functionId' is set if (functionId == null) { throw new ApiException("Missing the required parameter 'functionId' when calling createAiDecompilation(Async)"); } - return createAiDecompilationCall(functionId, temperature, typeSuggestions, applyTypes, _callback); + return createAiDecompilationCall(functionId, temperature, typeSuggestions, naming, applyTypes, _callback); } /** * Start AI decompilation - * Begins the AI decompilation process for a function. Charges team credits and starts the workflow. **Error codes:** - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `400` [`BAD_REQUEST`](/errors/BAD_REQUEST) — Bad Request - `409` [`CONFLICT`](/errors/CONFLICT) — Conflict - `402` [`INSUFFICIENT_CREDITS`](/errors/INSUFFICIENT_CREDITS) — Insufficient Credits + * Begins the AI decompilation process for a function. Charges team credits and starts the workflow. Replacing an existing completed decompilation requires write access to the analysis; any caller with read access can decompile a function that has no completed result. **Error codes:** - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `400` [`BAD_REQUEST`](/errors/BAD_REQUEST) — Bad Request - `409` [`CONFLICT`](/errors/CONFLICT) — Conflict - `402` [`INSUFFICIENT_CREDITS`](/errors/INSUFFICIENT_CREDITS) — Insufficient Credits * @param functionId Function ID (required) * @param temperature LLM temperature (0.0-1.0). Overrides the server default when set. Omit or set to -1 to use the server default. (optional, default to -1) * @param typeSuggestions Ask the language model to name the suggested types and their members. Set to false to skip the model call; the statically derived layouts are still computed and stored. Cannot re-enable the pass when the server has it off. (optional, default to true) + * @param naming Ask the language model to name the placeholder variables. Set to false to skip the model call; the generic names are kept. Cannot re-enable the pass when the server has it off. (optional, default to true) * @param applyTypes Store the suggested types as data types of this function's analysis, with a source_type of AI_DECOMP. Set to false to leave them as suggestions only. Cannot re-enable the pass when the server has it off. (optional, default to true) * @return CreateAIDecompOutputBody * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body @@ -198,22 +205,24 @@ private okhttp3.Call createAiDecompilationValidateBeforeCall(@javax.annotation.N 400 Bad Request - 402 Payment Required - 403 Forbidden - + 404 Not Found - 409 Conflict - 422 Unprocessable Entity - 500 Internal Server Error - */ - public CreateAIDecompOutputBody createAiDecompilation(@javax.annotation.Nonnull Long functionId, @javax.annotation.Nullable Double temperature, @javax.annotation.Nullable Boolean typeSuggestions, @javax.annotation.Nullable Boolean applyTypes) throws ApiException { - ApiResponse localVarResp = createAiDecompilationWithHttpInfo(functionId, temperature, typeSuggestions, applyTypes); + public CreateAIDecompOutputBody createAiDecompilation(@javax.annotation.Nonnull Long functionId, @javax.annotation.Nullable Double temperature, @javax.annotation.Nullable Boolean typeSuggestions, @javax.annotation.Nullable Boolean naming, @javax.annotation.Nullable Boolean applyTypes) throws ApiException { + ApiResponse localVarResp = createAiDecompilationWithHttpInfo(functionId, temperature, typeSuggestions, naming, applyTypes); return localVarResp.getData(); } /** * Start AI decompilation - * Begins the AI decompilation process for a function. Charges team credits and starts the workflow. **Error codes:** - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `400` [`BAD_REQUEST`](/errors/BAD_REQUEST) — Bad Request - `409` [`CONFLICT`](/errors/CONFLICT) — Conflict - `402` [`INSUFFICIENT_CREDITS`](/errors/INSUFFICIENT_CREDITS) — Insufficient Credits + * Begins the AI decompilation process for a function. Charges team credits and starts the workflow. Replacing an existing completed decompilation requires write access to the analysis; any caller with read access can decompile a function that has no completed result. **Error codes:** - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `400` [`BAD_REQUEST`](/errors/BAD_REQUEST) — Bad Request - `409` [`CONFLICT`](/errors/CONFLICT) — Conflict - `402` [`INSUFFICIENT_CREDITS`](/errors/INSUFFICIENT_CREDITS) — Insufficient Credits * @param functionId Function ID (required) * @param temperature LLM temperature (0.0-1.0). Overrides the server default when set. Omit or set to -1 to use the server default. (optional, default to -1) * @param typeSuggestions Ask the language model to name the suggested types and their members. Set to false to skip the model call; the statically derived layouts are still computed and stored. Cannot re-enable the pass when the server has it off. (optional, default to true) + * @param naming Ask the language model to name the placeholder variables. Set to false to skip the model call; the generic names are kept. Cannot re-enable the pass when the server has it off. (optional, default to true) * @param applyTypes Store the suggested types as data types of this function's analysis, with a source_type of AI_DECOMP. Set to false to leave them as suggestions only. Cannot re-enable the pass when the server has it off. (optional, default to true) * @return ApiResponse<CreateAIDecompOutputBody> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body @@ -225,23 +234,25 @@ public CreateAIDecompOutputBody createAiDecompilation(@javax.annotation.Nonnull 400 Bad Request - 402 Payment Required - 403 Forbidden - + 404 Not Found - 409 Conflict - 422 Unprocessable Entity - 500 Internal Server Error - */ - public ApiResponse createAiDecompilationWithHttpInfo(@javax.annotation.Nonnull Long functionId, @javax.annotation.Nullable Double temperature, @javax.annotation.Nullable Boolean typeSuggestions, @javax.annotation.Nullable Boolean applyTypes) throws ApiException { - okhttp3.Call localVarCall = createAiDecompilationValidateBeforeCall(functionId, temperature, typeSuggestions, applyTypes, null); + public ApiResponse createAiDecompilationWithHttpInfo(@javax.annotation.Nonnull Long functionId, @javax.annotation.Nullable Double temperature, @javax.annotation.Nullable Boolean typeSuggestions, @javax.annotation.Nullable Boolean naming, @javax.annotation.Nullable Boolean applyTypes) throws ApiException { + okhttp3.Call localVarCall = createAiDecompilationValidateBeforeCall(functionId, temperature, typeSuggestions, naming, applyTypes, null); Type localVarReturnType = new TypeToken(){}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } /** * Start AI decompilation (asynchronously) - * Begins the AI decompilation process for a function. Charges team credits and starts the workflow. **Error codes:** - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `400` [`BAD_REQUEST`](/errors/BAD_REQUEST) — Bad Request - `409` [`CONFLICT`](/errors/CONFLICT) — Conflict - `402` [`INSUFFICIENT_CREDITS`](/errors/INSUFFICIENT_CREDITS) — Insufficient Credits + * Begins the AI decompilation process for a function. Charges team credits and starts the workflow. Replacing an existing completed decompilation requires write access to the analysis; any caller with read access can decompile a function that has no completed result. **Error codes:** - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `400` [`BAD_REQUEST`](/errors/BAD_REQUEST) — Bad Request - `409` [`CONFLICT`](/errors/CONFLICT) — Conflict - `402` [`INSUFFICIENT_CREDITS`](/errors/INSUFFICIENT_CREDITS) — Insufficient Credits * @param functionId Function ID (required) * @param temperature LLM temperature (0.0-1.0). Overrides the server default when set. Omit or set to -1 to use the server default. (optional, default to -1) * @param typeSuggestions Ask the language model to name the suggested types and their members. Set to false to skip the model call; the statically derived layouts are still computed and stored. Cannot re-enable the pass when the server has it off. (optional, default to true) + * @param naming Ask the language model to name the placeholder variables. Set to false to skip the model call; the generic names are kept. Cannot re-enable the pass when the server has it off. (optional, default to true) * @param applyTypes Store the suggested types as data types of this function's analysis, with a source_type of AI_DECOMP. Set to false to leave them as suggestions only. Cannot re-enable the pass when the server has it off. (optional, default to true) * @param _callback The callback to be executed when the API call finishes * @return The request call @@ -254,14 +265,15 @@ public ApiResponse createAiDecompilationWithHttpInfo(@ 400 Bad Request - 402 Payment Required - 403 Forbidden - + 404 Not Found - 409 Conflict - 422 Unprocessable Entity - 500 Internal Server Error - */ - public okhttp3.Call createAiDecompilationAsync(@javax.annotation.Nonnull Long functionId, @javax.annotation.Nullable Double temperature, @javax.annotation.Nullable Boolean typeSuggestions, @javax.annotation.Nullable Boolean applyTypes, final ApiCallback _callback) throws ApiException { + public okhttp3.Call createAiDecompilationAsync(@javax.annotation.Nonnull Long functionId, @javax.annotation.Nullable Double temperature, @javax.annotation.Nullable Boolean typeSuggestions, @javax.annotation.Nullable Boolean naming, @javax.annotation.Nullable Boolean applyTypes, final ApiCallback _callback) throws ApiException { - okhttp3.Call localVarCall = createAiDecompilationValidateBeforeCall(functionId, temperature, typeSuggestions, applyTypes, _callback); + okhttp3.Call localVarCall = createAiDecompilationValidateBeforeCall(functionId, temperature, typeSuggestions, naming, applyTypes, _callback); Type localVarReturnType = new TypeToken(){}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; @@ -348,7 +360,7 @@ private okhttp3.Call deleteAiDecompilationInlineCommentValidateBeforeCall(@javax /** * Delete a single inline comment - * Removes the comment for the given line number. Requires comments to have been generated first. **Error codes:** - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found + * Removes the comment for the given line number. Requires write access to the analysis and comments to have been generated first. **Error codes:** - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found * @param functionId Function ID (required) * @param line Line number of the comment to delete (required) * @return CommentsData @@ -371,7 +383,7 @@ public CommentsData deleteAiDecompilationInlineComment(@javax.annotation.Nonnull /** * Delete a single inline comment - * Removes the comment for the given line number. Requires comments to have been generated first. **Error codes:** - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found + * Removes the comment for the given line number. Requires write access to the analysis and comments to have been generated first. **Error codes:** - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found * @param functionId Function ID (required) * @param line Line number of the comment to delete (required) * @return ApiResponse<CommentsData> @@ -395,7 +407,7 @@ public ApiResponse deleteAiDecompilationInlineCommentWithHttpInfo( /** * Delete a single inline comment (asynchronously) - * Removes the comment for the given line number. Requires comments to have been generated first. **Error codes:** - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found + * Removes the comment for the given line number. Requires write access to the analysis and comments to have been generated first. **Error codes:** - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found * @param functionId Function ID (required) * @param line Line number of the comment to delete (required) * @param _callback The callback to be executed when the API call finishes @@ -1499,7 +1511,7 @@ private okhttp3.Call patchAiDecompilationInlineCommentValidateBeforeCall(@javax. /** * Update a single inline comment - * Merges a single line comment into the existing AI-generated inline comments. Requires comments to have been generated first. **Error codes:** - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found + * Merges a single line comment into the existing AI-generated inline comments. Requires write access to the analysis and comments to have been generated first. **Error codes:** - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found * @param functionId Function ID (required) * @param patchCommentBody (required) * @return CommentsData @@ -1522,7 +1534,7 @@ public CommentsData patchAiDecompilationInlineComment(@javax.annotation.Nonnull /** * Update a single inline comment - * Merges a single line comment into the existing AI-generated inline comments. Requires comments to have been generated first. **Error codes:** - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found + * Merges a single line comment into the existing AI-generated inline comments. Requires write access to the analysis and comments to have been generated first. **Error codes:** - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found * @param functionId Function ID (required) * @param patchCommentBody (required) * @return ApiResponse<CommentsData> @@ -1546,7 +1558,7 @@ public ApiResponse patchAiDecompilationInlineCommentWithHttpInfo(@ /** * Update a single inline comment (asynchronously) - * Merges a single line comment into the existing AI-generated inline comments. Requires comments to have been generated first. **Error codes:** - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found + * Merges a single line comment into the existing AI-generated inline comments. Requires write access to the analysis and comments to have been generated first. **Error codes:** - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found * @param functionId Function ID (required) * @param patchCommentBody (required) * @param _callback The callback to be executed when the API call finishes @@ -1647,7 +1659,7 @@ private okhttp3.Call regenerateAiDecompilationInlineCommentsValidateBeforeCall(@ /** * Regenerate AI decompilation inline comments - * Starts a new inline comments generation workflow for the function. Requires an existing decompilation with a summary. Rejected while a decompilation is running: its naming and type-suggestion passes are still changing the identifiers the comments would reference. Poll the inline comments status endpoint, which reports PENDING until then. **Error codes:** - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `400` [`BAD_REQUEST`](/errors/BAD_REQUEST) — Bad Request - `409` [`CONFLICT`](/errors/CONFLICT) — Conflict + * Starts a new inline comments generation workflow for the function. Requires write access to the analysis and an existing decompilation with a summary. Rejected while a decompilation is running: its naming and type-suggestion passes are still changing the identifiers the comments would reference. Poll the inline comments status endpoint, which reports PENDING until then. **Error codes:** - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `400` [`BAD_REQUEST`](/errors/BAD_REQUEST) — Bad Request - `409` [`CONFLICT`](/errors/CONFLICT) — Conflict * @param functionId Function ID (required) * @return RegenerateOutputBody * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body @@ -1671,7 +1683,7 @@ public RegenerateOutputBody regenerateAiDecompilationInlineComments(@javax.annot /** * Regenerate AI decompilation inline comments - * Starts a new inline comments generation workflow for the function. Requires an existing decompilation with a summary. Rejected while a decompilation is running: its naming and type-suggestion passes are still changing the identifiers the comments would reference. Poll the inline comments status endpoint, which reports PENDING until then. **Error codes:** - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `400` [`BAD_REQUEST`](/errors/BAD_REQUEST) — Bad Request - `409` [`CONFLICT`](/errors/CONFLICT) — Conflict + * Starts a new inline comments generation workflow for the function. Requires write access to the analysis and an existing decompilation with a summary. Rejected while a decompilation is running: its naming and type-suggestion passes are still changing the identifiers the comments would reference. Poll the inline comments status endpoint, which reports PENDING until then. **Error codes:** - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `400` [`BAD_REQUEST`](/errors/BAD_REQUEST) — Bad Request - `409` [`CONFLICT`](/errors/CONFLICT) — Conflict * @param functionId Function ID (required) * @return ApiResponse<RegenerateOutputBody> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body @@ -1696,7 +1708,7 @@ public ApiResponse regenerateAiDecompilationInlineComments /** * Regenerate AI decompilation inline comments (asynchronously) - * Starts a new inline comments generation workflow for the function. Requires an existing decompilation with a summary. Rejected while a decompilation is running: its naming and type-suggestion passes are still changing the identifiers the comments would reference. Poll the inline comments status endpoint, which reports PENDING until then. **Error codes:** - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `400` [`BAD_REQUEST`](/errors/BAD_REQUEST) — Bad Request - `409` [`CONFLICT`](/errors/CONFLICT) — Conflict + * Starts a new inline comments generation workflow for the function. Requires write access to the analysis and an existing decompilation with a summary. Rejected while a decompilation is running: its naming and type-suggestion passes are still changing the identifiers the comments would reference. Poll the inline comments status endpoint, which reports PENDING until then. **Error codes:** - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `400` [`BAD_REQUEST`](/errors/BAD_REQUEST) — Bad Request - `409` [`CONFLICT`](/errors/CONFLICT) — Conflict * @param functionId Function ID (required) * @param _callback The callback to be executed when the API call finishes * @return The request call @@ -1797,7 +1809,7 @@ private okhttp3.Call regenerateAiDecompilationSummaryValidateBeforeCall(@javax.a /** * Regenerate AI decompilation summary - * Starts a new summary generation workflow for the function. Requires an existing decompilation. Rejected while a decompilation is running: its naming and type-suggestion passes are still changing the identifiers a summary would describe. Poll the summary status endpoint, which reports PENDING until then. **Error codes:** - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `409` [`CONFLICT`](/errors/CONFLICT) — Conflict + * Starts a new summary generation workflow for the function. Requires write access to the analysis and an existing decompilation. Rejected while a decompilation is running: its naming and type-suggestion passes are still changing the identifiers a summary would describe. Poll the summary status endpoint, which reports PENDING until then. **Error codes:** - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `409` [`CONFLICT`](/errors/CONFLICT) — Conflict * @param functionId Function ID (required) * @return RegenerateOutputBody * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body @@ -1820,7 +1832,7 @@ public RegenerateOutputBody regenerateAiDecompilationSummary(@javax.annotation.N /** * Regenerate AI decompilation summary - * Starts a new summary generation workflow for the function. Requires an existing decompilation. Rejected while a decompilation is running: its naming and type-suggestion passes are still changing the identifiers a summary would describe. Poll the summary status endpoint, which reports PENDING until then. **Error codes:** - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `409` [`CONFLICT`](/errors/CONFLICT) — Conflict + * Starts a new summary generation workflow for the function. Requires write access to the analysis and an existing decompilation. Rejected while a decompilation is running: its naming and type-suggestion passes are still changing the identifiers a summary would describe. Poll the summary status endpoint, which reports PENDING until then. **Error codes:** - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `409` [`CONFLICT`](/errors/CONFLICT) — Conflict * @param functionId Function ID (required) * @return ApiResponse<RegenerateOutputBody> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body @@ -1844,7 +1856,7 @@ public ApiResponse regenerateAiDecompilationSummaryWithHtt /** * Regenerate AI decompilation summary (asynchronously) - * Starts a new summary generation workflow for the function. Requires an existing decompilation. Rejected while a decompilation is running: its naming and type-suggestion passes are still changing the identifiers a summary would describe. Poll the summary status endpoint, which reports PENDING until then. **Error codes:** - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `409` [`CONFLICT`](/errors/CONFLICT) — Conflict + * Starts a new summary generation workflow for the function. Requires write access to the analysis and an existing decompilation. Rejected while a decompilation is running: its naming and type-suggestion passes are still changing the identifiers a summary would describe. Poll the summary status endpoint, which reports PENDING until then. **Error codes:** - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `409` [`CONFLICT`](/errors/CONFLICT) — Conflict * @param functionId Function ID (required) * @param _callback The callback to be executed when the API call finishes * @return The request call @@ -3107,7 +3119,7 @@ private okhttp3.Call v3RegenerateAiDecompilationTypeSuggestionsValidateBeforeCal /** * Regenerate AI decompilation type suggestions - * Starts a new type suggestion workflow for the function, discarding the suggestions already stored. Requires a successful decompilation; it re-runs only the type-naming pass, so it costs no decompilation credit. The regenerated types are stored as data types of the analysis unless `apply_types=false`; types a previous run stored are not removed. Rejected while a decompilation is running: it runs the same pass itself once its output settles. Poll the type-suggestions status endpoint, which reports PENDING until then, and read the result from the type-suggestions endpoint. **Error codes:** - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `409` [`CONFLICT`](/errors/CONFLICT) — Conflict - `500` [`INTERNAL_ERROR`](/errors/INTERNAL_ERROR) — Internal Server Error + * Starts a new type suggestion workflow for the function, discarding the suggestions already stored. Requires write access to the analysis and a successful decompilation; it re-runs only the type-naming pass, so it costs no decompilation credit. The regenerated types are stored as data types of the analysis unless `apply_types=false`; types a previous run stored are not removed. Rejected while a decompilation is running: it runs the same pass itself once its output settles. Poll the type-suggestions status endpoint, which reports PENDING until then, and read the result from the type-suggestions endpoint. **Error codes:** - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `409` [`CONFLICT`](/errors/CONFLICT) — Conflict - `500` [`INTERNAL_ERROR`](/errors/INTERNAL_ERROR) — Internal Server Error * @param functionId Function ID (required) * @param applyTypes Store the regenerated types as data types of this function's analysis, with a source_type of AI_DECOMP. Set to false to leave them as suggestions only. Cannot re-enable the pass when the server has it off. (optional, default to true) * @return RegenerateOutputBody @@ -3131,7 +3143,7 @@ public RegenerateOutputBody v3RegenerateAiDecompilationTypeSuggestions(@javax.an /** * Regenerate AI decompilation type suggestions - * Starts a new type suggestion workflow for the function, discarding the suggestions already stored. Requires a successful decompilation; it re-runs only the type-naming pass, so it costs no decompilation credit. The regenerated types are stored as data types of the analysis unless `apply_types=false`; types a previous run stored are not removed. Rejected while a decompilation is running: it runs the same pass itself once its output settles. Poll the type-suggestions status endpoint, which reports PENDING until then, and read the result from the type-suggestions endpoint. **Error codes:** - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `409` [`CONFLICT`](/errors/CONFLICT) — Conflict - `500` [`INTERNAL_ERROR`](/errors/INTERNAL_ERROR) — Internal Server Error + * Starts a new type suggestion workflow for the function, discarding the suggestions already stored. Requires write access to the analysis and a successful decompilation; it re-runs only the type-naming pass, so it costs no decompilation credit. The regenerated types are stored as data types of the analysis unless `apply_types=false`; types a previous run stored are not removed. Rejected while a decompilation is running: it runs the same pass itself once its output settles. Poll the type-suggestions status endpoint, which reports PENDING until then, and read the result from the type-suggestions endpoint. **Error codes:** - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `409` [`CONFLICT`](/errors/CONFLICT) — Conflict - `500` [`INTERNAL_ERROR`](/errors/INTERNAL_ERROR) — Internal Server Error * @param functionId Function ID (required) * @param applyTypes Store the regenerated types as data types of this function's analysis, with a source_type of AI_DECOMP. Set to false to leave them as suggestions only. Cannot re-enable the pass when the server has it off. (optional, default to true) * @return ApiResponse<RegenerateOutputBody> @@ -3156,7 +3168,7 @@ public ApiResponse v3RegenerateAiDecompilationTypeSuggesti /** * Regenerate AI decompilation type suggestions (asynchronously) - * Starts a new type suggestion workflow for the function, discarding the suggestions already stored. Requires a successful decompilation; it re-runs only the type-naming pass, so it costs no decompilation credit. The regenerated types are stored as data types of the analysis unless `apply_types=false`; types a previous run stored are not removed. Rejected while a decompilation is running: it runs the same pass itself once its output settles. Poll the type-suggestions status endpoint, which reports PENDING until then, and read the result from the type-suggestions endpoint. **Error codes:** - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `409` [`CONFLICT`](/errors/CONFLICT) — Conflict - `500` [`INTERNAL_ERROR`](/errors/INTERNAL_ERROR) — Internal Server Error + * Starts a new type suggestion workflow for the function, discarding the suggestions already stored. Requires write access to the analysis and a successful decompilation; it re-runs only the type-naming pass, so it costs no decompilation credit. The regenerated types are stored as data types of the analysis unless `apply_types=false`; types a previous run stored are not removed. Rejected while a decompilation is running: it runs the same pass itself once its output settles. Poll the type-suggestions status endpoint, which reports PENDING until then, and read the result from the type-suggestions endpoint. **Error codes:** - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `409` [`CONFLICT`](/errors/CONFLICT) — Conflict - `500` [`INTERNAL_ERROR`](/errors/INTERNAL_ERROR) — Internal Server Error * @param functionId Function ID (required) * @param applyTypes Store the regenerated types as data types of this function's analysis, with a source_type of AI_DECOMP. Set to false to leave them as suggestions only. Cannot re-enable the pass when the server has it off. (optional, default to true) * @param _callback The callback to be executed when the API call finishes @@ -3264,7 +3276,7 @@ private okhttp3.Call v3UpsertAiDecompilationOverridesValidateBeforeCall(@javax.a /** * Upsert variable/function name overrides - * Applies user-provided name overrides to placeholder tokens in the decompilation. **Error codes:** - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `400` [`BAD_REQUEST`](/errors/BAD_REQUEST) — Bad Request - `500` [`INTERNAL_ERROR`](/errors/INTERNAL_ERROR) — Internal Server Error + * Applies user-provided name overrides to placeholder tokens in the decompilation. Requires write access to the analysis. **Error codes:** - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `400` [`BAD_REQUEST`](/errors/BAD_REQUEST) — Bad Request - `500` [`INTERNAL_ERROR`](/errors/INTERNAL_ERROR) — Internal Server Error * @param functionId Function ID (required) * @param upsertOverridesInputBody (required) * @return UpsertOverridesData @@ -3288,7 +3300,7 @@ public UpsertOverridesData v3UpsertAiDecompilationOverrides(@javax.annotation.No /** * Upsert variable/function name overrides - * Applies user-provided name overrides to placeholder tokens in the decompilation. **Error codes:** - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `400` [`BAD_REQUEST`](/errors/BAD_REQUEST) — Bad Request - `500` [`INTERNAL_ERROR`](/errors/INTERNAL_ERROR) — Internal Server Error + * Applies user-provided name overrides to placeholder tokens in the decompilation. Requires write access to the analysis. **Error codes:** - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `400` [`BAD_REQUEST`](/errors/BAD_REQUEST) — Bad Request - `500` [`INTERNAL_ERROR`](/errors/INTERNAL_ERROR) — Internal Server Error * @param functionId Function ID (required) * @param upsertOverridesInputBody (required) * @return ApiResponse<UpsertOverridesData> @@ -3313,7 +3325,7 @@ public ApiResponse v3UpsertAiDecompilationOverridesWithHttp /** * Upsert variable/function name overrides (asynchronously) - * Applies user-provided name overrides to placeholder tokens in the decompilation. **Error codes:** - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `400` [`BAD_REQUEST`](/errors/BAD_REQUEST) — Bad Request - `500` [`INTERNAL_ERROR`](/errors/INTERNAL_ERROR) — Internal Server Error + * Applies user-provided name overrides to placeholder tokens in the decompilation. Requires write access to the analysis. **Error codes:** - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `400` [`BAD_REQUEST`](/errors/BAD_REQUEST) — Bad Request - `500` [`INTERNAL_ERROR`](/errors/INTERNAL_ERROR) — Internal Server Error * @param functionId Function ID (required) * @param upsertOverridesInputBody (required) * @param _callback The callback to be executed when the API call finishes diff --git a/src/main/java/ai/reveng/api/FunctionsCoreApi.java b/src/main/java/ai/reveng/api/FunctionsCoreApi.java index 353b539..5f245a0 100644 --- a/src/main/java/ai/reveng/api/FunctionsCoreApi.java +++ b/src/main/java/ai/reveng/api/FunctionsCoreApi.java @@ -50,6 +50,7 @@ import ai.reveng.model.ImportedFunctionDetailOutputBody; import ai.reveng.model.IndirectCallSitesOutputBody; import ai.reveng.model.ListAnalysisFunctionsOutputBody; +import ai.reveng.model.ListFunctionGlobalsOutputBody; import ai.reveng.model.ListFunctionStringsOutputBody; import ai.reveng.model.ListImportedFunctionsOutputBody; import ai.reveng.model.SearchFunctionsOutputBody; @@ -3858,6 +3859,149 @@ public okhttp3.Call v3GetAnalysisFuncMapsAsync(@javax.annotation.Nonnull Long an localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } + /** + * Build call for v3ListFunctionGlobals + * @param functionId Function 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 v3ListFunctionGlobalsCall(@javax.annotation.Nonnull Long functionId, 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/functions/{function_id}/globals" + .replace("{" + "function_id" + "}", localVarApiClient.escapeString(functionId.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 v3ListFunctionGlobalsValidateBeforeCall(@javax.annotation.Nonnull Long functionId, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'functionId' is set + if (functionId == null) { + throw new ApiException("Missing the required parameter 'functionId' when calling v3ListFunctionGlobals(Async)"); + } + + return v3ListFunctionGlobalsCall(functionId, _callback); + + } + + /** + * List the global variables a function references. + * Returns the global variables referenced by the function, ordered by address. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied + * @param functionId Function ID (required) + * @return ListFunctionGlobalsOutputBody + * @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 ListFunctionGlobalsOutputBody v3ListFunctionGlobals(@javax.annotation.Nonnull Long functionId) throws ApiException { + ApiResponse localVarResp = v3ListFunctionGlobalsWithHttpInfo(functionId); + return localVarResp.getData(); + } + + /** + * List the global variables a function references. + * Returns the global variables referenced by the function, ordered by address. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied + * @param functionId Function ID (required) + * @return ApiResponse<ListFunctionGlobalsOutputBody> + * @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 v3ListFunctionGlobalsWithHttpInfo(@javax.annotation.Nonnull Long functionId) throws ApiException { + okhttp3.Call localVarCall = v3ListFunctionGlobalsValidateBeforeCall(functionId, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * List the global variables a function references. (asynchronously) + * Returns the global variables referenced by the function, ordered by address. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied + * @param functionId Function 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 v3ListFunctionGlobalsAsync(@javax.annotation.Nonnull Long functionId, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = v3ListFunctionGlobalsValidateBeforeCall(functionId, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } /** * Build call for v3SearchFunctions * @param partialName Partial or full function name to search for (optional) diff --git a/src/main/java/ai/reveng/api/FunctionsRenamingHistoryApi.java b/src/main/java/ai/reveng/api/FunctionsRenamingHistoryApi.java index dd36d2c..aaed5c3 100644 --- a/src/main/java/ai/reveng/api/FunctionsRenamingHistoryApi.java +++ b/src/main/java/ai/reveng/api/FunctionsRenamingHistoryApi.java @@ -295,7 +295,7 @@ private okhttp3.Call batchRenameFunctionsValidateBeforeCall(@javax.annotation.No /** * Batch rename functions - * Renames multiple functions in a single request. Records name changes in history. **Error codes:** - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `400` [`BAD_REQUEST`](/errors/BAD_REQUEST) — Bad Request + * Renames multiple functions in a single request. Records name changes in history. **Error codes:** - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `400` [`BAD_REQUEST`](/errors/BAD_REQUEST) — Bad Request - `422` [`VALIDATION_FAILED`](/errors/VALIDATION_FAILED) — Validation Failed * @param batchRenameInputBody (required) * @return BatchRenameOutputBody * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body @@ -317,7 +317,7 @@ public BatchRenameOutputBody batchRenameFunctions(@javax.annotation.Nonnull Batc /** * Batch rename functions - * Renames multiple functions in a single request. Records name changes in history. **Error codes:** - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `400` [`BAD_REQUEST`](/errors/BAD_REQUEST) — Bad Request + * Renames multiple functions in a single request. Records name changes in history. **Error codes:** - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `400` [`BAD_REQUEST`](/errors/BAD_REQUEST) — Bad Request - `422` [`VALIDATION_FAILED`](/errors/VALIDATION_FAILED) — Validation Failed * @param batchRenameInputBody (required) * @return ApiResponse<BatchRenameOutputBody> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body @@ -340,7 +340,7 @@ public ApiResponse batchRenameFunctionsWithHttpInfo(@java /** * Batch rename functions (asynchronously) - * Renames multiple functions in a single request. Records name changes in history. **Error codes:** - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `400` [`BAD_REQUEST`](/errors/BAD_REQUEST) — Bad Request + * Renames multiple functions in a single request. Records name changes in history. **Error codes:** - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `400` [`BAD_REQUEST`](/errors/BAD_REQUEST) — Bad Request - `422` [`VALIDATION_FAILED`](/errors/VALIDATION_FAILED) — Validation Failed * @param batchRenameInputBody (required) * @param _callback The callback to be executed when the API call finishes * @return The request call @@ -728,7 +728,7 @@ private okhttp3.Call renameFunctionValidateBeforeCall(@javax.annotation.Nonnull /** * Rename a function - * Renames a single function and records the change in history. `source_type` defaults to USER when omitted. **Error codes:** - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found + * Renames a single function and records the change in history. `source_type` defaults to USER when omitted. **Error codes:** - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `422` [`VALIDATION_FAILED`](/errors/VALIDATION_FAILED) — Validation Failed * @param functionId Function ID (required) * @param renameInputBody (required) * @return RenameOutputBody @@ -751,7 +751,7 @@ public RenameOutputBody renameFunction(@javax.annotation.Nonnull Long functionId /** * Rename a function - * Renames a single function and records the change in history. `source_type` defaults to USER when omitted. **Error codes:** - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found + * Renames a single function and records the change in history. `source_type` defaults to USER when omitted. **Error codes:** - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `422` [`VALIDATION_FAILED`](/errors/VALIDATION_FAILED) — Validation Failed * @param functionId Function ID (required) * @param renameInputBody (required) * @return ApiResponse<RenameOutputBody> @@ -775,7 +775,7 @@ public ApiResponse renameFunctionWithHttpInfo(@javax.annotatio /** * Rename a function (asynchronously) - * Renames a single function and records the change in history. `source_type` defaults to USER when omitted. **Error codes:** - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found + * Renames a single function and records the change in history. `source_type` defaults to USER when omitted. **Error codes:** - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `422` [`VALIDATION_FAILED`](/errors/VALIDATION_FAILED) — Validation Failed * @param functionId Function ID (required) * @param renameInputBody (required) * @param _callback The callback to be executed when the API call finishes diff --git a/src/main/java/ai/reveng/invoker/ApiClient.java b/src/main/java/ai/reveng/invoker/ApiClient.java index 7d9ccfa..c72cd47 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.72.2/java"); + setUserAgent("OpenAPI-Generator/4.73.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 a9ab5ea..d66d603 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.72.2"; + public static final String VERSION = "4.73.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 d55cbee..bfb2685 100644 --- a/src/main/java/ai/reveng/invoker/JSON.java +++ b/src/main/java/ai/reveng/invoker/JSON.java @@ -119,6 +119,26 @@ public Class getClassForElement(JsonEle return getClassByDiscriminator(classByDiscriminatorValue, getDiscriminatorValue(readElement, "evidence_kind")); } + }) + .registerTypeSelector(ai.reveng.model.ReportFindingEvidenceInner.class, new TypeSelector() { + @Override + public Class getClassForElement(JsonElement readElement) { + Map classByDiscriminatorValue = new HashMap(); + classByDiscriminatorValue.put("api_combination", ai.reveng.model.APICombinationEvidence.class); + classByDiscriminatorValue.put("call_chain", ai.reveng.model.CallChainEvidence.class); + classByDiscriminatorValue.put("decompiler_summary", ai.reveng.model.DecompilerSummaryEvidence.class); + classByDiscriminatorValue.put("disassembly_summary", ai.reveng.model.DisassemblySummaryEvidence.class); + classByDiscriminatorValue.put("function_similarity", ai.reveng.model.FunctionSimilarityEvidence.class); + classByDiscriminatorValue.put("hardcoded_secret", ai.reveng.model.HardcodedSecretEvidence.class); + classByDiscriminatorValue.put("imported_api_call", ai.reveng.model.ImportedAPICallEvidence.class); + 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("string_match", ai.reveng.model.StringMatchEvidence.class); + classByDiscriminatorValue.put("ReportFinding_evidence_inner", ai.reveng.model.ReportFindingEvidenceInner.class); + return getClassByDiscriminator(classByDiscriminatorValue, + getDiscriminatorValue(readElement, "evidence_kind")); + } }) .registerTypeSelector(ai.reveng.model.UpdateDataTypeEntry.class, new TypeSelector() { @Override @@ -174,6 +194,7 @@ private static Class getClassByDiscriminator(Map classByDiscriminatorValue, Stri gsonBuilder.registerTypeAdapter(OffsetDateTime.class, offsetDateTimeTypeAdapter); gsonBuilder.registerTypeAdapter(LocalDate.class, localDateTypeAdapter); gsonBuilder.registerTypeAdapter(byte[].class, byteArrayAdapter); + gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.APICombinationEvidence.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.APIError.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.AcceptTypeSuggestionsInputBody.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.AcceptTypeSuggestionsOutputBody.CustomTypeAdapterFactory()); @@ -212,6 +233,8 @@ private static Class getClassByDiscriminator(Map classByDiscriminatorValue, Stri gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.AnalysisLogEntry.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.AnalysisLogMessage.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.AnalysisLogs.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.AnalysisOperationBody.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.AnalysisOperationsOutputBody.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.AnalysisRecord.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.AnalysisRecordBody.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.AnalysisReport.CustomTypeAdapterFactory()); @@ -439,12 +462,15 @@ private static Class getClassByDiscriminator(Map classByDiscriminatorValue, Stri gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.DecompilerSummaryEvidence.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.DieMatch.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.DisassemblyOutputBody.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.DisassemblySummaryEvidence.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.DnsQuery.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.DrakvufFileMetadata.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.DynamicExecutionMetadata.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.DynamicExecutionResult.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.DynamicExecutionStatusResponse.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.DynamicExecutionSummary.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.DynamicExecutionSummaryMetadata.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.DynamicExecutionSummaryResult.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.ELFImportModel.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.ELFModel.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.ELFRelocation.CustomTypeAdapterFactory()); @@ -527,6 +553,7 @@ private static Class getClassByDiscriminator(Map classByDiscriminatorValue, Stri gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.FunctionCapabilityResponse.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.FunctionDataType.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.FunctionDetailsOutputBody.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.FunctionGlobalVariable.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.FunctionListItem.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.FunctionLocalVariableResponse.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.FunctionMapping.CustomTypeAdapterFactory()); @@ -547,6 +574,7 @@ private static Class getClassByDiscriminator(Map classByDiscriminatorValue, Stri gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.FunctionStringItem.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.FunctionStringsResponse.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.FunctionTypeDefinition.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.FunctionUsage.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.FunctionsDetailResponse.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.FunctionsListRename.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.FunctionsProgressOutputBody.CustomTypeAdapterFactory()); @@ -564,6 +592,7 @@ private static Class getClassByDiscriminator(Map classByDiscriminatorValue, Stri gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.GetDieInfoOutputBody.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.GetFunctionMapsOutputBody.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.GetFunctionSignatureHistoryBody.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.GetGlobalHistoryOutputBody.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.GetMatchesOutputBody.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.GetMatchesStatusOutputBody.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.GetModelsOutputBody.CustomTypeAdapterFactory()); @@ -575,6 +604,8 @@ private static Class getClassByDiscriminator(Map classByDiscriminatorValue, Stri gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.GetSubscriptionOutputBody.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.GetTokensResponse.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.GetUserActivityOutputBody.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.GlobalHistoryEntry.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.GlobalVariable.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.HardcodedSecretEvidence.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.HistoryActor.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.HistoryEntry.CustomTypeAdapterFactory()); @@ -583,6 +614,7 @@ private static Class getClassByDiscriminator(Map classByDiscriminatorValue, Stri 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.ImportedAPICallEvidence.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.ImportedApi.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.ImportedApiCall.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.ImportedApiCallEvidence.CustomTypeAdapterFactory()); @@ -601,15 +633,20 @@ private static Class getClassByDiscriminator(Map classByDiscriminatorValue, Stri gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.ListAnalysesOutputBody.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.ListAnalysisDataTypesOutputBody.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.ListAnalysisFunctionsOutputBody.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.ListAnalysisGlobalsOutputBody.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.ListAnalysisStringsOutputBody.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.ListArchiveContentsOutputBody.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.ListCollectionResults.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.ListCollectionsOutputBody.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.ListDataTypeFunctionsBody.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.ListExampleAnalysesOutputBody.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.ListFunctionGlobalsOutputBody.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.ListFunctionSignaturesOutputBody.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.ListFunctionStringsOutputBody.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.ListGlobalFunctionsOutputBody.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.ListImportedFunctionsOutputBody.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.ListOperationPrerequisitesOutputBody.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.ListPublicUsersOutputBody.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.ListSecretStoreOutputBody.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.ListTeamsOutputBody.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.ListUsersOutputBody.CustomTypeAdapterFactory()); @@ -661,6 +698,8 @@ private static Class getClassByDiscriminator(Map classByDiscriminatorValue, Stri gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.OperationMetadataTriageResult.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.OperationNetworkingExplainMetadataNetworkingExplainResult.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.OperationNetworkingScanMetadataNetworkingScanResult.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.OperationPrerequisitesBody.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.OperationRenameUnnamedFunctionsMetadataRenameUnnamedFunctionsResult.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.OperationSecurityScanMetadataSecurityScanResult.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.OperationVirusTotalScanMetadataVirusTotalScanResult.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.OperationWorkflowProgressResultBody.CustomTypeAdapterFactory()); @@ -695,6 +734,7 @@ private static Class getClassByDiscriminator(Map classByDiscriminatorValue, Stri gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.ProgressMessage.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.ProseEvent.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.ProtocolsAgentResponse.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.PublicUserBody.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.PutAnalysisStringsRequest.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.QueuedWorkflowTaskResponse.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.RatingOutputBody.CustomTypeAdapterFactory()); @@ -714,15 +754,30 @@ private static Class getClassByDiscriminator(Map classByDiscriminatorValue, Stri gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.RenameAppliedEvent.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.RenameInputBody.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.RenameOutputBody.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.RenameUnnamedFunctionsMetadata.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.RenameUnnamedFunctionsResult.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.RenderedToken.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.ReportAnalysisBody.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.ReportAnalysisResponse.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.ReportBytesConstant.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.ReportCallChain.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.ReportCodeSummary.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.ReportEvent.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.ReportFinding.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.ReportFindingEvidenceInner.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.ReportFunctionSimilarity.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.ReportImportedAPI.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.ReportImportedAPICall.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.ReportInfo.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.ReportMeta.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.ReportModelInterpretation.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.ReportOptions.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.ReportReferencedConstant.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.ReportResult.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.ReportStringMatch.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.ReportSubject.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.RequestedConfigBody.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.RequeueAnalysisRequest.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.ResendVerificationEmailInputBody.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.ResolvedEntity.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.ResultBody.CustomTypeAdapterFactory()); @@ -850,6 +905,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.UpdateAnalysisGlobalInputBody.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()); diff --git a/src/main/java/ai/reveng/model/APICombinationEvidence.java b/src/main/java/ai/reveng/model/APICombinationEvidence.java new file mode 100644 index 0000000..228b049 --- /dev/null +++ b/src/main/java/ai/reveng/model/APICombinationEvidence.java @@ -0,0 +1,637 @@ +/* + * 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.ReportImportedAPI; +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; + +/** + * APICombinationEvidence + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class APICombinationEvidence { + public static final String SERIALIZED_NAME_APIS = "apis"; + @SerializedName(SERIALIZED_NAME_APIS) + @javax.annotation.Nonnull + private List apis = new ArrayList<>(); + + /** + * Whether the evidence supports or refutes the finding. + */ + @JsonAdapter(EffectEnum.Adapter.class) + public enum EffectEnum { + SUPPORTS("supports"), + + REFUTES("refutes"), + + UNKNOWN_DEFAULT_OPEN_API("unknown_default_open_api"); + + private String value; + + EffectEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static EffectEnum fromValue(String value) { + for (EffectEnum b : EffectEnum.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 EffectEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public EffectEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return EffectEnum.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + EffectEnum.fromValue(value); + } + } + + public static final String SERIALIZED_NAME_EFFECT = "effect"; + @SerializedName(SERIALIZED_NAME_EFFECT) + @javax.annotation.Nonnull + private EffectEnum effect; + + /** + * Kind of evidence. + */ + @JsonAdapter(EvidenceKindEnum.Adapter.class) + public enum EvidenceKindEnum { + API_COMBINATION("api_combination"), + + UNKNOWN_DEFAULT_OPEN_API("unknown_default_open_api"); + + private String value; + + EvidenceKindEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static EvidenceKindEnum fromValue(String value) { + for (EvidenceKindEnum b : EvidenceKindEnum.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 EvidenceKindEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public EvidenceKindEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return EvidenceKindEnum.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + EvidenceKindEnum.fromValue(value); + } + } + + public static final String SERIALIZED_NAME_EVIDENCE_KIND = "evidence_kind"; + @SerializedName(SERIALIZED_NAME_EVIDENCE_KIND) + @javax.annotation.Nonnull + private EvidenceKindEnum evidenceKind; + + /** + * How the evidence was derived. + */ + @JsonAdapter(KindEnum.Adapter.class) + public enum KindEnum { + DETERMINISTIC_DERIVATION("deterministic_derivation"), + + UNKNOWN_DEFAULT_OPEN_API("unknown_default_open_api"); + + private String value; + + KindEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static KindEnum fromValue(String value) { + for (KindEnum b : KindEnum.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 KindEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public KindEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return KindEnum.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + KindEnum.fromValue(value); + } + } + + public static final String SERIALIZED_NAME_KIND = "kind"; + @SerializedName(SERIALIZED_NAME_KIND) + @javax.annotation.Nonnull + private KindEnum kind; + + /** + * How directly the evidence bears on the finding. + */ + @JsonAdapter(StrengthEnum.Adapter.class) + public enum StrengthEnum { + INDIRECT("indirect"), + + UNKNOWN_DEFAULT_OPEN_API("unknown_default_open_api"); + + private String value; + + StrengthEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static StrengthEnum fromValue(String value) { + for (StrengthEnum b : StrengthEnum.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 StrengthEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public StrengthEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return StrengthEnum.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + StrengthEnum.fromValue(value); + } + } + + public static final String SERIALIZED_NAME_STRENGTH = "strength"; + @SerializedName(SERIALIZED_NAME_STRENGTH) + @javax.annotation.Nonnull + private StrengthEnum strength; + + public APICombinationEvidence() { + } + + public APICombinationEvidence apis(@javax.annotation.Nonnull List apis) { + this.apis = apis; + return this; + } + + public APICombinationEvidence addApisItem(ReportImportedAPI apisItem) { + if (this.apis == null) { + this.apis = new ArrayList<>(); + } + this.apis.add(apisItem); + return this; + } + + /** + * The APIs in the combination. + * @return apis + */ + @javax.annotation.Nonnull + public List getApis() { + return apis; + } + + public void setApis(@javax.annotation.Nonnull List apis) { + this.apis = apis; + } + + + public APICombinationEvidence effect(@javax.annotation.Nonnull EffectEnum effect) { + this.effect = effect; + return this; + } + + /** + * Whether the evidence supports or refutes the finding. + * @return effect + */ + @javax.annotation.Nonnull + public EffectEnum getEffect() { + return effect; + } + + public void setEffect(@javax.annotation.Nonnull EffectEnum effect) { + this.effect = effect; + } + + + public APICombinationEvidence evidenceKind(@javax.annotation.Nonnull EvidenceKindEnum evidenceKind) { + this.evidenceKind = evidenceKind; + return this; + } + + /** + * Kind of evidence. + * @return evidenceKind + */ + @javax.annotation.Nonnull + public EvidenceKindEnum getEvidenceKind() { + return evidenceKind; + } + + public void setEvidenceKind(@javax.annotation.Nonnull EvidenceKindEnum evidenceKind) { + this.evidenceKind = evidenceKind; + } + + + public APICombinationEvidence kind(@javax.annotation.Nonnull KindEnum kind) { + this.kind = kind; + return this; + } + + /** + * How the evidence was derived. + * @return kind + */ + @javax.annotation.Nonnull + public KindEnum getKind() { + return kind; + } + + public void setKind(@javax.annotation.Nonnull KindEnum kind) { + this.kind = kind; + } + + + public APICombinationEvidence strength(@javax.annotation.Nonnull StrengthEnum strength) { + this.strength = strength; + return this; + } + + /** + * How directly the evidence bears on the finding. + * @return strength + */ + @javax.annotation.Nonnull + public StrengthEnum getStrength() { + return strength; + } + + public void setStrength(@javax.annotation.Nonnull StrengthEnum strength) { + this.strength = strength; + } + + /** + * 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 APICombinationEvidence instance itself + */ + public APICombinationEvidence 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; + } + APICombinationEvidence apICombinationEvidence = (APICombinationEvidence) o; + return Objects.equals(this.apis, apICombinationEvidence.apis) && + Objects.equals(this.effect, apICombinationEvidence.effect) && + Objects.equals(this.evidenceKind, apICombinationEvidence.evidenceKind) && + Objects.equals(this.kind, apICombinationEvidence.kind) && + Objects.equals(this.strength, apICombinationEvidence.strength)&& + Objects.equals(this.additionalProperties, apICombinationEvidence.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(apis, effect, evidenceKind, kind, strength, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class APICombinationEvidence {\n"); + sb.append(" apis: ").append(toIndentedString(apis)).append("\n"); + sb.append(" effect: ").append(toIndentedString(effect)).append("\n"); + sb.append(" evidenceKind: ").append(toIndentedString(evidenceKind)).append("\n"); + sb.append(" kind: ").append(toIndentedString(kind)).append("\n"); + sb.append(" strength: ").append(toIndentedString(strength)).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("apis", "effect", "evidence_kind", "kind", "strength")); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(Arrays.asList("apis", "effect", "evidence_kind", "kind", "strength")); + } + + /** + * 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 APICombinationEvidence + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!APICombinationEvidence.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 APICombinationEvidence is not found in the empty JSON string", APICombinationEvidence.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : APICombinationEvidence.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("apis") == null) { + throw new IllegalArgumentException("Expected the field `linkedContent` to be an array in the JSON string but got `null`"); + } else if (!jsonObj.get("apis").isJsonArray()) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `apis` to be an array in the JSON string but got `%s`", jsonObj.get("apis").toString())); + } + if (!jsonObj.get("effect").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `effect` to be a primitive type in the JSON string but got `%s`", jsonObj.get("effect").toString())); + } + // validate the required field `effect` + EffectEnum.validateJsonElement(jsonObj.get("effect")); + if (!jsonObj.get("evidence_kind").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `evidence_kind` to be a primitive type in the JSON string but got `%s`", jsonObj.get("evidence_kind").toString())); + } + // validate the required field `evidence_kind` + EvidenceKindEnum.validateJsonElement(jsonObj.get("evidence_kind")); + if (!jsonObj.get("kind").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `kind` to be a primitive type in the JSON string but got `%s`", jsonObj.get("kind").toString())); + } + // validate the required field `kind` + KindEnum.validateJsonElement(jsonObj.get("kind")); + if (!jsonObj.get("strength").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `strength` to be a primitive type in the JSON string but got `%s`", jsonObj.get("strength").toString())); + } + // validate the required field `strength` + StrengthEnum.validateJsonElement(jsonObj.get("strength")); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!APICombinationEvidence.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'APICombinationEvidence' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(APICombinationEvidence.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, APICombinationEvidence 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 APICombinationEvidence read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + APICombinationEvidence 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 APICombinationEvidence given an JSON string + * + * @param jsonString JSON string + * @return An instance of APICombinationEvidence + * @throws IOException if the JSON string is invalid with respect to APICombinationEvidence + */ + public static APICombinationEvidence fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, APICombinationEvidence.class); + } + + /** + * Convert an instance of APICombinationEvidence to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/ai/reveng/model/AnalysisBasicInfoOutputBody.java b/src/main/java/ai/reveng/model/AnalysisBasicInfoOutputBody.java index 67a5e21..3ae3ed4 100644 --- a/src/main/java/ai/reveng/model/AnalysisBasicInfoOutputBody.java +++ b/src/main/java/ai/reveng/model/AnalysisBasicInfoOutputBody.java @@ -161,6 +161,11 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti @javax.annotation.Nonnull private String detectedBinaryType; + public static final String SERIALIZED_NAME_DETECTED_LANGUAGE = "detected_language"; + @SerializedName(SERIALIZED_NAME_DETECTED_LANGUAGE) + @javax.annotation.Nonnull + private String detectedLanguage; + public static final String SERIALIZED_NAME_FUNCTION_COUNT = "function_count"; @SerializedName(SERIALIZED_NAME_FUNCTION_COUNT) @javax.annotation.Nonnull @@ -443,6 +448,25 @@ public void setDetectedBinaryType(@javax.annotation.Nonnull String detectedBinar } + public AnalysisBasicInfoOutputBody detectedLanguage(@javax.annotation.Nonnull String detectedLanguage) { + this.detectedLanguage = detectedLanguage; + return this; + } + + /** + * Detected source language; empty when unavailable + * @return detectedLanguage + */ + @javax.annotation.Nonnull + public String getDetectedLanguage() { + return detectedLanguage; + } + + public void setDetectedLanguage(@javax.annotation.Nonnull String detectedLanguage) { + this.detectedLanguage = detectedLanguage; + } + + public AnalysisBasicInfoOutputBody functionCount(@javax.annotation.Nonnull Long functionCount) { this.functionCount = functionCount; return this; @@ -774,6 +798,7 @@ public boolean equals(Object o) { Objects.equals(this.detectedArchitecture, analysisBasicInfoOutputBody.detectedArchitecture) && Objects.equals(this.detectedBinaryFormat, analysisBasicInfoOutputBody.detectedBinaryFormat) && Objects.equals(this.detectedBinaryType, analysisBasicInfoOutputBody.detectedBinaryType) && + Objects.equals(this.detectedLanguage, analysisBasicInfoOutputBody.detectedLanguage) && Objects.equals(this.functionCount, analysisBasicInfoOutputBody.functionCount) && Objects.equals(this.isAdvanced, analysisBasicInfoOutputBody.isAdvanced) && Objects.equals(this.isOwner, analysisBasicInfoOutputBody.isOwner) && @@ -793,7 +818,7 @@ public boolean equals(Object o) { @Override public int hashCode() { - return Objects.hash(analysisScope, baseAddress, binaryId, binaryName, binarySize, binaryUuid, creation, debug, detectedArchitecture, detectedBinaryFormat, detectedBinaryType, functionCount, isAdvanced, isOwner, isSystem, modelId, modelName, modelUpgradeAvailable, ownerUsername, sequencerVersion, sha256Hash, suppliedArchitecture, suppliedBinaryFormat, suppliedBinaryType, teamId, additionalProperties); + return Objects.hash(analysisScope, baseAddress, binaryId, binaryName, binarySize, binaryUuid, creation, debug, detectedArchitecture, detectedBinaryFormat, detectedBinaryType, detectedLanguage, functionCount, isAdvanced, isOwner, isSystem, modelId, modelName, modelUpgradeAvailable, ownerUsername, sequencerVersion, sha256Hash, suppliedArchitecture, suppliedBinaryFormat, suppliedBinaryType, teamId, additionalProperties); } @Override @@ -811,6 +836,7 @@ public String toString() { sb.append(" detectedArchitecture: ").append(toIndentedString(detectedArchitecture)).append("\n"); sb.append(" detectedBinaryFormat: ").append(toIndentedString(detectedBinaryFormat)).append("\n"); sb.append(" detectedBinaryType: ").append(toIndentedString(detectedBinaryType)).append("\n"); + sb.append(" detectedLanguage: ").append(toIndentedString(detectedLanguage)).append("\n"); sb.append(" functionCount: ").append(toIndentedString(functionCount)).append("\n"); sb.append(" isAdvanced: ").append(toIndentedString(isAdvanced)).append("\n"); sb.append(" isOwner: ").append(toIndentedString(isOwner)).append("\n"); @@ -844,10 +870,10 @@ private String toIndentedString(Object o) { static { // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(Arrays.asList("analysis_scope", "base_address", "binary_id", "binary_name", "binary_size", "binary_uuid", "creation", "debug", "detected_architecture", "detected_binary_format", "detected_binary_type", "function_count", "is_advanced", "is_owner", "is_system", "model_id", "model_name", "model_upgrade_available", "owner_username", "sequencer_version", "sha_256_hash", "supplied_architecture", "supplied_binary_format", "supplied_binary_type", "team_id")); + openapiFields = new HashSet(Arrays.asList("analysis_scope", "base_address", "binary_id", "binary_name", "binary_size", "binary_uuid", "creation", "debug", "detected_architecture", "detected_binary_format", "detected_binary_type", "detected_language", "function_count", "is_advanced", "is_owner", "is_system", "model_id", "model_name", "model_upgrade_available", "owner_username", "sequencer_version", "sha_256_hash", "supplied_architecture", "supplied_binary_format", "supplied_binary_type", "team_id")); // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(Arrays.asList("analysis_scope", "base_address", "binary_id", "binary_name", "binary_size", "binary_uuid", "creation", "debug", "detected_architecture", "detected_binary_format", "detected_binary_type", "function_count", "is_advanced", "is_owner", "is_system", "model_id", "model_name", "model_upgrade_available", "owner_username", "sha_256_hash", "supplied_architecture", "supplied_binary_format", "supplied_binary_type", "team_id")); + openapiRequiredFields = new HashSet(Arrays.asList("analysis_scope", "base_address", "binary_id", "binary_name", "binary_size", "binary_uuid", "creation", "debug", "detected_architecture", "detected_binary_format", "detected_binary_type", "detected_language", "function_count", "is_advanced", "is_owner", "is_system", "model_id", "model_name", "model_upgrade_available", "owner_username", "sha_256_hash", "supplied_architecture", "supplied_binary_format", "supplied_binary_type", "team_id")); } /** @@ -890,6 +916,9 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti 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("detected_language").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `detected_language` to be a primitive type in the JSON string but got `%s`", jsonObj.get("detected_language").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())); } diff --git a/src/main/java/ai/reveng/model/AnalysisDetailOutputBody.java b/src/main/java/ai/reveng/model/AnalysisDetailOutputBody.java index 3d633bc..f7e9ed3 100644 --- a/src/main/java/ai/reveng/model/AnalysisDetailOutputBody.java +++ b/src/main/java/ai/reveng/model/AnalysisDetailOutputBody.java @@ -158,6 +158,11 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti @javax.annotation.Nonnull private String binaryType; + public static final String SERIALIZED_NAME_CAPABILITY_COUNT = "capability_count"; + @SerializedName(SERIALIZED_NAME_CAPABILITY_COUNT) + @javax.annotation.Nullable + private Long capabilityCount; + public static final String SERIALIZED_NAME_CREATION = "creation"; @SerializedName(SERIALIZED_NAME_CREATION) @javax.annotation.Nonnull @@ -183,11 +188,21 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti @javax.annotation.Nonnull private RequestedConfigBody requestedConfig; + public static final String SERIALIZED_NAME_SECURITY_FINDING_COUNT = "security_finding_count"; + @SerializedName(SERIALIZED_NAME_SECURITY_FINDING_COUNT) + @javax.annotation.Nullable + private Long securityFindingCount; + 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_THREAT_SCORE = "threat_score"; + @SerializedName(SERIALIZED_NAME_THREAT_SCORE) + @javax.annotation.Nullable + private Double threatScore; + public AnalysisDetailOutputBody() { } @@ -381,6 +396,26 @@ public void setBinaryType(@javax.annotation.Nonnull String binaryType) { } + public AnalysisDetailOutputBody capabilityCount(@javax.annotation.Nullable Long capabilityCount) { + this.capabilityCount = capabilityCount; + return this; + } + + /** + * Number of capabilities in the latest capabilities agent result. Null when the agent has not produced a result + * minimum: 0 + * @return capabilityCount + */ + @javax.annotation.Nullable + public Long getCapabilityCount() { + return capabilityCount; + } + + public void setCapabilityCount(@javax.annotation.Nullable Long capabilityCount) { + this.capabilityCount = capabilityCount; + } + + public AnalysisDetailOutputBody creation(@javax.annotation.Nonnull String creation) { this.creation = creation; return this; @@ -476,6 +511,26 @@ public void setRequestedConfig(@javax.annotation.Nonnull RequestedConfigBody req } + public AnalysisDetailOutputBody securityFindingCount(@javax.annotation.Nullable Long securityFindingCount) { + this.securityFindingCount = securityFindingCount; + return this; + } + + /** + * Number of HIGH or CRITICAL findings in the latest security scan. Null when the scan has not produced a result + * minimum: 0 + * @return securityFindingCount + */ + @javax.annotation.Nullable + public Long getSecurityFindingCount() { + return securityFindingCount; + } + + public void setSecurityFindingCount(@javax.annotation.Nullable Long securityFindingCount) { + this.securityFindingCount = securityFindingCount; + } + + public AnalysisDetailOutputBody sha256Hash(@javax.annotation.Nonnull String sha256Hash) { this.sha256Hash = sha256Hash; return this; @@ -494,6 +549,27 @@ public void setSha256Hash(@javax.annotation.Nonnull String sha256Hash) { this.sha256Hash = sha256Hash; } + + public AnalysisDetailOutputBody threatScore(@javax.annotation.Nullable Double threatScore) { + this.threatScore = threatScore; + return this; + } + + /** + * Software threat score from the latest triage result, from 0 to 1. Null when triage has not produced a result + * minimum: 0 + * maximum: 1 + * @return threatScore + */ + @javax.annotation.Nullable + public Double getThreatScore() { + return threatScore; + } + + public void setThreatScore(@javax.annotation.Nullable Double threatScore) { + this.threatScore = threatScore; + } + /** * A container for additional, undeclared properties. * This is a holder for any undeclared properties as specified with @@ -559,18 +635,21 @@ public boolean equals(Object o) { Objects.equals(this.binaryName, analysisDetailOutputBody.binaryName) && Objects.equals(this.binarySize, analysisDetailOutputBody.binarySize) && Objects.equals(this.binaryType, analysisDetailOutputBody.binaryType) && + Objects.equals(this.capabilityCount, analysisDetailOutputBody.capabilityCount) && 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.securityFindingCount, analysisDetailOutputBody.securityFindingCount) && + Objects.equals(this.sha256Hash, analysisDetailOutputBody.sha256Hash) && + Objects.equals(this.threatScore, analysisDetailOutputBody.threatScore)&& 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); + return Objects.hash(access, analysisId, analysisScope, architecture, autoRunAgents, binaryDynamic, binaryFormat, binaryName, binarySize, binaryType, capabilityCount, creation, dashboardUrl, debug, modelName, requestedConfig, securityFindingCount, sha256Hash, threatScore, additionalProperties); } @Override @@ -587,12 +666,15 @@ public String toString() { 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(" capabilityCount: ").append(toIndentedString(capabilityCount)).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(" securityFindingCount: ").append(toIndentedString(securityFindingCount)).append("\n"); sb.append(" sha256Hash: ").append(toIndentedString(sha256Hash)).append("\n"); + sb.append(" threatScore: ").append(toIndentedString(threatScore)).append("\n"); sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); sb.append("}"); return sb.toString(); @@ -612,10 +694,10 @@ private String toIndentedString(Object o) { 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")); + openapiFields = new HashSet(Arrays.asList("access", "analysis_id", "analysis_scope", "architecture", "auto_run_agents", "binary_dynamic", "binary_format", "binary_name", "binary_size", "binary_type", "capability_count", "creation", "dashboard_url", "debug", "model_name", "requested_config", "security_finding_count", "sha_256_hash", "threat_score")); // 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")); + openapiRequiredFields = new HashSet(Arrays.asList("access", "analysis_id", "analysis_scope", "architecture", "auto_run_agents", "binary_dynamic", "binary_format", "binary_name", "binary_size", "binary_type", "capability_count", "creation", "dashboard_url", "debug", "model_name", "requested_config", "security_finding_count", "sha_256_hash", "threat_score")); } /** diff --git a/src/main/java/ai/reveng/model/AnalysisOperationBody.java b/src/main/java/ai/reveng/model/AnalysisOperationBody.java new file mode 100644 index 0000000..a75f59c --- /dev/null +++ b/src/main/java/ai/reveng/model/AnalysisOperationBody.java @@ -0,0 +1,409 @@ +/* + * 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; + +/** + * AnalysisOperationBody + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class AnalysisOperationBody { + public static final String SERIALIZED_NAME_NAME = "name"; + @SerializedName(SERIALIZED_NAME_NAME) + @javax.annotation.Nonnull + private String name; + + public static final String SERIALIZED_NAME_OPERATION = "operation"; + @SerializedName(SERIALIZED_NAME_OPERATION) + @javax.annotation.Nonnull + private String operation; + + /** + * Status of the operation's latest run + */ + @JsonAdapter(StatusEnum.Adapter.class) + public enum StatusEnum { + UNINITIALISED("UNINITIALISED"), + + PENDING("PENDING"), + + RUNNING("RUNNING"), + + COMPLETED("COMPLETED"), + + FAILED("FAILED"), + + UNKNOWN_DEFAULT_OPEN_API("unknown_default_open_api"); + + private String value; + + StatusEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static StatusEnum fromValue(String value) { + for (StatusEnum b : StatusEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + return UNKNOWN_DEFAULT_OPEN_API; + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final StatusEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public StatusEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return StatusEnum.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + StatusEnum.fromValue(value); + } + } + + public static final String SERIALIZED_NAME_STATUS = "status"; + @SerializedName(SERIALIZED_NAME_STATUS) + @javax.annotation.Nonnull + private StatusEnum status; + + public AnalysisOperationBody() { + } + + public AnalysisOperationBody name(@javax.annotation.Nonnull String name) { + this.name = name; + return this; + } + + /** + * Resource name of the operation, polled at /v3/{name} + * @return name + */ + @javax.annotation.Nonnull + public String getName() { + return name; + } + + public void setName(@javax.annotation.Nonnull String name) { + this.name = name; + } + + + public AnalysisOperationBody operation(@javax.annotation.Nonnull String operation) { + this.operation = operation; + return this; + } + + /** + * Operation slug, the collection the operation is polled under + * @return operation + */ + @javax.annotation.Nonnull + public String getOperation() { + return operation; + } + + public void setOperation(@javax.annotation.Nonnull String operation) { + this.operation = operation; + } + + + public AnalysisOperationBody status(@javax.annotation.Nonnull StatusEnum status) { + this.status = status; + return this; + } + + /** + * Status of the operation's latest run + * @return status + */ + @javax.annotation.Nonnull + public StatusEnum getStatus() { + return status; + } + + public void setStatus(@javax.annotation.Nonnull StatusEnum status) { + this.status = status; + } + + /** + * 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 AnalysisOperationBody instance itself + */ + public AnalysisOperationBody 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; + } + AnalysisOperationBody analysisOperationBody = (AnalysisOperationBody) o; + return Objects.equals(this.name, analysisOperationBody.name) && + Objects.equals(this.operation, analysisOperationBody.operation) && + Objects.equals(this.status, analysisOperationBody.status)&& + Objects.equals(this.additionalProperties, analysisOperationBody.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(name, operation, status, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AnalysisOperationBody {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" operation: ").append(toIndentedString(operation)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).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("name", "operation", "status")); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(Arrays.asList("name", "operation", "status")); + } + + /** + * 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 AnalysisOperationBody + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!AnalysisOperationBody.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 AnalysisOperationBody is not found in the empty JSON string", AnalysisOperationBody.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : AnalysisOperationBody.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())); + } + if (!jsonObj.get("operation").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `operation` to be a primitive type in the JSON string but got `%s`", jsonObj.get("operation").toString())); + } + if (!jsonObj.get("status").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `status` to be a primitive type in the JSON string but got `%s`", jsonObj.get("status").toString())); + } + // validate the required field `status` + StatusEnum.validateJsonElement(jsonObj.get("status")); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!AnalysisOperationBody.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'AnalysisOperationBody' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(AnalysisOperationBody.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, AnalysisOperationBody 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 AnalysisOperationBody read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + AnalysisOperationBody 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 AnalysisOperationBody given an JSON string + * + * @param jsonString JSON string + * @return An instance of AnalysisOperationBody + * @throws IOException if the JSON string is invalid with respect to AnalysisOperationBody + */ + public static AnalysisOperationBody fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, AnalysisOperationBody.class); + } + + /** + * Convert an instance of AnalysisOperationBody to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/ai/reveng/model/AnalysisOperationsOutputBody.java b/src/main/java/ai/reveng/model/AnalysisOperationsOutputBody.java new file mode 100644 index 0000000..c56b88d --- /dev/null +++ b/src/main/java/ai/reveng/model/AnalysisOperationsOutputBody.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.AnalysisOperationBody; +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; + +/** + * AnalysisOperationsOutputBody + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class AnalysisOperationsOutputBody { + public static final String SERIALIZED_NAME_OPERATIONS = "operations"; + @SerializedName(SERIALIZED_NAME_OPERATIONS) + @javax.annotation.Nonnull + private List operations = new ArrayList<>(); + + public AnalysisOperationsOutputBody() { + } + + public AnalysisOperationsOutputBody operations(@javax.annotation.Nonnull List operations) { + this.operations = operations; + return this; + } + + public AnalysisOperationsOutputBody addOperationsItem(AnalysisOperationBody operationsItem) { + if (this.operations == null) { + this.operations = new ArrayList<>(); + } + this.operations.add(operationsItem); + return this; + } + + /** + * The analysis' static-analysis operation, followed by the latest run of each other operation started on its binary. Operations that have never run are omitted + * @return operations + */ + @javax.annotation.Nonnull + public List getOperations() { + return operations; + } + + public void setOperations(@javax.annotation.Nonnull List operations) { + this.operations = operations; + } + + /** + * 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 AnalysisOperationsOutputBody instance itself + */ + public AnalysisOperationsOutputBody 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; + } + AnalysisOperationsOutputBody analysisOperationsOutputBody = (AnalysisOperationsOutputBody) o; + return Objects.equals(this.operations, analysisOperationsOutputBody.operations)&& + Objects.equals(this.additionalProperties, analysisOperationsOutputBody.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(operations, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AnalysisOperationsOutputBody {\n"); + sb.append(" operations: ").append(toIndentedString(operations)).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("operations")); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(Arrays.asList("operations")); + } + + /** + * 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 AnalysisOperationsOutputBody + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!AnalysisOperationsOutputBody.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 AnalysisOperationsOutputBody is not found in the empty JSON string", AnalysisOperationsOutputBody.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : AnalysisOperationsOutputBody.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("operations") == null) { + throw new IllegalArgumentException("Expected the field `linkedContent` to be an array in the JSON string but got `null`"); + } else if (!jsonObj.get("operations").isJsonArray()) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `operations` to be an array in the JSON string but got `%s`", jsonObj.get("operations").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!AnalysisOperationsOutputBody.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'AnalysisOperationsOutputBody' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(AnalysisOperationsOutputBody.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, AnalysisOperationsOutputBody 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 AnalysisOperationsOutputBody read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + AnalysisOperationsOutputBody 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 AnalysisOperationsOutputBody given an JSON string + * + * @param jsonString JSON string + * @return An instance of AnalysisOperationsOutputBody + * @throws IOException if the JSON string is invalid with respect to AnalysisOperationsOutputBody + */ + public static AnalysisOperationsOutputBody fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, AnalysisOperationsOutputBody.class); + } + + /** + * Convert an instance of AnalysisOperationsOutputBody to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/ai/reveng/model/AnalysisRecordBody.java b/src/main/java/ai/reveng/model/AnalysisRecordBody.java index 3ce78fc..60a6cb1 100644 --- a/src/main/java/ai/reveng/model/AnalysisRecordBody.java +++ b/src/main/java/ai/reveng/model/AnalysisRecordBody.java @@ -159,6 +159,11 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti @javax.annotation.Nonnull private String detectedBinaryType; + public static final String SERIALIZED_NAME_DETECTED_LANGUAGE = "detected_language"; + @SerializedName(SERIALIZED_NAME_DETECTED_LANGUAGE) + @javax.annotation.Nonnull + private String detectedLanguage; + public static final String SERIALIZED_NAME_FUNCTION_BOUNDARIES_HASH = "function_boundaries_hash"; @SerializedName(SERIALIZED_NAME_FUNCTION_BOUNDARIES_HASH) @javax.annotation.Nonnull @@ -412,6 +417,25 @@ public void setDetectedBinaryType(@javax.annotation.Nonnull String detectedBinar } + public AnalysisRecordBody detectedLanguage(@javax.annotation.Nonnull String detectedLanguage) { + this.detectedLanguage = detectedLanguage; + return this; + } + + /** + * Detected source language; empty when unavailable + * @return detectedLanguage + */ + @javax.annotation.Nonnull + public String getDetectedLanguage() { + return detectedLanguage; + } + + public void setDetectedLanguage(@javax.annotation.Nonnull String detectedLanguage) { + this.detectedLanguage = detectedLanguage; + } + + public AnalysisRecordBody functionBoundariesHash(@javax.annotation.Nonnull String functionBoundariesHash) { this.functionBoundariesHash = functionBoundariesHash; return this; @@ -712,6 +736,7 @@ public boolean equals(Object o) { Objects.equals(this.detectedArchitecture, analysisRecordBody.detectedArchitecture) && Objects.equals(this.detectedBinaryFormat, analysisRecordBody.detectedBinaryFormat) && Objects.equals(this.detectedBinaryType, analysisRecordBody.detectedBinaryType) && + Objects.equals(this.detectedLanguage, analysisRecordBody.detectedLanguage) && Objects.equals(this.functionBoundariesHash, analysisRecordBody.functionBoundariesHash) && Objects.equals(this.isOwner, analysisRecordBody.isOwner) && Objects.equals(this.modelId, analysisRecordBody.modelId) && @@ -729,7 +754,7 @@ public boolean equals(Object o) { @Override public int hashCode() { - return Objects.hash(analysisId, analysisScope, baseAddress, binaryId, binaryName, binarySize, creation, detectedArchitecture, detectedBinaryFormat, detectedBinaryType, functionBoundariesHash, isOwner, modelId, modelName, modelUpgradeAvailable, sha256Hash, status, suppliedArchitecture, suppliedBinaryFormat, suppliedBinaryType, tags, username, additionalProperties); + return Objects.hash(analysisId, analysisScope, baseAddress, binaryId, binaryName, binarySize, creation, detectedArchitecture, detectedBinaryFormat, detectedBinaryType, detectedLanguage, functionBoundariesHash, isOwner, modelId, modelName, modelUpgradeAvailable, sha256Hash, status, suppliedArchitecture, suppliedBinaryFormat, suppliedBinaryType, tags, username, additionalProperties); } @Override @@ -746,6 +771,7 @@ public String toString() { sb.append(" detectedArchitecture: ").append(toIndentedString(detectedArchitecture)).append("\n"); sb.append(" detectedBinaryFormat: ").append(toIndentedString(detectedBinaryFormat)).append("\n"); sb.append(" detectedBinaryType: ").append(toIndentedString(detectedBinaryType)).append("\n"); + sb.append(" detectedLanguage: ").append(toIndentedString(detectedLanguage)).append("\n"); sb.append(" functionBoundariesHash: ").append(toIndentedString(functionBoundariesHash)).append("\n"); sb.append(" isOwner: ").append(toIndentedString(isOwner)).append("\n"); sb.append(" modelId: ").append(toIndentedString(modelId)).append("\n"); @@ -777,10 +803,10 @@ private String toIndentedString(Object o) { static { // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(Arrays.asList("analysis_id", "analysis_scope", "base_address", "binary_id", "binary_name", "binary_size", "creation", "detected_architecture", "detected_binary_format", "detected_binary_type", "function_boundaries_hash", "is_owner", "model_id", "model_name", "model_upgrade_available", "sha_256_hash", "status", "supplied_architecture", "supplied_binary_format", "supplied_binary_type", "tags", "username")); + openapiFields = new HashSet(Arrays.asList("analysis_id", "analysis_scope", "base_address", "binary_id", "binary_name", "binary_size", "creation", "detected_architecture", "detected_binary_format", "detected_binary_type", "detected_language", "function_boundaries_hash", "is_owner", "model_id", "model_name", "model_upgrade_available", "sha_256_hash", "status", "supplied_architecture", "supplied_binary_format", "supplied_binary_type", "tags", "username")); // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(Arrays.asList("analysis_id", "analysis_scope", "base_address", "binary_id", "binary_name", "binary_size", "creation", "detected_architecture", "detected_binary_format", "detected_binary_type", "function_boundaries_hash", "is_owner", "model_id", "model_name", "model_upgrade_available", "sha_256_hash", "status", "supplied_architecture", "supplied_binary_format", "supplied_binary_type", "tags", "username")); + openapiRequiredFields = new HashSet(Arrays.asList("analysis_id", "analysis_scope", "base_address", "binary_id", "binary_name", "binary_size", "creation", "detected_architecture", "detected_binary_format", "detected_binary_type", "detected_language", "function_boundaries_hash", "is_owner", "model_id", "model_name", "model_upgrade_available", "sha_256_hash", "status", "supplied_architecture", "supplied_binary_format", "supplied_binary_type", "tags", "username")); } /** @@ -820,6 +846,9 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti 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("detected_language").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `detected_language` to be a primitive type in the JSON string but got `%s`", jsonObj.get("detected_language").toString())); + } if (!jsonObj.get("function_boundaries_hash").isJsonPrimitive()) { throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `function_boundaries_hash` to be a primitive type in the JSON string but got `%s`", jsonObj.get("function_boundaries_hash").toString())); } diff --git a/src/main/java/ai/reveng/model/ApiCombinationEvidence.java b/src/main/java/ai/reveng/model/ApiCombinationEvidence0.java similarity index 100% rename from src/main/java/ai/reveng/model/ApiCombinationEvidence.java rename to src/main/java/ai/reveng/model/ApiCombinationEvidence0.java diff --git a/src/main/java/ai/reveng/model/Binary.java b/src/main/java/ai/reveng/model/Binary.java index b0904ca..8108cce 100644 --- a/src/main/java/ai/reveng/model/Binary.java +++ b/src/main/java/ai/reveng/model/Binary.java @@ -80,6 +80,11 @@ public class Binary { @javax.annotation.Nonnull private String detectedBinaryType; + public static final String SERIALIZED_NAME_DETECTED_LANGUAGE = "detected_language"; + @SerializedName(SERIALIZED_NAME_DETECTED_LANGUAGE) + @javax.annotation.Nonnull + private String detectedLanguage; + public static final String SERIALIZED_NAME_IS_SYSTEM_ANALYSIS = "is_system_analysis"; @SerializedName(SERIALIZED_NAME_IS_SYSTEM_ANALYSIS) @javax.annotation.Nonnull @@ -227,6 +232,25 @@ public void setDetectedBinaryType(@javax.annotation.Nonnull String detectedBinar } + public Binary detectedLanguage(@javax.annotation.Nonnull String detectedLanguage) { + this.detectedLanguage = detectedLanguage; + return this; + } + + /** + * Detected source language; empty when unavailable + * @return detectedLanguage + */ + @javax.annotation.Nonnull + public String getDetectedLanguage() { + return detectedLanguage; + } + + public void setDetectedLanguage(@javax.annotation.Nonnull String detectedLanguage) { + this.detectedLanguage = detectedLanguage; + } + + public Binary isSystemAnalysis(@javax.annotation.Nonnull Boolean isSystemAnalysis) { this.isSystemAnalysis = isSystemAnalysis; return this; @@ -401,6 +425,7 @@ public boolean equals(Object o) { Objects.equals(this.createdAt, binary.createdAt) && Objects.equals(this.detectedArchitecture, binary.detectedArchitecture) && Objects.equals(this.detectedBinaryType, binary.detectedBinaryType) && + Objects.equals(this.detectedLanguage, binary.detectedLanguage) && Objects.equals(this.isSystemAnalysis, binary.isSystemAnalysis) && Objects.equals(this.modelName, binary.modelName) && Objects.equals(this.ownerId, binary.ownerId) && @@ -412,7 +437,7 @@ public boolean equals(Object o) { @Override public int hashCode() { - return Objects.hash(analysisId, binaryId, binaryName, createdAt, detectedArchitecture, detectedBinaryType, isSystemAnalysis, modelName, ownerId, sha256Hash, suppliedArchitecture, suppliedBinaryType, additionalProperties); + return Objects.hash(analysisId, binaryId, binaryName, createdAt, detectedArchitecture, detectedBinaryType, detectedLanguage, isSystemAnalysis, modelName, ownerId, sha256Hash, suppliedArchitecture, suppliedBinaryType, additionalProperties); } @Override @@ -425,6 +450,7 @@ public String toString() { 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(" detectedLanguage: ").append(toIndentedString(detectedLanguage)).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"); @@ -450,10 +476,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", "detected_architecture", "detected_binary_type", "is_system_analysis", "model_name", "owner_id", "sha_256_hash", "supplied_architecture", "supplied_binary_type")); + openapiFields = new HashSet(Arrays.asList("analysis_id", "binary_id", "binary_name", "created_at", "detected_architecture", "detected_binary_type", "detected_language", "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", "detected_architecture", "detected_binary_type", "is_system_analysis", "model_name", "owner_id", "sha_256_hash", "supplied_architecture", "supplied_binary_type")); + openapiRequiredFields = new HashSet(Arrays.asList("analysis_id", "binary_id", "binary_name", "created_at", "detected_architecture", "detected_binary_type", "detected_language", "is_system_analysis", "model_name", "owner_id", "sha_256_hash", "supplied_architecture", "supplied_binary_type")); } /** @@ -485,6 +511,9 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti 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("detected_language").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `detected_language` to be a primitive type in the JSON string but got `%s`", jsonObj.get("detected_language").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())); } diff --git a/src/main/java/ai/reveng/model/CallChainEvidence.java b/src/main/java/ai/reveng/model/CallChainEvidence.java index 9b204ab..ac71ee1 100644 --- a/src/main/java/ai/reveng/model/CallChainEvidence.java +++ b/src/main/java/ai/reveng/model/CallChainEvidence.java @@ -13,7 +13,6 @@ package ai.reveng.model; import java.util.Objects; -import ai.reveng.model.EvidenceEffect; import com.google.gson.TypeAdapter; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; @@ -48,12 +47,76 @@ import ai.reveng.invoker.JSON; /** - * A concrete sequence of calls connecting program locations. + * CallChainEvidence */ @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class CallChainEvidence { + public static final String SERIALIZED_NAME_CALL_CHAIN = "call_chain"; + @SerializedName(SERIALIZED_NAME_CALL_CHAIN) + @javax.annotation.Nonnull + private List callChain = new ArrayList<>(); + + /** + * Whether the evidence supports or refutes the finding. + */ + @JsonAdapter(EffectEnum.Adapter.class) + public enum EffectEnum { + SUPPORTS("supports"), + + REFUTES("refutes"), + + UNKNOWN_DEFAULT_OPEN_API("unknown_default_open_api"); + + private String value; + + EffectEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static EffectEnum fromValue(String value) { + for (EffectEnum b : EffectEnum.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 EffectEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public EffectEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return EffectEnum.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + EffectEnum.fromValue(value); + } + } + + public static final String SERIALIZED_NAME_EFFECT = "effect"; + @SerializedName(SERIALIZED_NAME_EFFECT) + @javax.annotation.Nonnull + private EffectEnum effect; + /** - * Gets or Sets evidenceKind + * Kind of evidence. */ @JsonAdapter(EvidenceKindEnum.Adapter.class) public enum EvidenceKindEnum { @@ -106,11 +169,11 @@ 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.CALL_CHAIN; + @javax.annotation.Nonnull + private EvidenceKindEnum evidenceKind; /** - * Gets or Sets kind + * How the evidence was derived. */ @JsonAdapter(KindEnum.Adapter.class) public enum KindEnum { @@ -163,16 +226,11 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti public static final String SERIALIZED_NAME_KIND = "kind"; @SerializedName(SERIALIZED_NAME_KIND) - @javax.annotation.Nullable - private KindEnum kind = KindEnum.DETERMINISTIC_DERIVATION; - - public static final String SERIALIZED_NAME_EFFECT = "effect"; - @SerializedName(SERIALIZED_NAME_EFFECT) @javax.annotation.Nonnull - private EvidenceEffect effect; + private KindEnum kind; /** - * Gets or Sets strength + * How directly the evidence bears on the finding. */ @JsonAdapter(StrengthEnum.Adapter.class) public enum StrengthEnum { @@ -225,117 +283,112 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti public static final String SERIALIZED_NAME_STRENGTH = "strength"; @SerializedName(SERIALIZED_NAME_STRENGTH) - @javax.annotation.Nullable - private StrengthEnum strength = StrengthEnum.DIRECT; - - public static final String SERIALIZED_NAME_CALL_CHAIN = "call_chain"; - @SerializedName(SERIALIZED_NAME_CALL_CHAIN) @javax.annotation.Nonnull - private List callChain = new ArrayList<>(); + private StrengthEnum strength; public CallChainEvidence() { } - public CallChainEvidence evidenceKind(@javax.annotation.Nullable EvidenceKindEnum evidenceKind) { - this.evidenceKind = evidenceKind; + public CallChainEvidence callChain(@javax.annotation.Nonnull List callChain) { + this.callChain = callChain; return this; } - /** - * Get evidenceKind - * @return evidenceKind - */ - @javax.annotation.Nullable - public EvidenceKindEnum getEvidenceKind() { - return evidenceKind; - } - - public void setEvidenceKind(@javax.annotation.Nullable EvidenceKindEnum evidenceKind) { - this.evidenceKind = evidenceKind; - } - - - public CallChainEvidence kind(@javax.annotation.Nullable KindEnum kind) { - this.kind = kind; + public CallChainEvidence addCallChainItem(Long callChainItem) { + if (this.callChain == null) { + this.callChain = new ArrayList<>(); + } + this.callChain.add(callChainItem); return this; } /** - * Get kind - * @return kind + * Addresses along the call chain. + * @return callChain */ - @javax.annotation.Nullable - public KindEnum getKind() { - return kind; + @javax.annotation.Nonnull + public List getCallChain() { + return callChain; } - public void setKind(@javax.annotation.Nullable KindEnum kind) { - this.kind = kind; + public void setCallChain(@javax.annotation.Nonnull List callChain) { + this.callChain = callChain; } - public CallChainEvidence effect(@javax.annotation.Nonnull EvidenceEffect effect) { + public CallChainEvidence effect(@javax.annotation.Nonnull EffectEnum effect) { this.effect = effect; return this; } /** - * Get effect + * Whether the evidence supports or refutes the finding. * @return effect */ @javax.annotation.Nonnull - public EvidenceEffect getEffect() { + public EffectEnum getEffect() { return effect; } - public void setEffect(@javax.annotation.Nonnull EvidenceEffect effect) { + public void setEffect(@javax.annotation.Nonnull EffectEnum effect) { this.effect = effect; } - public CallChainEvidence strength(@javax.annotation.Nullable StrengthEnum strength) { - this.strength = strength; + public CallChainEvidence evidenceKind(@javax.annotation.Nonnull EvidenceKindEnum evidenceKind) { + this.evidenceKind = evidenceKind; return this; } /** - * Get strength - * @return strength + * Kind of evidence. + * @return evidenceKind */ - @javax.annotation.Nullable - public StrengthEnum getStrength() { - return strength; + @javax.annotation.Nonnull + public EvidenceKindEnum getEvidenceKind() { + return evidenceKind; } - public void setStrength(@javax.annotation.Nullable StrengthEnum strength) { - this.strength = strength; + public void setEvidenceKind(@javax.annotation.Nonnull EvidenceKindEnum evidenceKind) { + this.evidenceKind = evidenceKind; } - public CallChainEvidence callChain(@javax.annotation.Nonnull List callChain) { - this.callChain = callChain; + public CallChainEvidence kind(@javax.annotation.Nonnull KindEnum kind) { + this.kind = kind; return this; } - public CallChainEvidence addCallChainItem(Integer callChainItem) { - if (this.callChain == null) { - this.callChain = new ArrayList<>(); - } - this.callChain.add(callChainItem); + /** + * How the evidence was derived. + * @return kind + */ + @javax.annotation.Nonnull + public KindEnum getKind() { + return kind; + } + + public void setKind(@javax.annotation.Nonnull KindEnum kind) { + this.kind = kind; + } + + + public CallChainEvidence strength(@javax.annotation.Nonnull StrengthEnum strength) { + this.strength = strength; return this; } /** - * Get callChain - * @return callChain + * How directly the evidence bears on the finding. + * @return strength */ @javax.annotation.Nonnull - public List getCallChain() { - return callChain; + public StrengthEnum getStrength() { + return strength; } - public void setCallChain(@javax.annotation.Nonnull List callChain) { - this.callChain = callChain; + public void setStrength(@javax.annotation.Nonnull StrengthEnum strength) { + this.strength = strength; } /** @@ -393,28 +446,28 @@ public boolean equals(Object o) { return false; } CallChainEvidence callChainEvidence = (CallChainEvidence) o; - return Objects.equals(this.evidenceKind, callChainEvidence.evidenceKind) && - Objects.equals(this.kind, callChainEvidence.kind) && + return Objects.equals(this.callChain, callChainEvidence.callChain) && Objects.equals(this.effect, callChainEvidence.effect) && - Objects.equals(this.strength, callChainEvidence.strength) && - Objects.equals(this.callChain, callChainEvidence.callChain)&& + Objects.equals(this.evidenceKind, callChainEvidence.evidenceKind) && + Objects.equals(this.kind, callChainEvidence.kind) && + Objects.equals(this.strength, callChainEvidence.strength)&& Objects.equals(this.additionalProperties, callChainEvidence.additionalProperties); } @Override public int hashCode() { - return Objects.hash(evidenceKind, kind, effect, strength, callChain, additionalProperties); + return Objects.hash(callChain, effect, evidenceKind, kind, strength, additionalProperties); } @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class CallChainEvidence {\n"); + sb.append(" callChain: ").append(toIndentedString(callChain)).append("\n"); + sb.append(" effect: ").append(toIndentedString(effect)).append("\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"); sb.append(" strength: ").append(toIndentedString(strength)).append("\n"); - sb.append(" callChain: ").append(toIndentedString(callChain)).append("\n"); sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); sb.append("}"); return sb.toString(); @@ -434,10 +487,10 @@ private String toIndentedString(Object o) { static { // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(Arrays.asList("evidence_kind", "kind", "effect", "strength", "call_chain")); + openapiFields = new HashSet(Arrays.asList("call_chain", "effect", "evidence_kind", "kind", "strength")); // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(Arrays.asList("effect", "call_chain")); + openapiRequiredFields = new HashSet(Arrays.asList("call_chain", "effect", "evidence_kind", "kind", "strength")); } /** @@ -460,35 +513,32 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti } } JsonObject jsonObj = jsonElement.getAsJsonObject(); - if ((jsonObj.get("evidence_kind") != null && !jsonObj.get("evidence_kind").isJsonNull()) && !jsonObj.get("evidence_kind").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `evidence_kind` to be a primitive type in the JSON string but got `%s`", jsonObj.get("evidence_kind").toString())); - } - // validate the optional field `evidence_kind` - if (jsonObj.get("evidence_kind") != null && !jsonObj.get("evidence_kind").isJsonNull()) { - EvidenceKindEnum.validateJsonElement(jsonObj.get("evidence_kind")); - } - if ((jsonObj.get("kind") != null && !jsonObj.get("kind").isJsonNull()) && !jsonObj.get("kind").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `kind` to be a primitive type in the JSON string but got `%s`", jsonObj.get("kind").toString())); - } - // validate the optional field `kind` - if (jsonObj.get("kind") != null && !jsonObj.get("kind").isJsonNull()) { - KindEnum.validateJsonElement(jsonObj.get("kind")); - } - // validate the required field `effect` - EvidenceEffect.validateJsonElement(jsonObj.get("effect")); - if ((jsonObj.get("strength") != null && !jsonObj.get("strength").isJsonNull()) && !jsonObj.get("strength").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `strength` to be a primitive type in the JSON string but got `%s`", jsonObj.get("strength").toString())); - } - // validate the optional field `strength` - if (jsonObj.get("strength") != null && !jsonObj.get("strength").isJsonNull()) { - StrengthEnum.validateJsonElement(jsonObj.get("strength")); - } // ensure the required json array is present if (jsonObj.get("call_chain") == null) { throw new IllegalArgumentException("Expected the field `linkedContent` to be an array in the JSON string but got `null`"); } else if (!jsonObj.get("call_chain").isJsonArray()) { throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `call_chain` to be an array in the JSON string but got `%s`", jsonObj.get("call_chain").toString())); } + if (!jsonObj.get("effect").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `effect` to be a primitive type in the JSON string but got `%s`", jsonObj.get("effect").toString())); + } + // validate the required field `effect` + EffectEnum.validateJsonElement(jsonObj.get("effect")); + if (!jsonObj.get("evidence_kind").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `evidence_kind` to be a primitive type in the JSON string but got `%s`", jsonObj.get("evidence_kind").toString())); + } + // validate the required field `evidence_kind` + EvidenceKindEnum.validateJsonElement(jsonObj.get("evidence_kind")); + if (!jsonObj.get("kind").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `kind` to be a primitive type in the JSON string but got `%s`", jsonObj.get("kind").toString())); + } + // validate the required field `kind` + KindEnum.validateJsonElement(jsonObj.get("kind")); + if (!jsonObj.get("strength").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `strength` to be a primitive type in the JSON string but got `%s`", jsonObj.get("strength").toString())); + } + // validate the required field `strength` + StrengthEnum.validateJsonElement(jsonObj.get("strength")); } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { diff --git a/src/main/java/ai/reveng/model/DecompilerSummary.java b/src/main/java/ai/reveng/model/DecompilerSummary.java index 5156640..2b55989 100644 --- a/src/main/java/ai/reveng/model/DecompilerSummary.java +++ b/src/main/java/ai/reveng/model/DecompilerSummary.java @@ -54,7 +54,7 @@ public class DecompilerSummary { public static final String SERIALIZED_NAME_SUBJECT = "subject"; @SerializedName(SERIALIZED_NAME_SUBJECT) - @javax.annotation.Nonnull + @javax.annotation.Nullable private Subject subject; public static final String SERIALIZED_NAME_SUMMARY = "summary"; @@ -70,7 +70,7 @@ public class DecompilerSummary { public DecompilerSummary() { } - public DecompilerSummary subject(@javax.annotation.Nonnull Subject subject) { + public DecompilerSummary subject(@javax.annotation.Nullable Subject subject) { this.subject = subject; return this; } @@ -79,12 +79,12 @@ public DecompilerSummary subject(@javax.annotation.Nonnull Subject subject) { * Get subject * @return subject */ - @javax.annotation.Nonnull + @javax.annotation.Nullable public Subject getSubject() { return subject; } - public void setSubject(@javax.annotation.Nonnull Subject subject) { + public void setSubject(@javax.annotation.Nullable Subject subject) { this.subject = subject; } @@ -255,8 +255,10 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti } } JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (jsonObj.get("subject") != null && !jsonObj.get("subject").isJsonNull()) { // validate the required field `subject` Subject.validateJsonElement(jsonObj.get("subject")); + } if (!jsonObj.get("summary").isJsonPrimitive()) { throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `summary` to be a primitive type in the JSON string but got `%s`", jsonObj.get("summary").toString())); } diff --git a/src/main/java/ai/reveng/model/DecompilerSummaryEvidence.java b/src/main/java/ai/reveng/model/DecompilerSummaryEvidence.java index 2bc55f4..f93f430 100644 --- a/src/main/java/ai/reveng/model/DecompilerSummaryEvidence.java +++ b/src/main/java/ai/reveng/model/DecompilerSummaryEvidence.java @@ -13,8 +13,7 @@ package ai.reveng.model; import java.util.Objects; -import ai.reveng.model.DecompilerSummary; -import ai.reveng.model.EvidenceEffect; +import ai.reveng.model.ReportCodeSummary; import com.google.gson.TypeAdapter; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; @@ -49,12 +48,71 @@ import ai.reveng.invoker.JSON; /** - * Semantic summaries derived from decompiler output. + * DecompilerSummaryEvidence */ @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class DecompilerSummaryEvidence { /** - * Gets or Sets evidenceKind + * Whether the evidence supports or refutes the finding. + */ + @JsonAdapter(EffectEnum.Adapter.class) + public enum EffectEnum { + SUPPORTS("supports"), + + REFUTES("refutes"), + + UNKNOWN_DEFAULT_OPEN_API("unknown_default_open_api"); + + private String value; + + EffectEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static EffectEnum fromValue(String value) { + for (EffectEnum b : EffectEnum.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 EffectEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public EffectEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return EffectEnum.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + EffectEnum.fromValue(value); + } + } + + public static final String SERIALIZED_NAME_EFFECT = "effect"; + @SerializedName(SERIALIZED_NAME_EFFECT) + @javax.annotation.Nonnull + private EffectEnum effect; + + /** + * Kind of evidence. */ @JsonAdapter(EvidenceKindEnum.Adapter.class) public enum EvidenceKindEnum { @@ -107,11 +165,11 @@ 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.DECOMPILER_SUMMARY; + @javax.annotation.Nonnull + private EvidenceKindEnum evidenceKind; /** - * Gets or Sets kind + * How the evidence was derived. */ @JsonAdapter(KindEnum.Adapter.class) public enum KindEnum { @@ -164,16 +222,11 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti public static final String SERIALIZED_NAME_KIND = "kind"; @SerializedName(SERIALIZED_NAME_KIND) - @javax.annotation.Nullable - private KindEnum kind = KindEnum.MODEL_INTERPRETATION; - - public static final String SERIALIZED_NAME_EFFECT = "effect"; - @SerializedName(SERIALIZED_NAME_EFFECT) @javax.annotation.Nonnull - private EvidenceEffect effect; + private KindEnum kind; /** - * Gets or Sets strength + * How directly the evidence bears on the finding. */ @JsonAdapter(StrengthEnum.Adapter.class) public enum StrengthEnum { @@ -226,99 +279,99 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti public static final String SERIALIZED_NAME_STRENGTH = "strength"; @SerializedName(SERIALIZED_NAME_STRENGTH) - @javax.annotation.Nullable - private StrengthEnum strength = StrengthEnum.INDIRECT; + @javax.annotation.Nonnull + private StrengthEnum strength; public static final String SERIALIZED_NAME_SUMMARIES = "summaries"; @SerializedName(SERIALIZED_NAME_SUMMARIES) @javax.annotation.Nonnull - private List summaries = new ArrayList<>(); + private List summaries = new ArrayList<>(); public DecompilerSummaryEvidence() { } - public DecompilerSummaryEvidence evidenceKind(@javax.annotation.Nullable EvidenceKindEnum evidenceKind) { - this.evidenceKind = evidenceKind; + public DecompilerSummaryEvidence effect(@javax.annotation.Nonnull EffectEnum effect) { + this.effect = effect; return this; } /** - * Get evidenceKind - * @return evidenceKind + * Whether the evidence supports or refutes the finding. + * @return effect */ - @javax.annotation.Nullable - public EvidenceKindEnum getEvidenceKind() { - return evidenceKind; + @javax.annotation.Nonnull + public EffectEnum getEffect() { + return effect; } - public void setEvidenceKind(@javax.annotation.Nullable EvidenceKindEnum evidenceKind) { - this.evidenceKind = evidenceKind; + public void setEffect(@javax.annotation.Nonnull EffectEnum effect) { + this.effect = effect; } - public DecompilerSummaryEvidence kind(@javax.annotation.Nullable KindEnum kind) { - this.kind = kind; + public DecompilerSummaryEvidence evidenceKind(@javax.annotation.Nonnull EvidenceKindEnum evidenceKind) { + this.evidenceKind = evidenceKind; return this; } /** - * Get kind - * @return kind + * Kind of evidence. + * @return evidenceKind */ - @javax.annotation.Nullable - public KindEnum getKind() { - return kind; + @javax.annotation.Nonnull + public EvidenceKindEnum getEvidenceKind() { + return evidenceKind; } - public void setKind(@javax.annotation.Nullable KindEnum kind) { - this.kind = kind; + public void setEvidenceKind(@javax.annotation.Nonnull EvidenceKindEnum evidenceKind) { + this.evidenceKind = evidenceKind; } - public DecompilerSummaryEvidence effect(@javax.annotation.Nonnull EvidenceEffect effect) { - this.effect = effect; + public DecompilerSummaryEvidence kind(@javax.annotation.Nonnull KindEnum kind) { + this.kind = kind; return this; } /** - * Get effect - * @return effect + * How the evidence was derived. + * @return kind */ @javax.annotation.Nonnull - public EvidenceEffect getEffect() { - return effect; + public KindEnum getKind() { + return kind; } - public void setEffect(@javax.annotation.Nonnull EvidenceEffect effect) { - this.effect = effect; + public void setKind(@javax.annotation.Nonnull KindEnum kind) { + this.kind = kind; } - public DecompilerSummaryEvidence strength(@javax.annotation.Nullable StrengthEnum strength) { + public DecompilerSummaryEvidence strength(@javax.annotation.Nonnull StrengthEnum strength) { this.strength = strength; return this; } /** - * Get strength + * How directly the evidence bears on the finding. * @return strength */ - @javax.annotation.Nullable + @javax.annotation.Nonnull public StrengthEnum getStrength() { return strength; } - public void setStrength(@javax.annotation.Nullable StrengthEnum strength) { + public void setStrength(@javax.annotation.Nonnull StrengthEnum strength) { this.strength = strength; } - public DecompilerSummaryEvidence summaries(@javax.annotation.Nonnull List summaries) { + public DecompilerSummaryEvidence summaries(@javax.annotation.Nonnull List summaries) { this.summaries = summaries; return this; } - public DecompilerSummaryEvidence addSummariesItem(DecompilerSummary summariesItem) { + public DecompilerSummaryEvidence addSummariesItem(ReportCodeSummary summariesItem) { if (this.summaries == null) { this.summaries = new ArrayList<>(); } @@ -327,15 +380,15 @@ public DecompilerSummaryEvidence addSummariesItem(DecompilerSummary summariesIte } /** - * Get summaries + * Summaries of the decompiled code. * @return summaries */ @javax.annotation.Nonnull - public List getSummaries() { + public List getSummaries() { return summaries; } - public void setSummaries(@javax.annotation.Nonnull List summaries) { + public void setSummaries(@javax.annotation.Nonnull List summaries) { this.summaries = summaries; } @@ -394,9 +447,9 @@ public boolean equals(Object o) { return false; } DecompilerSummaryEvidence decompilerSummaryEvidence = (DecompilerSummaryEvidence) o; - return Objects.equals(this.evidenceKind, decompilerSummaryEvidence.evidenceKind) && + return Objects.equals(this.effect, decompilerSummaryEvidence.effect) && + Objects.equals(this.evidenceKind, decompilerSummaryEvidence.evidenceKind) && Objects.equals(this.kind, decompilerSummaryEvidence.kind) && - Objects.equals(this.effect, decompilerSummaryEvidence.effect) && Objects.equals(this.strength, decompilerSummaryEvidence.strength) && Objects.equals(this.summaries, decompilerSummaryEvidence.summaries)&& Objects.equals(this.additionalProperties, decompilerSummaryEvidence.additionalProperties); @@ -404,16 +457,16 @@ public boolean equals(Object o) { @Override public int hashCode() { - return Objects.hash(evidenceKind, kind, effect, strength, summaries, additionalProperties); + return Objects.hash(effect, evidenceKind, kind, strength, summaries, additionalProperties); } @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class DecompilerSummaryEvidence {\n"); + sb.append(" effect: ").append(toIndentedString(effect)).append("\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"); sb.append(" strength: ").append(toIndentedString(strength)).append("\n"); sb.append(" summaries: ").append(toIndentedString(summaries)).append("\n"); sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); @@ -435,10 +488,10 @@ private String toIndentedString(Object o) { static { // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(Arrays.asList("evidence_kind", "kind", "effect", "strength", "summaries")); + openapiFields = new HashSet(Arrays.asList("effect", "evidence_kind", "kind", "strength", "summaries")); // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(Arrays.asList("effect", "summaries")); + openapiRequiredFields = new HashSet(Arrays.asList("effect", "evidence_kind", "kind", "strength", "summaries")); } /** @@ -461,38 +514,31 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti } } JsonObject jsonObj = jsonElement.getAsJsonObject(); - if ((jsonObj.get("evidence_kind") != null && !jsonObj.get("evidence_kind").isJsonNull()) && !jsonObj.get("evidence_kind").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `evidence_kind` to be a primitive type in the JSON string but got `%s`", jsonObj.get("evidence_kind").toString())); + if (!jsonObj.get("effect").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `effect` to be a primitive type in the JSON string but got `%s`", jsonObj.get("effect").toString())); } - // validate the optional field `evidence_kind` - if (jsonObj.get("evidence_kind") != null && !jsonObj.get("evidence_kind").isJsonNull()) { - EvidenceKindEnum.validateJsonElement(jsonObj.get("evidence_kind")); + // validate the required field `effect` + EffectEnum.validateJsonElement(jsonObj.get("effect")); + if (!jsonObj.get("evidence_kind").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `evidence_kind` to be a primitive type in the JSON string but got `%s`", jsonObj.get("evidence_kind").toString())); } - if ((jsonObj.get("kind") != null && !jsonObj.get("kind").isJsonNull()) && !jsonObj.get("kind").isJsonPrimitive()) { + // validate the required field `evidence_kind` + EvidenceKindEnum.validateJsonElement(jsonObj.get("evidence_kind")); + if (!jsonObj.get("kind").isJsonPrimitive()) { throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `kind` to be a primitive type in the JSON string but got `%s`", jsonObj.get("kind").toString())); } - // validate the optional field `kind` - if (jsonObj.get("kind") != null && !jsonObj.get("kind").isJsonNull()) { - KindEnum.validateJsonElement(jsonObj.get("kind")); - } - // validate the required field `effect` - EvidenceEffect.validateJsonElement(jsonObj.get("effect")); - if ((jsonObj.get("strength") != null && !jsonObj.get("strength").isJsonNull()) && !jsonObj.get("strength").isJsonPrimitive()) { + // validate the required field `kind` + KindEnum.validateJsonElement(jsonObj.get("kind")); + if (!jsonObj.get("strength").isJsonPrimitive()) { throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `strength` to be a primitive type in the JSON string but got `%s`", jsonObj.get("strength").toString())); } - // validate the optional field `strength` - if (jsonObj.get("strength") != null && !jsonObj.get("strength").isJsonNull()) { - StrengthEnum.validateJsonElement(jsonObj.get("strength")); - } - if (jsonObj.get("summaries") != null) { - if (!jsonObj.get("summaries").isJsonArray()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `summaries` to be an array in the JSON string but got `%s`", jsonObj.get("summaries").toString())); - } - JsonArray jsonArraysummaries = jsonObj.getAsJsonArray("summaries"); - // validate the required field `summaries` (array) - for (int i = 0; i < jsonArraysummaries.size(); i++) { - DecompilerSummary.validateJsonElement(jsonArraysummaries.get(i)); - } + // validate the required field `strength` + StrengthEnum.validateJsonElement(jsonObj.get("strength")); + // ensure the required json array is present + if (jsonObj.get("summaries") == null) { + throw new IllegalArgumentException("Expected the field `linkedContent` to be an array in the JSON string but got `null`"); + } else if (!jsonObj.get("summaries").isJsonArray()) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `summaries` to be an array in the JSON string but got `%s`", jsonObj.get("summaries").toString())); } } diff --git a/src/main/java/ai/reveng/model/DisassemblySummaryEvidence.java b/src/main/java/ai/reveng/model/DisassemblySummaryEvidence.java new file mode 100644 index 0000000..e50368b --- /dev/null +++ b/src/main/java/ai/reveng/model/DisassemblySummaryEvidence.java @@ -0,0 +1,637 @@ +/* + * 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.ReportCodeSummary; +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; + +/** + * DisassemblySummaryEvidence + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class DisassemblySummaryEvidence { + /** + * Whether the evidence supports or refutes the finding. + */ + @JsonAdapter(EffectEnum.Adapter.class) + public enum EffectEnum { + SUPPORTS("supports"), + + REFUTES("refutes"), + + UNKNOWN_DEFAULT_OPEN_API("unknown_default_open_api"); + + private String value; + + EffectEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static EffectEnum fromValue(String value) { + for (EffectEnum b : EffectEnum.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 EffectEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public EffectEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return EffectEnum.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + EffectEnum.fromValue(value); + } + } + + public static final String SERIALIZED_NAME_EFFECT = "effect"; + @SerializedName(SERIALIZED_NAME_EFFECT) + @javax.annotation.Nonnull + private EffectEnum effect; + + /** + * Kind of evidence. + */ + @JsonAdapter(EvidenceKindEnum.Adapter.class) + public enum EvidenceKindEnum { + DISASSEMBLY_SUMMARY("disassembly_summary"), + + UNKNOWN_DEFAULT_OPEN_API("unknown_default_open_api"); + + private String value; + + EvidenceKindEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static EvidenceKindEnum fromValue(String value) { + for (EvidenceKindEnum b : EvidenceKindEnum.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 EvidenceKindEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public EvidenceKindEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return EvidenceKindEnum.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + EvidenceKindEnum.fromValue(value); + } + } + + public static final String SERIALIZED_NAME_EVIDENCE_KIND = "evidence_kind"; + @SerializedName(SERIALIZED_NAME_EVIDENCE_KIND) + @javax.annotation.Nonnull + private EvidenceKindEnum evidenceKind; + + /** + * How the evidence was derived. + */ + @JsonAdapter(KindEnum.Adapter.class) + public enum KindEnum { + MODEL_INTERPRETATION("model_interpretation"), + + UNKNOWN_DEFAULT_OPEN_API("unknown_default_open_api"); + + private String value; + + KindEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static KindEnum fromValue(String value) { + for (KindEnum b : KindEnum.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 KindEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public KindEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return KindEnum.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + KindEnum.fromValue(value); + } + } + + public static final String SERIALIZED_NAME_KIND = "kind"; + @SerializedName(SERIALIZED_NAME_KIND) + @javax.annotation.Nonnull + private KindEnum kind; + + /** + * How directly the evidence bears on the finding. + */ + @JsonAdapter(StrengthEnum.Adapter.class) + public enum StrengthEnum { + INDIRECT("indirect"), + + UNKNOWN_DEFAULT_OPEN_API("unknown_default_open_api"); + + private String value; + + StrengthEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static StrengthEnum fromValue(String value) { + for (StrengthEnum b : StrengthEnum.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 StrengthEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public StrengthEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return StrengthEnum.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + StrengthEnum.fromValue(value); + } + } + + public static final String SERIALIZED_NAME_STRENGTH = "strength"; + @SerializedName(SERIALIZED_NAME_STRENGTH) + @javax.annotation.Nonnull + private StrengthEnum strength; + + public static final String SERIALIZED_NAME_SUMMARIES = "summaries"; + @SerializedName(SERIALIZED_NAME_SUMMARIES) + @javax.annotation.Nonnull + private List summaries = new ArrayList<>(); + + public DisassemblySummaryEvidence() { + } + + public DisassemblySummaryEvidence effect(@javax.annotation.Nonnull EffectEnum effect) { + this.effect = effect; + return this; + } + + /** + * Whether the evidence supports or refutes the finding. + * @return effect + */ + @javax.annotation.Nonnull + public EffectEnum getEffect() { + return effect; + } + + public void setEffect(@javax.annotation.Nonnull EffectEnum effect) { + this.effect = effect; + } + + + public DisassemblySummaryEvidence evidenceKind(@javax.annotation.Nonnull EvidenceKindEnum evidenceKind) { + this.evidenceKind = evidenceKind; + return this; + } + + /** + * Kind of evidence. + * @return evidenceKind + */ + @javax.annotation.Nonnull + public EvidenceKindEnum getEvidenceKind() { + return evidenceKind; + } + + public void setEvidenceKind(@javax.annotation.Nonnull EvidenceKindEnum evidenceKind) { + this.evidenceKind = evidenceKind; + } + + + public DisassemblySummaryEvidence kind(@javax.annotation.Nonnull KindEnum kind) { + this.kind = kind; + return this; + } + + /** + * How the evidence was derived. + * @return kind + */ + @javax.annotation.Nonnull + public KindEnum getKind() { + return kind; + } + + public void setKind(@javax.annotation.Nonnull KindEnum kind) { + this.kind = kind; + } + + + public DisassemblySummaryEvidence strength(@javax.annotation.Nonnull StrengthEnum strength) { + this.strength = strength; + return this; + } + + /** + * How directly the evidence bears on the finding. + * @return strength + */ + @javax.annotation.Nonnull + public StrengthEnum getStrength() { + return strength; + } + + public void setStrength(@javax.annotation.Nonnull StrengthEnum strength) { + this.strength = strength; + } + + + public DisassemblySummaryEvidence summaries(@javax.annotation.Nonnull List summaries) { + this.summaries = summaries; + return this; + } + + public DisassemblySummaryEvidence addSummariesItem(ReportCodeSummary summariesItem) { + if (this.summaries == null) { + this.summaries = new ArrayList<>(); + } + this.summaries.add(summariesItem); + return this; + } + + /** + * Summaries of the disassembled code. + * @return summaries + */ + @javax.annotation.Nonnull + public List getSummaries() { + return summaries; + } + + public void setSummaries(@javax.annotation.Nonnull List summaries) { + this.summaries = summaries; + } + + /** + * 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 DisassemblySummaryEvidence instance itself + */ + public DisassemblySummaryEvidence 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; + } + DisassemblySummaryEvidence disassemblySummaryEvidence = (DisassemblySummaryEvidence) o; + return Objects.equals(this.effect, disassemblySummaryEvidence.effect) && + Objects.equals(this.evidenceKind, disassemblySummaryEvidence.evidenceKind) && + Objects.equals(this.kind, disassemblySummaryEvidence.kind) && + Objects.equals(this.strength, disassemblySummaryEvidence.strength) && + Objects.equals(this.summaries, disassemblySummaryEvidence.summaries)&& + Objects.equals(this.additionalProperties, disassemblySummaryEvidence.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(effect, evidenceKind, kind, strength, summaries, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DisassemblySummaryEvidence {\n"); + sb.append(" effect: ").append(toIndentedString(effect)).append("\n"); + sb.append(" evidenceKind: ").append(toIndentedString(evidenceKind)).append("\n"); + sb.append(" kind: ").append(toIndentedString(kind)).append("\n"); + sb.append(" strength: ").append(toIndentedString(strength)).append("\n"); + sb.append(" summaries: ").append(toIndentedString(summaries)).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("effect", "evidence_kind", "kind", "strength", "summaries")); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(Arrays.asList("effect", "evidence_kind", "kind", "strength", "summaries")); + } + + /** + * 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 DisassemblySummaryEvidence + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!DisassemblySummaryEvidence.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 DisassemblySummaryEvidence is not found in the empty JSON string", DisassemblySummaryEvidence.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : DisassemblySummaryEvidence.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("effect").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `effect` to be a primitive type in the JSON string but got `%s`", jsonObj.get("effect").toString())); + } + // validate the required field `effect` + EffectEnum.validateJsonElement(jsonObj.get("effect")); + if (!jsonObj.get("evidence_kind").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `evidence_kind` to be a primitive type in the JSON string but got `%s`", jsonObj.get("evidence_kind").toString())); + } + // validate the required field `evidence_kind` + EvidenceKindEnum.validateJsonElement(jsonObj.get("evidence_kind")); + if (!jsonObj.get("kind").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `kind` to be a primitive type in the JSON string but got `%s`", jsonObj.get("kind").toString())); + } + // validate the required field `kind` + KindEnum.validateJsonElement(jsonObj.get("kind")); + if (!jsonObj.get("strength").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `strength` to be a primitive type in the JSON string but got `%s`", jsonObj.get("strength").toString())); + } + // validate the required field `strength` + StrengthEnum.validateJsonElement(jsonObj.get("strength")); + // ensure the required json array is present + if (jsonObj.get("summaries") == null) { + throw new IllegalArgumentException("Expected the field `linkedContent` to be an array in the JSON string but got `null`"); + } else if (!jsonObj.get("summaries").isJsonArray()) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `summaries` to be an array in the JSON string but got `%s`", jsonObj.get("summaries").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!DisassemblySummaryEvidence.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'DisassemblySummaryEvidence' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(DisassemblySummaryEvidence.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, DisassemblySummaryEvidence 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 DisassemblySummaryEvidence read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + DisassemblySummaryEvidence 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 DisassemblySummaryEvidence given an JSON string + * + * @param jsonString JSON string + * @return An instance of DisassemblySummaryEvidence + * @throws IOException if the JSON string is invalid with respect to DisassemblySummaryEvidence + */ + public static DisassemblySummaryEvidence fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, DisassemblySummaryEvidence.class); + } + + /** + * Convert an instance of DisassemblySummaryEvidence to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/ai/reveng/model/DynamicExecutionResult.java b/src/main/java/ai/reveng/model/DynamicExecutionResult.java new file mode 100644 index 0000000..e9f1625 --- /dev/null +++ b/src/main/java/ai/reveng/model/DynamicExecutionResult.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; + +/** + * DynamicExecutionResult + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class DynamicExecutionResult { + public static final String SERIALIZED_NAME_REPORT_AVAILABLE = "report_available"; + @SerializedName(SERIALIZED_NAME_REPORT_AVAILABLE) + @javax.annotation.Nonnull + private Boolean reportAvailable; + + public DynamicExecutionResult() { + } + + public DynamicExecutionResult reportAvailable(@javax.annotation.Nonnull Boolean reportAvailable) { + this.reportAvailable = reportAvailable; + return this; + } + + /** + * Whether the run's report can be fetched from the report endpoint. Always true when the operation succeeded. + * @return reportAvailable + */ + @javax.annotation.Nonnull + public Boolean getReportAvailable() { + return reportAvailable; + } + + public void setReportAvailable(@javax.annotation.Nonnull Boolean reportAvailable) { + this.reportAvailable = reportAvailable; + } + + /** + * 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 DynamicExecutionResult instance itself + */ + public DynamicExecutionResult 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; + } + DynamicExecutionResult dynamicExecutionResult = (DynamicExecutionResult) o; + return Objects.equals(this.reportAvailable, dynamicExecutionResult.reportAvailable)&& + Objects.equals(this.additionalProperties, dynamicExecutionResult.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(reportAvailable, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DynamicExecutionResult {\n"); + sb.append(" reportAvailable: ").append(toIndentedString(reportAvailable)).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("report_available")); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(Arrays.asList("report_available")); + } + + /** + * 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 DynamicExecutionResult + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!DynamicExecutionResult.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 DynamicExecutionResult is not found in the empty JSON string", DynamicExecutionResult.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : DynamicExecutionResult.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 (!DynamicExecutionResult.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'DynamicExecutionResult' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(DynamicExecutionResult.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, DynamicExecutionResult 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 DynamicExecutionResult read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + DynamicExecutionResult 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 DynamicExecutionResult given an JSON string + * + * @param jsonString JSON string + * @return An instance of DynamicExecutionResult + * @throws IOException if the JSON string is invalid with respect to DynamicExecutionResult + */ + public static DynamicExecutionResult fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, DynamicExecutionResult.class); + } + + /** + * Convert an instance of DynamicExecutionResult to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/ai/reveng/model/DynamicExecutionSummaryResult.java b/src/main/java/ai/reveng/model/DynamicExecutionSummaryResult.java new file mode 100644 index 0000000..89f2aaf --- /dev/null +++ b/src/main/java/ai/reveng/model/DynamicExecutionSummaryResult.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; + +/** + * DynamicExecutionSummaryResult + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class DynamicExecutionSummaryResult { + public static final String SERIALIZED_NAME_SUMMARY_AVAILABLE = "summary_available"; + @SerializedName(SERIALIZED_NAME_SUMMARY_AVAILABLE) + @javax.annotation.Nonnull + private Boolean summaryAvailable; + + public DynamicExecutionSummaryResult() { + } + + public DynamicExecutionSummaryResult summaryAvailable(@javax.annotation.Nonnull Boolean summaryAvailable) { + this.summaryAvailable = summaryAvailable; + return this; + } + + /** + * Whether the summary can be fetched from the summary endpoint. Always true when the operation succeeded. + * @return summaryAvailable + */ + @javax.annotation.Nonnull + public Boolean getSummaryAvailable() { + return summaryAvailable; + } + + public void setSummaryAvailable(@javax.annotation.Nonnull Boolean summaryAvailable) { + this.summaryAvailable = summaryAvailable; + } + + /** + * 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 DynamicExecutionSummaryResult instance itself + */ + public DynamicExecutionSummaryResult 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; + } + DynamicExecutionSummaryResult dynamicExecutionSummaryResult = (DynamicExecutionSummaryResult) o; + return Objects.equals(this.summaryAvailable, dynamicExecutionSummaryResult.summaryAvailable)&& + Objects.equals(this.additionalProperties, dynamicExecutionSummaryResult.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(summaryAvailable, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DynamicExecutionSummaryResult {\n"); + sb.append(" summaryAvailable: ").append(toIndentedString(summaryAvailable)).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("summary_available")); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(Arrays.asList("summary_available")); + } + + /** + * 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 DynamicExecutionSummaryResult + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!DynamicExecutionSummaryResult.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 DynamicExecutionSummaryResult is not found in the empty JSON string", DynamicExecutionSummaryResult.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : DynamicExecutionSummaryResult.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 (!DynamicExecutionSummaryResult.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'DynamicExecutionSummaryResult' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(DynamicExecutionSummaryResult.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, DynamicExecutionSummaryResult 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 DynamicExecutionSummaryResult read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + DynamicExecutionSummaryResult 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 DynamicExecutionSummaryResult given an JSON string + * + * @param jsonString JSON string + * @return An instance of DynamicExecutionSummaryResult + * @throws IOException if the JSON string is invalid with respect to DynamicExecutionSummaryResult + */ + public static DynamicExecutionSummaryResult fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, DynamicExecutionSummaryResult.class); + } + + /** + * Convert an instance of DynamicExecutionSummaryResult to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/ai/reveng/model/ErrorBody.java b/src/main/java/ai/reveng/model/ErrorBody.java index 17f7bd2..d625e28 100644 --- a/src/main/java/ai/reveng/model/ErrorBody.java +++ b/src/main/java/ai/reveng/model/ErrorBody.java @@ -68,6 +68,8 @@ public enum CodeEnum { CONVERSATION_NOT_FOUND("CONVERSATION_NOT_FOUND"), + DISPOSABLE_EMAIL_NOT_ALLOWED("DISPOSABLE_EMAIL_NOT_ALLOWED"), + DOMAIN_ALREADY_CLAIMED("DOMAIN_ALREADY_CLAIMED"), DOMAIN_VERIFICATION_PENDING("DOMAIN_VERIFICATION_PENDING"), @@ -122,6 +124,8 @@ public enum CodeEnum { OIDC_DISCOVERY_FAILED("OIDC_DISCOVERY_FAILED"), + OPERATION_PREREQUISITE_NOT_MET("OPERATION_PREREQUISITE_NOT_MET"), + PASSWORD_RESET_REQUIRED("PASSWORD_RESET_REQUIRED"), PAYMENT_REQUIRED("PAYMENT_REQUIRED"), diff --git a/src/main/java/ai/reveng/model/EvidenceInner.java b/src/main/java/ai/reveng/model/EvidenceInner.java index 711ff8c..1d70389 100644 --- a/src/main/java/ai/reveng/model/EvidenceInner.java +++ b/src/main/java/ai/reveng/model/EvidenceInner.java @@ -14,24 +14,22 @@ import java.util.Objects; import ai.reveng.model.ApiCombinationEvidence; -import ai.reveng.model.BytesConstant; import ai.reveng.model.CallChainEvidence; -import ai.reveng.model.DecompilerSummary; import ai.reveng.model.DecompilerSummaryEvidence; -import ai.reveng.model.EvidenceStrength; -import ai.reveng.model.FunctionSimilarity; import ai.reveng.model.FunctionSimilarityEvidence; import ai.reveng.model.HardcodedSecretEvidence; import ai.reveng.model.ImportedApi; import ai.reveng.model.ImportedApiCall; import ai.reveng.model.ImportedApiCallEvidence; import ai.reveng.model.KnownConstantEvidence; -import ai.reveng.model.ModelInterpretation; import ai.reveng.model.ModelInterpretationEvidence; -import ai.reveng.model.ReferencedConstant; import ai.reveng.model.ReferencedConstantEvidence; -import ai.reveng.model.RuleKind; -import ai.reveng.model.StringMatch; +import ai.reveng.model.ReportBytesConstant; +import ai.reveng.model.ReportCodeSummary; +import ai.reveng.model.ReportFunctionSimilarity; +import ai.reveng.model.ReportModelInterpretation; +import ai.reveng.model.ReportReferencedConstant; +import ai.reveng.model.ReportStringMatch; import ai.reveng.model.StringMatchEvidence; import com.google.gson.TypeAdapter; import com.google.gson.annotations.JsonAdapter; @@ -39,7 +37,6 @@ import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import java.io.IOException; -import java.math.BigDecimal; import java.util.ArrayList; import java.util.Arrays; import java.util.List; diff --git a/src/main/java/ai/reveng/model/FunctionGlobalVariable.java b/src/main/java/ai/reveng/model/FunctionGlobalVariable.java new file mode 100644 index 0000000..ca5f190 --- /dev/null +++ b/src/main/java/ai/reveng/model/FunctionGlobalVariable.java @@ -0,0 +1,1056 @@ +/* + * 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; + +/** + * FunctionGlobalVariable + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class FunctionGlobalVariable { + public static final String SERIALIZED_NAME_D_TYPE = "d_type"; + @SerializedName(SERIALIZED_NAME_D_TYPE) + @javax.annotation.Nullable + private String dType; + + public static final String SERIALIZED_NAME_DATA_TYPE_ID = "data_type_id"; + @SerializedName(SERIALIZED_NAME_DATA_TYPE_ID) + @javax.annotation.Nullable + private Long dataTypeId; + + public static final String SERIALIZED_NAME_DECOMP_LINES = "decomp_lines"; + @SerializedName(SERIALIZED_NAME_DECOMP_LINES) + @javax.annotation.Nullable + private List decompLines; + + public static final String SERIALIZED_NAME_FUNCTION_COUNT = "function_count"; + @SerializedName(SERIALIZED_NAME_FUNCTION_COUNT) + @javax.annotation.Nonnull + private Long functionCount; + + public static final String SERIALIZED_NAME_INDIRECT_TARGET = "indirect_target"; + @SerializedName(SERIALIZED_NAME_INDIRECT_TARGET) + @javax.annotation.Nullable + private Long indirectTarget; + + public static final String SERIALIZED_NAME_IS_BSS = "is_bss"; + @SerializedName(SERIALIZED_NAME_IS_BSS) + @javax.annotation.Nonnull + private Boolean isBss; + + public static final String SERIALIZED_NAME_NAME = "name"; + @SerializedName(SERIALIZED_NAME_NAME) + @javax.annotation.Nullable + private String name; + + /** + * What named it. + */ + @JsonAdapter(NameSourceEnum.Adapter.class) + public enum NameSourceEnum { + SYSTEM("SYSTEM"), + + RESOLVER("RESOLVER"), + + DEBUG("DEBUG"), + + CONSTRUCTOR("CONSTRUCTOR"), + + VALUE("VALUE"), + + AI_DECOMP("AI_DECOMP"), + + AI_AGENT("AI_AGENT"), + + USER("USER"), + + ACCESS("ACCESS"), + + UNKNOWN_DEFAULT_OPEN_API("unknown_default_open_api"); + + private String value; + + NameSourceEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static NameSourceEnum fromValue(String value) { + for (NameSourceEnum b : NameSourceEnum.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 NameSourceEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public NameSourceEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return NameSourceEnum.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + NameSourceEnum.fromValue(value); + } + } + + public static final String SERIALIZED_NAME_NAME_SOURCE = "name_source"; + @SerializedName(SERIALIZED_NAME_NAME_SOURCE) + @javax.annotation.Nullable + private NameSourceEnum nameSource; + + public static final String SERIALIZED_NAME_REF_COUNT = "ref_count"; + @SerializedName(SERIALIZED_NAME_REF_COUNT) + @javax.annotation.Nonnull + private Long refCount; + + public static final String SERIALIZED_NAME_SIZE = "size"; + @SerializedName(SERIALIZED_NAME_SIZE) + @javax.annotation.Nullable + private Long size; + + public static final String SERIALIZED_NAME_SOURCE_FUNCTION_ID = "source_function_id"; + @SerializedName(SERIALIZED_NAME_SOURCE_FUNCTION_ID) + @javax.annotation.Nullable + private Long sourceFunctionId; + + public static final String SERIALIZED_NAME_TOTAL_REF_COUNT = "total_ref_count"; + @SerializedName(SERIALIZED_NAME_TOTAL_REF_COUNT) + @javax.annotation.Nonnull + private Long totalRefCount; + + /** + * What typed it. + */ + @JsonAdapter(TypeSourceEnum.Adapter.class) + public enum TypeSourceEnum { + SYSTEM("SYSTEM"), + + RESOLVER("RESOLVER"), + + DEBUG("DEBUG"), + + CONSTRUCTOR("CONSTRUCTOR"), + + VALUE("VALUE"), + + AI_DECOMP("AI_DECOMP"), + + AI_AGENT("AI_AGENT"), + + USER("USER"), + + ACCESS("ACCESS"), + + UNKNOWN_DEFAULT_OPEN_API("unknown_default_open_api"); + + private String value; + + TypeSourceEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static TypeSourceEnum fromValue(String value) { + for (TypeSourceEnum b : TypeSourceEnum.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 TypeSourceEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public TypeSourceEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return TypeSourceEnum.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + TypeSourceEnum.fromValue(value); + } + } + + public static final String SERIALIZED_NAME_TYPE_SOURCE = "type_source"; + @SerializedName(SERIALIZED_NAME_TYPE_SOURCE) + @javax.annotation.Nullable + private TypeSourceEnum typeSource; + + public static final String SERIALIZED_NAME_VADDR = "vaddr"; + @SerializedName(SERIALIZED_NAME_VADDR) + @javax.annotation.Nonnull + private Long vaddr; + + public static final String SERIALIZED_NAME_VALUE = "value"; + @SerializedName(SERIALIZED_NAME_VALUE) + @javax.annotation.Nullable + private String value; + + public static final String SERIALIZED_NAME_VALUE_CONFIDENCE = "value_confidence"; + @SerializedName(SERIALIZED_NAME_VALUE_CONFIDENCE) + @javax.annotation.Nullable + private String valueConfidence; + + /** + * How the value was interpreted. + */ + @JsonAdapter(ValueKindEnum.Adapter.class) + public enum ValueKindEnum { + BSS("BSS"), + + STRING("STRING"), + + SHORT_STRING("SHORT_STRING"), + + FLOAT("FLOAT"), + + POINTER("POINTER"), + + DYNAMIC_INIT("DYNAMIC_INIT"), + + HEX("HEX"), + + INT("INT"), + + BOOL("BOOL"), + + UNKNOWN_DEFAULT_OPEN_API("unknown_default_open_api"); + + private String value; + + ValueKindEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static ValueKindEnum fromValue(String value) { + for (ValueKindEnum b : ValueKindEnum.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 ValueKindEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public ValueKindEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return ValueKindEnum.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + ValueKindEnum.fromValue(value); + } + } + + public static final String SERIALIZED_NAME_VALUE_KIND = "value_kind"; + @SerializedName(SERIALIZED_NAME_VALUE_KIND) + @javax.annotation.Nullable + private ValueKindEnum valueKind; + + /** + * What produced the value. + */ + @JsonAdapter(ValueSourceEnum.Adapter.class) + public enum ValueSourceEnum { + SYSTEM("SYSTEM"), + + RESOLVER("RESOLVER"), + + DEBUG("DEBUG"), + + CONSTRUCTOR("CONSTRUCTOR"), + + VALUE("VALUE"), + + AI_DECOMP("AI_DECOMP"), + + AI_AGENT("AI_AGENT"), + + USER("USER"), + + ACCESS("ACCESS"), + + UNKNOWN_DEFAULT_OPEN_API("unknown_default_open_api"); + + private String value; + + ValueSourceEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static ValueSourceEnum fromValue(String value) { + for (ValueSourceEnum b : ValueSourceEnum.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 ValueSourceEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public ValueSourceEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return ValueSourceEnum.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + ValueSourceEnum.fromValue(value); + } + } + + public static final String SERIALIZED_NAME_VALUE_SOURCE = "value_source"; + @SerializedName(SERIALIZED_NAME_VALUE_SOURCE) + @javax.annotation.Nullable + private ValueSourceEnum valueSource; + + public FunctionGlobalVariable() { + } + + public FunctionGlobalVariable dType(@javax.annotation.Nullable String dType) { + this.dType = dType; + return this; + } + + /** + * Name of the assigned data type. + * @return dType + */ + @javax.annotation.Nullable + public String getdType() { + return dType; + } + + public void setdType(@javax.annotation.Nullable String dType) { + this.dType = dType; + } + + + public FunctionGlobalVariable dataTypeId(@javax.annotation.Nullable Long dataTypeId) { + this.dataTypeId = dataTypeId; + return this; + } + + /** + * Analysis data type, when one is assigned. + * @return dataTypeId + */ + @javax.annotation.Nullable + public Long getDataTypeId() { + return dataTypeId; + } + + public void setDataTypeId(@javax.annotation.Nullable Long dataTypeId) { + this.dataTypeId = dataTypeId; + } + + + public FunctionGlobalVariable decompLines(@javax.annotation.Nullable List decompLines) { + this.decompLines = decompLines; + return this; + } + + public FunctionGlobalVariable addDecompLinesItem(Integer decompLinesItem) { + if (this.decompLines == null) { + this.decompLines = new ArrayList<>(); + } + this.decompLines.add(decompLinesItem); + return this; + } + + /** + * 1-indexed lines of the function's AI decompilation that reference the global. + * @return decompLines + */ + @javax.annotation.Nullable + public List getDecompLines() { + return decompLines; + } + + public void setDecompLines(@javax.annotation.Nullable List decompLines) { + this.decompLines = decompLines; + } + + + public FunctionGlobalVariable functionCount(@javax.annotation.Nonnull Long functionCount) { + this.functionCount = functionCount; + return this; + } + + /** + * How many functions' AI decompilations reference the global. + * @return functionCount + */ + @javax.annotation.Nonnull + public Long getFunctionCount() { + return functionCount; + } + + public void setFunctionCount(@javax.annotation.Nonnull Long functionCount) { + this.functionCount = functionCount; + } + + + public FunctionGlobalVariable indirectTarget(@javax.annotation.Nullable Long indirectTarget) { + this.indirectTarget = indirectTarget; + return this; + } + + /** + * Address a pointer slot resolves to. + * @return indirectTarget + */ + @javax.annotation.Nullable + public Long getIndirectTarget() { + return indirectTarget; + } + + public void setIndirectTarget(@javax.annotation.Nullable Long indirectTarget) { + this.indirectTarget = indirectTarget; + } + + + public FunctionGlobalVariable isBss(@javax.annotation.Nonnull Boolean isBss) { + this.isBss = isBss; + return this; + } + + /** + * Whether the address falls in a zero-initialised section. + * @return isBss + */ + @javax.annotation.Nonnull + public Boolean getIsBss() { + return isBss; + } + + public void setIsBss(@javax.annotation.Nonnull Boolean isBss) { + this.isBss = isBss; + } + + + public FunctionGlobalVariable name(@javax.annotation.Nullable String name) { + this.name = name; + return this; + } + + /** + * Recovered name, absent when nothing named the address. + * @return name + */ + @javax.annotation.Nullable + public String getName() { + return name; + } + + public void setName(@javax.annotation.Nullable String name) { + this.name = name; + } + + + public FunctionGlobalVariable nameSource(@javax.annotation.Nullable NameSourceEnum nameSource) { + this.nameSource = nameSource; + return this; + } + + /** + * What named it. + * @return nameSource + */ + @javax.annotation.Nullable + public NameSourceEnum getNameSource() { + return nameSource; + } + + public void setNameSource(@javax.annotation.Nullable NameSourceEnum nameSource) { + this.nameSource = nameSource; + } + + + public FunctionGlobalVariable refCount(@javax.annotation.Nonnull Long refCount) { + this.refCount = refCount; + return this; + } + + /** + * How many times the function's AI decompilation references the global. + * @return refCount + */ + @javax.annotation.Nonnull + public Long getRefCount() { + return refCount; + } + + public void setRefCount(@javax.annotation.Nonnull Long refCount) { + this.refCount = refCount; + } + + + public FunctionGlobalVariable size(@javax.annotation.Nullable Long size) { + this.size = size; + return this; + } + + /** + * Size in bytes, when known. + * @return size + */ + @javax.annotation.Nullable + public Long getSize() { + return size; + } + + public void setSize(@javax.annotation.Nullable Long size) { + this.size = size; + } + + + public FunctionGlobalVariable sourceFunctionId(@javax.annotation.Nullable Long sourceFunctionId) { + this.sourceFunctionId = sourceFunctionId; + return this; + } + + /** + * Function a constructed static was initialised in. + * @return sourceFunctionId + */ + @javax.annotation.Nullable + public Long getSourceFunctionId() { + return sourceFunctionId; + } + + public void setSourceFunctionId(@javax.annotation.Nullable Long sourceFunctionId) { + this.sourceFunctionId = sourceFunctionId; + } + + + public FunctionGlobalVariable totalRefCount(@javax.annotation.Nonnull Long totalRefCount) { + this.totalRefCount = totalRefCount; + return this; + } + + /** + * How many times those AI decompilations reference the global, summed across functions. + * @return totalRefCount + */ + @javax.annotation.Nonnull + public Long getTotalRefCount() { + return totalRefCount; + } + + public void setTotalRefCount(@javax.annotation.Nonnull Long totalRefCount) { + this.totalRefCount = totalRefCount; + } + + + public FunctionGlobalVariable typeSource(@javax.annotation.Nullable TypeSourceEnum typeSource) { + this.typeSource = typeSource; + return this; + } + + /** + * What typed it. + * @return typeSource + */ + @javax.annotation.Nullable + public TypeSourceEnum getTypeSource() { + return typeSource; + } + + public void setTypeSource(@javax.annotation.Nullable TypeSourceEnum typeSource) { + this.typeSource = typeSource; + } + + + public FunctionGlobalVariable vaddr(@javax.annotation.Nonnull Long vaddr) { + this.vaddr = vaddr; + return this; + } + + /** + * Virtual address the global lives at. + * @return vaddr + */ + @javax.annotation.Nonnull + public Long getVaddr() { + return vaddr; + } + + public void setVaddr(@javax.annotation.Nonnull Long vaddr) { + this.vaddr = vaddr; + } + + + public FunctionGlobalVariable value(@javax.annotation.Nullable String value) { + this.value = value; + return this; + } + + /** + * Decoded initial value, rendered for display. + * @return value + */ + @javax.annotation.Nullable + public String getValue() { + return value; + } + + public void setValue(@javax.annotation.Nullable String value) { + this.value = value; + } + + + public FunctionGlobalVariable valueConfidence(@javax.annotation.Nullable String valueConfidence) { + this.valueConfidence = valueConfidence; + return this; + } + + /** + * How much to trust the decoded value. + * @return valueConfidence + */ + @javax.annotation.Nullable + public String getValueConfidence() { + return valueConfidence; + } + + public void setValueConfidence(@javax.annotation.Nullable String valueConfidence) { + this.valueConfidence = valueConfidence; + } + + + public FunctionGlobalVariable valueKind(@javax.annotation.Nullable ValueKindEnum valueKind) { + this.valueKind = valueKind; + return this; + } + + /** + * How the value was interpreted. + * @return valueKind + */ + @javax.annotation.Nullable + public ValueKindEnum getValueKind() { + return valueKind; + } + + public void setValueKind(@javax.annotation.Nullable ValueKindEnum valueKind) { + this.valueKind = valueKind; + } + + + public FunctionGlobalVariable valueSource(@javax.annotation.Nullable ValueSourceEnum valueSource) { + this.valueSource = valueSource; + return this; + } + + /** + * What produced the value. + * @return valueSource + */ + @javax.annotation.Nullable + public ValueSourceEnum getValueSource() { + return valueSource; + } + + public void setValueSource(@javax.annotation.Nullable ValueSourceEnum valueSource) { + this.valueSource = valueSource; + } + + /** + * 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 FunctionGlobalVariable instance itself + */ + public FunctionGlobalVariable 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; + } + FunctionGlobalVariable functionGlobalVariable = (FunctionGlobalVariable) o; + return Objects.equals(this.dType, functionGlobalVariable.dType) && + Objects.equals(this.dataTypeId, functionGlobalVariable.dataTypeId) && + Objects.equals(this.decompLines, functionGlobalVariable.decompLines) && + Objects.equals(this.functionCount, functionGlobalVariable.functionCount) && + Objects.equals(this.indirectTarget, functionGlobalVariable.indirectTarget) && + Objects.equals(this.isBss, functionGlobalVariable.isBss) && + Objects.equals(this.name, functionGlobalVariable.name) && + Objects.equals(this.nameSource, functionGlobalVariable.nameSource) && + Objects.equals(this.refCount, functionGlobalVariable.refCount) && + Objects.equals(this.size, functionGlobalVariable.size) && + Objects.equals(this.sourceFunctionId, functionGlobalVariable.sourceFunctionId) && + Objects.equals(this.totalRefCount, functionGlobalVariable.totalRefCount) && + Objects.equals(this.typeSource, functionGlobalVariable.typeSource) && + Objects.equals(this.vaddr, functionGlobalVariable.vaddr) && + Objects.equals(this.value, functionGlobalVariable.value) && + Objects.equals(this.valueConfidence, functionGlobalVariable.valueConfidence) && + Objects.equals(this.valueKind, functionGlobalVariable.valueKind) && + Objects.equals(this.valueSource, functionGlobalVariable.valueSource)&& + Objects.equals(this.additionalProperties, functionGlobalVariable.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(dType, dataTypeId, decompLines, functionCount, indirectTarget, isBss, name, nameSource, refCount, size, sourceFunctionId, totalRefCount, typeSource, vaddr, value, valueConfidence, valueKind, valueSource, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class FunctionGlobalVariable {\n"); + sb.append(" dType: ").append(toIndentedString(dType)).append("\n"); + sb.append(" dataTypeId: ").append(toIndentedString(dataTypeId)).append("\n"); + sb.append(" decompLines: ").append(toIndentedString(decompLines)).append("\n"); + sb.append(" functionCount: ").append(toIndentedString(functionCount)).append("\n"); + sb.append(" indirectTarget: ").append(toIndentedString(indirectTarget)).append("\n"); + sb.append(" isBss: ").append(toIndentedString(isBss)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" nameSource: ").append(toIndentedString(nameSource)).append("\n"); + sb.append(" refCount: ").append(toIndentedString(refCount)).append("\n"); + sb.append(" size: ").append(toIndentedString(size)).append("\n"); + sb.append(" sourceFunctionId: ").append(toIndentedString(sourceFunctionId)).append("\n"); + sb.append(" totalRefCount: ").append(toIndentedString(totalRefCount)).append("\n"); + sb.append(" typeSource: ").append(toIndentedString(typeSource)).append("\n"); + sb.append(" vaddr: ").append(toIndentedString(vaddr)).append("\n"); + sb.append(" value: ").append(toIndentedString(value)).append("\n"); + sb.append(" valueConfidence: ").append(toIndentedString(valueConfidence)).append("\n"); + sb.append(" valueKind: ").append(toIndentedString(valueKind)).append("\n"); + sb.append(" valueSource: ").append(toIndentedString(valueSource)).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("d_type", "data_type_id", "decomp_lines", "function_count", "indirect_target", "is_bss", "name", "name_source", "ref_count", "size", "source_function_id", "total_ref_count", "type_source", "vaddr", "value", "value_confidence", "value_kind", "value_source")); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(Arrays.asList("decomp_lines", "function_count", "is_bss", "ref_count", "total_ref_count", "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 FunctionGlobalVariable + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!FunctionGlobalVariable.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 FunctionGlobalVariable is not found in the empty JSON string", FunctionGlobalVariable.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : FunctionGlobalVariable.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("d_type") != null && !jsonObj.get("d_type").isJsonNull()) && !jsonObj.get("d_type").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `d_type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("d_type").toString())); + } + // ensure the required json array is present + if (jsonObj.get("decomp_lines") == null) { + throw new IllegalArgumentException("Expected the field `linkedContent` to be an array in the JSON string but got `null`"); + } else if (!jsonObj.get("decomp_lines").isJsonArray() && !jsonObj.get("decomp_lines").isJsonNull()) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `decomp_lines` to be an array in the JSON string but got `%s`", jsonObj.get("decomp_lines").toString())); + } + if ((jsonObj.get("name") != null && !jsonObj.get("name").isJsonNull()) && !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())); + } + if ((jsonObj.get("name_source") != null && !jsonObj.get("name_source").isJsonNull()) && !jsonObj.get("name_source").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `name_source` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name_source").toString())); + } + // validate the optional field `name_source` + if (jsonObj.get("name_source") != null && !jsonObj.get("name_source").isJsonNull()) { + NameSourceEnum.validateJsonElement(jsonObj.get("name_source")); + } + if ((jsonObj.get("type_source") != null && !jsonObj.get("type_source").isJsonNull()) && !jsonObj.get("type_source").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `type_source` to be a primitive type in the JSON string but got `%s`", jsonObj.get("type_source").toString())); + } + // validate the optional field `type_source` + if (jsonObj.get("type_source") != null && !jsonObj.get("type_source").isJsonNull()) { + TypeSourceEnum.validateJsonElement(jsonObj.get("type_source")); + } + if ((jsonObj.get("value") != null && !jsonObj.get("value").isJsonNull()) && !jsonObj.get("value").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `value` to be a primitive type in the JSON string but got `%s`", jsonObj.get("value").toString())); + } + if ((jsonObj.get("value_confidence") != null && !jsonObj.get("value_confidence").isJsonNull()) && !jsonObj.get("value_confidence").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `value_confidence` to be a primitive type in the JSON string but got `%s`", jsonObj.get("value_confidence").toString())); + } + if ((jsonObj.get("value_kind") != null && !jsonObj.get("value_kind").isJsonNull()) && !jsonObj.get("value_kind").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `value_kind` to be a primitive type in the JSON string but got `%s`", jsonObj.get("value_kind").toString())); + } + // validate the optional field `value_kind` + if (jsonObj.get("value_kind") != null && !jsonObj.get("value_kind").isJsonNull()) { + ValueKindEnum.validateJsonElement(jsonObj.get("value_kind")); + } + if ((jsonObj.get("value_source") != null && !jsonObj.get("value_source").isJsonNull()) && !jsonObj.get("value_source").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `value_source` to be a primitive type in the JSON string but got `%s`", jsonObj.get("value_source").toString())); + } + // validate the optional field `value_source` + if (jsonObj.get("value_source") != null && !jsonObj.get("value_source").isJsonNull()) { + ValueSourceEnum.validateJsonElement(jsonObj.get("value_source")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!FunctionGlobalVariable.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'FunctionGlobalVariable' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(FunctionGlobalVariable.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, FunctionGlobalVariable 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 FunctionGlobalVariable read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + FunctionGlobalVariable 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 FunctionGlobalVariable given an JSON string + * + * @param jsonString JSON string + * @return An instance of FunctionGlobalVariable + * @throws IOException if the JSON string is invalid with respect to FunctionGlobalVariable + */ + public static FunctionGlobalVariable fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, FunctionGlobalVariable.class); + } + + /** + * Convert an instance of FunctionGlobalVariable to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/ai/reveng/model/FunctionSimilarity.java b/src/main/java/ai/reveng/model/FunctionSimilarity.java index ec45f78..e8c5616 100644 --- a/src/main/java/ai/reveng/model/FunctionSimilarity.java +++ b/src/main/java/ai/reveng/model/FunctionSimilarity.java @@ -63,7 +63,7 @@ public class FunctionSimilarity { public static final String SERIALIZED_NAME_SUBJECT = "subject"; @SerializedName(SERIALIZED_NAME_SUBJECT) - @javax.annotation.Nonnull + @javax.annotation.Nullable private Subject subject; public FunctionSimilarity() { @@ -109,7 +109,7 @@ public void setSimilarity(@javax.annotation.Nonnull BigDecimal similarity) { } - public FunctionSimilarity subject(@javax.annotation.Nonnull Subject subject) { + public FunctionSimilarity subject(@javax.annotation.Nullable Subject subject) { this.subject = subject; return this; } @@ -118,12 +118,12 @@ public FunctionSimilarity subject(@javax.annotation.Nonnull Subject subject) { * Get subject * @return subject */ - @javax.annotation.Nonnull + @javax.annotation.Nullable public Subject getSubject() { return subject; } - public void setSubject(@javax.annotation.Nonnull Subject subject) { + public void setSubject(@javax.annotation.Nullable Subject subject) { this.subject = subject; } @@ -248,8 +248,10 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti 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())); } + if (jsonObj.get("subject") != null && !jsonObj.get("subject").isJsonNull()) { // validate the required field `subject` Subject.validateJsonElement(jsonObj.get("subject")); + } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { diff --git a/src/main/java/ai/reveng/model/FunctionSimilarityEvidence.java b/src/main/java/ai/reveng/model/FunctionSimilarityEvidence.java index a0d2f85..73182bc 100644 --- a/src/main/java/ai/reveng/model/FunctionSimilarityEvidence.java +++ b/src/main/java/ai/reveng/model/FunctionSimilarityEvidence.java @@ -13,8 +13,7 @@ package ai.reveng.model; import java.util.Objects; -import ai.reveng.model.EvidenceEffect; -import ai.reveng.model.FunctionSimilarity; +import ai.reveng.model.ReportFunctionSimilarity; import com.google.gson.TypeAdapter; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; @@ -49,12 +48,71 @@ import ai.reveng.invoker.JSON; /** - * Function-similarity results suggestive of a capability. + * FunctionSimilarityEvidence */ @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class FunctionSimilarityEvidence { /** - * Gets or Sets evidenceKind + * Whether the evidence supports or refutes the finding. + */ + @JsonAdapter(EffectEnum.Adapter.class) + public enum EffectEnum { + SUPPORTS("supports"), + + REFUTES("refutes"), + + UNKNOWN_DEFAULT_OPEN_API("unknown_default_open_api"); + + private String value; + + EffectEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static EffectEnum fromValue(String value) { + for (EffectEnum b : EffectEnum.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 EffectEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public EffectEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return EffectEnum.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + EffectEnum.fromValue(value); + } + } + + public static final String SERIALIZED_NAME_EFFECT = "effect"; + @SerializedName(SERIALIZED_NAME_EFFECT) + @javax.annotation.Nonnull + private EffectEnum effect; + + /** + * Kind of evidence. */ @JsonAdapter(EvidenceKindEnum.Adapter.class) public enum EvidenceKindEnum { @@ -107,11 +165,11 @@ 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.FUNCTION_SIMILARITY; + @javax.annotation.Nonnull + private EvidenceKindEnum evidenceKind; /** - * Gets or Sets kind + * How the evidence was derived. */ @JsonAdapter(KindEnum.Adapter.class) public enum KindEnum { @@ -164,16 +222,16 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti public static final String SERIALIZED_NAME_KIND = "kind"; @SerializedName(SERIALIZED_NAME_KIND) - @javax.annotation.Nullable - private KindEnum kind = KindEnum.DETERMINISTIC_DERIVATION; + @javax.annotation.Nonnull + private KindEnum kind; - public static final String SERIALIZED_NAME_EFFECT = "effect"; - @SerializedName(SERIALIZED_NAME_EFFECT) + public static final String SERIALIZED_NAME_SIMILARITIES = "similarities"; + @SerializedName(SERIALIZED_NAME_SIMILARITIES) @javax.annotation.Nonnull - private EvidenceEffect effect; + private List similarities = new ArrayList<>(); /** - * Gets or Sets strength + * How directly the evidence bears on the finding. */ @JsonAdapter(StrengthEnum.Adapter.class) public enum StrengthEnum { @@ -226,119 +284,114 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti public static final String SERIALIZED_NAME_STRENGTH = "strength"; @SerializedName(SERIALIZED_NAME_STRENGTH) - @javax.annotation.Nullable - private StrengthEnum strength = StrengthEnum.INDIRECT; - - public static final String SERIALIZED_NAME_SIMILARITIES = "similarities"; - @SerializedName(SERIALIZED_NAME_SIMILARITIES) @javax.annotation.Nonnull - private List similarities = new ArrayList<>(); + private StrengthEnum strength; public FunctionSimilarityEvidence() { } - public FunctionSimilarityEvidence evidenceKind(@javax.annotation.Nullable EvidenceKindEnum evidenceKind) { + public FunctionSimilarityEvidence effect(@javax.annotation.Nonnull EffectEnum effect) { + this.effect = effect; + return this; + } + + /** + * Whether the evidence supports or refutes the finding. + * @return effect + */ + @javax.annotation.Nonnull + public EffectEnum getEffect() { + return effect; + } + + public void setEffect(@javax.annotation.Nonnull EffectEnum effect) { + this.effect = effect; + } + + + public FunctionSimilarityEvidence evidenceKind(@javax.annotation.Nonnull EvidenceKindEnum evidenceKind) { this.evidenceKind = evidenceKind; return this; } /** - * Get evidenceKind + * Kind of evidence. * @return evidenceKind */ - @javax.annotation.Nullable + @javax.annotation.Nonnull public EvidenceKindEnum getEvidenceKind() { return evidenceKind; } - public void setEvidenceKind(@javax.annotation.Nullable EvidenceKindEnum evidenceKind) { + public void setEvidenceKind(@javax.annotation.Nonnull EvidenceKindEnum evidenceKind) { this.evidenceKind = evidenceKind; } - public FunctionSimilarityEvidence kind(@javax.annotation.Nullable KindEnum kind) { + public FunctionSimilarityEvidence kind(@javax.annotation.Nonnull KindEnum kind) { this.kind = kind; return this; } /** - * Get kind + * How the evidence was derived. * @return kind */ - @javax.annotation.Nullable + @javax.annotation.Nonnull public KindEnum getKind() { return kind; } - public void setKind(@javax.annotation.Nullable KindEnum kind) { + public void setKind(@javax.annotation.Nonnull KindEnum kind) { this.kind = kind; } - public FunctionSimilarityEvidence effect(@javax.annotation.Nonnull EvidenceEffect effect) { - this.effect = effect; + public FunctionSimilarityEvidence similarities(@javax.annotation.Nonnull List similarities) { + this.similarities = similarities; + return this; + } + + public FunctionSimilarityEvidence addSimilaritiesItem(ReportFunctionSimilarity similaritiesItem) { + if (this.similarities == null) { + this.similarities = new ArrayList<>(); + } + this.similarities.add(similaritiesItem); return this; } /** - * Get effect - * @return effect + * The similar functions. + * @return similarities */ @javax.annotation.Nonnull - public EvidenceEffect getEffect() { - return effect; + public List getSimilarities() { + return similarities; } - public void setEffect(@javax.annotation.Nonnull EvidenceEffect effect) { - this.effect = effect; + public void setSimilarities(@javax.annotation.Nonnull List similarities) { + this.similarities = similarities; } - public FunctionSimilarityEvidence strength(@javax.annotation.Nullable StrengthEnum strength) { + public FunctionSimilarityEvidence strength(@javax.annotation.Nonnull StrengthEnum strength) { this.strength = strength; return this; } /** - * Get strength + * How directly the evidence bears on the finding. * @return strength */ - @javax.annotation.Nullable + @javax.annotation.Nonnull public StrengthEnum getStrength() { return strength; } - public void setStrength(@javax.annotation.Nullable StrengthEnum strength) { + public void setStrength(@javax.annotation.Nonnull StrengthEnum strength) { this.strength = strength; } - - public FunctionSimilarityEvidence similarities(@javax.annotation.Nonnull List similarities) { - this.similarities = similarities; - return this; - } - - public FunctionSimilarityEvidence addSimilaritiesItem(FunctionSimilarity similaritiesItem) { - if (this.similarities == null) { - this.similarities = new ArrayList<>(); - } - this.similarities.add(similaritiesItem); - return this; - } - - /** - * Get similarities - * @return similarities - */ - @javax.annotation.Nonnull - public List getSimilarities() { - return similarities; - } - - public void setSimilarities(@javax.annotation.Nonnull List similarities) { - this.similarities = similarities; - } - /** * A container for additional, undeclared properties. * This is a holder for any undeclared properties as specified with @@ -394,28 +447,28 @@ public boolean equals(Object o) { return false; } FunctionSimilarityEvidence functionSimilarityEvidence = (FunctionSimilarityEvidence) o; - return Objects.equals(this.evidenceKind, functionSimilarityEvidence.evidenceKind) && + return Objects.equals(this.effect, functionSimilarityEvidence.effect) && + Objects.equals(this.evidenceKind, functionSimilarityEvidence.evidenceKind) && Objects.equals(this.kind, functionSimilarityEvidence.kind) && - Objects.equals(this.effect, functionSimilarityEvidence.effect) && - Objects.equals(this.strength, functionSimilarityEvidence.strength) && - Objects.equals(this.similarities, functionSimilarityEvidence.similarities)&& + Objects.equals(this.similarities, functionSimilarityEvidence.similarities) && + Objects.equals(this.strength, functionSimilarityEvidence.strength)&& Objects.equals(this.additionalProperties, functionSimilarityEvidence.additionalProperties); } @Override public int hashCode() { - return Objects.hash(evidenceKind, kind, effect, strength, similarities, additionalProperties); + return Objects.hash(effect, evidenceKind, kind, similarities, strength, additionalProperties); } @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class FunctionSimilarityEvidence {\n"); + sb.append(" effect: ").append(toIndentedString(effect)).append("\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"); - sb.append(" strength: ").append(toIndentedString(strength)).append("\n"); sb.append(" similarities: ").append(toIndentedString(similarities)).append("\n"); + sb.append(" strength: ").append(toIndentedString(strength)).append("\n"); sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); sb.append("}"); return sb.toString(); @@ -435,10 +488,10 @@ private String toIndentedString(Object o) { static { // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(Arrays.asList("evidence_kind", "kind", "effect", "strength", "similarities")); + openapiFields = new HashSet(Arrays.asList("effect", "evidence_kind", "kind", "similarities", "strength")); // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(Arrays.asList("effect", "similarities")); + openapiRequiredFields = new HashSet(Arrays.asList("effect", "evidence_kind", "kind", "similarities", "strength")); } /** @@ -461,39 +514,32 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti } } JsonObject jsonObj = jsonElement.getAsJsonObject(); - if ((jsonObj.get("evidence_kind") != null && !jsonObj.get("evidence_kind").isJsonNull()) && !jsonObj.get("evidence_kind").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `evidence_kind` to be a primitive type in the JSON string but got `%s`", jsonObj.get("evidence_kind").toString())); + if (!jsonObj.get("effect").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `effect` to be a primitive type in the JSON string but got `%s`", jsonObj.get("effect").toString())); } - // validate the optional field `evidence_kind` - if (jsonObj.get("evidence_kind") != null && !jsonObj.get("evidence_kind").isJsonNull()) { - EvidenceKindEnum.validateJsonElement(jsonObj.get("evidence_kind")); + // validate the required field `effect` + EffectEnum.validateJsonElement(jsonObj.get("effect")); + if (!jsonObj.get("evidence_kind").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `evidence_kind` to be a primitive type in the JSON string but got `%s`", jsonObj.get("evidence_kind").toString())); } - if ((jsonObj.get("kind") != null && !jsonObj.get("kind").isJsonNull()) && !jsonObj.get("kind").isJsonPrimitive()) { + // validate the required field `evidence_kind` + EvidenceKindEnum.validateJsonElement(jsonObj.get("evidence_kind")); + if (!jsonObj.get("kind").isJsonPrimitive()) { throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `kind` to be a primitive type in the JSON string but got `%s`", jsonObj.get("kind").toString())); } - // validate the optional field `kind` - if (jsonObj.get("kind") != null && !jsonObj.get("kind").isJsonNull()) { - KindEnum.validateJsonElement(jsonObj.get("kind")); + // validate the required field `kind` + KindEnum.validateJsonElement(jsonObj.get("kind")); + // ensure the required json array is present + if (jsonObj.get("similarities") == null) { + throw new IllegalArgumentException("Expected the field `linkedContent` to be an array in the JSON string but got `null`"); + } else if (!jsonObj.get("similarities").isJsonArray()) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `similarities` to be an array in the JSON string but got `%s`", jsonObj.get("similarities").toString())); } - // validate the required field `effect` - EvidenceEffect.validateJsonElement(jsonObj.get("effect")); - if ((jsonObj.get("strength") != null && !jsonObj.get("strength").isJsonNull()) && !jsonObj.get("strength").isJsonPrimitive()) { + if (!jsonObj.get("strength").isJsonPrimitive()) { throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `strength` to be a primitive type in the JSON string but got `%s`", jsonObj.get("strength").toString())); } - // validate the optional field `strength` - if (jsonObj.get("strength") != null && !jsonObj.get("strength").isJsonNull()) { - StrengthEnum.validateJsonElement(jsonObj.get("strength")); - } - if (jsonObj.get("similarities") != null) { - if (!jsonObj.get("similarities").isJsonArray()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `similarities` to be an array in the JSON string but got `%s`", jsonObj.get("similarities").toString())); - } - JsonArray jsonArraysimilarities = jsonObj.getAsJsonArray("similarities"); - // validate the required field `similarities` (array) - for (int i = 0; i < jsonArraysimilarities.size(); i++) { - FunctionSimilarity.validateJsonElement(jsonArraysimilarities.get(i)); - } - } + // validate the required field `strength` + StrengthEnum.validateJsonElement(jsonObj.get("strength")); } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { diff --git a/src/main/java/ai/reveng/model/FunctionUsage.java b/src/main/java/ai/reveng/model/FunctionUsage.java new file mode 100644 index 0000000..5cbf73f --- /dev/null +++ b/src/main/java/ai/reveng/model/FunctionUsage.java @@ -0,0 +1,409 @@ +/* + * 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; + +/** + * FunctionUsage + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class FunctionUsage { + public static final String SERIALIZED_NAME_DECOMP_LINES = "decomp_lines"; + @SerializedName(SERIALIZED_NAME_DECOMP_LINES) + @javax.annotation.Nullable + private List decompLines; + + public static final String SERIALIZED_NAME_FUNCTION_ID = "function_id"; + @SerializedName(SERIALIZED_NAME_FUNCTION_ID) + @javax.annotation.Nonnull + private Long functionId; + + 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 static final String SERIALIZED_NAME_REF_COUNT = "ref_count"; + @SerializedName(SERIALIZED_NAME_REF_COUNT) + @javax.annotation.Nonnull + private Long refCount; + + public FunctionUsage() { + } + + public FunctionUsage decompLines(@javax.annotation.Nullable List decompLines) { + this.decompLines = decompLines; + return this; + } + + public FunctionUsage addDecompLinesItem(Integer decompLinesItem) { + if (this.decompLines == null) { + this.decompLines = new ArrayList<>(); + } + this.decompLines.add(decompLinesItem); + return this; + } + + /** + * Get decompLines + * @return decompLines + */ + @javax.annotation.Nullable + public List getDecompLines() { + return decompLines; + } + + public void setDecompLines(@javax.annotation.Nullable List decompLines) { + this.decompLines = decompLines; + } + + + public FunctionUsage functionId(@javax.annotation.Nonnull Long functionId) { + this.functionId = functionId; + return this; + } + + /** + * Get functionId + * @return functionId + */ + @javax.annotation.Nonnull + public Long getFunctionId() { + return functionId; + } + + public void setFunctionId(@javax.annotation.Nonnull Long functionId) { + this.functionId = functionId; + } + + + public FunctionUsage functionName(@javax.annotation.Nonnull String functionName) { + this.functionName = functionName; + return this; + } + + /** + * Get functionName + * @return functionName + */ + @javax.annotation.Nonnull + public String getFunctionName() { + return functionName; + } + + public void setFunctionName(@javax.annotation.Nonnull String functionName) { + this.functionName = functionName; + } + + + public FunctionUsage functionVaddr(@javax.annotation.Nonnull Long functionVaddr) { + this.functionVaddr = functionVaddr; + return this; + } + + /** + * Get functionVaddr + * @return functionVaddr + */ + @javax.annotation.Nonnull + public Long getFunctionVaddr() { + return functionVaddr; + } + + public void setFunctionVaddr(@javax.annotation.Nonnull Long functionVaddr) { + this.functionVaddr = functionVaddr; + } + + + public FunctionUsage refCount(@javax.annotation.Nonnull Long refCount) { + this.refCount = refCount; + return this; + } + + /** + * Get refCount + * @return refCount + */ + @javax.annotation.Nonnull + public Long getRefCount() { + return refCount; + } + + public void setRefCount(@javax.annotation.Nonnull Long refCount) { + this.refCount = refCount; + } + + /** + * 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 FunctionUsage instance itself + */ + public FunctionUsage 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; + } + FunctionUsage functionUsage = (FunctionUsage) o; + return Objects.equals(this.decompLines, functionUsage.decompLines) && + Objects.equals(this.functionId, functionUsage.functionId) && + Objects.equals(this.functionName, functionUsage.functionName) && + Objects.equals(this.functionVaddr, functionUsage.functionVaddr) && + Objects.equals(this.refCount, functionUsage.refCount)&& + Objects.equals(this.additionalProperties, functionUsage.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(decompLines, functionId, functionName, functionVaddr, refCount, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class FunctionUsage {\n"); + sb.append(" decompLines: ").append(toIndentedString(decompLines)).append("\n"); + sb.append(" functionId: ").append(toIndentedString(functionId)).append("\n"); + sb.append(" functionName: ").append(toIndentedString(functionName)).append("\n"); + sb.append(" functionVaddr: ").append(toIndentedString(functionVaddr)).append("\n"); + sb.append(" refCount: ").append(toIndentedString(refCount)).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("decomp_lines", "function_id", "function_name", "function_vaddr", "ref_count")); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(Arrays.asList("decomp_lines", "function_id", "function_name", "function_vaddr", "ref_count")); + } + + /** + * 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 FunctionUsage + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!FunctionUsage.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 FunctionUsage is not found in the empty JSON string", FunctionUsage.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : FunctionUsage.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("decomp_lines") == null) { + throw new IllegalArgumentException("Expected the field `linkedContent` to be an array in the JSON string but got `null`"); + } else if (!jsonObj.get("decomp_lines").isJsonArray() && !jsonObj.get("decomp_lines").isJsonNull()) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `decomp_lines` to be an array in the JSON string but got `%s`", jsonObj.get("decomp_lines").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 (!FunctionUsage.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'FunctionUsage' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(FunctionUsage.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, FunctionUsage 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 FunctionUsage read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + FunctionUsage 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 FunctionUsage given an JSON string + * + * @param jsonString JSON string + * @return An instance of FunctionUsage + * @throws IOException if the JSON string is invalid with respect to FunctionUsage + */ + public static FunctionUsage fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, FunctionUsage.class); + } + + /** + * Convert an instance of FunctionUsage to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/ai/reveng/model/GetGlobalHistoryOutputBody.java b/src/main/java/ai/reveng/model/GetGlobalHistoryOutputBody.java new file mode 100644 index 0000000..c09548a --- /dev/null +++ b/src/main/java/ai/reveng/model/GetGlobalHistoryOutputBody.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.GlobalHistoryEntry; +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; + +/** + * GetGlobalHistoryOutputBody + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class GetGlobalHistoryOutputBody { + public static final String SERIALIZED_NAME_HISTORY = "history"; + @SerializedName(SERIALIZED_NAME_HISTORY) + @javax.annotation.Nullable + private List history; + + public GetGlobalHistoryOutputBody() { + } + + public GetGlobalHistoryOutputBody history(@javax.annotation.Nullable List history) { + this.history = history; + return this; + } + + public GetGlobalHistoryOutputBody addHistoryItem(GlobalHistoryEntry historyItem) { + if (this.history == null) { + this.history = new ArrayList<>(); + } + this.history.add(historyItem); + return this; + } + + /** + * Replaced values, oldest first. + * @return history + */ + @javax.annotation.Nullable + public List getHistory() { + return history; + } + + public void setHistory(@javax.annotation.Nullable List history) { + this.history = history; + } + + /** + * 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 GetGlobalHistoryOutputBody instance itself + */ + public GetGlobalHistoryOutputBody 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; + } + GetGlobalHistoryOutputBody getGlobalHistoryOutputBody = (GetGlobalHistoryOutputBody) o; + return Objects.equals(this.history, getGlobalHistoryOutputBody.history)&& + Objects.equals(this.additionalProperties, getGlobalHistoryOutputBody.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(history, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetGlobalHistoryOutputBody {\n"); + sb.append(" history: ").append(toIndentedString(history)).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("history")); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(Arrays.asList("history")); + } + + /** + * 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 GetGlobalHistoryOutputBody + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!GetGlobalHistoryOutputBody.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 GetGlobalHistoryOutputBody is not found in the empty JSON string", GetGlobalHistoryOutputBody.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : GetGlobalHistoryOutputBody.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("history") == null) { + throw new IllegalArgumentException("Expected the field `linkedContent` to be an array in the JSON string but got `null`"); + } else if (!jsonObj.get("history").isJsonArray() && !jsonObj.get("history").isJsonNull()) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `history` to be an array in the JSON string but got `%s`", jsonObj.get("history").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!GetGlobalHistoryOutputBody.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'GetGlobalHistoryOutputBody' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(GetGlobalHistoryOutputBody.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, GetGlobalHistoryOutputBody 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 GetGlobalHistoryOutputBody read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + GetGlobalHistoryOutputBody 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 GetGlobalHistoryOutputBody given an JSON string + * + * @param jsonString JSON string + * @return An instance of GetGlobalHistoryOutputBody + * @throws IOException if the JSON string is invalid with respect to GetGlobalHistoryOutputBody + */ + public static GetGlobalHistoryOutputBody fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, GetGlobalHistoryOutputBody.class); + } + + /** + * Convert an instance of GetGlobalHistoryOutputBody to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/ai/reveng/model/GlobalHistoryEntry.java b/src/main/java/ai/reveng/model/GlobalHistoryEntry.java new file mode 100644 index 0000000..e450bad --- /dev/null +++ b/src/main/java/ai/reveng/model/GlobalHistoryEntry.java @@ -0,0 +1,340 @@ +/* + * 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.GlobalVariable; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import ai.reveng.invoker.JSON; + +/** + * GlobalHistoryEntry + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class GlobalHistoryEntry { + public static final String SERIALIZED_NAME_PREVIOUS = "previous"; + @SerializedName(SERIALIZED_NAME_PREVIOUS) + @javax.annotation.Nonnull + private GlobalVariable previous; + + public static final String SERIALIZED_NAME_REPLACED_AT = "replaced_at"; + @SerializedName(SERIALIZED_NAME_REPLACED_AT) + @javax.annotation.Nonnull + private OffsetDateTime replacedAt; + + public static final String SERIALIZED_NAME_REPLACED_BY_USER_ID = "replaced_by_user_id"; + @SerializedName(SERIALIZED_NAME_REPLACED_BY_USER_ID) + @javax.annotation.Nonnull + private Long replacedByUserId; + + public GlobalHistoryEntry() { + } + + public GlobalHistoryEntry previous(@javax.annotation.Nonnull GlobalVariable previous) { + this.previous = previous; + return this; + } + + /** + * The global as it stood before that edit. + * @return previous + */ + @javax.annotation.Nonnull + public GlobalVariable getPrevious() { + return previous; + } + + public void setPrevious(@javax.annotation.Nonnull GlobalVariable previous) { + this.previous = previous; + } + + + public GlobalHistoryEntry replacedAt(@javax.annotation.Nonnull OffsetDateTime replacedAt) { + this.replacedAt = replacedAt; + return this; + } + + /** + * When the value below was replaced. + * @return replacedAt + */ + @javax.annotation.Nonnull + public OffsetDateTime getReplacedAt() { + return replacedAt; + } + + public void setReplacedAt(@javax.annotation.Nonnull OffsetDateTime replacedAt) { + this.replacedAt = replacedAt; + } + + + public GlobalHistoryEntry replacedByUserId(@javax.annotation.Nonnull Long replacedByUserId) { + this.replacedByUserId = replacedByUserId; + return this; + } + + /** + * Who replaced it. + * @return replacedByUserId + */ + @javax.annotation.Nonnull + public Long getReplacedByUserId() { + return replacedByUserId; + } + + public void setReplacedByUserId(@javax.annotation.Nonnull Long replacedByUserId) { + this.replacedByUserId = replacedByUserId; + } + + /** + * 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 GlobalHistoryEntry instance itself + */ + public GlobalHistoryEntry 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; + } + GlobalHistoryEntry globalHistoryEntry = (GlobalHistoryEntry) o; + return Objects.equals(this.previous, globalHistoryEntry.previous) && + Objects.equals(this.replacedAt, globalHistoryEntry.replacedAt) && + Objects.equals(this.replacedByUserId, globalHistoryEntry.replacedByUserId)&& + Objects.equals(this.additionalProperties, globalHistoryEntry.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(previous, replacedAt, replacedByUserId, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GlobalHistoryEntry {\n"); + sb.append(" previous: ").append(toIndentedString(previous)).append("\n"); + sb.append(" replacedAt: ").append(toIndentedString(replacedAt)).append("\n"); + sb.append(" replacedByUserId: ").append(toIndentedString(replacedByUserId)).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("previous", "replaced_at", "replaced_by_user_id")); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(Arrays.asList("previous", "replaced_at", "replaced_by_user_id")); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to GlobalHistoryEntry + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!GlobalHistoryEntry.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 GlobalHistoryEntry is not found in the empty JSON string", GlobalHistoryEntry.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : GlobalHistoryEntry.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 (!GlobalHistoryEntry.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'GlobalHistoryEntry' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(GlobalHistoryEntry.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, GlobalHistoryEntry 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 GlobalHistoryEntry read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + GlobalHistoryEntry 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 GlobalHistoryEntry given an JSON string + * + * @param jsonString JSON string + * @return An instance of GlobalHistoryEntry + * @throws IOException if the JSON string is invalid with respect to GlobalHistoryEntry + */ + public static GlobalHistoryEntry fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, GlobalHistoryEntry.class); + } + + /** + * Convert an instance of GlobalHistoryEntry to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/ai/reveng/model/GlobalVariable.java b/src/main/java/ai/reveng/model/GlobalVariable.java new file mode 100644 index 0000000..0f42fb0 --- /dev/null +++ b/src/main/java/ai/reveng/model/GlobalVariable.java @@ -0,0 +1,988 @@ +/* + * 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; + +/** + * GlobalVariable + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class GlobalVariable { + public static final String SERIALIZED_NAME_D_TYPE = "d_type"; + @SerializedName(SERIALIZED_NAME_D_TYPE) + @javax.annotation.Nullable + private String dType; + + public static final String SERIALIZED_NAME_DATA_TYPE_ID = "data_type_id"; + @SerializedName(SERIALIZED_NAME_DATA_TYPE_ID) + @javax.annotation.Nullable + private Long dataTypeId; + + public static final String SERIALIZED_NAME_FUNCTION_COUNT = "function_count"; + @SerializedName(SERIALIZED_NAME_FUNCTION_COUNT) + @javax.annotation.Nonnull + private Long functionCount; + + public static final String SERIALIZED_NAME_INDIRECT_TARGET = "indirect_target"; + @SerializedName(SERIALIZED_NAME_INDIRECT_TARGET) + @javax.annotation.Nullable + private Long indirectTarget; + + public static final String SERIALIZED_NAME_IS_BSS = "is_bss"; + @SerializedName(SERIALIZED_NAME_IS_BSS) + @javax.annotation.Nonnull + private Boolean isBss; + + public static final String SERIALIZED_NAME_NAME = "name"; + @SerializedName(SERIALIZED_NAME_NAME) + @javax.annotation.Nullable + private String name; + + /** + * What named it. + */ + @JsonAdapter(NameSourceEnum.Adapter.class) + public enum NameSourceEnum { + SYSTEM("SYSTEM"), + + RESOLVER("RESOLVER"), + + DEBUG("DEBUG"), + + CONSTRUCTOR("CONSTRUCTOR"), + + VALUE("VALUE"), + + AI_DECOMP("AI_DECOMP"), + + AI_AGENT("AI_AGENT"), + + USER("USER"), + + ACCESS("ACCESS"), + + UNKNOWN_DEFAULT_OPEN_API("unknown_default_open_api"); + + private String value; + + NameSourceEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static NameSourceEnum fromValue(String value) { + for (NameSourceEnum b : NameSourceEnum.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 NameSourceEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public NameSourceEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return NameSourceEnum.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + NameSourceEnum.fromValue(value); + } + } + + public static final String SERIALIZED_NAME_NAME_SOURCE = "name_source"; + @SerializedName(SERIALIZED_NAME_NAME_SOURCE) + @javax.annotation.Nullable + private NameSourceEnum nameSource; + + public static final String SERIALIZED_NAME_SIZE = "size"; + @SerializedName(SERIALIZED_NAME_SIZE) + @javax.annotation.Nullable + private Long size; + + public static final String SERIALIZED_NAME_SOURCE_FUNCTION_ID = "source_function_id"; + @SerializedName(SERIALIZED_NAME_SOURCE_FUNCTION_ID) + @javax.annotation.Nullable + private Long sourceFunctionId; + + public static final String SERIALIZED_NAME_TOTAL_REF_COUNT = "total_ref_count"; + @SerializedName(SERIALIZED_NAME_TOTAL_REF_COUNT) + @javax.annotation.Nonnull + private Long totalRefCount; + + /** + * What typed it. + */ + @JsonAdapter(TypeSourceEnum.Adapter.class) + public enum TypeSourceEnum { + SYSTEM("SYSTEM"), + + RESOLVER("RESOLVER"), + + DEBUG("DEBUG"), + + CONSTRUCTOR("CONSTRUCTOR"), + + VALUE("VALUE"), + + AI_DECOMP("AI_DECOMP"), + + AI_AGENT("AI_AGENT"), + + USER("USER"), + + ACCESS("ACCESS"), + + UNKNOWN_DEFAULT_OPEN_API("unknown_default_open_api"); + + private String value; + + TypeSourceEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static TypeSourceEnum fromValue(String value) { + for (TypeSourceEnum b : TypeSourceEnum.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 TypeSourceEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public TypeSourceEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return TypeSourceEnum.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + TypeSourceEnum.fromValue(value); + } + } + + public static final String SERIALIZED_NAME_TYPE_SOURCE = "type_source"; + @SerializedName(SERIALIZED_NAME_TYPE_SOURCE) + @javax.annotation.Nullable + private TypeSourceEnum typeSource; + + public static final String SERIALIZED_NAME_VADDR = "vaddr"; + @SerializedName(SERIALIZED_NAME_VADDR) + @javax.annotation.Nonnull + private Long vaddr; + + public static final String SERIALIZED_NAME_VALUE = "value"; + @SerializedName(SERIALIZED_NAME_VALUE) + @javax.annotation.Nullable + private String value; + + public static final String SERIALIZED_NAME_VALUE_CONFIDENCE = "value_confidence"; + @SerializedName(SERIALIZED_NAME_VALUE_CONFIDENCE) + @javax.annotation.Nullable + private String valueConfidence; + + /** + * How the value was interpreted. + */ + @JsonAdapter(ValueKindEnum.Adapter.class) + public enum ValueKindEnum { + BSS("BSS"), + + STRING("STRING"), + + SHORT_STRING("SHORT_STRING"), + + FLOAT("FLOAT"), + + POINTER("POINTER"), + + DYNAMIC_INIT("DYNAMIC_INIT"), + + HEX("HEX"), + + INT("INT"), + + BOOL("BOOL"), + + UNKNOWN_DEFAULT_OPEN_API("unknown_default_open_api"); + + private String value; + + ValueKindEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static ValueKindEnum fromValue(String value) { + for (ValueKindEnum b : ValueKindEnum.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 ValueKindEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public ValueKindEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return ValueKindEnum.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + ValueKindEnum.fromValue(value); + } + } + + public static final String SERIALIZED_NAME_VALUE_KIND = "value_kind"; + @SerializedName(SERIALIZED_NAME_VALUE_KIND) + @javax.annotation.Nullable + private ValueKindEnum valueKind; + + /** + * What produced the value. + */ + @JsonAdapter(ValueSourceEnum.Adapter.class) + public enum ValueSourceEnum { + SYSTEM("SYSTEM"), + + RESOLVER("RESOLVER"), + + DEBUG("DEBUG"), + + CONSTRUCTOR("CONSTRUCTOR"), + + VALUE("VALUE"), + + AI_DECOMP("AI_DECOMP"), + + AI_AGENT("AI_AGENT"), + + USER("USER"), + + ACCESS("ACCESS"), + + UNKNOWN_DEFAULT_OPEN_API("unknown_default_open_api"); + + private String value; + + ValueSourceEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static ValueSourceEnum fromValue(String value) { + for (ValueSourceEnum b : ValueSourceEnum.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 ValueSourceEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public ValueSourceEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return ValueSourceEnum.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + ValueSourceEnum.fromValue(value); + } + } + + public static final String SERIALIZED_NAME_VALUE_SOURCE = "value_source"; + @SerializedName(SERIALIZED_NAME_VALUE_SOURCE) + @javax.annotation.Nullable + private ValueSourceEnum valueSource; + + public GlobalVariable() { + } + + public GlobalVariable dType(@javax.annotation.Nullable String dType) { + this.dType = dType; + return this; + } + + /** + * Name of the assigned data type. + * @return dType + */ + @javax.annotation.Nullable + public String getdType() { + return dType; + } + + public void setdType(@javax.annotation.Nullable String dType) { + this.dType = dType; + } + + + public GlobalVariable dataTypeId(@javax.annotation.Nullable Long dataTypeId) { + this.dataTypeId = dataTypeId; + return this; + } + + /** + * Analysis data type, when one is assigned. + * @return dataTypeId + */ + @javax.annotation.Nullable + public Long getDataTypeId() { + return dataTypeId; + } + + public void setDataTypeId(@javax.annotation.Nullable Long dataTypeId) { + this.dataTypeId = dataTypeId; + } + + + public GlobalVariable functionCount(@javax.annotation.Nonnull Long functionCount) { + this.functionCount = functionCount; + return this; + } + + /** + * How many functions' AI decompilations reference the global. + * @return functionCount + */ + @javax.annotation.Nonnull + public Long getFunctionCount() { + return functionCount; + } + + public void setFunctionCount(@javax.annotation.Nonnull Long functionCount) { + this.functionCount = functionCount; + } + + + public GlobalVariable indirectTarget(@javax.annotation.Nullable Long indirectTarget) { + this.indirectTarget = indirectTarget; + return this; + } + + /** + * Address a pointer slot resolves to. + * @return indirectTarget + */ + @javax.annotation.Nullable + public Long getIndirectTarget() { + return indirectTarget; + } + + public void setIndirectTarget(@javax.annotation.Nullable Long indirectTarget) { + this.indirectTarget = indirectTarget; + } + + + public GlobalVariable isBss(@javax.annotation.Nonnull Boolean isBss) { + this.isBss = isBss; + return this; + } + + /** + * Whether the address falls in a zero-initialised section. + * @return isBss + */ + @javax.annotation.Nonnull + public Boolean getIsBss() { + return isBss; + } + + public void setIsBss(@javax.annotation.Nonnull Boolean isBss) { + this.isBss = isBss; + } + + + public GlobalVariable name(@javax.annotation.Nullable String name) { + this.name = name; + return this; + } + + /** + * Recovered name, absent when nothing named the address. + * @return name + */ + @javax.annotation.Nullable + public String getName() { + return name; + } + + public void setName(@javax.annotation.Nullable String name) { + this.name = name; + } + + + public GlobalVariable nameSource(@javax.annotation.Nullable NameSourceEnum nameSource) { + this.nameSource = nameSource; + return this; + } + + /** + * What named it. + * @return nameSource + */ + @javax.annotation.Nullable + public NameSourceEnum getNameSource() { + return nameSource; + } + + public void setNameSource(@javax.annotation.Nullable NameSourceEnum nameSource) { + this.nameSource = nameSource; + } + + + public GlobalVariable size(@javax.annotation.Nullable Long size) { + this.size = size; + return this; + } + + /** + * Size in bytes, when known. + * @return size + */ + @javax.annotation.Nullable + public Long getSize() { + return size; + } + + public void setSize(@javax.annotation.Nullable Long size) { + this.size = size; + } + + + public GlobalVariable sourceFunctionId(@javax.annotation.Nullable Long sourceFunctionId) { + this.sourceFunctionId = sourceFunctionId; + return this; + } + + /** + * Function a constructed static was initialised in. + * @return sourceFunctionId + */ + @javax.annotation.Nullable + public Long getSourceFunctionId() { + return sourceFunctionId; + } + + public void setSourceFunctionId(@javax.annotation.Nullable Long sourceFunctionId) { + this.sourceFunctionId = sourceFunctionId; + } + + + public GlobalVariable totalRefCount(@javax.annotation.Nonnull Long totalRefCount) { + this.totalRefCount = totalRefCount; + return this; + } + + /** + * How many times those AI decompilations reference the global, summed across functions. + * @return totalRefCount + */ + @javax.annotation.Nonnull + public Long getTotalRefCount() { + return totalRefCount; + } + + public void setTotalRefCount(@javax.annotation.Nonnull Long totalRefCount) { + this.totalRefCount = totalRefCount; + } + + + public GlobalVariable typeSource(@javax.annotation.Nullable TypeSourceEnum typeSource) { + this.typeSource = typeSource; + return this; + } + + /** + * What typed it. + * @return typeSource + */ + @javax.annotation.Nullable + public TypeSourceEnum getTypeSource() { + return typeSource; + } + + public void setTypeSource(@javax.annotation.Nullable TypeSourceEnum typeSource) { + this.typeSource = typeSource; + } + + + public GlobalVariable vaddr(@javax.annotation.Nonnull Long vaddr) { + this.vaddr = vaddr; + return this; + } + + /** + * Virtual address the global lives at. + * @return vaddr + */ + @javax.annotation.Nonnull + public Long getVaddr() { + return vaddr; + } + + public void setVaddr(@javax.annotation.Nonnull Long vaddr) { + this.vaddr = vaddr; + } + + + public GlobalVariable value(@javax.annotation.Nullable String value) { + this.value = value; + return this; + } + + /** + * Decoded initial value, rendered for display. + * @return value + */ + @javax.annotation.Nullable + public String getValue() { + return value; + } + + public void setValue(@javax.annotation.Nullable String value) { + this.value = value; + } + + + public GlobalVariable valueConfidence(@javax.annotation.Nullable String valueConfidence) { + this.valueConfidence = valueConfidence; + return this; + } + + /** + * How much to trust the decoded value. + * @return valueConfidence + */ + @javax.annotation.Nullable + public String getValueConfidence() { + return valueConfidence; + } + + public void setValueConfidence(@javax.annotation.Nullable String valueConfidence) { + this.valueConfidence = valueConfidence; + } + + + public GlobalVariable valueKind(@javax.annotation.Nullable ValueKindEnum valueKind) { + this.valueKind = valueKind; + return this; + } + + /** + * How the value was interpreted. + * @return valueKind + */ + @javax.annotation.Nullable + public ValueKindEnum getValueKind() { + return valueKind; + } + + public void setValueKind(@javax.annotation.Nullable ValueKindEnum valueKind) { + this.valueKind = valueKind; + } + + + public GlobalVariable valueSource(@javax.annotation.Nullable ValueSourceEnum valueSource) { + this.valueSource = valueSource; + return this; + } + + /** + * What produced the value. + * @return valueSource + */ + @javax.annotation.Nullable + public ValueSourceEnum getValueSource() { + return valueSource; + } + + public void setValueSource(@javax.annotation.Nullable ValueSourceEnum valueSource) { + this.valueSource = valueSource; + } + + /** + * 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 GlobalVariable instance itself + */ + public GlobalVariable 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; + } + GlobalVariable globalVariable = (GlobalVariable) o; + return Objects.equals(this.dType, globalVariable.dType) && + Objects.equals(this.dataTypeId, globalVariable.dataTypeId) && + Objects.equals(this.functionCount, globalVariable.functionCount) && + Objects.equals(this.indirectTarget, globalVariable.indirectTarget) && + Objects.equals(this.isBss, globalVariable.isBss) && + Objects.equals(this.name, globalVariable.name) && + Objects.equals(this.nameSource, globalVariable.nameSource) && + Objects.equals(this.size, globalVariable.size) && + Objects.equals(this.sourceFunctionId, globalVariable.sourceFunctionId) && + Objects.equals(this.totalRefCount, globalVariable.totalRefCount) && + Objects.equals(this.typeSource, globalVariable.typeSource) && + Objects.equals(this.vaddr, globalVariable.vaddr) && + Objects.equals(this.value, globalVariable.value) && + Objects.equals(this.valueConfidence, globalVariable.valueConfidence) && + Objects.equals(this.valueKind, globalVariable.valueKind) && + Objects.equals(this.valueSource, globalVariable.valueSource)&& + Objects.equals(this.additionalProperties, globalVariable.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(dType, dataTypeId, functionCount, indirectTarget, isBss, name, nameSource, size, sourceFunctionId, totalRefCount, typeSource, vaddr, value, valueConfidence, valueKind, valueSource, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GlobalVariable {\n"); + sb.append(" dType: ").append(toIndentedString(dType)).append("\n"); + sb.append(" dataTypeId: ").append(toIndentedString(dataTypeId)).append("\n"); + sb.append(" functionCount: ").append(toIndentedString(functionCount)).append("\n"); + sb.append(" indirectTarget: ").append(toIndentedString(indirectTarget)).append("\n"); + sb.append(" isBss: ").append(toIndentedString(isBss)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" nameSource: ").append(toIndentedString(nameSource)).append("\n"); + sb.append(" size: ").append(toIndentedString(size)).append("\n"); + sb.append(" sourceFunctionId: ").append(toIndentedString(sourceFunctionId)).append("\n"); + sb.append(" totalRefCount: ").append(toIndentedString(totalRefCount)).append("\n"); + sb.append(" typeSource: ").append(toIndentedString(typeSource)).append("\n"); + sb.append(" vaddr: ").append(toIndentedString(vaddr)).append("\n"); + sb.append(" value: ").append(toIndentedString(value)).append("\n"); + sb.append(" valueConfidence: ").append(toIndentedString(valueConfidence)).append("\n"); + sb.append(" valueKind: ").append(toIndentedString(valueKind)).append("\n"); + sb.append(" valueSource: ").append(toIndentedString(valueSource)).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("d_type", "data_type_id", "function_count", "indirect_target", "is_bss", "name", "name_source", "size", "source_function_id", "total_ref_count", "type_source", "vaddr", "value", "value_confidence", "value_kind", "value_source")); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(Arrays.asList("function_count", "is_bss", "total_ref_count", "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 GlobalVariable + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!GlobalVariable.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 GlobalVariable is not found in the empty JSON string", GlobalVariable.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : GlobalVariable.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("d_type") != null && !jsonObj.get("d_type").isJsonNull()) && !jsonObj.get("d_type").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `d_type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("d_type").toString())); + } + if ((jsonObj.get("name") != null && !jsonObj.get("name").isJsonNull()) && !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())); + } + if ((jsonObj.get("name_source") != null && !jsonObj.get("name_source").isJsonNull()) && !jsonObj.get("name_source").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `name_source` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name_source").toString())); + } + // validate the optional field `name_source` + if (jsonObj.get("name_source") != null && !jsonObj.get("name_source").isJsonNull()) { + NameSourceEnum.validateJsonElement(jsonObj.get("name_source")); + } + if ((jsonObj.get("type_source") != null && !jsonObj.get("type_source").isJsonNull()) && !jsonObj.get("type_source").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `type_source` to be a primitive type in the JSON string but got `%s`", jsonObj.get("type_source").toString())); + } + // validate the optional field `type_source` + if (jsonObj.get("type_source") != null && !jsonObj.get("type_source").isJsonNull()) { + TypeSourceEnum.validateJsonElement(jsonObj.get("type_source")); + } + if ((jsonObj.get("value") != null && !jsonObj.get("value").isJsonNull()) && !jsonObj.get("value").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `value` to be a primitive type in the JSON string but got `%s`", jsonObj.get("value").toString())); + } + if ((jsonObj.get("value_confidence") != null && !jsonObj.get("value_confidence").isJsonNull()) && !jsonObj.get("value_confidence").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `value_confidence` to be a primitive type in the JSON string but got `%s`", jsonObj.get("value_confidence").toString())); + } + if ((jsonObj.get("value_kind") != null && !jsonObj.get("value_kind").isJsonNull()) && !jsonObj.get("value_kind").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `value_kind` to be a primitive type in the JSON string but got `%s`", jsonObj.get("value_kind").toString())); + } + // validate the optional field `value_kind` + if (jsonObj.get("value_kind") != null && !jsonObj.get("value_kind").isJsonNull()) { + ValueKindEnum.validateJsonElement(jsonObj.get("value_kind")); + } + if ((jsonObj.get("value_source") != null && !jsonObj.get("value_source").isJsonNull()) && !jsonObj.get("value_source").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `value_source` to be a primitive type in the JSON string but got `%s`", jsonObj.get("value_source").toString())); + } + // validate the optional field `value_source` + if (jsonObj.get("value_source") != null && !jsonObj.get("value_source").isJsonNull()) { + ValueSourceEnum.validateJsonElement(jsonObj.get("value_source")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!GlobalVariable.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'GlobalVariable' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(GlobalVariable.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, GlobalVariable 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 GlobalVariable read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + GlobalVariable 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 GlobalVariable given an JSON string + * + * @param jsonString JSON string + * @return An instance of GlobalVariable + * @throws IOException if the JSON string is invalid with respect to GlobalVariable + */ + public static GlobalVariable fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, GlobalVariable.class); + } + + /** + * Convert an instance of GlobalVariable to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/ai/reveng/model/HardcodedSecretEvidence.java b/src/main/java/ai/reveng/model/HardcodedSecretEvidence.java index bc44b25..26b12bb 100644 --- a/src/main/java/ai/reveng/model/HardcodedSecretEvidence.java +++ b/src/main/java/ai/reveng/model/HardcodedSecretEvidence.java @@ -13,15 +13,12 @@ package ai.reveng.model; import java.util.Objects; -import ai.reveng.model.EvidenceStrength; -import ai.reveng.model.RuleKind; import com.google.gson.TypeAdapter; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import java.io.IOException; -import java.math.BigDecimal; import java.util.ArrayList; import java.util.Arrays; import java.util.List; @@ -50,12 +47,79 @@ import ai.reveng.invoker.JSON; /** - * A hard-coded secret identified in the binary's data. + * HardcodedSecretEvidence */ @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class HardcodedSecretEvidence { + public static final String SERIALIZED_NAME_DESCRIPTION = "description"; + @SerializedName(SERIALIZED_NAME_DESCRIPTION) + @javax.annotation.Nonnull + private String description; + /** - * Gets or Sets evidenceKind + * Whether the evidence supports or refutes the finding. + */ + @JsonAdapter(EffectEnum.Adapter.class) + public enum EffectEnum { + SUPPORTS("supports"), + + UNKNOWN_DEFAULT_OPEN_API("unknown_default_open_api"); + + private String value; + + EffectEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static EffectEnum fromValue(String value) { + for (EffectEnum b : EffectEnum.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 EffectEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public EffectEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return EffectEnum.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + EffectEnum.fromValue(value); + } + } + + public static final String SERIALIZED_NAME_EFFECT = "effect"; + @SerializedName(SERIALIZED_NAME_EFFECT) + @javax.annotation.Nonnull + private EffectEnum effect; + + public static final String SERIALIZED_NAME_ENTROPY = "entropy"; + @SerializedName(SERIALIZED_NAME_ENTROPY) + @javax.annotation.Nonnull + private Double entropy; + + /** + * Kind of evidence. */ @JsonAdapter(EvidenceKindEnum.Adapter.class) public enum EvidenceKindEnum { @@ -108,11 +172,11 @@ 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.HARDCODED_SECRET; + @javax.annotation.Nonnull + private EvidenceKindEnum evidenceKind; /** - * Gets or Sets kind + * How the evidence was derived. */ @JsonAdapter(KindEnum.Adapter.class) public enum KindEnum { @@ -165,21 +229,52 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti public static final String SERIALIZED_NAME_KIND = "kind"; @SerializedName(SERIALIZED_NAME_KIND) - @javax.annotation.Nullable - private KindEnum kind = KindEnum.DETERMINISTIC_DERIVATION; + @javax.annotation.Nonnull + private KindEnum kind; + + public static final String SERIALIZED_NAME_REFERENCES = "references"; + @SerializedName(SERIALIZED_NAME_REFERENCES) + @javax.annotation.Nonnull + private List references = new ArrayList<>(); + + public static final String SERIALIZED_NAME_RULE_ID = "rule_id"; + @SerializedName(SERIALIZED_NAME_RULE_ID) + @javax.annotation.Nonnull + private String ruleId; + + public static final String SERIALIZED_NAME_SECRET = "secret"; + @SerializedName(SERIALIZED_NAME_SECRET) + @javax.annotation.Nonnull + private String secret; /** - * Gets or Sets effect + * Category of the secret. */ - @JsonAdapter(EffectEnum.Adapter.class) - public enum EffectEnum { - SUPPORTS("supports"), + @JsonAdapter(SecretKindEnum.Adapter.class) + public enum SecretKindEnum { + CREDENTIALS("credentials"), + + API_CREDENTIALS("api-credentials"), + + OAUTH_CREDENTIALS("oauth-credentials"), + + ENCRYPTION_KEY("encryption-key"), + + JWT_TOKEN("jwt-token"), + + WEBHOOK_URL("webhook-url"), + + PRIVATE_KEY("private-key"), + + SIGNED_URL("signed-url"), + + GENERIC("generic"), UNKNOWN_DEFAULT_OPEN_API("unknown_default_open_api"); private String value; - EffectEnum(String value) { + SecretKindEnum(String value) { this.value = value; } @@ -192,8 +287,8 @@ public String toString() { return String.valueOf(value); } - public static EffectEnum fromValue(String value) { - for (EffectEnum b : EffectEnum.values()) { + public static SecretKindEnum fromValue(String value) { + for (SecretKindEnum b : SecretKindEnum.values()) { if (b.value.equals(value)) { return b; } @@ -201,203 +296,237 @@ public static EffectEnum fromValue(String value) { return UNKNOWN_DEFAULT_OPEN_API; } - public static class Adapter extends TypeAdapter { + public static class Adapter extends TypeAdapter { @Override - public void write(final JsonWriter jsonWriter, final EffectEnum enumeration) throws IOException { + public void write(final JsonWriter jsonWriter, final SecretKindEnum enumeration) throws IOException { jsonWriter.value(enumeration.getValue()); } @Override - public EffectEnum read(final JsonReader jsonReader) throws IOException { + public SecretKindEnum read(final JsonReader jsonReader) throws IOException { String value = jsonReader.nextString(); - return EffectEnum.fromValue(value); + return SecretKindEnum.fromValue(value); } } public static void validateJsonElement(JsonElement jsonElement) throws IOException { String value = jsonElement.getAsString(); - EffectEnum.fromValue(value); + SecretKindEnum.fromValue(value); } } - public static final String SERIALIZED_NAME_EFFECT = "effect"; - @SerializedName(SERIALIZED_NAME_EFFECT) - @javax.annotation.Nullable - private EffectEnum effect = EffectEnum.SUPPORTS; - - public static final String SERIALIZED_NAME_STRENGTH = "strength"; - @SerializedName(SERIALIZED_NAME_STRENGTH) + public static final String SERIALIZED_NAME_SECRET_KIND = "secret_kind"; + @SerializedName(SERIALIZED_NAME_SECRET_KIND) @javax.annotation.Nonnull - private EvidenceStrength strength; + private SecretKindEnum secretKind; - public static final String SERIALIZED_NAME_RULE_ID = "rule_id"; - @SerializedName(SERIALIZED_NAME_RULE_ID) + public static final String SERIALIZED_NAME_SIZE = "size"; + @SerializedName(SERIALIZED_NAME_SIZE) @javax.annotation.Nonnull - private String ruleId; + private Long size; - public static final String SERIALIZED_NAME_DESCRIPTION = "description"; - @SerializedName(SERIALIZED_NAME_DESCRIPTION) - @javax.annotation.Nonnull - private String description; + /** + * How directly the evidence bears on the finding. + */ + @JsonAdapter(StrengthEnum.Adapter.class) + public enum StrengthEnum { + DIRECT("direct"), + + INDIRECT("indirect"), + + UNKNOWN_DEFAULT_OPEN_API("unknown_default_open_api"); - public static final String SERIALIZED_NAME_SECRET_KIND = "secret_kind"; - @SerializedName(SERIALIZED_NAME_SECRET_KIND) - @javax.annotation.Nonnull - private RuleKind secretKind; + private String value; - public static final String SERIALIZED_NAME_SECRET = "secret"; - @SerializedName(SERIALIZED_NAME_SECRET) - @javax.annotation.Nonnull - private String secret; + StrengthEnum(String value) { + this.value = value; + } - public static final String SERIALIZED_NAME_ENTROPY = "entropy"; - @SerializedName(SERIALIZED_NAME_ENTROPY) - @javax.annotation.Nonnull - private BigDecimal entropy; + public String getValue() { + return value; + } - public static final String SERIALIZED_NAME_SIZE = "size"; - @SerializedName(SERIALIZED_NAME_SIZE) - @javax.annotation.Nonnull - private Integer size; + @Override + public String toString() { + return String.valueOf(value); + } - public static final String SERIALIZED_NAME_REFERENCES = "references"; - @SerializedName(SERIALIZED_NAME_REFERENCES) + public static StrengthEnum fromValue(String value) { + for (StrengthEnum b : StrengthEnum.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 StrengthEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public StrengthEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return StrengthEnum.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + StrengthEnum.fromValue(value); + } + } + + public static final String SERIALIZED_NAME_STRENGTH = "strength"; + @SerializedName(SERIALIZED_NAME_STRENGTH) @javax.annotation.Nonnull - private List references = new ArrayList<>(); + private StrengthEnum strength; public HardcodedSecretEvidence() { } - public HardcodedSecretEvidence evidenceKind(@javax.annotation.Nullable EvidenceKindEnum evidenceKind) { - this.evidenceKind = evidenceKind; + public HardcodedSecretEvidence description(@javax.annotation.Nonnull String description) { + this.description = description; return this; } /** - * Get evidenceKind - * @return evidenceKind + * What the rule detects. + * @return description */ - @javax.annotation.Nullable - public EvidenceKindEnum getEvidenceKind() { - return evidenceKind; + @javax.annotation.Nonnull + public String getDescription() { + return description; } - public void setEvidenceKind(@javax.annotation.Nullable EvidenceKindEnum evidenceKind) { - this.evidenceKind = evidenceKind; + public void setDescription(@javax.annotation.Nonnull String description) { + this.description = description; } - public HardcodedSecretEvidence kind(@javax.annotation.Nullable KindEnum kind) { - this.kind = kind; + public HardcodedSecretEvidence effect(@javax.annotation.Nonnull EffectEnum effect) { + this.effect = effect; return this; } /** - * Get kind - * @return kind + * Whether the evidence supports or refutes the finding. + * @return effect */ - @javax.annotation.Nullable - public KindEnum getKind() { - return kind; + @javax.annotation.Nonnull + public EffectEnum getEffect() { + return effect; } - public void setKind(@javax.annotation.Nullable KindEnum kind) { - this.kind = kind; + public void setEffect(@javax.annotation.Nonnull EffectEnum effect) { + this.effect = effect; } - public HardcodedSecretEvidence effect(@javax.annotation.Nullable EffectEnum effect) { - this.effect = effect; + public HardcodedSecretEvidence entropy(@javax.annotation.Nonnull Double entropy) { + this.entropy = entropy; return this; } /** - * Get effect - * @return effect + * Shannon entropy of the secret, in bits per byte. + * minimum: 0 + * maximum: 8 + * @return entropy */ - @javax.annotation.Nullable - public EffectEnum getEffect() { - return effect; + @javax.annotation.Nonnull + public Double getEntropy() { + return entropy; } - public void setEffect(@javax.annotation.Nullable EffectEnum effect) { - this.effect = effect; + public void setEntropy(@javax.annotation.Nonnull Double entropy) { + this.entropy = entropy; } - public HardcodedSecretEvidence strength(@javax.annotation.Nonnull EvidenceStrength strength) { - this.strength = strength; + public HardcodedSecretEvidence evidenceKind(@javax.annotation.Nonnull EvidenceKindEnum evidenceKind) { + this.evidenceKind = evidenceKind; return this; } /** - * Get strength - * @return strength + * Kind of evidence. + * @return evidenceKind */ @javax.annotation.Nonnull - public EvidenceStrength getStrength() { - return strength; + public EvidenceKindEnum getEvidenceKind() { + return evidenceKind; } - public void setStrength(@javax.annotation.Nonnull EvidenceStrength strength) { - this.strength = strength; + public void setEvidenceKind(@javax.annotation.Nonnull EvidenceKindEnum evidenceKind) { + this.evidenceKind = evidenceKind; } - public HardcodedSecretEvidence ruleId(@javax.annotation.Nonnull String ruleId) { - this.ruleId = ruleId; + public HardcodedSecretEvidence kind(@javax.annotation.Nonnull KindEnum kind) { + this.kind = kind; return this; } /** - * Get ruleId - * @return ruleId + * How the evidence was derived. + * @return kind */ @javax.annotation.Nonnull - public String getRuleId() { - return ruleId; + public KindEnum getKind() { + return kind; } - public void setRuleId(@javax.annotation.Nonnull String ruleId) { - this.ruleId = ruleId; + public void setKind(@javax.annotation.Nonnull KindEnum kind) { + this.kind = kind; } - public HardcodedSecretEvidence description(@javax.annotation.Nonnull String description) { - this.description = description; + public HardcodedSecretEvidence references(@javax.annotation.Nonnull List references) { + this.references = references; + return this; + } + + public HardcodedSecretEvidence addReferencesItem(Long referencesItem) { + if (this.references == null) { + this.references = new ArrayList<>(); + } + this.references.add(referencesItem); return this; } /** - * Get description - * @return description + * Address of the secret in the binary's data. + * @return references */ @javax.annotation.Nonnull - public String getDescription() { - return description; + public List getReferences() { + return references; } - public void setDescription(@javax.annotation.Nonnull String description) { - this.description = description; + public void setReferences(@javax.annotation.Nonnull List references) { + this.references = references; } - public HardcodedSecretEvidence secretKind(@javax.annotation.Nonnull RuleKind secretKind) { - this.secretKind = secretKind; + public HardcodedSecretEvidence ruleId(@javax.annotation.Nonnull String ruleId) { + this.ruleId = ruleId; return this; } /** - * Get secretKind - * @return secretKind + * Identifier of the secret-scanning rule that matched. + * @return ruleId */ @javax.annotation.Nonnull - public RuleKind getSecretKind() { - return secretKind; + public String getRuleId() { + return ruleId; } - public void setSecretKind(@javax.annotation.Nonnull RuleKind secretKind) { - this.secretKind = secretKind; + public void setRuleId(@javax.annotation.Nonnull String ruleId) { + this.ruleId = ruleId; } @@ -407,7 +536,7 @@ public HardcodedSecretEvidence secret(@javax.annotation.Nonnull String secret) { } /** - * Get secret + * The secret as it appears in the binary. * @return secret */ @javax.annotation.Nonnull @@ -420,71 +549,61 @@ public void setSecret(@javax.annotation.Nonnull String secret) { } - public HardcodedSecretEvidence entropy(@javax.annotation.Nonnull BigDecimal entropy) { - this.entropy = entropy; + public HardcodedSecretEvidence secretKind(@javax.annotation.Nonnull SecretKindEnum secretKind) { + this.secretKind = secretKind; return this; } /** - * Get entropy - * minimum: 0 - * maximum: 8 - * @return entropy + * Category of the secret. + * @return secretKind */ @javax.annotation.Nonnull - public BigDecimal getEntropy() { - return entropy; + public SecretKindEnum getSecretKind() { + return secretKind; } - public void setEntropy(@javax.annotation.Nonnull BigDecimal entropy) { - this.entropy = entropy; + public void setSecretKind(@javax.annotation.Nonnull SecretKindEnum secretKind) { + this.secretKind = secretKind; } - public HardcodedSecretEvidence size(@javax.annotation.Nonnull Integer size) { + public HardcodedSecretEvidence size(@javax.annotation.Nonnull Long size) { this.size = size; return this; } /** - * Get size + * Size of the secret in bytes. * minimum: 1 * @return size */ @javax.annotation.Nonnull - public Integer getSize() { + public Long getSize() { return size; } - public void setSize(@javax.annotation.Nonnull Integer size) { + public void setSize(@javax.annotation.Nonnull Long size) { this.size = size; } - public HardcodedSecretEvidence references(@javax.annotation.Nonnull List references) { - this.references = references; - return this; - } - - public HardcodedSecretEvidence addReferencesItem(Integer referencesItem) { - if (this.references == null) { - this.references = new ArrayList<>(); - } - this.references.add(referencesItem); + public HardcodedSecretEvidence strength(@javax.annotation.Nonnull StrengthEnum strength) { + this.strength = strength; return this; } /** - * Get references - * @return references + * How directly the evidence bears on the finding. + * @return strength */ @javax.annotation.Nonnull - public List getReferences() { - return references; + public StrengthEnum getStrength() { + return strength; } - public void setReferences(@javax.annotation.Nonnull List references) { - this.references = references; + public void setStrength(@javax.annotation.Nonnull StrengthEnum strength) { + this.strength = strength; } /** @@ -542,40 +661,40 @@ public boolean equals(Object o) { return false; } HardcodedSecretEvidence hardcodedSecretEvidence = (HardcodedSecretEvidence) o; - return Objects.equals(this.evidenceKind, hardcodedSecretEvidence.evidenceKind) && - Objects.equals(this.kind, hardcodedSecretEvidence.kind) && + return Objects.equals(this.description, hardcodedSecretEvidence.description) && Objects.equals(this.effect, hardcodedSecretEvidence.effect) && - Objects.equals(this.strength, hardcodedSecretEvidence.strength) && + Objects.equals(this.entropy, hardcodedSecretEvidence.entropy) && + Objects.equals(this.evidenceKind, hardcodedSecretEvidence.evidenceKind) && + Objects.equals(this.kind, hardcodedSecretEvidence.kind) && + Objects.equals(this.references, hardcodedSecretEvidence.references) && Objects.equals(this.ruleId, hardcodedSecretEvidence.ruleId) && - Objects.equals(this.description, hardcodedSecretEvidence.description) && - Objects.equals(this.secretKind, hardcodedSecretEvidence.secretKind) && Objects.equals(this.secret, hardcodedSecretEvidence.secret) && - Objects.equals(this.entropy, hardcodedSecretEvidence.entropy) && + Objects.equals(this.secretKind, hardcodedSecretEvidence.secretKind) && Objects.equals(this.size, hardcodedSecretEvidence.size) && - Objects.equals(this.references, hardcodedSecretEvidence.references)&& + Objects.equals(this.strength, hardcodedSecretEvidence.strength)&& Objects.equals(this.additionalProperties, hardcodedSecretEvidence.additionalProperties); } @Override public int hashCode() { - return Objects.hash(evidenceKind, kind, effect, strength, ruleId, description, secretKind, secret, entropy, size, references, additionalProperties); + return Objects.hash(description, effect, entropy, evidenceKind, kind, references, ruleId, secret, secretKind, size, strength, additionalProperties); } @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class HardcodedSecretEvidence {\n"); + sb.append(" description: ").append(toIndentedString(description)).append("\n"); + sb.append(" effect: ").append(toIndentedString(effect)).append("\n"); + sb.append(" entropy: ").append(toIndentedString(entropy)).append("\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"); - sb.append(" strength: ").append(toIndentedString(strength)).append("\n"); + sb.append(" references: ").append(toIndentedString(references)).append("\n"); sb.append(" ruleId: ").append(toIndentedString(ruleId)).append("\n"); - sb.append(" description: ").append(toIndentedString(description)).append("\n"); - sb.append(" secretKind: ").append(toIndentedString(secretKind)).append("\n"); sb.append(" secret: ").append(toIndentedString(secret)).append("\n"); - sb.append(" entropy: ").append(toIndentedString(entropy)).append("\n"); + sb.append(" secretKind: ").append(toIndentedString(secretKind)).append("\n"); sb.append(" size: ").append(toIndentedString(size)).append("\n"); - sb.append(" references: ").append(toIndentedString(references)).append("\n"); + sb.append(" strength: ").append(toIndentedString(strength)).append("\n"); sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); sb.append("}"); return sb.toString(); @@ -595,10 +714,10 @@ private String toIndentedString(Object o) { static { // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(Arrays.asList("evidence_kind", "kind", "effect", "strength", "rule_id", "description", "secret_kind", "secret", "entropy", "size", "references")); + openapiFields = new HashSet(Arrays.asList("description", "effect", "entropy", "evidence_kind", "kind", "references", "rule_id", "secret", "secret_kind", "size", "strength")); // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(Arrays.asList("strength", "rule_id", "description", "secret_kind", "secret", "entropy", "size", "references")); + openapiRequiredFields = new HashSet(Arrays.asList("description", "effect", "entropy", "evidence_kind", "kind", "references", "rule_id", "secret", "secret_kind", "size", "strength")); } /** @@ -621,46 +740,46 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti } } JsonObject jsonObj = jsonElement.getAsJsonObject(); - if ((jsonObj.get("evidence_kind") != null && !jsonObj.get("evidence_kind").isJsonNull()) && !jsonObj.get("evidence_kind").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `evidence_kind` to be a primitive type in the JSON string but got `%s`", jsonObj.get("evidence_kind").toString())); - } - // validate the optional field `evidence_kind` - if (jsonObj.get("evidence_kind") != null && !jsonObj.get("evidence_kind").isJsonNull()) { - EvidenceKindEnum.validateJsonElement(jsonObj.get("evidence_kind")); + if (!jsonObj.get("description").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `description` to be a primitive type in the JSON string but got `%s`", jsonObj.get("description").toString())); } - if ((jsonObj.get("kind") != null && !jsonObj.get("kind").isJsonNull()) && !jsonObj.get("kind").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `kind` to be a primitive type in the JSON string but got `%s`", jsonObj.get("kind").toString())); + if (!jsonObj.get("effect").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `effect` to be a primitive type in the JSON string but got `%s`", jsonObj.get("effect").toString())); } - // validate the optional field `kind` - if (jsonObj.get("kind") != null && !jsonObj.get("kind").isJsonNull()) { - KindEnum.validateJsonElement(jsonObj.get("kind")); + // validate the required field `effect` + EffectEnum.validateJsonElement(jsonObj.get("effect")); + if (!jsonObj.get("evidence_kind").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `evidence_kind` to be a primitive type in the JSON string but got `%s`", jsonObj.get("evidence_kind").toString())); } - if ((jsonObj.get("effect") != null && !jsonObj.get("effect").isJsonNull()) && !jsonObj.get("effect").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `effect` to be a primitive type in the JSON string but got `%s`", jsonObj.get("effect").toString())); + // validate the required field `evidence_kind` + EvidenceKindEnum.validateJsonElement(jsonObj.get("evidence_kind")); + if (!jsonObj.get("kind").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `kind` to be a primitive type in the JSON string but got `%s`", jsonObj.get("kind").toString())); } - // validate the optional field `effect` - if (jsonObj.get("effect") != null && !jsonObj.get("effect").isJsonNull()) { - EffectEnum.validateJsonElement(jsonObj.get("effect")); + // validate the required field `kind` + KindEnum.validateJsonElement(jsonObj.get("kind")); + // ensure the required json array is present + if (jsonObj.get("references") == null) { + throw new IllegalArgumentException("Expected the field `linkedContent` to be an array in the JSON string but got `null`"); + } else if (!jsonObj.get("references").isJsonArray()) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `references` to be an array in the JSON string but got `%s`", jsonObj.get("references").toString())); } - // validate the required field `strength` - EvidenceStrength.validateJsonElement(jsonObj.get("strength")); if (!jsonObj.get("rule_id").isJsonPrimitive()) { throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `rule_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("rule_id").toString())); } - if (!jsonObj.get("description").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `description` to be a primitive type in the JSON string but got `%s`", jsonObj.get("description").toString())); - } - // validate the required field `secret_kind` - RuleKind.validateJsonElement(jsonObj.get("secret_kind")); if (!jsonObj.get("secret").isJsonPrimitive()) { throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `secret` to be a primitive type in the JSON string but got `%s`", jsonObj.get("secret").toString())); } - // ensure the required json array is present - if (jsonObj.get("references") == null) { - throw new IllegalArgumentException("Expected the field `linkedContent` to be an array in the JSON string but got `null`"); - } else if (!jsonObj.get("references").isJsonArray()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `references` to be an array in the JSON string but got `%s`", jsonObj.get("references").toString())); + if (!jsonObj.get("secret_kind").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `secret_kind` to be a primitive type in the JSON string but got `%s`", jsonObj.get("secret_kind").toString())); } + // validate the required field `secret_kind` + SecretKindEnum.validateJsonElement(jsonObj.get("secret_kind")); + if (!jsonObj.get("strength").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `strength` to be a primitive type in the JSON string but got `%s`", jsonObj.get("strength").toString())); + } + // validate the required field `strength` + StrengthEnum.validateJsonElement(jsonObj.get("strength")); } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { diff --git a/src/main/java/ai/reveng/model/ImportedAPICallEvidence.java b/src/main/java/ai/reveng/model/ImportedAPICallEvidence.java new file mode 100644 index 0000000..89ff6a8 --- /dev/null +++ b/src/main/java/ai/reveng/model/ImportedAPICallEvidence.java @@ -0,0 +1,637 @@ +/* + * 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.ReportImportedAPICall; +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; + +/** + * ImportedAPICallEvidence + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class ImportedAPICallEvidence { + public static final String SERIALIZED_NAME_CALLS = "calls"; + @SerializedName(SERIALIZED_NAME_CALLS) + @javax.annotation.Nonnull + private List calls = new ArrayList<>(); + + /** + * Whether the evidence supports or refutes the finding. + */ + @JsonAdapter(EffectEnum.Adapter.class) + public enum EffectEnum { + SUPPORTS("supports"), + + REFUTES("refutes"), + + UNKNOWN_DEFAULT_OPEN_API("unknown_default_open_api"); + + private String value; + + EffectEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static EffectEnum fromValue(String value) { + for (EffectEnum b : EffectEnum.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 EffectEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public EffectEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return EffectEnum.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + EffectEnum.fromValue(value); + } + } + + public static final String SERIALIZED_NAME_EFFECT = "effect"; + @SerializedName(SERIALIZED_NAME_EFFECT) + @javax.annotation.Nonnull + private EffectEnum effect; + + /** + * Kind of evidence. + */ + @JsonAdapter(EvidenceKindEnum.Adapter.class) + public enum EvidenceKindEnum { + IMPORTED_API_CALL("imported_api_call"), + + UNKNOWN_DEFAULT_OPEN_API("unknown_default_open_api"); + + private String value; + + EvidenceKindEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static EvidenceKindEnum fromValue(String value) { + for (EvidenceKindEnum b : EvidenceKindEnum.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 EvidenceKindEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public EvidenceKindEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return EvidenceKindEnum.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + EvidenceKindEnum.fromValue(value); + } + } + + public static final String SERIALIZED_NAME_EVIDENCE_KIND = "evidence_kind"; + @SerializedName(SERIALIZED_NAME_EVIDENCE_KIND) + @javax.annotation.Nonnull + private EvidenceKindEnum evidenceKind; + + /** + * How the evidence was derived. + */ + @JsonAdapter(KindEnum.Adapter.class) + public enum KindEnum { + DETERMINISTIC_DERIVATION("deterministic_derivation"), + + UNKNOWN_DEFAULT_OPEN_API("unknown_default_open_api"); + + private String value; + + KindEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static KindEnum fromValue(String value) { + for (KindEnum b : KindEnum.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 KindEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public KindEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return KindEnum.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + KindEnum.fromValue(value); + } + } + + public static final String SERIALIZED_NAME_KIND = "kind"; + @SerializedName(SERIALIZED_NAME_KIND) + @javax.annotation.Nonnull + private KindEnum kind; + + /** + * How directly the evidence bears on the finding. + */ + @JsonAdapter(StrengthEnum.Adapter.class) + public enum StrengthEnum { + DIRECT("direct"), + + UNKNOWN_DEFAULT_OPEN_API("unknown_default_open_api"); + + private String value; + + StrengthEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static StrengthEnum fromValue(String value) { + for (StrengthEnum b : StrengthEnum.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 StrengthEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public StrengthEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return StrengthEnum.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + StrengthEnum.fromValue(value); + } + } + + public static final String SERIALIZED_NAME_STRENGTH = "strength"; + @SerializedName(SERIALIZED_NAME_STRENGTH) + @javax.annotation.Nonnull + private StrengthEnum strength; + + public ImportedAPICallEvidence() { + } + + public ImportedAPICallEvidence calls(@javax.annotation.Nonnull List calls) { + this.calls = calls; + return this; + } + + public ImportedAPICallEvidence addCallsItem(ReportImportedAPICall callsItem) { + if (this.calls == null) { + this.calls = new ArrayList<>(); + } + this.calls.add(callsItem); + return this; + } + + /** + * The observed calls. + * @return calls + */ + @javax.annotation.Nonnull + public List getCalls() { + return calls; + } + + public void setCalls(@javax.annotation.Nonnull List calls) { + this.calls = calls; + } + + + public ImportedAPICallEvidence effect(@javax.annotation.Nonnull EffectEnum effect) { + this.effect = effect; + return this; + } + + /** + * Whether the evidence supports or refutes the finding. + * @return effect + */ + @javax.annotation.Nonnull + public EffectEnum getEffect() { + return effect; + } + + public void setEffect(@javax.annotation.Nonnull EffectEnum effect) { + this.effect = effect; + } + + + public ImportedAPICallEvidence evidenceKind(@javax.annotation.Nonnull EvidenceKindEnum evidenceKind) { + this.evidenceKind = evidenceKind; + return this; + } + + /** + * Kind of evidence. + * @return evidenceKind + */ + @javax.annotation.Nonnull + public EvidenceKindEnum getEvidenceKind() { + return evidenceKind; + } + + public void setEvidenceKind(@javax.annotation.Nonnull EvidenceKindEnum evidenceKind) { + this.evidenceKind = evidenceKind; + } + + + public ImportedAPICallEvidence kind(@javax.annotation.Nonnull KindEnum kind) { + this.kind = kind; + return this; + } + + /** + * How the evidence was derived. + * @return kind + */ + @javax.annotation.Nonnull + public KindEnum getKind() { + return kind; + } + + public void setKind(@javax.annotation.Nonnull KindEnum kind) { + this.kind = kind; + } + + + public ImportedAPICallEvidence strength(@javax.annotation.Nonnull StrengthEnum strength) { + this.strength = strength; + return this; + } + + /** + * How directly the evidence bears on the finding. + * @return strength + */ + @javax.annotation.Nonnull + public StrengthEnum getStrength() { + return strength; + } + + public void setStrength(@javax.annotation.Nonnull StrengthEnum strength) { + this.strength = strength; + } + + /** + * 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 ImportedAPICallEvidence instance itself + */ + public ImportedAPICallEvidence 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; + } + ImportedAPICallEvidence importedAPICallEvidence = (ImportedAPICallEvidence) o; + return Objects.equals(this.calls, importedAPICallEvidence.calls) && + Objects.equals(this.effect, importedAPICallEvidence.effect) && + Objects.equals(this.evidenceKind, importedAPICallEvidence.evidenceKind) && + Objects.equals(this.kind, importedAPICallEvidence.kind) && + Objects.equals(this.strength, importedAPICallEvidence.strength)&& + Objects.equals(this.additionalProperties, importedAPICallEvidence.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(calls, effect, evidenceKind, kind, strength, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ImportedAPICallEvidence {\n"); + sb.append(" calls: ").append(toIndentedString(calls)).append("\n"); + sb.append(" effect: ").append(toIndentedString(effect)).append("\n"); + sb.append(" evidenceKind: ").append(toIndentedString(evidenceKind)).append("\n"); + sb.append(" kind: ").append(toIndentedString(kind)).append("\n"); + sb.append(" strength: ").append(toIndentedString(strength)).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("calls", "effect", "evidence_kind", "kind", "strength")); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(Arrays.asList("calls", "effect", "evidence_kind", "kind", "strength")); + } + + /** + * 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 ImportedAPICallEvidence + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ImportedAPICallEvidence.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 ImportedAPICallEvidence is not found in the empty JSON string", ImportedAPICallEvidence.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : ImportedAPICallEvidence.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("calls") == null) { + throw new IllegalArgumentException("Expected the field `linkedContent` to be an array in the JSON string but got `null`"); + } else if (!jsonObj.get("calls").isJsonArray()) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `calls` to be an array in the JSON string but got `%s`", jsonObj.get("calls").toString())); + } + if (!jsonObj.get("effect").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `effect` to be a primitive type in the JSON string but got `%s`", jsonObj.get("effect").toString())); + } + // validate the required field `effect` + EffectEnum.validateJsonElement(jsonObj.get("effect")); + if (!jsonObj.get("evidence_kind").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `evidence_kind` to be a primitive type in the JSON string but got `%s`", jsonObj.get("evidence_kind").toString())); + } + // validate the required field `evidence_kind` + EvidenceKindEnum.validateJsonElement(jsonObj.get("evidence_kind")); + if (!jsonObj.get("kind").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `kind` to be a primitive type in the JSON string but got `%s`", jsonObj.get("kind").toString())); + } + // validate the required field `kind` + KindEnum.validateJsonElement(jsonObj.get("kind")); + if (!jsonObj.get("strength").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `strength` to be a primitive type in the JSON string but got `%s`", jsonObj.get("strength").toString())); + } + // validate the required field `strength` + StrengthEnum.validateJsonElement(jsonObj.get("strength")); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ImportedAPICallEvidence.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ImportedAPICallEvidence' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ImportedAPICallEvidence.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, ImportedAPICallEvidence 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 ImportedAPICallEvidence read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + ImportedAPICallEvidence 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 ImportedAPICallEvidence given an JSON string + * + * @param jsonString JSON string + * @return An instance of ImportedAPICallEvidence + * @throws IOException if the JSON string is invalid with respect to ImportedAPICallEvidence + */ + public static ImportedAPICallEvidence fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ImportedAPICallEvidence.class); + } + + /** + * Convert an instance of ImportedAPICallEvidence to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/ai/reveng/model/ImportedApiCallEvidence.java b/src/main/java/ai/reveng/model/ImportedApiCallEvidence0.java similarity index 100% rename from src/main/java/ai/reveng/model/ImportedApiCallEvidence.java rename to src/main/java/ai/reveng/model/ImportedApiCallEvidence0.java diff --git a/src/main/java/ai/reveng/model/KnownConstantEvidence.java b/src/main/java/ai/reveng/model/KnownConstantEvidence.java index 08e02a9..adfa6b2 100644 --- a/src/main/java/ai/reveng/model/KnownConstantEvidence.java +++ b/src/main/java/ai/reveng/model/KnownConstantEvidence.java @@ -13,8 +13,7 @@ package ai.reveng.model; import java.util.Objects; -import ai.reveng.model.BytesConstant; -import ai.reveng.model.EvidenceEffect; +import ai.reveng.model.ReportBytesConstant; import com.google.gson.TypeAdapter; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; @@ -49,12 +48,71 @@ import ai.reveng.invoker.JSON; /** - * A known constant whose semantic use has not been demonstrated. + * KnownConstantEvidence */ @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class KnownConstantEvidence { /** - * Gets or Sets evidenceKind + * Whether the evidence supports or refutes the finding. + */ + @JsonAdapter(EffectEnum.Adapter.class) + public enum EffectEnum { + SUPPORTS("supports"), + + REFUTES("refutes"), + + UNKNOWN_DEFAULT_OPEN_API("unknown_default_open_api"); + + private String value; + + EffectEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static EffectEnum fromValue(String value) { + for (EffectEnum b : EffectEnum.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 EffectEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public EffectEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return EffectEnum.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + EffectEnum.fromValue(value); + } + } + + public static final String SERIALIZED_NAME_EFFECT = "effect"; + @SerializedName(SERIALIZED_NAME_EFFECT) + @javax.annotation.Nonnull + private EffectEnum effect; + + /** + * Kind of evidence. */ @JsonAdapter(EvidenceKindEnum.Adapter.class) public enum EvidenceKindEnum { @@ -107,11 +165,11 @@ 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.KNOWN_CONSTANT; + @javax.annotation.Nonnull + private EvidenceKindEnum evidenceKind; /** - * Gets or Sets kind + * How the evidence was derived. */ @JsonAdapter(KindEnum.Adapter.class) public enum KindEnum { @@ -164,16 +222,11 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti public static final String SERIALIZED_NAME_KIND = "kind"; @SerializedName(SERIALIZED_NAME_KIND) - @javax.annotation.Nullable - private KindEnum kind = KindEnum.DETERMINISTIC_DERIVATION; - - public static final String SERIALIZED_NAME_EFFECT = "effect"; - @SerializedName(SERIALIZED_NAME_EFFECT) @javax.annotation.Nonnull - private EvidenceEffect effect; + private KindEnum kind; /** - * Gets or Sets strength + * How directly the evidence bears on the finding. */ @JsonAdapter(StrengthEnum.Adapter.class) public enum StrengthEnum { @@ -226,99 +279,99 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti public static final String SERIALIZED_NAME_STRENGTH = "strength"; @SerializedName(SERIALIZED_NAME_STRENGTH) - @javax.annotation.Nullable - private StrengthEnum strength = StrengthEnum.INDIRECT; + @javax.annotation.Nonnull + private StrengthEnum strength; public static final String SERIALIZED_NAME_VALUES = "values"; @SerializedName(SERIALIZED_NAME_VALUES) @javax.annotation.Nonnull - private List values = new ArrayList<>(); + private List values = new ArrayList<>(); public KnownConstantEvidence() { } - public KnownConstantEvidence evidenceKind(@javax.annotation.Nullable EvidenceKindEnum evidenceKind) { - this.evidenceKind = evidenceKind; + public KnownConstantEvidence effect(@javax.annotation.Nonnull EffectEnum effect) { + this.effect = effect; return this; } /** - * Get evidenceKind - * @return evidenceKind + * Whether the evidence supports or refutes the finding. + * @return effect */ - @javax.annotation.Nullable - public EvidenceKindEnum getEvidenceKind() { - return evidenceKind; + @javax.annotation.Nonnull + public EffectEnum getEffect() { + return effect; } - public void setEvidenceKind(@javax.annotation.Nullable EvidenceKindEnum evidenceKind) { - this.evidenceKind = evidenceKind; + public void setEffect(@javax.annotation.Nonnull EffectEnum effect) { + this.effect = effect; } - public KnownConstantEvidence kind(@javax.annotation.Nullable KindEnum kind) { - this.kind = kind; + public KnownConstantEvidence evidenceKind(@javax.annotation.Nonnull EvidenceKindEnum evidenceKind) { + this.evidenceKind = evidenceKind; return this; } /** - * Get kind - * @return kind + * Kind of evidence. + * @return evidenceKind */ - @javax.annotation.Nullable - public KindEnum getKind() { - return kind; + @javax.annotation.Nonnull + public EvidenceKindEnum getEvidenceKind() { + return evidenceKind; } - public void setKind(@javax.annotation.Nullable KindEnum kind) { - this.kind = kind; + public void setEvidenceKind(@javax.annotation.Nonnull EvidenceKindEnum evidenceKind) { + this.evidenceKind = evidenceKind; } - public KnownConstantEvidence effect(@javax.annotation.Nonnull EvidenceEffect effect) { - this.effect = effect; + public KnownConstantEvidence kind(@javax.annotation.Nonnull KindEnum kind) { + this.kind = kind; return this; } /** - * Get effect - * @return effect + * How the evidence was derived. + * @return kind */ @javax.annotation.Nonnull - public EvidenceEffect getEffect() { - return effect; + public KindEnum getKind() { + return kind; } - public void setEffect(@javax.annotation.Nonnull EvidenceEffect effect) { - this.effect = effect; + public void setKind(@javax.annotation.Nonnull KindEnum kind) { + this.kind = kind; } - public KnownConstantEvidence strength(@javax.annotation.Nullable StrengthEnum strength) { + public KnownConstantEvidence strength(@javax.annotation.Nonnull StrengthEnum strength) { this.strength = strength; return this; } /** - * Get strength + * How directly the evidence bears on the finding. * @return strength */ - @javax.annotation.Nullable + @javax.annotation.Nonnull public StrengthEnum getStrength() { return strength; } - public void setStrength(@javax.annotation.Nullable StrengthEnum strength) { + public void setStrength(@javax.annotation.Nonnull StrengthEnum strength) { this.strength = strength; } - public KnownConstantEvidence values(@javax.annotation.Nonnull List values) { + public KnownConstantEvidence values(@javax.annotation.Nonnull List values) { this.values = values; return this; } - public KnownConstantEvidence addValuesItem(BytesConstant valuesItem) { + public KnownConstantEvidence addValuesItem(ReportBytesConstant valuesItem) { if (this.values == null) { this.values = new ArrayList<>(); } @@ -327,15 +380,15 @@ public KnownConstantEvidence addValuesItem(BytesConstant valuesItem) { } /** - * Get values + * The well-known constants found in the binary. * @return values */ @javax.annotation.Nonnull - public List getValues() { + public List getValues() { return values; } - public void setValues(@javax.annotation.Nonnull List values) { + public void setValues(@javax.annotation.Nonnull List values) { this.values = values; } @@ -394,9 +447,9 @@ public boolean equals(Object o) { return false; } KnownConstantEvidence knownConstantEvidence = (KnownConstantEvidence) o; - return Objects.equals(this.evidenceKind, knownConstantEvidence.evidenceKind) && + return Objects.equals(this.effect, knownConstantEvidence.effect) && + Objects.equals(this.evidenceKind, knownConstantEvidence.evidenceKind) && Objects.equals(this.kind, knownConstantEvidence.kind) && - Objects.equals(this.effect, knownConstantEvidence.effect) && Objects.equals(this.strength, knownConstantEvidence.strength) && Objects.equals(this.values, knownConstantEvidence.values)&& Objects.equals(this.additionalProperties, knownConstantEvidence.additionalProperties); @@ -404,16 +457,16 @@ public boolean equals(Object o) { @Override public int hashCode() { - return Objects.hash(evidenceKind, kind, effect, strength, values, additionalProperties); + return Objects.hash(effect, evidenceKind, kind, strength, values, additionalProperties); } @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class KnownConstantEvidence {\n"); + sb.append(" effect: ").append(toIndentedString(effect)).append("\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"); sb.append(" strength: ").append(toIndentedString(strength)).append("\n"); sb.append(" values: ").append(toIndentedString(values)).append("\n"); sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); @@ -435,10 +488,10 @@ private String toIndentedString(Object o) { static { // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(Arrays.asList("evidence_kind", "kind", "effect", "strength", "values")); + openapiFields = new HashSet(Arrays.asList("effect", "evidence_kind", "kind", "strength", "values")); // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(Arrays.asList("effect", "values")); + openapiRequiredFields = new HashSet(Arrays.asList("effect", "evidence_kind", "kind", "strength", "values")); } /** @@ -461,29 +514,26 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti } } JsonObject jsonObj = jsonElement.getAsJsonObject(); - if ((jsonObj.get("evidence_kind") != null && !jsonObj.get("evidence_kind").isJsonNull()) && !jsonObj.get("evidence_kind").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `evidence_kind` to be a primitive type in the JSON string but got `%s`", jsonObj.get("evidence_kind").toString())); + if (!jsonObj.get("effect").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `effect` to be a primitive type in the JSON string but got `%s`", jsonObj.get("effect").toString())); } - // validate the optional field `evidence_kind` - if (jsonObj.get("evidence_kind") != null && !jsonObj.get("evidence_kind").isJsonNull()) { - EvidenceKindEnum.validateJsonElement(jsonObj.get("evidence_kind")); + // validate the required field `effect` + EffectEnum.validateJsonElement(jsonObj.get("effect")); + if (!jsonObj.get("evidence_kind").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `evidence_kind` to be a primitive type in the JSON string but got `%s`", jsonObj.get("evidence_kind").toString())); } - if ((jsonObj.get("kind") != null && !jsonObj.get("kind").isJsonNull()) && !jsonObj.get("kind").isJsonPrimitive()) { + // validate the required field `evidence_kind` + EvidenceKindEnum.validateJsonElement(jsonObj.get("evidence_kind")); + if (!jsonObj.get("kind").isJsonPrimitive()) { throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `kind` to be a primitive type in the JSON string but got `%s`", jsonObj.get("kind").toString())); } - // validate the optional field `kind` - if (jsonObj.get("kind") != null && !jsonObj.get("kind").isJsonNull()) { - KindEnum.validateJsonElement(jsonObj.get("kind")); - } - // validate the required field `effect` - EvidenceEffect.validateJsonElement(jsonObj.get("effect")); - if ((jsonObj.get("strength") != null && !jsonObj.get("strength").isJsonNull()) && !jsonObj.get("strength").isJsonPrimitive()) { + // validate the required field `kind` + KindEnum.validateJsonElement(jsonObj.get("kind")); + if (!jsonObj.get("strength").isJsonPrimitive()) { throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `strength` to be a primitive type in the JSON string but got `%s`", jsonObj.get("strength").toString())); } - // validate the optional field `strength` - if (jsonObj.get("strength") != null && !jsonObj.get("strength").isJsonNull()) { - StrengthEnum.validateJsonElement(jsonObj.get("strength")); - } + // validate the required field `strength` + StrengthEnum.validateJsonElement(jsonObj.get("strength")); // ensure the required json array is present if (jsonObj.get("values") == null) { throw new IllegalArgumentException("Expected the field `linkedContent` to be an array in the JSON string but got `null`"); diff --git a/src/main/java/ai/reveng/model/ListAnalysisGlobalsOutputBody.java b/src/main/java/ai/reveng/model/ListAnalysisGlobalsOutputBody.java new file mode 100644 index 0000000..8c9668b --- /dev/null +++ b/src/main/java/ai/reveng/model/ListAnalysisGlobalsOutputBody.java @@ -0,0 +1,355 @@ +/* + * 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.GlobalVariable; +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; + +/** + * ListAnalysisGlobalsOutputBody + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class ListAnalysisGlobalsOutputBody { + public static final String SERIALIZED_NAME_GLOBALS = "globals"; + @SerializedName(SERIALIZED_NAME_GLOBALS) + @javax.annotation.Nullable + private List globals; + + public static final String SERIALIZED_NAME_TOTAL = "total"; + @SerializedName(SERIALIZED_NAME_TOTAL) + @javax.annotation.Nonnull + private Long total; + + public static final String SERIALIZED_NAME_TOTAL_UNFILTERED = "total_unfiltered"; + @SerializedName(SERIALIZED_NAME_TOTAL_UNFILTERED) + @javax.annotation.Nonnull + private Long totalUnfiltered; + + public ListAnalysisGlobalsOutputBody() { + } + + public ListAnalysisGlobalsOutputBody globals(@javax.annotation.Nullable List globals) { + this.globals = globals; + return this; + } + + public ListAnalysisGlobalsOutputBody addGlobalsItem(GlobalVariable globalsItem) { + if (this.globals == null) { + this.globals = new ArrayList<>(); + } + this.globals.add(globalsItem); + return this; + } + + /** + * Get globals + * @return globals + */ + @javax.annotation.Nullable + public List getGlobals() { + return globals; + } + + public void setGlobals(@javax.annotation.Nullable List globals) { + this.globals = globals; + } + + + public ListAnalysisGlobalsOutputBody total(@javax.annotation.Nonnull Long total) { + this.total = total; + return this; + } + + /** + * Get total + * @return total + */ + @javax.annotation.Nonnull + public Long getTotal() { + return total; + } + + public void setTotal(@javax.annotation.Nonnull Long total) { + this.total = total; + } + + + public ListAnalysisGlobalsOutputBody totalUnfiltered(@javax.annotation.Nonnull Long totalUnfiltered) { + this.totalUnfiltered = totalUnfiltered; + return this; + } + + /** + * Get totalUnfiltered + * @return totalUnfiltered + */ + @javax.annotation.Nonnull + public Long getTotalUnfiltered() { + return totalUnfiltered; + } + + public void setTotalUnfiltered(@javax.annotation.Nonnull Long totalUnfiltered) { + this.totalUnfiltered = totalUnfiltered; + } + + /** + * 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 ListAnalysisGlobalsOutputBody instance itself + */ + public ListAnalysisGlobalsOutputBody 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; + } + ListAnalysisGlobalsOutputBody listAnalysisGlobalsOutputBody = (ListAnalysisGlobalsOutputBody) o; + return Objects.equals(this.globals, listAnalysisGlobalsOutputBody.globals) && + Objects.equals(this.total, listAnalysisGlobalsOutputBody.total) && + Objects.equals(this.totalUnfiltered, listAnalysisGlobalsOutputBody.totalUnfiltered)&& + Objects.equals(this.additionalProperties, listAnalysisGlobalsOutputBody.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(globals, total, totalUnfiltered, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ListAnalysisGlobalsOutputBody {\n"); + sb.append(" globals: ").append(toIndentedString(globals)).append("\n"); + sb.append(" total: ").append(toIndentedString(total)).append("\n"); + sb.append(" totalUnfiltered: ").append(toIndentedString(totalUnfiltered)).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("globals", "total", "total_unfiltered")); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(Arrays.asList("globals", "total", "total_unfiltered")); + } + + /** + * 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 ListAnalysisGlobalsOutputBody + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ListAnalysisGlobalsOutputBody.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 ListAnalysisGlobalsOutputBody is not found in the empty JSON string", ListAnalysisGlobalsOutputBody.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : ListAnalysisGlobalsOutputBody.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("globals") == null) { + throw new IllegalArgumentException("Expected the field `linkedContent` to be an array in the JSON string but got `null`"); + } else if (!jsonObj.get("globals").isJsonArray() && !jsonObj.get("globals").isJsonNull()) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `globals` to be an array in the JSON string but got `%s`", jsonObj.get("globals").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ListAnalysisGlobalsOutputBody.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ListAnalysisGlobalsOutputBody' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ListAnalysisGlobalsOutputBody.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, ListAnalysisGlobalsOutputBody 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 ListAnalysisGlobalsOutputBody read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + ListAnalysisGlobalsOutputBody 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 ListAnalysisGlobalsOutputBody given an JSON string + * + * @param jsonString JSON string + * @return An instance of ListAnalysisGlobalsOutputBody + * @throws IOException if the JSON string is invalid with respect to ListAnalysisGlobalsOutputBody + */ + public static ListAnalysisGlobalsOutputBody fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ListAnalysisGlobalsOutputBody.class); + } + + /** + * Convert an instance of ListAnalysisGlobalsOutputBody to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/ai/reveng/model/ListFunctionGlobalsOutputBody.java b/src/main/java/ai/reveng/model/ListFunctionGlobalsOutputBody.java new file mode 100644 index 0000000..409eee2 --- /dev/null +++ b/src/main/java/ai/reveng/model/ListFunctionGlobalsOutputBody.java @@ -0,0 +1,329 @@ +/* + * 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.FunctionGlobalVariable; +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; + +/** + * ListFunctionGlobalsOutputBody + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class ListFunctionGlobalsOutputBody { + public static final String SERIALIZED_NAME_DECOMPILED = "decompiled"; + @SerializedName(SERIALIZED_NAME_DECOMPILED) + @javax.annotation.Nonnull + private Boolean decompiled; + + public static final String SERIALIZED_NAME_GLOBALS = "globals"; + @SerializedName(SERIALIZED_NAME_GLOBALS) + @javax.annotation.Nullable + private List globals; + + public ListFunctionGlobalsOutputBody() { + } + + public ListFunctionGlobalsOutputBody decompiled(@javax.annotation.Nonnull Boolean decompiled) { + this.decompiled = decompiled; + return this; + } + + /** + * Whether the function has a successful AI decompilation. Its globals are recorded from that decompilation, so before one exists the list is empty however many globals the function uses. + * @return decompiled + */ + @javax.annotation.Nonnull + public Boolean getDecompiled() { + return decompiled; + } + + public void setDecompiled(@javax.annotation.Nonnull Boolean decompiled) { + this.decompiled = decompiled; + } + + + public ListFunctionGlobalsOutputBody globals(@javax.annotation.Nullable List globals) { + this.globals = globals; + return this; + } + + public ListFunctionGlobalsOutputBody addGlobalsItem(FunctionGlobalVariable globalsItem) { + if (this.globals == null) { + this.globals = new ArrayList<>(); + } + this.globals.add(globalsItem); + return this; + } + + /** + * Get globals + * @return globals + */ + @javax.annotation.Nullable + public List getGlobals() { + return globals; + } + + public void setGlobals(@javax.annotation.Nullable List globals) { + this.globals = globals; + } + + /** + * 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 ListFunctionGlobalsOutputBody instance itself + */ + public ListFunctionGlobalsOutputBody 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; + } + ListFunctionGlobalsOutputBody listFunctionGlobalsOutputBody = (ListFunctionGlobalsOutputBody) o; + return Objects.equals(this.decompiled, listFunctionGlobalsOutputBody.decompiled) && + Objects.equals(this.globals, listFunctionGlobalsOutputBody.globals)&& + Objects.equals(this.additionalProperties, listFunctionGlobalsOutputBody.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(decompiled, globals, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ListFunctionGlobalsOutputBody {\n"); + sb.append(" decompiled: ").append(toIndentedString(decompiled)).append("\n"); + sb.append(" globals: ").append(toIndentedString(globals)).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("decompiled", "globals")); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(Arrays.asList("decompiled", "globals")); + } + + /** + * 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 ListFunctionGlobalsOutputBody + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ListFunctionGlobalsOutputBody.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 ListFunctionGlobalsOutputBody is not found in the empty JSON string", ListFunctionGlobalsOutputBody.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : ListFunctionGlobalsOutputBody.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("globals") == null) { + throw new IllegalArgumentException("Expected the field `linkedContent` to be an array in the JSON string but got `null`"); + } else if (!jsonObj.get("globals").isJsonArray() && !jsonObj.get("globals").isJsonNull()) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `globals` to be an array in the JSON string but got `%s`", jsonObj.get("globals").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ListFunctionGlobalsOutputBody.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ListFunctionGlobalsOutputBody' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ListFunctionGlobalsOutputBody.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, ListFunctionGlobalsOutputBody 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 ListFunctionGlobalsOutputBody read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + ListFunctionGlobalsOutputBody 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 ListFunctionGlobalsOutputBody given an JSON string + * + * @param jsonString JSON string + * @return An instance of ListFunctionGlobalsOutputBody + * @throws IOException if the JSON string is invalid with respect to ListFunctionGlobalsOutputBody + */ + public static ListFunctionGlobalsOutputBody fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ListFunctionGlobalsOutputBody.class); + } + + /** + * Convert an instance of ListFunctionGlobalsOutputBody to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/ai/reveng/model/ListGlobalFunctionsOutputBody.java b/src/main/java/ai/reveng/model/ListGlobalFunctionsOutputBody.java new file mode 100644 index 0000000..ba63e71 --- /dev/null +++ b/src/main/java/ai/reveng/model/ListGlobalFunctionsOutputBody.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.FunctionUsage; +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; + +/** + * ListGlobalFunctionsOutputBody + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class ListGlobalFunctionsOutputBody { + public static final String SERIALIZED_NAME_FUNCTIONS = "functions"; + @SerializedName(SERIALIZED_NAME_FUNCTIONS) + @javax.annotation.Nullable + private List functions; + + public ListGlobalFunctionsOutputBody() { + } + + public ListGlobalFunctionsOutputBody functions(@javax.annotation.Nullable List functions) { + this.functions = functions; + return this; + } + + public ListGlobalFunctionsOutputBody addFunctionsItem(FunctionUsage functionsItem) { + if (this.functions == null) { + this.functions = new ArrayList<>(); + } + this.functions.add(functionsItem); + return this; + } + + /** + * Get functions + * @return functions + */ + @javax.annotation.Nullable + public List getFunctions() { + return functions; + } + + public void setFunctions(@javax.annotation.Nullable List functions) { + this.functions = functions; + } + + /** + * 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 ListGlobalFunctionsOutputBody instance itself + */ + public ListGlobalFunctionsOutputBody 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; + } + ListGlobalFunctionsOutputBody listGlobalFunctionsOutputBody = (ListGlobalFunctionsOutputBody) o; + return Objects.equals(this.functions, listGlobalFunctionsOutputBody.functions)&& + Objects.equals(this.additionalProperties, listGlobalFunctionsOutputBody.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(functions, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ListGlobalFunctionsOutputBody {\n"); + sb.append(" functions: ").append(toIndentedString(functions)).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("functions")); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(Arrays.asList("functions")); + } + + /** + * 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 ListGlobalFunctionsOutputBody + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ListGlobalFunctionsOutputBody.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 ListGlobalFunctionsOutputBody is not found in the empty JSON string", ListGlobalFunctionsOutputBody.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : ListGlobalFunctionsOutputBody.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("functions") == null) { + throw new IllegalArgumentException("Expected the field `linkedContent` to be an array in the JSON string but got `null`"); + } else if (!jsonObj.get("functions").isJsonArray() && !jsonObj.get("functions").isJsonNull()) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `functions` to be an array in the JSON string but got `%s`", jsonObj.get("functions").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ListGlobalFunctionsOutputBody.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ListGlobalFunctionsOutputBody' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ListGlobalFunctionsOutputBody.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, ListGlobalFunctionsOutputBody 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 ListGlobalFunctionsOutputBody read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + ListGlobalFunctionsOutputBody 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 ListGlobalFunctionsOutputBody given an JSON string + * + * @param jsonString JSON string + * @return An instance of ListGlobalFunctionsOutputBody + * @throws IOException if the JSON string is invalid with respect to ListGlobalFunctionsOutputBody + */ + public static ListGlobalFunctionsOutputBody fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ListGlobalFunctionsOutputBody.class); + } + + /** + * Convert an instance of ListGlobalFunctionsOutputBody to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/ai/reveng/model/ListOperationPrerequisitesOutputBody.java b/src/main/java/ai/reveng/model/ListOperationPrerequisitesOutputBody.java new file mode 100644 index 0000000..82f90ff --- /dev/null +++ b/src/main/java/ai/reveng/model/ListOperationPrerequisitesOutputBody.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.OperationPrerequisitesBody; +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; + +/** + * ListOperationPrerequisitesOutputBody + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class ListOperationPrerequisitesOutputBody { + public static final String SERIALIZED_NAME_OPERATIONS = "operations"; + @SerializedName(SERIALIZED_NAME_OPERATIONS) + @javax.annotation.Nonnull + private List operations = new ArrayList<>(); + + public ListOperationPrerequisitesOutputBody() { + } + + public ListOperationPrerequisitesOutputBody operations(@javax.annotation.Nonnull List operations) { + this.operations = operations; + return this; + } + + public ListOperationPrerequisitesOutputBody addOperationsItem(OperationPrerequisitesBody operationsItem) { + if (this.operations == null) { + this.operations = new ArrayList<>(); + } + this.operations.add(operationsItem); + return this; + } + + /** + * Operations that have prerequisites + * @return operations + */ + @javax.annotation.Nonnull + public List getOperations() { + return operations; + } + + public void setOperations(@javax.annotation.Nonnull List operations) { + this.operations = operations; + } + + /** + * 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 ListOperationPrerequisitesOutputBody instance itself + */ + public ListOperationPrerequisitesOutputBody 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; + } + ListOperationPrerequisitesOutputBody listOperationPrerequisitesOutputBody = (ListOperationPrerequisitesOutputBody) o; + return Objects.equals(this.operations, listOperationPrerequisitesOutputBody.operations)&& + Objects.equals(this.additionalProperties, listOperationPrerequisitesOutputBody.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(operations, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ListOperationPrerequisitesOutputBody {\n"); + sb.append(" operations: ").append(toIndentedString(operations)).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("operations")); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(Arrays.asList("operations")); + } + + /** + * 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 ListOperationPrerequisitesOutputBody + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ListOperationPrerequisitesOutputBody.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 ListOperationPrerequisitesOutputBody is not found in the empty JSON string", ListOperationPrerequisitesOutputBody.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : ListOperationPrerequisitesOutputBody.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("operations") == null) { + throw new IllegalArgumentException("Expected the field `linkedContent` to be an array in the JSON string but got `null`"); + } else if (!jsonObj.get("operations").isJsonArray()) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `operations` to be an array in the JSON string but got `%s`", jsonObj.get("operations").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ListOperationPrerequisitesOutputBody.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ListOperationPrerequisitesOutputBody' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ListOperationPrerequisitesOutputBody.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, ListOperationPrerequisitesOutputBody 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 ListOperationPrerequisitesOutputBody read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + ListOperationPrerequisitesOutputBody 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 ListOperationPrerequisitesOutputBody given an JSON string + * + * @param jsonString JSON string + * @return An instance of ListOperationPrerequisitesOutputBody + * @throws IOException if the JSON string is invalid with respect to ListOperationPrerequisitesOutputBody + */ + public static ListOperationPrerequisitesOutputBody fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ListOperationPrerequisitesOutputBody.class); + } + + /** + * Convert an instance of ListOperationPrerequisitesOutputBody to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/ai/reveng/model/ListPublicUsersOutputBody.java b/src/main/java/ai/reveng/model/ListPublicUsersOutputBody.java new file mode 100644 index 0000000..96c8da2 --- /dev/null +++ b/src/main/java/ai/reveng/model/ListPublicUsersOutputBody.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.PublicUserBody; +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; + +/** + * ListPublicUsersOutputBody + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class ListPublicUsersOutputBody { + public static final String SERIALIZED_NAME_RESULTS = "results"; + @SerializedName(SERIALIZED_NAME_RESULTS) + @javax.annotation.Nullable + private List results; + + public ListPublicUsersOutputBody() { + } + + public ListPublicUsersOutputBody results(@javax.annotation.Nullable List results) { + this.results = results; + return this; + } + + public ListPublicUsersOutputBody addResultsItem(PublicUserBody resultsItem) { + if (this.results == null) { + this.results = new ArrayList<>(); + } + this.results.add(resultsItem); + return this; + } + + /** + * Up to 5 matching active users, ordered by username + * @return results + */ + @javax.annotation.Nullable + public List getResults() { + return results; + } + + public void setResults(@javax.annotation.Nullable List results) { + this.results = results; + } + + /** + * 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 ListPublicUsersOutputBody instance itself + */ + public ListPublicUsersOutputBody 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; + } + ListPublicUsersOutputBody listPublicUsersOutputBody = (ListPublicUsersOutputBody) o; + return Objects.equals(this.results, listPublicUsersOutputBody.results)&& + Objects.equals(this.additionalProperties, listPublicUsersOutputBody.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(results, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ListPublicUsersOutputBody {\n"); + sb.append(" results: ").append(toIndentedString(results)).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("results")); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(Arrays.asList("results")); + } + + /** + * 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 ListPublicUsersOutputBody + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ListPublicUsersOutputBody.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 ListPublicUsersOutputBody is not found in the empty JSON string", ListPublicUsersOutputBody.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : ListPublicUsersOutputBody.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("results") == null) { + throw new IllegalArgumentException("Expected the field `linkedContent` to be an array in the JSON string but got `null`"); + } else if (!jsonObj.get("results").isJsonArray() && !jsonObj.get("results").isJsonNull()) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `results` to be an array in the JSON string but got `%s`", jsonObj.get("results").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ListPublicUsersOutputBody.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ListPublicUsersOutputBody' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ListPublicUsersOutputBody.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, ListPublicUsersOutputBody 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 ListPublicUsersOutputBody read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + ListPublicUsersOutputBody 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 ListPublicUsersOutputBody given an JSON string + * + * @param jsonString JSON string + * @return An instance of ListPublicUsersOutputBody + * @throws IOException if the JSON string is invalid with respect to ListPublicUsersOutputBody + */ + public static ListPublicUsersOutputBody fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ListPublicUsersOutputBody.class); + } + + /** + * Convert an instance of ListPublicUsersOutputBody to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/ai/reveng/model/ModelInterpretation.java b/src/main/java/ai/reveng/model/ModelInterpretation.java index 8a9355f..fcf0fdd 100644 --- a/src/main/java/ai/reveng/model/ModelInterpretation.java +++ b/src/main/java/ai/reveng/model/ModelInterpretation.java @@ -64,7 +64,7 @@ public ModelInterpretation interpretation(@javax.annotation.Nullable String inte } /** - * Get interpretation + * Search is applied to string value * @return interpretation */ @javax.annotation.Nullable diff --git a/src/main/java/ai/reveng/model/ModelInterpretationEvidence.java b/src/main/java/ai/reveng/model/ModelInterpretationEvidence.java index 20f67f4..a03da67 100644 --- a/src/main/java/ai/reveng/model/ModelInterpretationEvidence.java +++ b/src/main/java/ai/reveng/model/ModelInterpretationEvidence.java @@ -13,9 +13,7 @@ package ai.reveng.model; import java.util.Objects; -import ai.reveng.model.EvidenceEffect; -import ai.reveng.model.EvidenceStrength; -import ai.reveng.model.ModelInterpretation; +import ai.reveng.model.ReportModelInterpretation; import com.google.gson.TypeAdapter; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; @@ -50,12 +48,71 @@ import ai.reveng.invoker.JSON; /** - * LLM interpretations of observations. + * ModelInterpretationEvidence */ @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class ModelInterpretationEvidence { /** - * Gets or Sets evidenceKind + * Whether the evidence supports or refutes the finding. + */ + @JsonAdapter(EffectEnum.Adapter.class) + public enum EffectEnum { + SUPPORTS("supports"), + + REFUTES("refutes"), + + UNKNOWN_DEFAULT_OPEN_API("unknown_default_open_api"); + + private String value; + + EffectEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static EffectEnum fromValue(String value) { + for (EffectEnum b : EffectEnum.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 EffectEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public EffectEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return EffectEnum.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + EffectEnum.fromValue(value); + } + } + + public static final String SERIALIZED_NAME_EFFECT = "effect"; + @SerializedName(SERIALIZED_NAME_EFFECT) + @javax.annotation.Nonnull + private EffectEnum effect; + + /** + * Kind of evidence. */ @JsonAdapter(EvidenceKindEnum.Adapter.class) public enum EvidenceKindEnum { @@ -108,11 +165,16 @@ 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.MODEL_INTERPRETATION; + @javax.annotation.Nonnull + private EvidenceKindEnum evidenceKind; + + public static final String SERIALIZED_NAME_INTERPRETATIONS = "interpretations"; + @SerializedName(SERIALIZED_NAME_INTERPRETATIONS) + @javax.annotation.Nonnull + private List interpretations = new ArrayList<>(); /** - * Gets or Sets kind + * How the evidence was derived. */ @JsonAdapter(KindEnum.Adapter.class) public enum KindEnum { @@ -165,109 +227,115 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti public static final String SERIALIZED_NAME_KIND = "kind"; @SerializedName(SERIALIZED_NAME_KIND) - @javax.annotation.Nullable - private KindEnum kind = KindEnum.MODEL_INTERPRETATION; - - public static final String SERIALIZED_NAME_EFFECT = "effect"; - @SerializedName(SERIALIZED_NAME_EFFECT) @javax.annotation.Nonnull - private EvidenceEffect effect; + private KindEnum kind; - public static final String SERIALIZED_NAME_STRENGTH = "strength"; - @SerializedName(SERIALIZED_NAME_STRENGTH) - @javax.annotation.Nullable - private EvidenceStrength strength = EvidenceStrength.INDIRECT; + /** + * How directly the evidence bears on the finding. + */ + @JsonAdapter(StrengthEnum.Adapter.class) + public enum StrengthEnum { + DIRECT("direct"), + + INDIRECT("indirect"), + + UNKNOWN_DEFAULT_OPEN_API("unknown_default_open_api"); - public static final String SERIALIZED_NAME_INTERPRETATIONS = "interpretations"; - @SerializedName(SERIALIZED_NAME_INTERPRETATIONS) - @javax.annotation.Nonnull - private List interpretations = new ArrayList<>(); + private String value; - public ModelInterpretationEvidence() { - } + StrengthEnum(String value) { + this.value = value; + } - public ModelInterpretationEvidence evidenceKind(@javax.annotation.Nullable EvidenceKindEnum evidenceKind) { - this.evidenceKind = evidenceKind; - return this; - } + public String getValue() { + return value; + } - /** - * Get evidenceKind - * @return evidenceKind - */ - @javax.annotation.Nullable - public EvidenceKindEnum getEvidenceKind() { - return evidenceKind; - } + @Override + public String toString() { + return String.valueOf(value); + } - public void setEvidenceKind(@javax.annotation.Nullable EvidenceKindEnum evidenceKind) { - this.evidenceKind = evidenceKind; - } + public static StrengthEnum fromValue(String value) { + for (StrengthEnum b : StrengthEnum.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 StrengthEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } - public ModelInterpretationEvidence kind(@javax.annotation.Nullable KindEnum kind) { - this.kind = kind; - return this; - } + @Override + public StrengthEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return StrengthEnum.fromValue(value); + } + } - /** - * Get kind - * @return kind - */ - @javax.annotation.Nullable - public KindEnum getKind() { - return kind; + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + StrengthEnum.fromValue(value); + } } - public void setKind(@javax.annotation.Nullable KindEnum kind) { - this.kind = kind; - } + public static final String SERIALIZED_NAME_STRENGTH = "strength"; + @SerializedName(SERIALIZED_NAME_STRENGTH) + @javax.annotation.Nonnull + private StrengthEnum strength; + public ModelInterpretationEvidence() { + } - public ModelInterpretationEvidence effect(@javax.annotation.Nonnull EvidenceEffect effect) { + public ModelInterpretationEvidence effect(@javax.annotation.Nonnull EffectEnum effect) { this.effect = effect; return this; } /** - * Get effect + * Whether the evidence supports or refutes the finding. * @return effect */ @javax.annotation.Nonnull - public EvidenceEffect getEffect() { + public EffectEnum getEffect() { return effect; } - public void setEffect(@javax.annotation.Nonnull EvidenceEffect effect) { + public void setEffect(@javax.annotation.Nonnull EffectEnum effect) { this.effect = effect; } - public ModelInterpretationEvidence strength(@javax.annotation.Nullable EvidenceStrength strength) { - this.strength = strength; + public ModelInterpretationEvidence evidenceKind(@javax.annotation.Nonnull EvidenceKindEnum evidenceKind) { + this.evidenceKind = evidenceKind; return this; } /** - * Get strength - * @return strength + * Kind of evidence. + * @return evidenceKind */ - @javax.annotation.Nullable - public EvidenceStrength getStrength() { - return strength; + @javax.annotation.Nonnull + public EvidenceKindEnum getEvidenceKind() { + return evidenceKind; } - public void setStrength(@javax.annotation.Nullable EvidenceStrength strength) { - this.strength = strength; + public void setEvidenceKind(@javax.annotation.Nonnull EvidenceKindEnum evidenceKind) { + this.evidenceKind = evidenceKind; } - public ModelInterpretationEvidence interpretations(@javax.annotation.Nonnull List interpretations) { + public ModelInterpretationEvidence interpretations(@javax.annotation.Nonnull List interpretations) { this.interpretations = interpretations; return this; } - public ModelInterpretationEvidence addInterpretationsItem(ModelInterpretation interpretationsItem) { + public ModelInterpretationEvidence addInterpretationsItem(ReportModelInterpretation interpretationsItem) { if (this.interpretations == null) { this.interpretations = new ArrayList<>(); } @@ -276,18 +344,56 @@ public ModelInterpretationEvidence addInterpretationsItem(ModelInterpretation in } /** - * Get interpretations + * Interpretations of the code by an AI model. * @return interpretations */ @javax.annotation.Nonnull - public List getInterpretations() { + public List getInterpretations() { return interpretations; } - public void setInterpretations(@javax.annotation.Nonnull List interpretations) { + public void setInterpretations(@javax.annotation.Nonnull List interpretations) { this.interpretations = interpretations; } + + public ModelInterpretationEvidence kind(@javax.annotation.Nonnull KindEnum kind) { + this.kind = kind; + return this; + } + + /** + * How the evidence was derived. + * @return kind + */ + @javax.annotation.Nonnull + public KindEnum getKind() { + return kind; + } + + public void setKind(@javax.annotation.Nonnull KindEnum kind) { + this.kind = kind; + } + + + public ModelInterpretationEvidence strength(@javax.annotation.Nonnull StrengthEnum strength) { + this.strength = strength; + return this; + } + + /** + * How directly the evidence bears on the finding. + * @return strength + */ + @javax.annotation.Nonnull + public StrengthEnum getStrength() { + return strength; + } + + public void setStrength(@javax.annotation.Nonnull StrengthEnum strength) { + this.strength = strength; + } + /** * A container for additional, undeclared properties. * This is a holder for any undeclared properties as specified with @@ -343,28 +449,28 @@ public boolean equals(Object o) { return false; } ModelInterpretationEvidence modelInterpretationEvidence = (ModelInterpretationEvidence) o; - return Objects.equals(this.evidenceKind, modelInterpretationEvidence.evidenceKind) && + return Objects.equals(this.effect, modelInterpretationEvidence.effect) && + Objects.equals(this.evidenceKind, modelInterpretationEvidence.evidenceKind) && + Objects.equals(this.interpretations, modelInterpretationEvidence.interpretations) && Objects.equals(this.kind, modelInterpretationEvidence.kind) && - Objects.equals(this.effect, modelInterpretationEvidence.effect) && - Objects.equals(this.strength, modelInterpretationEvidence.strength) && - Objects.equals(this.interpretations, modelInterpretationEvidence.interpretations)&& + Objects.equals(this.strength, modelInterpretationEvidence.strength)&& Objects.equals(this.additionalProperties, modelInterpretationEvidence.additionalProperties); } @Override public int hashCode() { - return Objects.hash(evidenceKind, kind, effect, strength, interpretations, additionalProperties); + return Objects.hash(effect, evidenceKind, interpretations, kind, strength, additionalProperties); } @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class ModelInterpretationEvidence {\n"); + sb.append(" effect: ").append(toIndentedString(effect)).append("\n"); sb.append(" evidenceKind: ").append(toIndentedString(evidenceKind)).append("\n"); + sb.append(" interpretations: ").append(toIndentedString(interpretations)).append("\n"); sb.append(" kind: ").append(toIndentedString(kind)).append("\n"); - sb.append(" effect: ").append(toIndentedString(effect)).append("\n"); sb.append(" strength: ").append(toIndentedString(strength)).append("\n"); - sb.append(" interpretations: ").append(toIndentedString(interpretations)).append("\n"); sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); sb.append("}"); return sb.toString(); @@ -384,10 +490,10 @@ private String toIndentedString(Object o) { static { // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(Arrays.asList("evidence_kind", "kind", "effect", "strength", "interpretations")); + openapiFields = new HashSet(Arrays.asList("effect", "evidence_kind", "interpretations", "kind", "strength")); // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(Arrays.asList("effect", "interpretations")); + openapiRequiredFields = new HashSet(Arrays.asList("effect", "evidence_kind", "interpretations", "kind", "strength")); } /** @@ -410,36 +516,32 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti } } JsonObject jsonObj = jsonElement.getAsJsonObject(); - if ((jsonObj.get("evidence_kind") != null && !jsonObj.get("evidence_kind").isJsonNull()) && !jsonObj.get("evidence_kind").isJsonPrimitive()) { + if (!jsonObj.get("effect").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `effect` to be a primitive type in the JSON string but got `%s`", jsonObj.get("effect").toString())); + } + // validate the required field `effect` + EffectEnum.validateJsonElement(jsonObj.get("effect")); + if (!jsonObj.get("evidence_kind").isJsonPrimitive()) { throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `evidence_kind` to be a primitive type in the JSON string but got `%s`", jsonObj.get("evidence_kind").toString())); } - // validate the optional field `evidence_kind` - if (jsonObj.get("evidence_kind") != null && !jsonObj.get("evidence_kind").isJsonNull()) { - EvidenceKindEnum.validateJsonElement(jsonObj.get("evidence_kind")); + // validate the required field `evidence_kind` + EvidenceKindEnum.validateJsonElement(jsonObj.get("evidence_kind")); + // ensure the required json array is present + if (jsonObj.get("interpretations") == null) { + throw new IllegalArgumentException("Expected the field `linkedContent` to be an array in the JSON string but got `null`"); + } else if (!jsonObj.get("interpretations").isJsonArray()) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `interpretations` to be an array in the JSON string but got `%s`", jsonObj.get("interpretations").toString())); } - if ((jsonObj.get("kind") != null && !jsonObj.get("kind").isJsonNull()) && !jsonObj.get("kind").isJsonPrimitive()) { + if (!jsonObj.get("kind").isJsonPrimitive()) { throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `kind` to be a primitive type in the JSON string but got `%s`", jsonObj.get("kind").toString())); } - // validate the optional field `kind` - if (jsonObj.get("kind") != null && !jsonObj.get("kind").isJsonNull()) { - KindEnum.validateJsonElement(jsonObj.get("kind")); - } - // validate the required field `effect` - EvidenceEffect.validateJsonElement(jsonObj.get("effect")); - // validate the optional field `strength` - if (jsonObj.get("strength") != null && !jsonObj.get("strength").isJsonNull()) { - EvidenceStrength.validateJsonElement(jsonObj.get("strength")); - } - if (jsonObj.get("interpretations") != null) { - if (!jsonObj.get("interpretations").isJsonArray()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `interpretations` to be an array in the JSON string but got `%s`", jsonObj.get("interpretations").toString())); - } - JsonArray jsonArrayinterpretations = jsonObj.getAsJsonArray("interpretations"); - // validate the required field `interpretations` (array) - for (int i = 0; i < jsonArrayinterpretations.size(); i++) { - ModelInterpretation.validateJsonElement(jsonArrayinterpretations.get(i)); - } + // validate the required field `kind` + KindEnum.validateJsonElement(jsonObj.get("kind")); + if (!jsonObj.get("strength").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `strength` to be a primitive type in the JSON string but got `%s`", jsonObj.get("strength").toString())); } + // validate the required field `strength` + StrengthEnum.validateJsonElement(jsonObj.get("strength")); } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { diff --git a/src/main/java/ai/reveng/model/OperationDynamicExecutionMetadataDynamicExecutionResult.java b/src/main/java/ai/reveng/model/OperationDynamicExecutionMetadataDynamicExecutionResult.java index 6eddb1d..b19f957 100644 --- a/src/main/java/ai/reveng/model/OperationDynamicExecutionMetadataDynamicExecutionResult.java +++ b/src/main/java/ai/reveng/model/OperationDynamicExecutionMetadataDynamicExecutionResult.java @@ -14,6 +14,7 @@ import java.util.Objects; import ai.reveng.model.DynamicExecutionMetadata; +import ai.reveng.model.DynamicExecutionResult; import ai.reveng.model.Status; import com.google.gson.TypeAdapter; import com.google.gson.annotations.JsonAdapter; @@ -74,7 +75,7 @@ public class OperationDynamicExecutionMetadataDynamicExecutionResult { public static final String SERIALIZED_NAME_RESPONSE = "response"; @SerializedName(SERIALIZED_NAME_RESPONSE) @javax.annotation.Nullable - private Object response; + private DynamicExecutionResult response; public OperationDynamicExecutionMetadataDynamicExecutionResult() { } @@ -155,7 +156,7 @@ public void setName(@javax.annotation.Nonnull String name) { } - public OperationDynamicExecutionMetadataDynamicExecutionResult response(@javax.annotation.Nullable Object response) { + public OperationDynamicExecutionMetadataDynamicExecutionResult response(@javax.annotation.Nullable DynamicExecutionResult response) { this.response = response; return this; } @@ -165,11 +166,11 @@ public OperationDynamicExecutionMetadataDynamicExecutionResult response(@javax.a * @return response */ @javax.annotation.Nullable - public Object getResponse() { + public DynamicExecutionResult getResponse() { return response; } - public void setResponse(@javax.annotation.Nullable Object response) { + public void setResponse(@javax.annotation.Nullable DynamicExecutionResult response) { this.response = response; } diff --git a/src/main/java/ai/reveng/model/OperationDynamicExecutionSummaryMetadataDynamicExecutionSummaryResult.java b/src/main/java/ai/reveng/model/OperationDynamicExecutionSummaryMetadataDynamicExecutionSummaryResult.java index e007193..2867448 100644 --- a/src/main/java/ai/reveng/model/OperationDynamicExecutionSummaryMetadataDynamicExecutionSummaryResult.java +++ b/src/main/java/ai/reveng/model/OperationDynamicExecutionSummaryMetadataDynamicExecutionSummaryResult.java @@ -14,6 +14,7 @@ import java.util.Objects; import ai.reveng.model.DynamicExecutionSummaryMetadata; +import ai.reveng.model.DynamicExecutionSummaryResult; import ai.reveng.model.Status; import com.google.gson.TypeAdapter; import com.google.gson.annotations.JsonAdapter; @@ -74,7 +75,7 @@ public class OperationDynamicExecutionSummaryMetadataDynamicExecutionSummaryResu public static final String SERIALIZED_NAME_RESPONSE = "response"; @SerializedName(SERIALIZED_NAME_RESPONSE) @javax.annotation.Nullable - private Object response; + private DynamicExecutionSummaryResult response; public OperationDynamicExecutionSummaryMetadataDynamicExecutionSummaryResult() { } @@ -155,7 +156,7 @@ public void setName(@javax.annotation.Nonnull String name) { } - public OperationDynamicExecutionSummaryMetadataDynamicExecutionSummaryResult response(@javax.annotation.Nullable Object response) { + public OperationDynamicExecutionSummaryMetadataDynamicExecutionSummaryResult response(@javax.annotation.Nullable DynamicExecutionSummaryResult response) { this.response = response; return this; } @@ -165,11 +166,11 @@ public OperationDynamicExecutionSummaryMetadataDynamicExecutionSummaryResult res * @return response */ @javax.annotation.Nullable - public Object getResponse() { + public DynamicExecutionSummaryResult getResponse() { return response; } - public void setResponse(@javax.annotation.Nullable Object response) { + public void setResponse(@javax.annotation.Nullable DynamicExecutionSummaryResult response) { this.response = response; } diff --git a/src/main/java/ai/reveng/model/OperationPrerequisitesBody.java b/src/main/java/ai/reveng/model/OperationPrerequisitesBody.java new file mode 100644 index 0000000..3513376 --- /dev/null +++ b/src/main/java/ai/reveng/model/OperationPrerequisitesBody.java @@ -0,0 +1,331 @@ +/* + * 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; + +/** + * OperationPrerequisitesBody + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class OperationPrerequisitesBody { + public static final String SERIALIZED_NAME_OPERATION = "operation"; + @SerializedName(SERIALIZED_NAME_OPERATION) + @javax.annotation.Nonnull + private String operation; + + public static final String SERIALIZED_NAME_PREREQUISITES = "prerequisites"; + @SerializedName(SERIALIZED_NAME_PREREQUISITES) + @javax.annotation.Nonnull + private List prerequisites = new ArrayList<>(); + + public OperationPrerequisitesBody() { + } + + public OperationPrerequisitesBody operation(@javax.annotation.Nonnull String operation) { + this.operation = operation; + return this; + } + + /** + * The operation + * @return operation + */ + @javax.annotation.Nonnull + public String getOperation() { + return operation; + } + + public void setOperation(@javax.annotation.Nonnull String operation) { + this.operation = operation; + } + + + public OperationPrerequisitesBody prerequisites(@javax.annotation.Nonnull List prerequisites) { + this.prerequisites = prerequisites; + return this; + } + + public OperationPrerequisitesBody addPrerequisitesItem(String prerequisitesItem) { + if (this.prerequisites == null) { + this.prerequisites = new ArrayList<>(); + } + this.prerequisites.add(prerequisitesItem); + return this; + } + + /** + * Operations that must complete before this operation can start + * @return prerequisites + */ + @javax.annotation.Nonnull + public List getPrerequisites() { + return prerequisites; + } + + public void setPrerequisites(@javax.annotation.Nonnull List prerequisites) { + this.prerequisites = prerequisites; + } + + /** + * 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 OperationPrerequisitesBody instance itself + */ + public OperationPrerequisitesBody 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; + } + OperationPrerequisitesBody operationPrerequisitesBody = (OperationPrerequisitesBody) o; + return Objects.equals(this.operation, operationPrerequisitesBody.operation) && + Objects.equals(this.prerequisites, operationPrerequisitesBody.prerequisites)&& + Objects.equals(this.additionalProperties, operationPrerequisitesBody.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(operation, prerequisites, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class OperationPrerequisitesBody {\n"); + sb.append(" operation: ").append(toIndentedString(operation)).append("\n"); + sb.append(" prerequisites: ").append(toIndentedString(prerequisites)).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("operation", "prerequisites")); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(Arrays.asList("operation", "prerequisites")); + } + + /** + * 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 OperationPrerequisitesBody + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!OperationPrerequisitesBody.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 OperationPrerequisitesBody is not found in the empty JSON string", OperationPrerequisitesBody.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : OperationPrerequisitesBody.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("operation").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `operation` to be a primitive type in the JSON string but got `%s`", jsonObj.get("operation").toString())); + } + // ensure the required json array is present + if (jsonObj.get("prerequisites") == null) { + throw new IllegalArgumentException("Expected the field `linkedContent` to be an array in the JSON string but got `null`"); + } else if (!jsonObj.get("prerequisites").isJsonArray()) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `prerequisites` to be an array in the JSON string but got `%s`", jsonObj.get("prerequisites").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!OperationPrerequisitesBody.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'OperationPrerequisitesBody' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(OperationPrerequisitesBody.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, OperationPrerequisitesBody 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 OperationPrerequisitesBody read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + OperationPrerequisitesBody 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 OperationPrerequisitesBody given an JSON string + * + * @param jsonString JSON string + * @return An instance of OperationPrerequisitesBody + * @throws IOException if the JSON string is invalid with respect to OperationPrerequisitesBody + */ + public static OperationPrerequisitesBody fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, OperationPrerequisitesBody.class); + } + + /** + * Convert an instance of OperationPrerequisitesBody to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/ai/reveng/model/OperationRenameUnnamedFunctionsMetadataRenameUnnamedFunctionsResult.java b/src/main/java/ai/reveng/model/OperationRenameUnnamedFunctionsMetadataRenameUnnamedFunctionsResult.java new file mode 100644 index 0000000..c39ee33 --- /dev/null +++ b/src/main/java/ai/reveng/model/OperationRenameUnnamedFunctionsMetadataRenameUnnamedFunctionsResult.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.RenameUnnamedFunctionsMetadata; +import ai.reveng.model.RenameUnnamedFunctionsResult; +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; + +/** + * OperationRenameUnnamedFunctionsMetadataRenameUnnamedFunctionsResult + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class OperationRenameUnnamedFunctionsMetadataRenameUnnamedFunctionsResult { + 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 RenameUnnamedFunctionsMetadata 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 RenameUnnamedFunctionsResult response; + + public OperationRenameUnnamedFunctionsMetadataRenameUnnamedFunctionsResult() { + } + + public OperationRenameUnnamedFunctionsMetadataRenameUnnamedFunctionsResult 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 OperationRenameUnnamedFunctionsMetadataRenameUnnamedFunctionsResult 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 OperationRenameUnnamedFunctionsMetadataRenameUnnamedFunctionsResult metadata(@javax.annotation.Nullable RenameUnnamedFunctionsMetadata metadata) { + this.metadata = metadata; + return this; + } + + /** + * In-flight information and details. + * @return metadata + */ + @javax.annotation.Nullable + public RenameUnnamedFunctionsMetadata getMetadata() { + return metadata; + } + + public void setMetadata(@javax.annotation.Nullable RenameUnnamedFunctionsMetadata metadata) { + this.metadata = metadata; + } + + + public OperationRenameUnnamedFunctionsMetadataRenameUnnamedFunctionsResult 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 OperationRenameUnnamedFunctionsMetadataRenameUnnamedFunctionsResult response(@javax.annotation.Nullable RenameUnnamedFunctionsResult response) { + this.response = response; + return this; + } + + /** + * Result, set only when done is true and the operation succeeded. + * @return response + */ + @javax.annotation.Nullable + public RenameUnnamedFunctionsResult getResponse() { + return response; + } + + public void setResponse(@javax.annotation.Nullable RenameUnnamedFunctionsResult 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 OperationRenameUnnamedFunctionsMetadataRenameUnnamedFunctionsResult instance itself + */ + public OperationRenameUnnamedFunctionsMetadataRenameUnnamedFunctionsResult 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; + } + OperationRenameUnnamedFunctionsMetadataRenameUnnamedFunctionsResult operationRenameUnnamedFunctionsMetadataRenameUnnamedFunctionsResult = (OperationRenameUnnamedFunctionsMetadataRenameUnnamedFunctionsResult) o; + return Objects.equals(this.done, operationRenameUnnamedFunctionsMetadataRenameUnnamedFunctionsResult.done) && + Objects.equals(this.error, operationRenameUnnamedFunctionsMetadataRenameUnnamedFunctionsResult.error) && + Objects.equals(this.metadata, operationRenameUnnamedFunctionsMetadataRenameUnnamedFunctionsResult.metadata) && + Objects.equals(this.name, operationRenameUnnamedFunctionsMetadataRenameUnnamedFunctionsResult.name) && + Objects.equals(this.response, operationRenameUnnamedFunctionsMetadataRenameUnnamedFunctionsResult.response)&& + Objects.equals(this.additionalProperties, operationRenameUnnamedFunctionsMetadataRenameUnnamedFunctionsResult.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 OperationRenameUnnamedFunctionsMetadataRenameUnnamedFunctionsResult {\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 OperationRenameUnnamedFunctionsMetadataRenameUnnamedFunctionsResult + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!OperationRenameUnnamedFunctionsMetadataRenameUnnamedFunctionsResult.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 OperationRenameUnnamedFunctionsMetadataRenameUnnamedFunctionsResult is not found in the empty JSON string", OperationRenameUnnamedFunctionsMetadataRenameUnnamedFunctionsResult.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : OperationRenameUnnamedFunctionsMetadataRenameUnnamedFunctionsResult.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 (!OperationRenameUnnamedFunctionsMetadataRenameUnnamedFunctionsResult.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'OperationRenameUnnamedFunctionsMetadataRenameUnnamedFunctionsResult' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(OperationRenameUnnamedFunctionsMetadataRenameUnnamedFunctionsResult.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, OperationRenameUnnamedFunctionsMetadataRenameUnnamedFunctionsResult 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 OperationRenameUnnamedFunctionsMetadataRenameUnnamedFunctionsResult read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + OperationRenameUnnamedFunctionsMetadataRenameUnnamedFunctionsResult 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 OperationRenameUnnamedFunctionsMetadataRenameUnnamedFunctionsResult given an JSON string + * + * @param jsonString JSON string + * @return An instance of OperationRenameUnnamedFunctionsMetadataRenameUnnamedFunctionsResult + * @throws IOException if the JSON string is invalid with respect to OperationRenameUnnamedFunctionsMetadataRenameUnnamedFunctionsResult + */ + public static OperationRenameUnnamedFunctionsMetadataRenameUnnamedFunctionsResult fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, OperationRenameUnnamedFunctionsMetadataRenameUnnamedFunctionsResult.class); + } + + /** + * Convert an instance of OperationRenameUnnamedFunctionsMetadataRenameUnnamedFunctionsResult to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/ai/reveng/model/PublicUserBody.java b/src/main/java/ai/reveng/model/PublicUserBody.java new file mode 100644 index 0000000..64f3249 --- /dev/null +++ b/src/main/java/ai/reveng/model/PublicUserBody.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; + +/** + * PublicUserBody + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class PublicUserBody { + public static final String SERIALIZED_NAME_USER_ID = "user_id"; + @SerializedName(SERIALIZED_NAME_USER_ID) + @javax.annotation.Nonnull + private Long userId; + + public static final String SERIALIZED_NAME_USERNAME = "username"; + @SerializedName(SERIALIZED_NAME_USERNAME) + @javax.annotation.Nonnull + private String username; + + public PublicUserBody() { + } + + public PublicUserBody userId(@javax.annotation.Nonnull Long userId) { + this.userId = userId; + return this; + } + + /** + * The user's ID + * @return userId + */ + @javax.annotation.Nonnull + public Long getUserId() { + return userId; + } + + public void setUserId(@javax.annotation.Nonnull Long userId) { + this.userId = userId; + } + + + public PublicUserBody username(@javax.annotation.Nonnull String username) { + this.username = username; + return this; + } + + /** + * The user's display name + * @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 PublicUserBody instance itself + */ + public PublicUserBody 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; + } + PublicUserBody publicUserBody = (PublicUserBody) o; + return Objects.equals(this.userId, publicUserBody.userId) && + Objects.equals(this.username, publicUserBody.username)&& + Objects.equals(this.additionalProperties, publicUserBody.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(userId, username, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class PublicUserBody {\n"); + sb.append(" userId: ").append(toIndentedString(userId)).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("user_id", "username")); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(Arrays.asList("user_id", "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 PublicUserBody + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!PublicUserBody.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 PublicUserBody is not found in the empty JSON string", PublicUserBody.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : PublicUserBody.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 (!PublicUserBody.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'PublicUserBody' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(PublicUserBody.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, PublicUserBody 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 PublicUserBody read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + PublicUserBody 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 PublicUserBody given an JSON string + * + * @param jsonString JSON string + * @return An instance of PublicUserBody + * @throws IOException if the JSON string is invalid with respect to PublicUserBody + */ + public static PublicUserBody fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, PublicUserBody.class); + } + + /** + * Convert an instance of PublicUserBody to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/ai/reveng/model/ReferencedConstant.java b/src/main/java/ai/reveng/model/ReferencedConstant.java index 6362c69..5e9e1a9 100644 --- a/src/main/java/ai/reveng/model/ReferencedConstant.java +++ b/src/main/java/ai/reveng/model/ReferencedConstant.java @@ -55,7 +55,7 @@ public class ReferencedConstant { public static final String SERIALIZED_NAME_SUBJECT = "subject"; @SerializedName(SERIALIZED_NAME_SUBJECT) - @javax.annotation.Nonnull + @javax.annotation.Nullable private Subject subject; public static final String SERIALIZED_NAME_VALUE = "value"; @@ -71,7 +71,7 @@ public class ReferencedConstant { public ReferencedConstant() { } - public ReferencedConstant subject(@javax.annotation.Nonnull Subject subject) { + public ReferencedConstant subject(@javax.annotation.Nullable Subject subject) { this.subject = subject; return this; } @@ -80,12 +80,12 @@ public ReferencedConstant subject(@javax.annotation.Nonnull Subject subject) { * Get subject * @return subject */ - @javax.annotation.Nonnull + @javax.annotation.Nullable public Subject getSubject() { return subject; } - public void setSubject(@javax.annotation.Nonnull Subject subject) { + public void setSubject(@javax.annotation.Nullable Subject subject) { this.subject = subject; } @@ -256,8 +256,10 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti } } JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (jsonObj.get("subject") != null && !jsonObj.get("subject").isJsonNull()) { // validate the required field `subject` Subject.validateJsonElement(jsonObj.get("subject")); + } // validate the optional field `display` if (jsonObj.get("display") != null && !jsonObj.get("display").isJsonNull()) { Display.validateJsonElement(jsonObj.get("display")); diff --git a/src/main/java/ai/reveng/model/ReferencedConstantEvidence.java b/src/main/java/ai/reveng/model/ReferencedConstantEvidence.java index f2eda9b..990ce89 100644 --- a/src/main/java/ai/reveng/model/ReferencedConstantEvidence.java +++ b/src/main/java/ai/reveng/model/ReferencedConstantEvidence.java @@ -13,8 +13,7 @@ package ai.reveng.model; import java.util.Objects; -import ai.reveng.model.EvidenceEffect; -import ai.reveng.model.ReferencedConstant; +import ai.reveng.model.ReportReferencedConstant; import com.google.gson.TypeAdapter; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; @@ -49,12 +48,76 @@ import ai.reveng.invoker.JSON; /** - * Constants and the instructions that reference them. + * ReferencedConstantEvidence */ @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class ReferencedConstantEvidence { + public static final String SERIALIZED_NAME_CONSTANTS = "constants"; + @SerializedName(SERIALIZED_NAME_CONSTANTS) + @javax.annotation.Nonnull + private List constants = new ArrayList<>(); + + /** + * Whether the evidence supports or refutes the finding. + */ + @JsonAdapter(EffectEnum.Adapter.class) + public enum EffectEnum { + SUPPORTS("supports"), + + REFUTES("refutes"), + + UNKNOWN_DEFAULT_OPEN_API("unknown_default_open_api"); + + private String value; + + EffectEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static EffectEnum fromValue(String value) { + for (EffectEnum b : EffectEnum.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 EffectEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public EffectEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return EffectEnum.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + EffectEnum.fromValue(value); + } + } + + public static final String SERIALIZED_NAME_EFFECT = "effect"; + @SerializedName(SERIALIZED_NAME_EFFECT) + @javax.annotation.Nonnull + private EffectEnum effect; + /** - * Gets or Sets evidenceKind + * Kind of evidence. */ @JsonAdapter(EvidenceKindEnum.Adapter.class) public enum EvidenceKindEnum { @@ -107,11 +170,11 @@ 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.REFERENCED_CONSTANT; + @javax.annotation.Nonnull + private EvidenceKindEnum evidenceKind; /** - * Gets or Sets kind + * How the evidence was derived. */ @JsonAdapter(KindEnum.Adapter.class) public enum KindEnum { @@ -164,16 +227,11 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti public static final String SERIALIZED_NAME_KIND = "kind"; @SerializedName(SERIALIZED_NAME_KIND) - @javax.annotation.Nullable - private KindEnum kind = KindEnum.DETERMINISTIC_DERIVATION; - - public static final String SERIALIZED_NAME_EFFECT = "effect"; - @SerializedName(SERIALIZED_NAME_EFFECT) @javax.annotation.Nonnull - private EvidenceEffect effect; + private KindEnum kind; /** - * Gets or Sets strength + * How directly the evidence bears on the finding. */ @JsonAdapter(StrengthEnum.Adapter.class) public enum StrengthEnum { @@ -226,117 +284,112 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti public static final String SERIALIZED_NAME_STRENGTH = "strength"; @SerializedName(SERIALIZED_NAME_STRENGTH) - @javax.annotation.Nullable - private StrengthEnum strength = StrengthEnum.DIRECT; - - public static final String SERIALIZED_NAME_CONSTANTS = "constants"; - @SerializedName(SERIALIZED_NAME_CONSTANTS) @javax.annotation.Nonnull - private List constants = new ArrayList<>(); + private StrengthEnum strength; public ReferencedConstantEvidence() { } - public ReferencedConstantEvidence evidenceKind(@javax.annotation.Nullable EvidenceKindEnum evidenceKind) { - this.evidenceKind = evidenceKind; + public ReferencedConstantEvidence constants(@javax.annotation.Nonnull List constants) { + this.constants = constants; return this; } - /** - * Get evidenceKind - * @return evidenceKind - */ - @javax.annotation.Nullable - public EvidenceKindEnum getEvidenceKind() { - return evidenceKind; - } - - public void setEvidenceKind(@javax.annotation.Nullable EvidenceKindEnum evidenceKind) { - this.evidenceKind = evidenceKind; - } - - - public ReferencedConstantEvidence kind(@javax.annotation.Nullable KindEnum kind) { - this.kind = kind; + public ReferencedConstantEvidence addConstantsItem(ReportReferencedConstant constantsItem) { + if (this.constants == null) { + this.constants = new ArrayList<>(); + } + this.constants.add(constantsItem); return this; } /** - * Get kind - * @return kind + * The constants and where they are referenced. + * @return constants */ - @javax.annotation.Nullable - public KindEnum getKind() { - return kind; + @javax.annotation.Nonnull + public List getConstants() { + return constants; } - public void setKind(@javax.annotation.Nullable KindEnum kind) { - this.kind = kind; + public void setConstants(@javax.annotation.Nonnull List constants) { + this.constants = constants; } - public ReferencedConstantEvidence effect(@javax.annotation.Nonnull EvidenceEffect effect) { + public ReferencedConstantEvidence effect(@javax.annotation.Nonnull EffectEnum effect) { this.effect = effect; return this; } /** - * Get effect + * Whether the evidence supports or refutes the finding. * @return effect */ @javax.annotation.Nonnull - public EvidenceEffect getEffect() { + public EffectEnum getEffect() { return effect; } - public void setEffect(@javax.annotation.Nonnull EvidenceEffect effect) { + public void setEffect(@javax.annotation.Nonnull EffectEnum effect) { this.effect = effect; } - public ReferencedConstantEvidence strength(@javax.annotation.Nullable StrengthEnum strength) { - this.strength = strength; + public ReferencedConstantEvidence evidenceKind(@javax.annotation.Nonnull EvidenceKindEnum evidenceKind) { + this.evidenceKind = evidenceKind; return this; } /** - * Get strength - * @return strength + * Kind of evidence. + * @return evidenceKind */ - @javax.annotation.Nullable - public StrengthEnum getStrength() { - return strength; + @javax.annotation.Nonnull + public EvidenceKindEnum getEvidenceKind() { + return evidenceKind; } - public void setStrength(@javax.annotation.Nullable StrengthEnum strength) { - this.strength = strength; + public void setEvidenceKind(@javax.annotation.Nonnull EvidenceKindEnum evidenceKind) { + this.evidenceKind = evidenceKind; } - public ReferencedConstantEvidence constants(@javax.annotation.Nonnull List constants) { - this.constants = constants; + public ReferencedConstantEvidence kind(@javax.annotation.Nonnull KindEnum kind) { + this.kind = kind; return this; } - public ReferencedConstantEvidence addConstantsItem(ReferencedConstant constantsItem) { - if (this.constants == null) { - this.constants = new ArrayList<>(); - } - this.constants.add(constantsItem); + /** + * How the evidence was derived. + * @return kind + */ + @javax.annotation.Nonnull + public KindEnum getKind() { + return kind; + } + + public void setKind(@javax.annotation.Nonnull KindEnum kind) { + this.kind = kind; + } + + + public ReferencedConstantEvidence strength(@javax.annotation.Nonnull StrengthEnum strength) { + this.strength = strength; return this; } /** - * Get constants - * @return constants + * How directly the evidence bears on the finding. + * @return strength */ @javax.annotation.Nonnull - public List getConstants() { - return constants; + public StrengthEnum getStrength() { + return strength; } - public void setConstants(@javax.annotation.Nonnull List constants) { - this.constants = constants; + public void setStrength(@javax.annotation.Nonnull StrengthEnum strength) { + this.strength = strength; } /** @@ -394,28 +447,28 @@ public boolean equals(Object o) { return false; } ReferencedConstantEvidence referencedConstantEvidence = (ReferencedConstantEvidence) o; - return Objects.equals(this.evidenceKind, referencedConstantEvidence.evidenceKind) && - Objects.equals(this.kind, referencedConstantEvidence.kind) && + return Objects.equals(this.constants, referencedConstantEvidence.constants) && Objects.equals(this.effect, referencedConstantEvidence.effect) && - Objects.equals(this.strength, referencedConstantEvidence.strength) && - Objects.equals(this.constants, referencedConstantEvidence.constants)&& + Objects.equals(this.evidenceKind, referencedConstantEvidence.evidenceKind) && + Objects.equals(this.kind, referencedConstantEvidence.kind) && + Objects.equals(this.strength, referencedConstantEvidence.strength)&& Objects.equals(this.additionalProperties, referencedConstantEvidence.additionalProperties); } @Override public int hashCode() { - return Objects.hash(evidenceKind, kind, effect, strength, constants, additionalProperties); + return Objects.hash(constants, effect, evidenceKind, kind, strength, additionalProperties); } @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class ReferencedConstantEvidence {\n"); + sb.append(" constants: ").append(toIndentedString(constants)).append("\n"); + sb.append(" effect: ").append(toIndentedString(effect)).append("\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"); sb.append(" strength: ").append(toIndentedString(strength)).append("\n"); - sb.append(" constants: ").append(toIndentedString(constants)).append("\n"); sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); sb.append("}"); return sb.toString(); @@ -435,10 +488,10 @@ private String toIndentedString(Object o) { static { // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(Arrays.asList("evidence_kind", "kind", "effect", "strength", "constants")); + openapiFields = new HashSet(Arrays.asList("constants", "effect", "evidence_kind", "kind", "strength")); // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(Arrays.asList("effect", "constants")); + openapiRequiredFields = new HashSet(Arrays.asList("constants", "effect", "evidence_kind", "kind", "strength")); } /** @@ -461,39 +514,32 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti } } JsonObject jsonObj = jsonElement.getAsJsonObject(); - if ((jsonObj.get("evidence_kind") != null && !jsonObj.get("evidence_kind").isJsonNull()) && !jsonObj.get("evidence_kind").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `evidence_kind` to be a primitive type in the JSON string but got `%s`", jsonObj.get("evidence_kind").toString())); - } - // validate the optional field `evidence_kind` - if (jsonObj.get("evidence_kind") != null && !jsonObj.get("evidence_kind").isJsonNull()) { - EvidenceKindEnum.validateJsonElement(jsonObj.get("evidence_kind")); + // ensure the required json array is present + if (jsonObj.get("constants") == null) { + throw new IllegalArgumentException("Expected the field `linkedContent` to be an array in the JSON string but got `null`"); + } else if (!jsonObj.get("constants").isJsonArray()) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `constants` to be an array in the JSON string but got `%s`", jsonObj.get("constants").toString())); } - if ((jsonObj.get("kind") != null && !jsonObj.get("kind").isJsonNull()) && !jsonObj.get("kind").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `kind` to be a primitive type in the JSON string but got `%s`", jsonObj.get("kind").toString())); - } - // validate the optional field `kind` - if (jsonObj.get("kind") != null && !jsonObj.get("kind").isJsonNull()) { - KindEnum.validateJsonElement(jsonObj.get("kind")); + if (!jsonObj.get("effect").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `effect` to be a primitive type in the JSON string but got `%s`", jsonObj.get("effect").toString())); } // validate the required field `effect` - EvidenceEffect.validateJsonElement(jsonObj.get("effect")); - if ((jsonObj.get("strength") != null && !jsonObj.get("strength").isJsonNull()) && !jsonObj.get("strength").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `strength` to be a primitive type in the JSON string but got `%s`", jsonObj.get("strength").toString())); + EffectEnum.validateJsonElement(jsonObj.get("effect")); + if (!jsonObj.get("evidence_kind").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `evidence_kind` to be a primitive type in the JSON string but got `%s`", jsonObj.get("evidence_kind").toString())); } - // validate the optional field `strength` - if (jsonObj.get("strength") != null && !jsonObj.get("strength").isJsonNull()) { - StrengthEnum.validateJsonElement(jsonObj.get("strength")); + // validate the required field `evidence_kind` + EvidenceKindEnum.validateJsonElement(jsonObj.get("evidence_kind")); + if (!jsonObj.get("kind").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `kind` to be a primitive type in the JSON string but got `%s`", jsonObj.get("kind").toString())); } - if (jsonObj.get("constants") != null) { - if (!jsonObj.get("constants").isJsonArray()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `constants` to be an array in the JSON string but got `%s`", jsonObj.get("constants").toString())); - } - JsonArray jsonArrayconstants = jsonObj.getAsJsonArray("constants"); - // validate the required field `constants` (array) - for (int i = 0; i < jsonArrayconstants.size(); i++) { - ReferencedConstant.validateJsonElement(jsonArrayconstants.get(i)); - } + // validate the required field `kind` + KindEnum.validateJsonElement(jsonObj.get("kind")); + if (!jsonObj.get("strength").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `strength` to be a primitive type in the JSON string but got `%s`", jsonObj.get("strength").toString())); } + // validate the required field `strength` + StrengthEnum.validateJsonElement(jsonObj.get("strength")); } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { diff --git a/src/main/java/ai/reveng/model/RenameUnnamedFunctionsMetadata.java b/src/main/java/ai/reveng/model/RenameUnnamedFunctionsMetadata.java new file mode 100644 index 0000000..d046dfb --- /dev/null +++ b/src/main/java/ai/reveng/model/RenameUnnamedFunctionsMetadata.java @@ -0,0 +1,403 @@ +/* + * 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 org.openapitools.jackson.nullable.JsonNullable; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import ai.reveng.invoker.JSON; + +/** + * RenameUnnamedFunctionsMetadata + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class RenameUnnamedFunctionsMetadata { + public static final String SERIALIZED_NAME_LOG_HISTORY = "log_history"; + @SerializedName(SERIALIZED_NAME_LOG_HISTORY) + @javax.annotation.Nullable + private List> logHistory; + + /** + * Run status. UNINITIALISED means the agent has never been triggered for this analysis. + */ + @JsonAdapter(StatusEnum.Adapter.class) + public enum StatusEnum { + UNINITIALISED("UNINITIALISED"), + + PENDING("PENDING"), + + RUNNING("RUNNING"), + + COMPLETED("COMPLETED"), + + FAILED("FAILED"), + + UNKNOWN_DEFAULT_OPEN_API("unknown_default_open_api"); + + private String value; + + StatusEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static StatusEnum fromValue(String value) { + for (StatusEnum b : StatusEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + return UNKNOWN_DEFAULT_OPEN_API; + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final StatusEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public StatusEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return StatusEnum.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + StatusEnum.fromValue(value); + } + } + + public static final String SERIALIZED_NAME_STATUS = "status"; + @SerializedName(SERIALIZED_NAME_STATUS) + @javax.annotation.Nonnull + private StatusEnum status; + + public RenameUnnamedFunctionsMetadata() { + } + + public RenameUnnamedFunctionsMetadata logHistory(@javax.annotation.Nullable List> logHistory) { + this.logHistory = logHistory; + return this; + } + + public RenameUnnamedFunctionsMetadata addLogHistoryItem(List logHistoryItem) { + if (this.logHistory == null) { + this.logHistory = new ArrayList<>(); + } + this.logHistory.add(logHistoryItem); + return this; + } + + /** + * Progress messages the run recorded, oldest first. + * @return logHistory + */ + @javax.annotation.Nullable + public List> getLogHistory() { + return logHistory; + } + + public void setLogHistory(@javax.annotation.Nullable List> logHistory) { + this.logHistory = logHistory; + } + + + public RenameUnnamedFunctionsMetadata status(@javax.annotation.Nonnull StatusEnum status) { + this.status = status; + return this; + } + + /** + * Run status. UNINITIALISED means the agent has never been triggered for this analysis. + * @return status + */ + @javax.annotation.Nonnull + public StatusEnum getStatus() { + return status; + } + + public void setStatus(@javax.annotation.Nonnull StatusEnum status) { + this.status = status; + } + + /** + * 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 RenameUnnamedFunctionsMetadata instance itself + */ + public RenameUnnamedFunctionsMetadata 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; + } + RenameUnnamedFunctionsMetadata renameUnnamedFunctionsMetadata = (RenameUnnamedFunctionsMetadata) o; + return Objects.equals(this.logHistory, renameUnnamedFunctionsMetadata.logHistory) && + Objects.equals(this.status, renameUnnamedFunctionsMetadata.status)&& + Objects.equals(this.additionalProperties, renameUnnamedFunctionsMetadata.additionalProperties); + } + + private static boolean equalsNullable(JsonNullable a, JsonNullable b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + + @Override + public int hashCode() { + return Objects.hash(logHistory, status, additionalProperties); + } + + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class RenameUnnamedFunctionsMetadata {\n"); + sb.append(" logHistory: ").append(toIndentedString(logHistory)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).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("log_history", "status")); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(Arrays.asList("status")); + } + + /** + * 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 RenameUnnamedFunctionsMetadata + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!RenameUnnamedFunctionsMetadata.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 RenameUnnamedFunctionsMetadata is not found in the empty JSON string", RenameUnnamedFunctionsMetadata.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : RenameUnnamedFunctionsMetadata.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 optional json data is an array if present + if (jsonObj.get("log_history") != null && !jsonObj.get("log_history").isJsonNull() && !jsonObj.get("log_history").isJsonArray()) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `log_history` to be an array in the JSON string but got `%s`", jsonObj.get("log_history").toString())); + } + if (!jsonObj.get("status").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `status` to be a primitive type in the JSON string but got `%s`", jsonObj.get("status").toString())); + } + // validate the required field `status` + StatusEnum.validateJsonElement(jsonObj.get("status")); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!RenameUnnamedFunctionsMetadata.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'RenameUnnamedFunctionsMetadata' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(RenameUnnamedFunctionsMetadata.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, RenameUnnamedFunctionsMetadata 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 RenameUnnamedFunctionsMetadata read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + RenameUnnamedFunctionsMetadata 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 RenameUnnamedFunctionsMetadata given an JSON string + * + * @param jsonString JSON string + * @return An instance of RenameUnnamedFunctionsMetadata + * @throws IOException if the JSON string is invalid with respect to RenameUnnamedFunctionsMetadata + */ + public static RenameUnnamedFunctionsMetadata fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, RenameUnnamedFunctionsMetadata.class); + } + + /** + * Convert an instance of RenameUnnamedFunctionsMetadata to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/ai/reveng/model/ReportBytesConstant.java b/src/main/java/ai/reveng/model/ReportBytesConstant.java new file mode 100644 index 0000000..49fcd33 --- /dev/null +++ b/src/main/java/ai/reveng/model/ReportBytesConstant.java @@ -0,0 +1,471 @@ +/* + * 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; + +/** + * ReportBytesConstant + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class ReportBytesConstant { + /** + * Suggested format for displaying the value. + */ + @JsonAdapter(DisplayEnum.Adapter.class) + public enum DisplayEnum { + HEX("hex"), + + UINT8("uint8"), + + UINT16("uint16"), + + UINT32("uint32"), + + UINT64("uint64"), + + INT8("int8"), + + INT16("int16"), + + INT32("int32"), + + INT64("int64"), + + UNKNOWN_DEFAULT_OPEN_API("unknown_default_open_api"); + + private String value; + + DisplayEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static DisplayEnum fromValue(String value) { + for (DisplayEnum b : DisplayEnum.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 DisplayEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public DisplayEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return DisplayEnum.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + DisplayEnum.fromValue(value); + } + } + + public static final String SERIALIZED_NAME_DISPLAY = "display"; + @SerializedName(SERIALIZED_NAME_DISPLAY) + @javax.annotation.Nonnull + private DisplayEnum display; + + /** + * Encoding of the value. + */ + @JsonAdapter(FormatEnum.Adapter.class) + public enum FormatEnum { + BYTES("bytes"), + + UNKNOWN_DEFAULT_OPEN_API("unknown_default_open_api"); + + private String value; + + FormatEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static FormatEnum fromValue(String value) { + for (FormatEnum b : FormatEnum.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 FormatEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public FormatEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return FormatEnum.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + FormatEnum.fromValue(value); + } + } + + public static final String SERIALIZED_NAME_FORMAT = "format"; + @SerializedName(SERIALIZED_NAME_FORMAT) + @javax.annotation.Nonnull + private FormatEnum format; + + public static final String SERIALIZED_NAME_VALUE = "value"; + @SerializedName(SERIALIZED_NAME_VALUE) + @javax.annotation.Nonnull + private String value; + + public ReportBytesConstant() { + } + + public ReportBytesConstant display(@javax.annotation.Nonnull DisplayEnum display) { + this.display = display; + return this; + } + + /** + * Suggested format for displaying the value. + * @return display + */ + @javax.annotation.Nonnull + public DisplayEnum getDisplay() { + return display; + } + + public void setDisplay(@javax.annotation.Nonnull DisplayEnum display) { + this.display = display; + } + + + public ReportBytesConstant format(@javax.annotation.Nonnull FormatEnum format) { + this.format = format; + return this; + } + + /** + * Encoding of the value. + * @return format + */ + @javax.annotation.Nonnull + public FormatEnum getFormat() { + return format; + } + + public void setFormat(@javax.annotation.Nonnull FormatEnum format) { + this.format = format; + } + + + public ReportBytesConstant value(@javax.annotation.Nonnull String value) { + this.value = value; + return this; + } + + /** + * The bytes of the constant, hex-encoded. + * @return value + */ + @javax.annotation.Nonnull + public String getValue() { + return value; + } + + public void setValue(@javax.annotation.Nonnull String value) { + this.value = value; + } + + /** + * 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 ReportBytesConstant instance itself + */ + public ReportBytesConstant 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; + } + ReportBytesConstant reportBytesConstant = (ReportBytesConstant) o; + return Objects.equals(this.display, reportBytesConstant.display) && + Objects.equals(this.format, reportBytesConstant.format) && + Objects.equals(this.value, reportBytesConstant.value)&& + Objects.equals(this.additionalProperties, reportBytesConstant.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(display, format, value, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ReportBytesConstant {\n"); + sb.append(" display: ").append(toIndentedString(display)).append("\n"); + sb.append(" format: ").append(toIndentedString(format)).append("\n"); + sb.append(" value: ").append(toIndentedString(value)).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("display", "format", "value")); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(Arrays.asList("display", "format", "value")); + } + + /** + * 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 ReportBytesConstant + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ReportBytesConstant.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 ReportBytesConstant is not found in the empty JSON string", ReportBytesConstant.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : ReportBytesConstant.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("display").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `display` to be a primitive type in the JSON string but got `%s`", jsonObj.get("display").toString())); + } + // validate the required field `display` + DisplayEnum.validateJsonElement(jsonObj.get("display")); + if (!jsonObj.get("format").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `format` to be a primitive type in the JSON string but got `%s`", jsonObj.get("format").toString())); + } + // validate the required field `format` + FormatEnum.validateJsonElement(jsonObj.get("format")); + if (!jsonObj.get("value").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `value` to be a primitive type in the JSON string but got `%s`", jsonObj.get("value").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ReportBytesConstant.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ReportBytesConstant' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ReportBytesConstant.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, ReportBytesConstant 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 ReportBytesConstant read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + ReportBytesConstant 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 ReportBytesConstant given an JSON string + * + * @param jsonString JSON string + * @return An instance of ReportBytesConstant + * @throws IOException if the JSON string is invalid with respect to ReportBytesConstant + */ + public static ReportBytesConstant fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ReportBytesConstant.class); + } + + /** + * Convert an instance of ReportBytesConstant to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/ai/reveng/model/ReportCallChain.java b/src/main/java/ai/reveng/model/ReportCallChain.java new file mode 100644 index 0000000..aa143ff --- /dev/null +++ b/src/main/java/ai/reveng/model/ReportCallChain.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; + +/** + * ReportCallChain + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class ReportCallChain { + public static final String SERIALIZED_NAME_PATH = "path"; + @SerializedName(SERIALIZED_NAME_PATH) + @javax.annotation.Nonnull + private List path = new ArrayList<>(); + + public ReportCallChain() { + } + + public ReportCallChain path(@javax.annotation.Nonnull List path) { + this.path = path; + return this; + } + + public ReportCallChain addPathItem(Long pathItem) { + if (this.path == null) { + this.path = new ArrayList<>(); + } + this.path.add(pathItem); + return this; + } + + /** + * Call addresses along the path, entry point first. + * @return path + */ + @javax.annotation.Nonnull + public List getPath() { + return path; + } + + public void setPath(@javax.annotation.Nonnull List path) { + this.path = path; + } + + /** + * 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 ReportCallChain instance itself + */ + public ReportCallChain 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; + } + ReportCallChain reportCallChain = (ReportCallChain) o; + return Objects.equals(this.path, reportCallChain.path)&& + Objects.equals(this.additionalProperties, reportCallChain.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(path, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ReportCallChain {\n"); + sb.append(" path: ").append(toIndentedString(path)).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("path")); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(Arrays.asList("path")); + } + + /** + * 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 ReportCallChain + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ReportCallChain.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 ReportCallChain is not found in the empty JSON string", ReportCallChain.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : ReportCallChain.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("path") == null) { + throw new IllegalArgumentException("Expected the field `linkedContent` to be an array in the JSON string but got `null`"); + } else if (!jsonObj.get("path").isJsonArray()) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `path` to be an array in the JSON string but got `%s`", jsonObj.get("path").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ReportCallChain.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ReportCallChain' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ReportCallChain.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, ReportCallChain 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 ReportCallChain read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + ReportCallChain 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 ReportCallChain given an JSON string + * + * @param jsonString JSON string + * @return An instance of ReportCallChain + * @throws IOException if the JSON string is invalid with respect to ReportCallChain + */ + public static ReportCallChain fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ReportCallChain.class); + } + + /** + * Convert an instance of ReportCallChain to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/ai/reveng/model/ReportCodeSummary.java b/src/main/java/ai/reveng/model/ReportCodeSummary.java new file mode 100644 index 0000000..2676bc3 --- /dev/null +++ b/src/main/java/ai/reveng/model/ReportCodeSummary.java @@ -0,0 +1,343 @@ +/* + * 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.ReportCallChain; +import ai.reveng.model.ReportSubject; +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; + +/** + * ReportCodeSummary + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class ReportCodeSummary { + public static final String SERIALIZED_NAME_REACHABILITY = "reachability"; + @SerializedName(SERIALIZED_NAME_REACHABILITY) + @javax.annotation.Nullable + private ReportCallChain reachability; + + public static final String SERIALIZED_NAME_SUBJECT = "subject"; + @SerializedName(SERIALIZED_NAME_SUBJECT) + @javax.annotation.Nonnull + private ReportSubject subject; + + public static final String SERIALIZED_NAME_SUMMARY = "summary"; + @SerializedName(SERIALIZED_NAME_SUMMARY) + @javax.annotation.Nonnull + private String summary; + + public ReportCodeSummary() { + } + + public ReportCodeSummary reachability(@javax.annotation.Nullable ReportCallChain reachability) { + this.reachability = reachability; + return this; + } + + /** + * A call chain reaching the entity, absent when none was found. + * @return reachability + */ + @javax.annotation.Nullable + public ReportCallChain getReachability() { + return reachability; + } + + public void setReachability(@javax.annotation.Nullable ReportCallChain reachability) { + this.reachability = reachability; + } + + + public ReportCodeSummary subject(@javax.annotation.Nonnull ReportSubject subject) { + this.subject = subject; + return this; + } + + /** + * The program location whose code is summarised. + * @return subject + */ + @javax.annotation.Nonnull + public ReportSubject getSubject() { + return subject; + } + + public void setSubject(@javax.annotation.Nonnull ReportSubject subject) { + this.subject = subject; + } + + + public ReportCodeSummary summary(@javax.annotation.Nonnull String summary) { + this.summary = summary; + return this; + } + + /** + * What the code does. + * @return summary + */ + @javax.annotation.Nonnull + public String getSummary() { + return summary; + } + + public void setSummary(@javax.annotation.Nonnull String summary) { + this.summary = summary; + } + + /** + * 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 ReportCodeSummary instance itself + */ + public ReportCodeSummary 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; + } + ReportCodeSummary reportCodeSummary = (ReportCodeSummary) o; + return Objects.equals(this.reachability, reportCodeSummary.reachability) && + Objects.equals(this.subject, reportCodeSummary.subject) && + Objects.equals(this.summary, reportCodeSummary.summary)&& + Objects.equals(this.additionalProperties, reportCodeSummary.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(reachability, subject, summary, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ReportCodeSummary {\n"); + sb.append(" reachability: ").append(toIndentedString(reachability)).append("\n"); + sb.append(" subject: ").append(toIndentedString(subject)).append("\n"); + sb.append(" summary: ").append(toIndentedString(summary)).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("reachability", "subject", "summary")); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(Arrays.asList("subject", "summary")); + } + + /** + * 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 ReportCodeSummary + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ReportCodeSummary.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 ReportCodeSummary is not found in the empty JSON string", ReportCodeSummary.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : ReportCodeSummary.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("summary").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `summary` to be a primitive type in the JSON string but got `%s`", jsonObj.get("summary").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ReportCodeSummary.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ReportCodeSummary' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ReportCodeSummary.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, ReportCodeSummary 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 ReportCodeSummary read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + ReportCodeSummary 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 ReportCodeSummary given an JSON string + * + * @param jsonString JSON string + * @return An instance of ReportCodeSummary + * @throws IOException if the JSON string is invalid with respect to ReportCodeSummary + */ + public static ReportCodeSummary fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ReportCodeSummary.class); + } + + /** + * Convert an instance of ReportCodeSummary to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/ai/reveng/model/ReportFinding.java b/src/main/java/ai/reveng/model/ReportFinding.java new file mode 100644 index 0000000..42f816d --- /dev/null +++ b/src/main/java/ai/reveng/model/ReportFinding.java @@ -0,0 +1,423 @@ +/* + * 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.ReportFindingEvidenceInner; +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; + +/** + * ReportFinding + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class ReportFinding { + public static final String SERIALIZED_NAME_EVIDENCE = "evidence"; + @SerializedName(SERIALIZED_NAME_EVIDENCE) + @javax.annotation.Nonnull + private List evidence = new ArrayList<>(); + + public static final String SERIALIZED_NAME_PROPERTY_ID = "property_id"; + @SerializedName(SERIALIZED_NAME_PROPERTY_ID) + @javax.annotation.Nonnull + private String propertyId; + + /** + * Whether the code behind the finding is reachable from an entry point. + */ + @JsonAdapter(ReachabilityEnum.Adapter.class) + public enum ReachabilityEnum { + UNDETERMINED("undetermined"), + + REACHABLE("reachable"), + + UNREACHABLE("unreachable"), + + UNKNOWN_DEFAULT_OPEN_API("unknown_default_open_api"); + + private String value; + + ReachabilityEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static ReachabilityEnum fromValue(String value) { + for (ReachabilityEnum b : ReachabilityEnum.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 ReachabilityEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public ReachabilityEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return ReachabilityEnum.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + ReachabilityEnum.fromValue(value); + } + } + + public static final String SERIALIZED_NAME_REACHABILITY = "reachability"; + @SerializedName(SERIALIZED_NAME_REACHABILITY) + @javax.annotation.Nonnull + private ReachabilityEnum reachability; + + public ReportFinding() { + } + + public ReportFinding evidence(@javax.annotation.Nonnull List evidence) { + this.evidence = evidence; + return this; + } + + public ReportFinding addEvidenceItem(ReportFindingEvidenceInner evidenceItem) { + if (this.evidence == null) { + this.evidence = new ArrayList<>(); + } + this.evidence.add(evidenceItem); + return this; + } + + /** + * The evidence for or against the finding. + * @return evidence + */ + @javax.annotation.Nonnull + public List getEvidence() { + return evidence; + } + + public void setEvidence(@javax.annotation.Nonnull List evidence) { + this.evidence = evidence; + } + + + public ReportFinding propertyId(@javax.annotation.Nonnull String propertyId) { + this.propertyId = propertyId; + return this; + } + + /** + * Identifier of the property the finding asserts. + * @return propertyId + */ + @javax.annotation.Nonnull + public String getPropertyId() { + return propertyId; + } + + public void setPropertyId(@javax.annotation.Nonnull String propertyId) { + this.propertyId = propertyId; + } + + + public ReportFinding reachability(@javax.annotation.Nonnull ReachabilityEnum reachability) { + this.reachability = reachability; + return this; + } + + /** + * Whether the code behind the finding is reachable from an entry point. + * @return reachability + */ + @javax.annotation.Nonnull + public ReachabilityEnum getReachability() { + return reachability; + } + + public void setReachability(@javax.annotation.Nonnull ReachabilityEnum reachability) { + this.reachability = reachability; + } + + /** + * 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 ReportFinding instance itself + */ + public ReportFinding 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; + } + ReportFinding reportFinding = (ReportFinding) o; + return Objects.equals(this.evidence, reportFinding.evidence) && + Objects.equals(this.propertyId, reportFinding.propertyId) && + Objects.equals(this.reachability, reportFinding.reachability)&& + Objects.equals(this.additionalProperties, reportFinding.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(evidence, propertyId, reachability, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ReportFinding {\n"); + sb.append(" evidence: ").append(toIndentedString(evidence)).append("\n"); + sb.append(" propertyId: ").append(toIndentedString(propertyId)).append("\n"); + sb.append(" reachability: ").append(toIndentedString(reachability)).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("evidence", "property_id", "reachability")); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(Arrays.asList("evidence", "property_id", "reachability")); + } + + /** + * 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 ReportFinding + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ReportFinding.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 ReportFinding is not found in the empty JSON string", ReportFinding.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : ReportFinding.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("evidence") != null) { + if (!jsonObj.get("evidence").isJsonArray()) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `evidence` to be an array in the JSON string but got `%s`", jsonObj.get("evidence").toString())); + } + JsonArray jsonArrayevidence = jsonObj.getAsJsonArray("evidence"); + // validate the required field `evidence` (array) + for (int i = 0; i < jsonArrayevidence.size(); i++) { + ReportFindingEvidenceInner.validateJsonElement(jsonArrayevidence.get(i)); + } + } + if (!jsonObj.get("property_id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `property_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("property_id").toString())); + } + if (!jsonObj.get("reachability").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `reachability` to be a primitive type in the JSON string but got `%s`", jsonObj.get("reachability").toString())); + } + // validate the required field `reachability` + ReachabilityEnum.validateJsonElement(jsonObj.get("reachability")); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ReportFinding.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ReportFinding' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ReportFinding.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, ReportFinding 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 ReportFinding read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + ReportFinding 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 ReportFinding given an JSON string + * + * @param jsonString JSON string + * @return An instance of ReportFinding + * @throws IOException if the JSON string is invalid with respect to ReportFinding + */ + public static ReportFinding fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ReportFinding.class); + } + + /** + * Convert an instance of ReportFinding to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/ai/reveng/model/ReportFindingEvidenceInner.java b/src/main/java/ai/reveng/model/ReportFindingEvidenceInner.java new file mode 100644 index 0000000..e3f081a --- /dev/null +++ b/src/main/java/ai/reveng/model/ReportFindingEvidenceInner.java @@ -0,0 +1,700 @@ +/* + * 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.APICombinationEvidence; +import ai.reveng.model.CallChainEvidence; +import ai.reveng.model.DecompilerSummaryEvidence; +import ai.reveng.model.DisassemblySummaryEvidence; +import ai.reveng.model.FunctionSimilarityEvidence; +import ai.reveng.model.HardcodedSecretEvidence; +import ai.reveng.model.ImportedAPICallEvidence; +import ai.reveng.model.KnownConstantEvidence; +import ai.reveng.model.ModelInterpretationEvidence; +import ai.reveng.model.ReferencedConstantEvidence; +import ai.reveng.model.ReportBytesConstant; +import ai.reveng.model.ReportCodeSummary; +import ai.reveng.model.ReportFunctionSimilarity; +import ai.reveng.model.ReportImportedAPI; +import ai.reveng.model.ReportImportedAPICall; +import ai.reveng.model.ReportModelInterpretation; +import ai.reveng.model.ReportReferencedConstant; +import ai.reveng.model.ReportStringMatch; +import ai.reveng.model.StringMatchEvidence; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + + + +import java.io.IOException; +import java.lang.reflect.Type; +import java.util.logging.Level; +import java.util.logging.Logger; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashSet; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.JsonPrimitive; +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 com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonSerializationContext; +import com.google.gson.JsonSerializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonArray; +import com.google.gson.JsonParseException; + +import ai.reveng.invoker.JSON; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class ReportFindingEvidenceInner extends AbstractOpenApiSchema { + private static final Logger log = Logger.getLogger(ReportFindingEvidenceInner.class.getName()); + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ReportFindingEvidenceInner.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ReportFindingEvidenceInner' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + 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 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)); + final TypeAdapter adapterDisassemblySummaryEvidence = gson.getDelegateAdapter(this, TypeToken.get(DisassemblySummaryEvidence.class)); + final TypeAdapter adapterModelInterpretationEvidence = gson.getDelegateAdapter(this, TypeToken.get(ModelInterpretationEvidence.class)); + final TypeAdapter adapterKnownConstantEvidence = gson.getDelegateAdapter(this, TypeToken.get(KnownConstantEvidence.class)); + final TypeAdapter adapterHardcodedSecretEvidence = gson.getDelegateAdapter(this, TypeToken.get(HardcodedSecretEvidence.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, ReportFindingEvidenceInner value) throws IOException { + if (value == null || value.getActualInstance() == null) { + elementAdapter.write(out, null); + return; + } + + // check if the actual instance is of the type `CallChainEvidence` + if (value.getActualInstance() instanceof CallChainEvidence) { + JsonElement element = adapterCallChainEvidence.toJsonTree((CallChainEvidence)value.getActualInstance()); + elementAdapter.write(out, element); + return; + } + // check if the actual instance is of the type `ReferencedConstantEvidence` + if (value.getActualInstance() instanceof ReferencedConstantEvidence) { + JsonElement element = adapterReferencedConstantEvidence.toJsonTree((ReferencedConstantEvidence)value.getActualInstance()); + elementAdapter.write(out, element); + return; + } + // check if the actual instance is of the type `ImportedAPICallEvidence` + if (value.getActualInstance() instanceof ImportedAPICallEvidence) { + JsonElement element = adapterImportedAPICallEvidence.toJsonTree((ImportedAPICallEvidence)value.getActualInstance()); + elementAdapter.write(out, element); + return; + } + // 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; + } + // check if the actual instance is of the type `FunctionSimilarityEvidence` + if (value.getActualInstance() instanceof FunctionSimilarityEvidence) { + JsonElement element = adapterFunctionSimilarityEvidence.toJsonTree((FunctionSimilarityEvidence)value.getActualInstance()); + elementAdapter.write(out, element); + return; + } + // check if the actual instance is of the type `APICombinationEvidence` + if (value.getActualInstance() instanceof APICombinationEvidence) { + JsonElement element = adapterAPICombinationEvidence.toJsonTree((APICombinationEvidence)value.getActualInstance()); + elementAdapter.write(out, element); + return; + } + // check if the actual instance is of the type `DecompilerSummaryEvidence` + if (value.getActualInstance() instanceof DecompilerSummaryEvidence) { + JsonElement element = adapterDecompilerSummaryEvidence.toJsonTree((DecompilerSummaryEvidence)value.getActualInstance()); + elementAdapter.write(out, element); + return; + } + // check if the actual instance is of the type `DisassemblySummaryEvidence` + if (value.getActualInstance() instanceof DisassemblySummaryEvidence) { + JsonElement element = adapterDisassemblySummaryEvidence.toJsonTree((DisassemblySummaryEvidence)value.getActualInstance()); + elementAdapter.write(out, element); + return; + } + // check if the actual instance is of the type `ModelInterpretationEvidence` + if (value.getActualInstance() instanceof ModelInterpretationEvidence) { + JsonElement element = adapterModelInterpretationEvidence.toJsonTree((ModelInterpretationEvidence)value.getActualInstance()); + elementAdapter.write(out, element); + return; + } + // check if the actual instance is of the type `KnownConstantEvidence` + if (value.getActualInstance() instanceof KnownConstantEvidence) { + JsonElement element = adapterKnownConstantEvidence.toJsonTree((KnownConstantEvidence)value.getActualInstance()); + elementAdapter.write(out, element); + return; + } + // check if the actual instance is of the type `HardcodedSecretEvidence` + if (value.getActualInstance() instanceof HardcodedSecretEvidence) { + JsonElement element = adapterHardcodedSecretEvidence.toJsonTree((HardcodedSecretEvidence)value.getActualInstance()); + elementAdapter.write(out, element); + return; + } + throw new IOException("Failed to serialize as the type doesn't match oneOf schemas: APICombinationEvidence, CallChainEvidence, DecompilerSummaryEvidence, DisassemblySummaryEvidence, FunctionSimilarityEvidence, HardcodedSecretEvidence, ImportedAPICallEvidence, KnownConstantEvidence, ModelInterpretationEvidence, ReferencedConstantEvidence, StringMatchEvidence"); + } + + @Override + public ReportFindingEvidenceInner read(JsonReader in) throws IOException { + Object deserialized = null; + JsonElement jsonElement = elementAdapter.read(in); + + int match = 0; + ArrayList errorMessages = new ArrayList<>(); + TypeAdapter actualAdapter = elementAdapter; + + // deserialize CallChainEvidence + try { + // validate the JSON object to see if any exception is thrown + CallChainEvidence.validateJsonElement(jsonElement); + actualAdapter = adapterCallChainEvidence; + match++; + log.log(Level.FINER, "Input data matches schema 'CallChainEvidence'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format(java.util.Locale.ROOT, "Deserialization for CallChainEvidence failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'CallChainEvidence'", e); + } + // deserialize ReferencedConstantEvidence + try { + // validate the JSON object to see if any exception is thrown + ReferencedConstantEvidence.validateJsonElement(jsonElement); + actualAdapter = adapterReferencedConstantEvidence; + match++; + log.log(Level.FINER, "Input data matches schema 'ReferencedConstantEvidence'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format(java.util.Locale.ROOT, "Deserialization for ReferencedConstantEvidence failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'ReferencedConstantEvidence'", e); + } + // deserialize ImportedAPICallEvidence + try { + // validate the JSON object to see if any exception is thrown + ImportedAPICallEvidence.validateJsonElement(jsonElement); + actualAdapter = adapterImportedAPICallEvidence; + match++; + log.log(Level.FINER, "Input data matches schema 'ImportedAPICallEvidence'"); + } catch (Exception e) { + // deserialization failed, continue + 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 StringMatchEvidence + try { + // validate the JSON object to see if any exception is thrown + StringMatchEvidence.validateJsonElement(jsonElement); + actualAdapter = adapterStringMatchEvidence; + match++; + 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 StringMatchEvidence failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'StringMatchEvidence'", e); + } + // deserialize FunctionSimilarityEvidence + try { + // validate the JSON object to see if any exception is thrown + FunctionSimilarityEvidence.validateJsonElement(jsonElement); + actualAdapter = adapterFunctionSimilarityEvidence; + match++; + log.log(Level.FINER, "Input data matches schema 'FunctionSimilarityEvidence'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format(java.util.Locale.ROOT, "Deserialization for FunctionSimilarityEvidence failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'FunctionSimilarityEvidence'", e); + } + // deserialize APICombinationEvidence + try { + // validate the JSON object to see if any exception is thrown + APICombinationEvidence.validateJsonElement(jsonElement); + actualAdapter = adapterAPICombinationEvidence; + match++; + log.log(Level.FINER, "Input data matches schema 'APICombinationEvidence'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format(java.util.Locale.ROOT, "Deserialization for APICombinationEvidence failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'APICombinationEvidence'", e); + } + // deserialize DecompilerSummaryEvidence + try { + // validate the JSON object to see if any exception is thrown + DecompilerSummaryEvidence.validateJsonElement(jsonElement); + actualAdapter = adapterDecompilerSummaryEvidence; + match++; + log.log(Level.FINER, "Input data matches schema 'DecompilerSummaryEvidence'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format(java.util.Locale.ROOT, "Deserialization for DecompilerSummaryEvidence failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'DecompilerSummaryEvidence'", e); + } + // deserialize DisassemblySummaryEvidence + try { + // validate the JSON object to see if any exception is thrown + DisassemblySummaryEvidence.validateJsonElement(jsonElement); + actualAdapter = adapterDisassemblySummaryEvidence; + match++; + log.log(Level.FINER, "Input data matches schema 'DisassemblySummaryEvidence'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format(java.util.Locale.ROOT, "Deserialization for DisassemblySummaryEvidence failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'DisassemblySummaryEvidence'", e); + } + // deserialize ModelInterpretationEvidence + try { + // validate the JSON object to see if any exception is thrown + ModelInterpretationEvidence.validateJsonElement(jsonElement); + actualAdapter = adapterModelInterpretationEvidence; + match++; + log.log(Level.FINER, "Input data matches schema 'ModelInterpretationEvidence'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format(java.util.Locale.ROOT, "Deserialization for ModelInterpretationEvidence failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'ModelInterpretationEvidence'", e); + } + // deserialize KnownConstantEvidence + try { + // validate the JSON object to see if any exception is thrown + KnownConstantEvidence.validateJsonElement(jsonElement); + actualAdapter = adapterKnownConstantEvidence; + match++; + log.log(Level.FINER, "Input data matches schema 'KnownConstantEvidence'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format(java.util.Locale.ROOT, "Deserialization for KnownConstantEvidence failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'KnownConstantEvidence'", e); + } + // deserialize HardcodedSecretEvidence + try { + // validate the JSON object to see if any exception is thrown + HardcodedSecretEvidence.validateJsonElement(jsonElement); + actualAdapter = adapterHardcodedSecretEvidence; + match++; + log.log(Level.FINER, "Input data matches schema 'HardcodedSecretEvidence'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format(java.util.Locale.ROOT, "Deserialization for HardcodedSecretEvidence failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'HardcodedSecretEvidence'", e); + } + + if (match == 1) { + ReportFindingEvidenceInner ret = new ReportFindingEvidenceInner(); + ret.setActualInstance(actualAdapter.fromJsonTree(jsonElement)); + return ret; + } + + throw new IOException(String.format(java.util.Locale.ROOT, "Failed deserialization for ReportFindingEvidenceInner: %d classes match result, expected 1. Detailed failure message for oneOf schemas: %s. JSON: %s", match, errorMessages, jsonElement.toString())); + } + }.nullSafe(); + } + } + + // store a list of schema names defined in oneOf + public static final Map> schemas = new HashMap>(); + + public ReportFindingEvidenceInner() { + super("oneOf", Boolean.FALSE); + } + + public ReportFindingEvidenceInner(Object o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + static { + schemas.put("CallChainEvidence", CallChainEvidence.class); + schemas.put("ReferencedConstantEvidence", ReferencedConstantEvidence.class); + schemas.put("ImportedAPICallEvidence", ImportedAPICallEvidence.class); + schemas.put("StringMatchEvidence", StringMatchEvidence.class); + schemas.put("FunctionSimilarityEvidence", FunctionSimilarityEvidence.class); + schemas.put("APICombinationEvidence", APICombinationEvidence.class); + schemas.put("DecompilerSummaryEvidence", DecompilerSummaryEvidence.class); + schemas.put("DisassemblySummaryEvidence", DisassemblySummaryEvidence.class); + schemas.put("ModelInterpretationEvidence", ModelInterpretationEvidence.class); + schemas.put("KnownConstantEvidence", KnownConstantEvidence.class); + schemas.put("HardcodedSecretEvidence", HardcodedSecretEvidence.class); + } + + @Override + public Map> getSchemas() { + return ReportFindingEvidenceInner.schemas; + } + + /** + * Set the instance that matches the oneOf child schema, check + * the instance parameter is valid against the oneOf child schemas: + * APICombinationEvidence, CallChainEvidence, DecompilerSummaryEvidence, DisassemblySummaryEvidence, FunctionSimilarityEvidence, HardcodedSecretEvidence, ImportedAPICallEvidence, KnownConstantEvidence, ModelInterpretationEvidence, ReferencedConstantEvidence, StringMatchEvidence + * + * It could be an instance of the 'oneOf' schemas. + */ + @Override + public void setActualInstance(Object instance) { + if (instance instanceof CallChainEvidence) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof ReferencedConstantEvidence) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof ImportedAPICallEvidence) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof StringMatchEvidence) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof FunctionSimilarityEvidence) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof APICombinationEvidence) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof DecompilerSummaryEvidence) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof DisassemblySummaryEvidence) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof ModelInterpretationEvidence) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof KnownConstantEvidence) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof HardcodedSecretEvidence) { + super.setActualInstance(instance); + return; + } + + throw new RuntimeException("Invalid instance type. Must be APICombinationEvidence, CallChainEvidence, DecompilerSummaryEvidence, DisassemblySummaryEvidence, FunctionSimilarityEvidence, HardcodedSecretEvidence, ImportedAPICallEvidence, KnownConstantEvidence, ModelInterpretationEvidence, ReferencedConstantEvidence, StringMatchEvidence"); + } + + /** + * Get the actual instance, which can be the following: + * APICombinationEvidence, CallChainEvidence, DecompilerSummaryEvidence, DisassemblySummaryEvidence, FunctionSimilarityEvidence, HardcodedSecretEvidence, ImportedAPICallEvidence, KnownConstantEvidence, ModelInterpretationEvidence, ReferencedConstantEvidence, StringMatchEvidence + * + * @return The actual instance (APICombinationEvidence, CallChainEvidence, DecompilerSummaryEvidence, DisassemblySummaryEvidence, FunctionSimilarityEvidence, HardcodedSecretEvidence, ImportedAPICallEvidence, KnownConstantEvidence, ModelInterpretationEvidence, ReferencedConstantEvidence, StringMatchEvidence) + */ + @SuppressWarnings("unchecked") + @Override + public Object getActualInstance() { + return super.getActualInstance(); + } + + /** + * Get the actual instance of `CallChainEvidence`. If the actual instance is not `CallChainEvidence`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `CallChainEvidence` + * @throws ClassCastException if the instance is not `CallChainEvidence` + */ + @SuppressWarnings("unchecked") + public CallChainEvidence getCallChainEvidence() throws ClassCastException { + return (CallChainEvidence)super.getActualInstance(); + } + + /** + * Get the actual instance of `ReferencedConstantEvidence`. If the actual instance is not `ReferencedConstantEvidence`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `ReferencedConstantEvidence` + * @throws ClassCastException if the instance is not `ReferencedConstantEvidence` + */ + @SuppressWarnings("unchecked") + public ReferencedConstantEvidence getReferencedConstantEvidence() throws ClassCastException { + return (ReferencedConstantEvidence)super.getActualInstance(); + } + + /** + * Get the actual instance of `ImportedAPICallEvidence`. If the actual instance is not `ImportedAPICallEvidence`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `ImportedAPICallEvidence` + * @throws ClassCastException if the instance is not `ImportedAPICallEvidence` + */ + @SuppressWarnings("unchecked") + public ImportedAPICallEvidence getImportedAPICallEvidence() throws ClassCastException { + return (ImportedAPICallEvidence)super.getActualInstance(); + } + + /** + * Get the actual instance of `StringMatchEvidence`. If the actual instance is not `StringMatchEvidence`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `StringMatchEvidence` + * @throws ClassCastException if the instance is not `StringMatchEvidence` + */ + @SuppressWarnings("unchecked") + public StringMatchEvidence getStringMatchEvidence() throws ClassCastException { + return (StringMatchEvidence)super.getActualInstance(); + } + + /** + * Get the actual instance of `FunctionSimilarityEvidence`. If the actual instance is not `FunctionSimilarityEvidence`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `FunctionSimilarityEvidence` + * @throws ClassCastException if the instance is not `FunctionSimilarityEvidence` + */ + @SuppressWarnings("unchecked") + public FunctionSimilarityEvidence getFunctionSimilarityEvidence() throws ClassCastException { + return (FunctionSimilarityEvidence)super.getActualInstance(); + } + + /** + * Get the actual instance of `APICombinationEvidence`. If the actual instance is not `APICombinationEvidence`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `APICombinationEvidence` + * @throws ClassCastException if the instance is not `APICombinationEvidence` + */ + @SuppressWarnings("unchecked") + public APICombinationEvidence getAPICombinationEvidence() throws ClassCastException { + return (APICombinationEvidence)super.getActualInstance(); + } + + /** + * Get the actual instance of `DecompilerSummaryEvidence`. If the actual instance is not `DecompilerSummaryEvidence`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `DecompilerSummaryEvidence` + * @throws ClassCastException if the instance is not `DecompilerSummaryEvidence` + */ + @SuppressWarnings("unchecked") + public DecompilerSummaryEvidence getDecompilerSummaryEvidence() throws ClassCastException { + return (DecompilerSummaryEvidence)super.getActualInstance(); + } + + /** + * Get the actual instance of `DisassemblySummaryEvidence`. If the actual instance is not `DisassemblySummaryEvidence`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `DisassemblySummaryEvidence` + * @throws ClassCastException if the instance is not `DisassemblySummaryEvidence` + */ + @SuppressWarnings("unchecked") + public DisassemblySummaryEvidence getDisassemblySummaryEvidence() throws ClassCastException { + return (DisassemblySummaryEvidence)super.getActualInstance(); + } + + /** + * Get the actual instance of `ModelInterpretationEvidence`. If the actual instance is not `ModelInterpretationEvidence`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `ModelInterpretationEvidence` + * @throws ClassCastException if the instance is not `ModelInterpretationEvidence` + */ + @SuppressWarnings("unchecked") + public ModelInterpretationEvidence getModelInterpretationEvidence() throws ClassCastException { + return (ModelInterpretationEvidence)super.getActualInstance(); + } + + /** + * Get the actual instance of `KnownConstantEvidence`. If the actual instance is not `KnownConstantEvidence`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `KnownConstantEvidence` + * @throws ClassCastException if the instance is not `KnownConstantEvidence` + */ + @SuppressWarnings("unchecked") + public KnownConstantEvidence getKnownConstantEvidence() throws ClassCastException { + return (KnownConstantEvidence)super.getActualInstance(); + } + + /** + * Get the actual instance of `HardcodedSecretEvidence`. If the actual instance is not `HardcodedSecretEvidence`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `HardcodedSecretEvidence` + * @throws ClassCastException if the instance is not `HardcodedSecretEvidence` + */ + @SuppressWarnings("unchecked") + public HardcodedSecretEvidence getHardcodedSecretEvidence() throws ClassCastException { + return (HardcodedSecretEvidence)super.getActualInstance(); + } + + /** + * 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 ReportFindingEvidenceInner + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + // validate oneOf schemas one by one + int validCount = 0; + ArrayList errorMessages = new ArrayList<>(); + // validate the json string with CallChainEvidence + try { + CallChainEvidence.validateJsonElement(jsonElement); + validCount++; + } catch (Exception e) { + errorMessages.add(String.format(java.util.Locale.ROOT, "Deserialization for CallChainEvidence failed with `%s`.", e.getMessage())); + // continue to the next one + } + // validate the json string with ReferencedConstantEvidence + try { + ReferencedConstantEvidence.validateJsonElement(jsonElement); + validCount++; + } catch (Exception e) { + errorMessages.add(String.format(java.util.Locale.ROOT, "Deserialization for ReferencedConstantEvidence failed with `%s`.", e.getMessage())); + // continue to the next one + } + // validate the json string with ImportedAPICallEvidence + try { + ImportedAPICallEvidence.validateJsonElement(jsonElement); + validCount++; + } catch (Exception e) { + 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 StringMatchEvidence + try { + StringMatchEvidence.validateJsonElement(jsonElement); + validCount++; + } catch (Exception e) { + 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 + try { + FunctionSimilarityEvidence.validateJsonElement(jsonElement); + validCount++; + } catch (Exception e) { + errorMessages.add(String.format(java.util.Locale.ROOT, "Deserialization for FunctionSimilarityEvidence failed with `%s`.", e.getMessage())); + // continue to the next one + } + // validate the json string with APICombinationEvidence + try { + APICombinationEvidence.validateJsonElement(jsonElement); + validCount++; + } catch (Exception e) { + errorMessages.add(String.format(java.util.Locale.ROOT, "Deserialization for APICombinationEvidence failed with `%s`.", e.getMessage())); + // continue to the next one + } + // validate the json string with DecompilerSummaryEvidence + try { + DecompilerSummaryEvidence.validateJsonElement(jsonElement); + validCount++; + } catch (Exception e) { + errorMessages.add(String.format(java.util.Locale.ROOT, "Deserialization for DecompilerSummaryEvidence failed with `%s`.", e.getMessage())); + // continue to the next one + } + // validate the json string with DisassemblySummaryEvidence + try { + DisassemblySummaryEvidence.validateJsonElement(jsonElement); + validCount++; + } catch (Exception e) { + errorMessages.add(String.format(java.util.Locale.ROOT, "Deserialization for DisassemblySummaryEvidence failed with `%s`.", e.getMessage())); + // continue to the next one + } + // validate the json string with ModelInterpretationEvidence + try { + ModelInterpretationEvidence.validateJsonElement(jsonElement); + validCount++; + } catch (Exception e) { + errorMessages.add(String.format(java.util.Locale.ROOT, "Deserialization for ModelInterpretationEvidence failed with `%s`.", e.getMessage())); + // continue to the next one + } + // validate the json string with KnownConstantEvidence + try { + KnownConstantEvidence.validateJsonElement(jsonElement); + validCount++; + } catch (Exception e) { + errorMessages.add(String.format(java.util.Locale.ROOT, "Deserialization for KnownConstantEvidence failed with `%s`.", e.getMessage())); + // continue to the next one + } + // validate the json string with HardcodedSecretEvidence + try { + HardcodedSecretEvidence.validateJsonElement(jsonElement); + validCount++; + } catch (Exception e) { + errorMessages.add(String.format(java.util.Locale.ROOT, "Deserialization for HardcodedSecretEvidence failed with `%s`.", e.getMessage())); + // continue to the next one + } + if (validCount != 1) { + throw new IOException(String.format(java.util.Locale.ROOT, "The JSON string is invalid for ReportFindingEvidenceInner with oneOf schemas: APICombinationEvidence, CallChainEvidence, DecompilerSummaryEvidence, DisassemblySummaryEvidence, 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())); + } + } + + /** + * Create an instance of ReportFindingEvidenceInner given an JSON string + * + * @param jsonString JSON string + * @return An instance of ReportFindingEvidenceInner + * @throws IOException if the JSON string is invalid with respect to ReportFindingEvidenceInner + */ + public static ReportFindingEvidenceInner fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ReportFindingEvidenceInner.class); + } + + /** + * Convert an instance of ReportFindingEvidenceInner to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/ai/reveng/model/ReportFunctionSimilarity.java b/src/main/java/ai/reveng/model/ReportFunctionSimilarity.java new file mode 100644 index 0000000..b912d53 --- /dev/null +++ b/src/main/java/ai/reveng/model/ReportFunctionSimilarity.java @@ -0,0 +1,344 @@ +/* + * 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.ReportSubject; +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; + +/** + * ReportFunctionSimilarity + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class ReportFunctionSimilarity { + public static final String SERIALIZED_NAME_NAME = "name"; + @SerializedName(SERIALIZED_NAME_NAME) + @javax.annotation.Nonnull + private String name; + + public static final String SERIALIZED_NAME_SIMILARITY = "similarity"; + @SerializedName(SERIALIZED_NAME_SIMILARITY) + @javax.annotation.Nonnull + private Double similarity; + + public static final String SERIALIZED_NAME_SUBJECT = "subject"; + @SerializedName(SERIALIZED_NAME_SUBJECT) + @javax.annotation.Nonnull + private ReportSubject subject; + + public ReportFunctionSimilarity() { + } + + public ReportFunctionSimilarity name(@javax.annotation.Nonnull String name) { + this.name = name; + return this; + } + + /** + * Name of the known function. + * @return name + */ + @javax.annotation.Nonnull + public String getName() { + return name; + } + + public void setName(@javax.annotation.Nonnull String name) { + this.name = name; + } + + + public ReportFunctionSimilarity similarity(@javax.annotation.Nonnull Double similarity) { + this.similarity = similarity; + return this; + } + + /** + * Similarity score, from 0 to 1. + * minimum: 0 + * maximum: 1 + * @return similarity + */ + @javax.annotation.Nonnull + public Double getSimilarity() { + return similarity; + } + + public void setSimilarity(@javax.annotation.Nonnull Double similarity) { + this.similarity = similarity; + } + + + public ReportFunctionSimilarity subject(@javax.annotation.Nonnull ReportSubject subject) { + this.subject = subject; + return this; + } + + /** + * The matching function in the analysed binary. + * @return subject + */ + @javax.annotation.Nonnull + public ReportSubject getSubject() { + return subject; + } + + public void setSubject(@javax.annotation.Nonnull ReportSubject subject) { + this.subject = subject; + } + + /** + * 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 ReportFunctionSimilarity instance itself + */ + public ReportFunctionSimilarity 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; + } + ReportFunctionSimilarity reportFunctionSimilarity = (ReportFunctionSimilarity) o; + return Objects.equals(this.name, reportFunctionSimilarity.name) && + Objects.equals(this.similarity, reportFunctionSimilarity.similarity) && + Objects.equals(this.subject, reportFunctionSimilarity.subject)&& + Objects.equals(this.additionalProperties, reportFunctionSimilarity.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(name, similarity, subject, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ReportFunctionSimilarity {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" similarity: ").append(toIndentedString(similarity)).append("\n"); + sb.append(" subject: ").append(toIndentedString(subject)).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("name", "similarity", "subject")); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(Arrays.asList("name", "similarity", "subject")); + } + + /** + * 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 ReportFunctionSimilarity + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ReportFunctionSimilarity.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 ReportFunctionSimilarity is not found in the empty JSON string", ReportFunctionSimilarity.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : ReportFunctionSimilarity.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 (!ReportFunctionSimilarity.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ReportFunctionSimilarity' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ReportFunctionSimilarity.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, ReportFunctionSimilarity 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 ReportFunctionSimilarity read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + ReportFunctionSimilarity 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 ReportFunctionSimilarity given an JSON string + * + * @param jsonString JSON string + * @return An instance of ReportFunctionSimilarity + * @throws IOException if the JSON string is invalid with respect to ReportFunctionSimilarity + */ + public static ReportFunctionSimilarity fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ReportFunctionSimilarity.class); + } + + /** + * Convert an instance of ReportFunctionSimilarity to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/ai/reveng/model/ReportImportedAPI.java b/src/main/java/ai/reveng/model/ReportImportedAPI.java new file mode 100644 index 0000000..65846b3 --- /dev/null +++ b/src/main/java/ai/reveng/model/ReportImportedAPI.java @@ -0,0 +1,318 @@ +/* + * 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; + +/** + * ReportImportedAPI + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class ReportImportedAPI { + public static final String SERIALIZED_NAME_API = "api"; + @SerializedName(SERIALIZED_NAME_API) + @javax.annotation.Nonnull + private String api; + + public static final String SERIALIZED_NAME_MODULE = "module"; + @SerializedName(SERIALIZED_NAME_MODULE) + @javax.annotation.Nullable + private String module; + + public ReportImportedAPI() { + } + + public ReportImportedAPI api(@javax.annotation.Nonnull String api) { + this.api = api; + return this; + } + + /** + * Name of the API. + * @return api + */ + @javax.annotation.Nonnull + public String getApi() { + return api; + } + + public void setApi(@javax.annotation.Nonnull String api) { + this.api = api; + } + + + public ReportImportedAPI module(@javax.annotation.Nullable String module) { + this.module = module; + return this; + } + + /** + * Module the API is imported from, or null when unknown. + * @return module + */ + @javax.annotation.Nullable + public String getModule() { + return module; + } + + public void setModule(@javax.annotation.Nullable String module) { + this.module = module; + } + + /** + * 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 ReportImportedAPI instance itself + */ + public ReportImportedAPI 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; + } + ReportImportedAPI reportImportedAPI = (ReportImportedAPI) o; + return Objects.equals(this.api, reportImportedAPI.api) && + Objects.equals(this.module, reportImportedAPI.module)&& + Objects.equals(this.additionalProperties, reportImportedAPI.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(api, module, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ReportImportedAPI {\n"); + sb.append(" api: ").append(toIndentedString(api)).append("\n"); + sb.append(" module: ").append(toIndentedString(module)).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("api", "module")); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(Arrays.asList("api", "module")); + } + + /** + * 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 ReportImportedAPI + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ReportImportedAPI.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 ReportImportedAPI is not found in the empty JSON string", ReportImportedAPI.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : ReportImportedAPI.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("api").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `api` to be a primitive type in the JSON string but got `%s`", jsonObj.get("api").toString())); + } + if ((jsonObj.get("module") != null && !jsonObj.get("module").isJsonNull()) && !jsonObj.get("module").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `module` to be a primitive type in the JSON string but got `%s`", jsonObj.get("module").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ReportImportedAPI.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ReportImportedAPI' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ReportImportedAPI.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, ReportImportedAPI 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 ReportImportedAPI read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + ReportImportedAPI 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 ReportImportedAPI given an JSON string + * + * @param jsonString JSON string + * @return An instance of ReportImportedAPI + * @throws IOException if the JSON string is invalid with respect to ReportImportedAPI + */ + public static ReportImportedAPI fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ReportImportedAPI.class); + } + + /** + * Convert an instance of ReportImportedAPI to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/ai/reveng/model/ReportImportedAPICall.java b/src/main/java/ai/reveng/model/ReportImportedAPICall.java new file mode 100644 index 0000000..b2db068 --- /dev/null +++ b/src/main/java/ai/reveng/model/ReportImportedAPICall.java @@ -0,0 +1,341 @@ +/* + * 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.ReportCallChain; +import ai.reveng.model.ReportImportedAPI; +import ai.reveng.model.ReportSubject; +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; + +/** + * ReportImportedAPICall + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class ReportImportedAPICall { + public static final String SERIALIZED_NAME_IMPORTED_API = "imported_api"; + @SerializedName(SERIALIZED_NAME_IMPORTED_API) + @javax.annotation.Nonnull + private ReportImportedAPI importedApi; + + public static final String SERIALIZED_NAME_REACHABILITY = "reachability"; + @SerializedName(SERIALIZED_NAME_REACHABILITY) + @javax.annotation.Nullable + private ReportCallChain reachability; + + public static final String SERIALIZED_NAME_SUBJECT = "subject"; + @SerializedName(SERIALIZED_NAME_SUBJECT) + @javax.annotation.Nonnull + private ReportSubject subject; + + public ReportImportedAPICall() { + } + + public ReportImportedAPICall importedApi(@javax.annotation.Nonnull ReportImportedAPI importedApi) { + this.importedApi = importedApi; + return this; + } + + /** + * The API called. + * @return importedApi + */ + @javax.annotation.Nonnull + public ReportImportedAPI getImportedApi() { + return importedApi; + } + + public void setImportedApi(@javax.annotation.Nonnull ReportImportedAPI importedApi) { + this.importedApi = importedApi; + } + + + public ReportImportedAPICall reachability(@javax.annotation.Nullable ReportCallChain reachability) { + this.reachability = reachability; + return this; + } + + /** + * A call chain reaching the call, absent when none was found. + * @return reachability + */ + @javax.annotation.Nullable + public ReportCallChain getReachability() { + return reachability; + } + + public void setReachability(@javax.annotation.Nullable ReportCallChain reachability) { + this.reachability = reachability; + } + + + public ReportImportedAPICall subject(@javax.annotation.Nonnull ReportSubject subject) { + this.subject = subject; + return this; + } + + /** + * Where the call is made. + * @return subject + */ + @javax.annotation.Nonnull + public ReportSubject getSubject() { + return subject; + } + + public void setSubject(@javax.annotation.Nonnull ReportSubject subject) { + this.subject = subject; + } + + /** + * 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 ReportImportedAPICall instance itself + */ + public ReportImportedAPICall 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; + } + ReportImportedAPICall reportImportedAPICall = (ReportImportedAPICall) o; + return Objects.equals(this.importedApi, reportImportedAPICall.importedApi) && + Objects.equals(this.reachability, reportImportedAPICall.reachability) && + Objects.equals(this.subject, reportImportedAPICall.subject)&& + Objects.equals(this.additionalProperties, reportImportedAPICall.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(importedApi, reachability, subject, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ReportImportedAPICall {\n"); + sb.append(" importedApi: ").append(toIndentedString(importedApi)).append("\n"); + sb.append(" reachability: ").append(toIndentedString(reachability)).append("\n"); + sb.append(" subject: ").append(toIndentedString(subject)).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("imported_api", "reachability", "subject")); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(Arrays.asList("imported_api", "subject")); + } + + /** + * 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 ReportImportedAPICall + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ReportImportedAPICall.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 ReportImportedAPICall is not found in the empty JSON string", ReportImportedAPICall.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : ReportImportedAPICall.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 (!ReportImportedAPICall.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ReportImportedAPICall' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ReportImportedAPICall.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, ReportImportedAPICall 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 ReportImportedAPICall read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + ReportImportedAPICall 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 ReportImportedAPICall given an JSON string + * + * @param jsonString JSON string + * @return An instance of ReportImportedAPICall + * @throws IOException if the JSON string is invalid with respect to ReportImportedAPICall + */ + public static ReportImportedAPICall fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ReportImportedAPICall.class); + } + + /** + * Convert an instance of ReportImportedAPICall to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/ai/reveng/model/ReportMeta.java b/src/main/java/ai/reveng/model/ReportMeta.java new file mode 100644 index 0000000..cf397c3 --- /dev/null +++ b/src/main/java/ai/reveng/model/ReportMeta.java @@ -0,0 +1,347 @@ +/* + * RevEng.AI API + * RevEng.AI is an AI-powered binary analysis platform for reverse engineering and malware analysis. It provides similarity search across executable binaries and functions, AI-driven decompilation, dynamic execution analysis, firmware unpacking, and integration with external threat intelligence sources like VirusTotal. + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package ai.reveng.model; + +import java.util.Objects; +import 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; + +/** + * ReportMeta + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class ReportMeta { + /** + * Byte order of the analysed binary. + */ + @JsonAdapter(EndiannessEnum.Adapter.class) + public enum EndiannessEnum { + UNSPECIFIED("unspecified"), + + LITTLE("little"), + + BIG("big"), + + UNKNOWN_DEFAULT_OPEN_API("unknown_default_open_api"); + + private String value; + + EndiannessEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static EndiannessEnum fromValue(String value) { + for (EndiannessEnum b : EndiannessEnum.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 EndiannessEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public EndiannessEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return EndiannessEnum.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + EndiannessEnum.fromValue(value); + } + } + + public static final String SERIALIZED_NAME_ENDIANNESS = "endianness"; + @SerializedName(SERIALIZED_NAME_ENDIANNESS) + @javax.annotation.Nonnull + private EndiannessEnum endianness; + + public ReportMeta() { + } + + public ReportMeta endianness(@javax.annotation.Nonnull EndiannessEnum endianness) { + this.endianness = endianness; + return this; + } + + /** + * Byte order of the analysed binary. + * @return endianness + */ + @javax.annotation.Nonnull + public EndiannessEnum getEndianness() { + return endianness; + } + + public void setEndianness(@javax.annotation.Nonnull EndiannessEnum endianness) { + this.endianness = endianness; + } + + /** + * 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 ReportMeta instance itself + */ + public ReportMeta 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; + } + ReportMeta reportMeta = (ReportMeta) o; + return Objects.equals(this.endianness, reportMeta.endianness)&& + Objects.equals(this.additionalProperties, reportMeta.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(endianness, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ReportMeta {\n"); + sb.append(" endianness: ").append(toIndentedString(endianness)).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("endianness")); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(Arrays.asList("endianness")); + } + + /** + * 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 ReportMeta + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ReportMeta.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 ReportMeta is not found in the empty JSON string", ReportMeta.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : ReportMeta.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("endianness").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `endianness` to be a primitive type in the JSON string but got `%s`", jsonObj.get("endianness").toString())); + } + // validate the required field `endianness` + EndiannessEnum.validateJsonElement(jsonObj.get("endianness")); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ReportMeta.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ReportMeta' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ReportMeta.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, ReportMeta 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 ReportMeta read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + ReportMeta 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 ReportMeta given an JSON string + * + * @param jsonString JSON string + * @return An instance of ReportMeta + * @throws IOException if the JSON string is invalid with respect to ReportMeta + */ + public static ReportMeta fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ReportMeta.class); + } + + /** + * Convert an instance of ReportMeta to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/ai/reveng/model/ReportModelInterpretation.java b/src/main/java/ai/reveng/model/ReportModelInterpretation.java new file mode 100644 index 0000000..edae236 --- /dev/null +++ b/src/main/java/ai/reveng/model/ReportModelInterpretation.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; + +/** + * ReportModelInterpretation + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class ReportModelInterpretation { + public static final String SERIALIZED_NAME_INTERPRETATION = "interpretation"; + @SerializedName(SERIALIZED_NAME_INTERPRETATION) + @javax.annotation.Nullable + private String interpretation; + + public ReportModelInterpretation() { + } + + public ReportModelInterpretation interpretation(@javax.annotation.Nullable String interpretation) { + this.interpretation = interpretation; + return this; + } + + /** + * The interpretation, or null when the model did not provide one. + * @return interpretation + */ + @javax.annotation.Nullable + public String getInterpretation() { + return interpretation; + } + + public void setInterpretation(@javax.annotation.Nullable String interpretation) { + this.interpretation = interpretation; + } + + /** + * 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 ReportModelInterpretation instance itself + */ + public ReportModelInterpretation 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; + } + ReportModelInterpretation reportModelInterpretation = (ReportModelInterpretation) o; + return Objects.equals(this.interpretation, reportModelInterpretation.interpretation)&& + Objects.equals(this.additionalProperties, reportModelInterpretation.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(interpretation, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ReportModelInterpretation {\n"); + sb.append(" interpretation: ").append(toIndentedString(interpretation)).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("interpretation")); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(Arrays.asList("interpretation")); + } + + /** + * 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 ReportModelInterpretation + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ReportModelInterpretation.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 ReportModelInterpretation is not found in the empty JSON string", ReportModelInterpretation.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : ReportModelInterpretation.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("interpretation") != null && !jsonObj.get("interpretation").isJsonNull()) && !jsonObj.get("interpretation").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `interpretation` to be a primitive type in the JSON string but got `%s`", jsonObj.get("interpretation").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ReportModelInterpretation.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ReportModelInterpretation' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ReportModelInterpretation.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, ReportModelInterpretation 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 ReportModelInterpretation read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + ReportModelInterpretation 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 ReportModelInterpretation given an JSON string + * + * @param jsonString JSON string + * @return An instance of ReportModelInterpretation + * @throws IOException if the JSON string is invalid with respect to ReportModelInterpretation + */ + public static ReportModelInterpretation fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ReportModelInterpretation.class); + } + + /** + * Convert an instance of ReportModelInterpretation to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/ai/reveng/model/ReportReferencedConstant.java b/src/main/java/ai/reveng/model/ReportReferencedConstant.java new file mode 100644 index 0000000..97b684b --- /dev/null +++ b/src/main/java/ai/reveng/model/ReportReferencedConstant.java @@ -0,0 +1,415 @@ +/* + * 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.ReportBytesConstant; +import ai.reveng.model.ReportSubject; +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; + +/** + * ReportReferencedConstant + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class ReportReferencedConstant { + /** + * Suggested format for displaying the value at this reference, absent to use the constant's own. + */ + @JsonAdapter(DisplayEnum.Adapter.class) + public enum DisplayEnum { + HEX("hex"), + + UINT8("uint8"), + + UINT16("uint16"), + + UINT32("uint32"), + + UINT64("uint64"), + + INT8("int8"), + + INT16("int16"), + + INT32("int32"), + + INT64("int64"), + + UNKNOWN_DEFAULT_OPEN_API("unknown_default_open_api"); + + private String value; + + DisplayEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static DisplayEnum fromValue(String value) { + for (DisplayEnum b : DisplayEnum.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 DisplayEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public DisplayEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return DisplayEnum.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + DisplayEnum.fromValue(value); + } + } + + public static final String SERIALIZED_NAME_DISPLAY = "display"; + @SerializedName(SERIALIZED_NAME_DISPLAY) + @javax.annotation.Nullable + private DisplayEnum display; + + public static final String SERIALIZED_NAME_SUBJECT = "subject"; + @SerializedName(SERIALIZED_NAME_SUBJECT) + @javax.annotation.Nonnull + private ReportSubject subject; + + public static final String SERIALIZED_NAME_VALUE = "value"; + @SerializedName(SERIALIZED_NAME_VALUE) + @javax.annotation.Nonnull + private ReportBytesConstant value; + + public ReportReferencedConstant() { + } + + public ReportReferencedConstant display(@javax.annotation.Nullable DisplayEnum display) { + this.display = display; + return this; + } + + /** + * Suggested format for displaying the value at this reference, absent to use the constant's own. + * @return display + */ + @javax.annotation.Nullable + public DisplayEnum getDisplay() { + return display; + } + + public void setDisplay(@javax.annotation.Nullable DisplayEnum display) { + this.display = display; + } + + + public ReportReferencedConstant subject(@javax.annotation.Nonnull ReportSubject subject) { + this.subject = subject; + return this; + } + + /** + * Where the constant is referenced. + * @return subject + */ + @javax.annotation.Nonnull + public ReportSubject getSubject() { + return subject; + } + + public void setSubject(@javax.annotation.Nonnull ReportSubject subject) { + this.subject = subject; + } + + + public ReportReferencedConstant value(@javax.annotation.Nonnull ReportBytesConstant value) { + this.value = value; + return this; + } + + /** + * The constant. + * @return value + */ + @javax.annotation.Nonnull + public ReportBytesConstant getValue() { + return value; + } + + public void setValue(@javax.annotation.Nonnull ReportBytesConstant value) { + this.value = value; + } + + /** + * 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 ReportReferencedConstant instance itself + */ + public ReportReferencedConstant 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; + } + ReportReferencedConstant reportReferencedConstant = (ReportReferencedConstant) o; + return Objects.equals(this.display, reportReferencedConstant.display) && + Objects.equals(this.subject, reportReferencedConstant.subject) && + Objects.equals(this.value, reportReferencedConstant.value)&& + Objects.equals(this.additionalProperties, reportReferencedConstant.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(display, subject, value, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ReportReferencedConstant {\n"); + sb.append(" display: ").append(toIndentedString(display)).append("\n"); + sb.append(" subject: ").append(toIndentedString(subject)).append("\n"); + sb.append(" value: ").append(toIndentedString(value)).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("display", "subject", "value")); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(Arrays.asList("subject", "value")); + } + + /** + * 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 ReportReferencedConstant + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ReportReferencedConstant.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 ReportReferencedConstant is not found in the empty JSON string", ReportReferencedConstant.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : ReportReferencedConstant.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("display") != null && !jsonObj.get("display").isJsonNull()) && !jsonObj.get("display").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `display` to be a primitive type in the JSON string but got `%s`", jsonObj.get("display").toString())); + } + // validate the optional field `display` + if (jsonObj.get("display") != null && !jsonObj.get("display").isJsonNull()) { + DisplayEnum.validateJsonElement(jsonObj.get("display")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ReportReferencedConstant.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ReportReferencedConstant' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ReportReferencedConstant.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, ReportReferencedConstant 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 ReportReferencedConstant read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + ReportReferencedConstant 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 ReportReferencedConstant given an JSON string + * + * @param jsonString JSON string + * @return An instance of ReportReferencedConstant + * @throws IOException if the JSON string is invalid with respect to ReportReferencedConstant + */ + public static ReportReferencedConstant fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ReportReferencedConstant.class); + } + + /** + * Convert an instance of ReportReferencedConstant to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/ai/reveng/model/ReportResult.java b/src/main/java/ai/reveng/model/ReportResult.java index cd427df..6bcf409 100644 --- a/src/main/java/ai/reveng/model/ReportResult.java +++ b/src/main/java/ai/reveng/model/ReportResult.java @@ -13,13 +13,17 @@ package ai.reveng.model; import java.util.Objects; +import ai.reveng.model.ReportFinding; +import ai.reveng.model.ReportMeta; 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; @@ -51,51 +55,59 @@ public class ReportResult { public static final String SERIALIZED_NAME_FINDINGS = "findings"; @SerializedName(SERIALIZED_NAME_FINDINGS) - @javax.annotation.Nullable - private Object findings = null; + @javax.annotation.Nonnull + private List findings = new ArrayList<>(); public static final String SERIALIZED_NAME_META = "meta"; @SerializedName(SERIALIZED_NAME_META) - @javax.annotation.Nullable - private Object meta = null; + @javax.annotation.Nonnull + private ReportMeta meta; public ReportResult() { } - public ReportResult findings(@javax.annotation.Nullable Object findings) { + public ReportResult findings(@javax.annotation.Nonnull List findings) { this.findings = findings; return this; } + public ReportResult addFindingsItem(ReportFinding findingsItem) { + if (this.findings == null) { + this.findings = new ArrayList<>(); + } + this.findings.add(findingsItem); + return this; + } + /** - * Get findings + * The findings the agent reported, each with its supporting evidence. * @return findings */ - @javax.annotation.Nullable - public Object getFindings() { + @javax.annotation.Nonnull + public List getFindings() { return findings; } - public void setFindings(@javax.annotation.Nullable Object findings) { + public void setFindings(@javax.annotation.Nonnull List findings) { this.findings = findings; } - public ReportResult meta(@javax.annotation.Nullable Object meta) { + public ReportResult meta(@javax.annotation.Nonnull ReportMeta meta) { this.meta = meta; return this; } /** - * Get meta + * Report-level metadata. * @return meta */ - @javax.annotation.Nullable - public Object getMeta() { + @javax.annotation.Nonnull + public ReportMeta getMeta() { return meta; } - public void setMeta(@javax.annotation.Nullable Object meta) { + public void setMeta(@javax.annotation.Nonnull ReportMeta meta) { this.meta = meta; } @@ -215,6 +227,12 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti } } JsonObject jsonObj = jsonElement.getAsJsonObject(); + // ensure the required json array is present + if (jsonObj.get("findings") == null) { + throw new IllegalArgumentException("Expected the field `linkedContent` to be an array in the JSON string but got `null`"); + } else if (!jsonObj.get("findings").isJsonArray()) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `findings` to be an array in the JSON string but got `%s`", jsonObj.get("findings").toString())); + } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { diff --git a/src/main/java/ai/reveng/model/ReportStringMatch.java b/src/main/java/ai/reveng/model/ReportStringMatch.java new file mode 100644 index 0000000..c5417cc --- /dev/null +++ b/src/main/java/ai/reveng/model/ReportStringMatch.java @@ -0,0 +1,316 @@ +/* + * 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.ReportSubject; +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; + +/** + * ReportStringMatch + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class ReportStringMatch { + public static final String SERIALIZED_NAME_SUBJECT = "subject"; + @SerializedName(SERIALIZED_NAME_SUBJECT) + @javax.annotation.Nullable + private ReportSubject subject; + + public static final String SERIALIZED_NAME_VALUE = "value"; + @SerializedName(SERIALIZED_NAME_VALUE) + @javax.annotation.Nonnull + private String value; + + public ReportStringMatch() { + } + + public ReportStringMatch subject(@javax.annotation.Nullable ReportSubject subject) { + this.subject = subject; + return this; + } + + /** + * Where the string is located, absent when unknown. + * @return subject + */ + @javax.annotation.Nullable + public ReportSubject getSubject() { + return subject; + } + + public void setSubject(@javax.annotation.Nullable ReportSubject subject) { + this.subject = subject; + } + + + public ReportStringMatch value(@javax.annotation.Nonnull String value) { + this.value = value; + return this; + } + + /** + * The matched string. + * @return value + */ + @javax.annotation.Nonnull + public String getValue() { + return value; + } + + public void setValue(@javax.annotation.Nonnull String value) { + this.value = value; + } + + /** + * 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 ReportStringMatch instance itself + */ + public ReportStringMatch 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; + } + ReportStringMatch reportStringMatch = (ReportStringMatch) o; + return Objects.equals(this.subject, reportStringMatch.subject) && + Objects.equals(this.value, reportStringMatch.value)&& + Objects.equals(this.additionalProperties, reportStringMatch.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(subject, value, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ReportStringMatch {\n"); + sb.append(" subject: ").append(toIndentedString(subject)).append("\n"); + sb.append(" value: ").append(toIndentedString(value)).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("subject", "value")); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(Arrays.asList("value")); + } + + /** + * 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 ReportStringMatch + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ReportStringMatch.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 ReportStringMatch is not found in the empty JSON string", ReportStringMatch.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : ReportStringMatch.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("value").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `value` to be a primitive type in the JSON string but got `%s`", jsonObj.get("value").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ReportStringMatch.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ReportStringMatch' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ReportStringMatch.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, ReportStringMatch 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 ReportStringMatch read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + ReportStringMatch 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 ReportStringMatch given an JSON string + * + * @param jsonString JSON string + * @return An instance of ReportStringMatch + * @throws IOException if the JSON string is invalid with respect to ReportStringMatch + */ + public static ReportStringMatch fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ReportStringMatch.class); + } + + /** + * Convert an instance of ReportStringMatch to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/ai/reveng/model/ReportSubject.java b/src/main/java/ai/reveng/model/ReportSubject.java new file mode 100644 index 0000000..798483f --- /dev/null +++ b/src/main/java/ai/reveng/model/ReportSubject.java @@ -0,0 +1,361 @@ +/* + * 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; + +/** + * ReportSubject + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class ReportSubject { + public static final String SERIALIZED_NAME_CALL_SITE = "call_site"; + @SerializedName(SERIALIZED_NAME_CALL_SITE) + @javax.annotation.Nullable + private Long callSite; + + public static final String SERIALIZED_NAME_DATA = "data"; + @SerializedName(SERIALIZED_NAME_DATA) + @javax.annotation.Nullable + private Long data; + + public static final String SERIALIZED_NAME_FUNCTION = "function"; + @SerializedName(SERIALIZED_NAME_FUNCTION) + @javax.annotation.Nullable + private Long function; + + public static final String SERIALIZED_NAME_INSTRUCTION = "instruction"; + @SerializedName(SERIALIZED_NAME_INSTRUCTION) + @javax.annotation.Nullable + private Long instruction; + + public ReportSubject() { + } + + public ReportSubject callSite(@javax.annotation.Nullable Long callSite) { + this.callSite = callSite; + return this; + } + + /** + * Call-site address. + * minimum: 0 + * @return callSite + */ + @javax.annotation.Nullable + public Long getCallSite() { + return callSite; + } + + public void setCallSite(@javax.annotation.Nullable Long callSite) { + this.callSite = callSite; + } + + + public ReportSubject data(@javax.annotation.Nullable Long data) { + this.data = data; + return this; + } + + /** + * Data address. + * minimum: 0 + * @return data + */ + @javax.annotation.Nullable + public Long getData() { + return data; + } + + public void setData(@javax.annotation.Nullable Long data) { + this.data = data; + } + + + public ReportSubject function(@javax.annotation.Nullable Long function) { + this.function = function; + return this; + } + + /** + * Function entry address. + * minimum: 0 + * @return function + */ + @javax.annotation.Nullable + public Long getFunction() { + return function; + } + + public void setFunction(@javax.annotation.Nullable Long function) { + this.function = function; + } + + + public ReportSubject instruction(@javax.annotation.Nullable Long instruction) { + this.instruction = instruction; + return this; + } + + /** + * Instruction address. + * minimum: 0 + * @return instruction + */ + @javax.annotation.Nullable + public Long getInstruction() { + return instruction; + } + + public void setInstruction(@javax.annotation.Nullable Long instruction) { + this.instruction = instruction; + } + + /** + * 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 ReportSubject instance itself + */ + public ReportSubject 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; + } + ReportSubject reportSubject = (ReportSubject) o; + return Objects.equals(this.callSite, reportSubject.callSite) && + Objects.equals(this.data, reportSubject.data) && + Objects.equals(this.function, reportSubject.function) && + Objects.equals(this.instruction, reportSubject.instruction)&& + Objects.equals(this.additionalProperties, reportSubject.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(callSite, data, function, instruction, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ReportSubject {\n"); + sb.append(" callSite: ").append(toIndentedString(callSite)).append("\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" function: ").append(toIndentedString(function)).append("\n"); + sb.append(" instruction: ").append(toIndentedString(instruction)).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("call_site", "data", "function", "instruction")); + + // 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 ReportSubject + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ReportSubject.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 ReportSubject is not found in the empty JSON string", ReportSubject.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ReportSubject.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ReportSubject' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ReportSubject.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, ReportSubject 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 ReportSubject read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + ReportSubject 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 ReportSubject given an JSON string + * + * @param jsonString JSON string + * @return An instance of ReportSubject + * @throws IOException if the JSON string is invalid with respect to ReportSubject + */ + public static ReportSubject fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ReportSubject.class); + } + + /** + * Convert an instance of ReportSubject to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/ai/reveng/model/RequeueAnalysisRequest.java b/src/main/java/ai/reveng/model/RequeueAnalysisRequest.java new file mode 100644 index 0000000..928e123 --- /dev/null +++ b/src/main/java/ai/reveng/model/RequeueAnalysisRequest.java @@ -0,0 +1,438 @@ +/* + * 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 org.openapitools.jackson.nullable.JsonNullable; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import ai.reveng.invoker.JSON; + +/** + * RequeueAnalysisRequest + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class RequeueAnalysisRequest { + public static final String SERIALIZED_NAME_COMMAND_LINE_ARGS = "command_line_args"; + @SerializedName(SERIALIZED_NAME_COMMAND_LINE_ARGS) + @javax.annotation.Nullable + private String commandLineArgs; + + public static final String SERIALIZED_NAME_ENABLE_DYNAMIC_EXECUTION = "enable_dynamic_execution"; + @SerializedName(SERIALIZED_NAME_ENABLE_DYNAMIC_EXECUTION) + @javax.annotation.Nullable + private Boolean enableDynamicExecution; + + public static final String SERIALIZED_NAME_GENERATE_CAPABILITIES = "generate_capabilities"; + @SerializedName(SERIALIZED_NAME_GENERATE_CAPABILITIES) + @javax.annotation.Nullable + private Boolean generateCapabilities; + + public static final String SERIALIZED_NAME_NO_CACHE = "no_cache"; + @SerializedName(SERIALIZED_NAME_NO_CACHE) + @javax.annotation.Nullable + private Boolean noCache; + + public static final String SERIALIZED_NAME_SCRAPE_TAGS = "scrape_tags"; + @SerializedName(SERIALIZED_NAME_SCRAPE_TAGS) + @javax.annotation.Nullable + private Boolean scrapeTags; + + public static final String SERIALIZED_NAME_TAGS = "tags"; + @SerializedName(SERIALIZED_NAME_TAGS) + @javax.annotation.Nullable + private List tags; + + public RequeueAnalysisRequest() { + } + + public RequeueAnalysisRequest commandLineArgs(@javax.annotation.Nullable String commandLineArgs) { + this.commandLineArgs = commandLineArgs; + return this; + } + + /** + * Command-line arguments passed to the sample when enable_dynamic_execution is set + * @return commandLineArgs + */ + @javax.annotation.Nullable + public String getCommandLineArgs() { + return commandLineArgs; + } + + public void setCommandLineArgs(@javax.annotation.Nullable String commandLineArgs) { + this.commandLineArgs = commandLineArgs; + } + + + public RequeueAnalysisRequest enableDynamicExecution(@javax.annotation.Nullable Boolean enableDynamicExecution) { + this.enableDynamicExecution = enableDynamicExecution; + return this; + } + + /** + * Run the new Analysis with dynamic execution (sandbox) enabled + * @return enableDynamicExecution + */ + @javax.annotation.Nullable + public Boolean getEnableDynamicExecution() { + return enableDynamicExecution; + } + + public void setEnableDynamicExecution(@javax.annotation.Nullable Boolean enableDynamicExecution) { + this.enableDynamicExecution = enableDynamicExecution; + } + + + public RequeueAnalysisRequest generateCapabilities(@javax.annotation.Nullable Boolean generateCapabilities) { + this.generateCapabilities = generateCapabilities; + return this; + } + + /** + * Regenerate capabilities for the new Analysis instead of copying the original Binary's existing ones + * @return generateCapabilities + */ + @javax.annotation.Nullable + public Boolean getGenerateCapabilities() { + return generateCapabilities; + } + + public void setGenerateCapabilities(@javax.annotation.Nullable Boolean generateCapabilities) { + this.generateCapabilities = generateCapabilities; + } + + + public RequeueAnalysisRequest noCache(@javax.annotation.Nullable Boolean noCache) { + this.noCache = noCache; + return this; + } + + /** + * Get noCache + * @return noCache + */ + @javax.annotation.Nullable + public Boolean getNoCache() { + return noCache; + } + + public void setNoCache(@javax.annotation.Nullable Boolean noCache) { + this.noCache = noCache; + } + + + public RequeueAnalysisRequest scrapeTags(@javax.annotation.Nullable Boolean scrapeTags) { + this.scrapeTags = scrapeTags; + return this; + } + + /** + * Re-scrape third-party tags for the new Analysis instead of copying the original Binary's existing ones + * @return scrapeTags + */ + @javax.annotation.Nullable + public Boolean getScrapeTags() { + return scrapeTags; + } + + public void setScrapeTags(@javax.annotation.Nullable Boolean scrapeTags) { + this.scrapeTags = scrapeTags; + } + + + public RequeueAnalysisRequest tags(@javax.annotation.Nullable List tags) { + this.tags = tags; + return this; + } + + public RequeueAnalysisRequest addTagsItem(String tagsItem) { + if (this.tags == null) { + this.tags = new ArrayList<>(); + } + this.tags.add(tagsItem); + return this; + } + + /** + * Additional Tags to apply to the requeued Binary, on top of any carried over because generate_capabilities/scrape_tags are false + * @return tags + */ + @javax.annotation.Nullable + public List getTags() { + return tags; + } + + public void setTags(@javax.annotation.Nullable List tags) { + this.tags = tags; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the RequeueAnalysisRequest instance itself + */ + public RequeueAnalysisRequest 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; + } + RequeueAnalysisRequest requeueAnalysisRequest = (RequeueAnalysisRequest) o; + return Objects.equals(this.commandLineArgs, requeueAnalysisRequest.commandLineArgs) && + Objects.equals(this.enableDynamicExecution, requeueAnalysisRequest.enableDynamicExecution) && + Objects.equals(this.generateCapabilities, requeueAnalysisRequest.generateCapabilities) && + Objects.equals(this.noCache, requeueAnalysisRequest.noCache) && + Objects.equals(this.scrapeTags, requeueAnalysisRequest.scrapeTags) && + Objects.equals(this.tags, requeueAnalysisRequest.tags)&& + Objects.equals(this.additionalProperties, requeueAnalysisRequest.additionalProperties); + } + + private static boolean equalsNullable(JsonNullable a, JsonNullable b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + + @Override + public int hashCode() { + return Objects.hash(commandLineArgs, enableDynamicExecution, generateCapabilities, noCache, scrapeTags, tags, additionalProperties); + } + + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class RequeueAnalysisRequest {\n"); + sb.append(" commandLineArgs: ").append(toIndentedString(commandLineArgs)).append("\n"); + sb.append(" enableDynamicExecution: ").append(toIndentedString(enableDynamicExecution)).append("\n"); + sb.append(" generateCapabilities: ").append(toIndentedString(generateCapabilities)).append("\n"); + sb.append(" noCache: ").append(toIndentedString(noCache)).append("\n"); + sb.append(" scrapeTags: ").append(toIndentedString(scrapeTags)).append("\n"); + sb.append(" tags: ").append(toIndentedString(tags)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + 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("command_line_args", "enable_dynamic_execution", "generate_capabilities", "no_cache", "scrape_tags", "tags")); + + // 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 RequeueAnalysisRequest + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!RequeueAnalysisRequest.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 RequeueAnalysisRequest is not found in the empty JSON string", RequeueAnalysisRequest.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("command_line_args") != null && !jsonObj.get("command_line_args").isJsonNull()) && !jsonObj.get("command_line_args").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `command_line_args` to be a primitive type in the JSON string but got `%s`", jsonObj.get("command_line_args").toString())); + } + // ensure the optional json data is an array if present + if (jsonObj.get("tags") != null && !jsonObj.get("tags").isJsonNull() && !jsonObj.get("tags").isJsonArray()) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `tags` to be an array in the JSON string but got `%s`", jsonObj.get("tags").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!RequeueAnalysisRequest.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'RequeueAnalysisRequest' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(RequeueAnalysisRequest.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, RequeueAnalysisRequest 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 RequeueAnalysisRequest read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + RequeueAnalysisRequest 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 RequeueAnalysisRequest given an JSON string + * + * @param jsonString JSON string + * @return An instance of RequeueAnalysisRequest + * @throws IOException if the JSON string is invalid with respect to RequeueAnalysisRequest + */ + public static RequeueAnalysisRequest fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, RequeueAnalysisRequest.class); + } + + /** + * Convert an instance of RequeueAnalysisRequest to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/ai/reveng/model/ResolvedEntity.java b/src/main/java/ai/reveng/model/ResolvedEntity.java index c3a46f8..44f4d03 100644 --- a/src/main/java/ai/reveng/model/ResolvedEntity.java +++ b/src/main/java/ai/reveng/model/ResolvedEntity.java @@ -275,6 +275,11 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti @javax.annotation.Nullable private Long typeIndex; + public static final String SERIALIZED_NAME_TYPE_SOURCE = "type_source"; + @SerializedName(SERIALIZED_NAME_TYPE_SOURCE) + @javax.annotation.Nullable + private String typeSource; + public static final String SERIALIZED_NAME_VADDR = "vaddr"; @SerializedName(SERIALIZED_NAME_VADDR) @javax.annotation.Nullable @@ -290,6 +295,11 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti @javax.annotation.Nullable private String valueConfidence; + public static final String SERIALIZED_NAME_VALUE_KIND = "value_kind"; + @SerializedName(SERIALIZED_NAME_VALUE_KIND) + @javax.annotation.Nullable + private String valueKind; + public static final String SERIALIZED_NAME_VALUE_TYPE = "value_type"; @SerializedName(SERIALIZED_NAME_VALUE_TYPE) @javax.annotation.Nullable @@ -705,6 +715,25 @@ public void setTypeIndex(@javax.annotation.Nullable Long typeIndex) { } + public ResolvedEntity typeSource(@javax.annotation.Nullable String typeSource) { + this.typeSource = typeSource; + return this; + } + + /** + * Get typeSource + * @return typeSource + */ + @javax.annotation.Nullable + public String getTypeSource() { + return typeSource; + } + + public void setTypeSource(@javax.annotation.Nullable String typeSource) { + this.typeSource = typeSource; + } + + public ResolvedEntity vaddr(@javax.annotation.Nullable Long vaddr) { this.vaddr = vaddr; return this; @@ -762,6 +791,25 @@ public void setValueConfidence(@javax.annotation.Nullable String valueConfidence } + public ResolvedEntity valueKind(@javax.annotation.Nullable String valueKind) { + this.valueKind = valueKind; + return this; + } + + /** + * Get valueKind + * @return valueKind + */ + @javax.annotation.Nullable + public String getValueKind() { + return valueKind; + } + + public void setValueKind(@javax.annotation.Nullable String valueKind) { + this.valueKind = valueKind; + } + + public ResolvedEntity valueType(@javax.annotation.Nullable String valueType) { this.valueType = valueType; return this; @@ -856,9 +904,11 @@ public boolean equals(Object o) { Objects.equals(this.suggestionConfidence, resolvedEntity.suggestionConfidence) && Objects.equals(this.token, resolvedEntity.token) && Objects.equals(this.typeIndex, resolvedEntity.typeIndex) && + Objects.equals(this.typeSource, resolvedEntity.typeSource) && Objects.equals(this.vaddr, resolvedEntity.vaddr) && Objects.equals(this.value, resolvedEntity.value) && Objects.equals(this.valueConfidence, resolvedEntity.valueConfidence) && + Objects.equals(this.valueKind, resolvedEntity.valueKind) && Objects.equals(this.valueType, resolvedEntity.valueType)&& Objects.equals(this.additionalProperties, resolvedEntity.additionalProperties); } @@ -869,7 +919,7 @@ private static boolean equalsNullable(JsonNullable a, JsonNullable b) @Override public int hashCode() { - return Objects.hash(addrToken, allAddrTokens, bitOffset, byteOffset, byteSize, count, dataTypeIndex, fieldStatus, functionId, importedFunctionId, kind, name, nameSource, needsNaming, provenance, resolvedName, suggestedName, suggestedType, suggestionConfidence, token, typeIndex, vaddr, value, valueConfidence, valueType, additionalProperties); + return Objects.hash(addrToken, allAddrTokens, bitOffset, byteOffset, byteSize, count, dataTypeIndex, fieldStatus, functionId, importedFunctionId, kind, name, nameSource, needsNaming, provenance, resolvedName, suggestedName, suggestedType, suggestionConfidence, token, typeIndex, typeSource, vaddr, value, valueConfidence, valueKind, valueType, additionalProperties); } private static int hashCodeNullable(JsonNullable a) { @@ -904,9 +954,11 @@ public String toString() { sb.append(" suggestionConfidence: ").append(toIndentedString(suggestionConfidence)).append("\n"); sb.append(" token: ").append(toIndentedString(token)).append("\n"); sb.append(" typeIndex: ").append(toIndentedString(typeIndex)).append("\n"); + sb.append(" typeSource: ").append(toIndentedString(typeSource)).append("\n"); sb.append(" vaddr: ").append(toIndentedString(vaddr)).append("\n"); sb.append(" value: ").append(toIndentedString(value)).append("\n"); sb.append(" valueConfidence: ").append(toIndentedString(valueConfidence)).append("\n"); + sb.append(" valueKind: ").append(toIndentedString(valueKind)).append("\n"); sb.append(" valueType: ").append(toIndentedString(valueType)).append("\n"); sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); sb.append("}"); @@ -927,10 +979,10 @@ private String toIndentedString(Object o) { static { // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(Arrays.asList("addr_token", "all_addr_tokens", "bit_offset", "byte_offset", "byte_size", "count", "data_type_index", "field_status", "function_id", "imported_function_id", "kind", "name", "name_source", "needs_naming", "provenance", "resolved_name", "suggested_name", "suggested_type", "suggestion_confidence", "token", "type_index", "vaddr", "value", "value_confidence", "value_type")); + openapiFields = new HashSet(Arrays.asList("addr_token", "all_addr_tokens", "bit_offset", "byte_offset", "byte_size", "count", "data_type_index", "field_status", "function_id", "imported_function_id", "kind", "name", "name_source", "needs_naming", "provenance", "resolved_name", "suggested_name", "suggested_type", "suggestion_confidence", "token", "type_index", "type_source", "vaddr", "value", "value_confidence", "value_kind", "value_type")); // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(Arrays.asList("addr_token", "all_addr_tokens", "bit_offset", "byte_offset", "byte_size", "count", "data_type_index", "kind", "name", "name_source", "needs_naming", "provenance", "resolved_name", "suggested_type", "suggestion_confidence", "token", "type_index", "vaddr", "value", "value_confidence", "value_type")); + openapiRequiredFields = new HashSet(Arrays.asList("addr_token", "all_addr_tokens", "bit_offset", "byte_offset", "byte_size", "count", "data_type_index", "kind", "name", "name_source", "needs_naming", "provenance", "resolved_name", "suggested_type", "suggestion_confidence", "token", "type_index", "type_source", "vaddr", "value", "value_confidence", "value_kind", "value_type")); } /** @@ -998,12 +1050,18 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti if ((jsonObj.get("token") != null && !jsonObj.get("token").isJsonNull()) && !jsonObj.get("token").isJsonPrimitive()) { throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `token` to be a primitive type in the JSON string but got `%s`", jsonObj.get("token").toString())); } + if ((jsonObj.get("type_source") != null && !jsonObj.get("type_source").isJsonNull()) && !jsonObj.get("type_source").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `type_source` to be a primitive type in the JSON string but got `%s`", jsonObj.get("type_source").toString())); + } if ((jsonObj.get("value") != null && !jsonObj.get("value").isJsonNull()) && !jsonObj.get("value").isJsonPrimitive()) { throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `value` to be a primitive type in the JSON string but got `%s`", jsonObj.get("value").toString())); } if ((jsonObj.get("value_confidence") != null && !jsonObj.get("value_confidence").isJsonNull()) && !jsonObj.get("value_confidence").isJsonPrimitive()) { throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `value_confidence` to be a primitive type in the JSON string but got `%s`", jsonObj.get("value_confidence").toString())); } + if ((jsonObj.get("value_kind") != null && !jsonObj.get("value_kind").isJsonNull()) && !jsonObj.get("value_kind").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `value_kind` to be a primitive type in the JSON string but got `%s`", jsonObj.get("value_kind").toString())); + } if ((jsonObj.get("value_type") != null && !jsonObj.get("value_type").isJsonNull()) && !jsonObj.get("value_type").isJsonPrimitive()) { throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `value_type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("value_type").toString())); } diff --git a/src/main/java/ai/reveng/model/Status.java b/src/main/java/ai/reveng/model/Status.java index 2b0ed88..e1177a8 100644 --- a/src/main/java/ai/reveng/model/Status.java +++ b/src/main/java/ai/reveng/model/Status.java @@ -68,6 +68,8 @@ public enum CodeEnum { CONVERSATION_NOT_FOUND("CONVERSATION_NOT_FOUND"), + DISPOSABLE_EMAIL_NOT_ALLOWED("DISPOSABLE_EMAIL_NOT_ALLOWED"), + DOMAIN_ALREADY_CLAIMED("DOMAIN_ALREADY_CLAIMED"), DOMAIN_VERIFICATION_PENDING("DOMAIN_VERIFICATION_PENDING"), @@ -122,6 +124,8 @@ public enum CodeEnum { OIDC_DISCOVERY_FAILED("OIDC_DISCOVERY_FAILED"), + OPERATION_PREREQUISITE_NOT_MET("OPERATION_PREREQUISITE_NOT_MET"), + PASSWORD_RESET_REQUIRED("PASSWORD_RESET_REQUIRED"), PAYMENT_REQUIRED("PAYMENT_REQUIRED"), diff --git a/src/main/java/ai/reveng/model/StringMatchEvidence.java b/src/main/java/ai/reveng/model/StringMatchEvidence.java index ea7ee39..914735e 100644 --- a/src/main/java/ai/reveng/model/StringMatchEvidence.java +++ b/src/main/java/ai/reveng/model/StringMatchEvidence.java @@ -13,8 +13,7 @@ package ai.reveng.model; import java.util.Objects; -import ai.reveng.model.EvidenceEffect; -import ai.reveng.model.StringMatch; +import ai.reveng.model.ReportStringMatch; import com.google.gson.TypeAdapter; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; @@ -49,12 +48,71 @@ import ai.reveng.invoker.JSON; /** - * String matches without demonstrated semantic use. + * StringMatchEvidence */ @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class StringMatchEvidence { /** - * Gets or Sets evidenceKind + * Whether the evidence supports or refutes the finding. + */ + @JsonAdapter(EffectEnum.Adapter.class) + public enum EffectEnum { + SUPPORTS("supports"), + + REFUTES("refutes"), + + UNKNOWN_DEFAULT_OPEN_API("unknown_default_open_api"); + + private String value; + + EffectEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static EffectEnum fromValue(String value) { + for (EffectEnum b : EffectEnum.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 EffectEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public EffectEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return EffectEnum.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + EffectEnum.fromValue(value); + } + } + + public static final String SERIALIZED_NAME_EFFECT = "effect"; + @SerializedName(SERIALIZED_NAME_EFFECT) + @javax.annotation.Nonnull + private EffectEnum effect; + + /** + * Kind of evidence. */ @JsonAdapter(EvidenceKindEnum.Adapter.class) public enum EvidenceKindEnum { @@ -107,11 +165,11 @@ 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.STRING_MATCH; + @javax.annotation.Nonnull + private EvidenceKindEnum evidenceKind; /** - * Gets or Sets kind + * How the evidence was derived. */ @JsonAdapter(KindEnum.Adapter.class) public enum KindEnum { @@ -164,16 +222,11 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti public static final String SERIALIZED_NAME_KIND = "kind"; @SerializedName(SERIALIZED_NAME_KIND) - @javax.annotation.Nullable - private KindEnum kind = KindEnum.DETERMINISTIC_DERIVATION; - - public static final String SERIALIZED_NAME_EFFECT = "effect"; - @SerializedName(SERIALIZED_NAME_EFFECT) @javax.annotation.Nonnull - private EvidenceEffect effect; + private KindEnum kind; /** - * Gets or Sets strength + * How directly the evidence bears on the finding. */ @JsonAdapter(StrengthEnum.Adapter.class) public enum StrengthEnum { @@ -226,99 +279,99 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti public static final String SERIALIZED_NAME_STRENGTH = "strength"; @SerializedName(SERIALIZED_NAME_STRENGTH) - @javax.annotation.Nullable - private StrengthEnum strength = StrengthEnum.INDIRECT; + @javax.annotation.Nonnull + private StrengthEnum strength; 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 StringMatchEvidence() { } - public StringMatchEvidence evidenceKind(@javax.annotation.Nullable EvidenceKindEnum evidenceKind) { - this.evidenceKind = evidenceKind; + public StringMatchEvidence effect(@javax.annotation.Nonnull EffectEnum effect) { + this.effect = effect; return this; } /** - * Get evidenceKind - * @return evidenceKind + * Whether the evidence supports or refutes the finding. + * @return effect */ - @javax.annotation.Nullable - public EvidenceKindEnum getEvidenceKind() { - return evidenceKind; + @javax.annotation.Nonnull + public EffectEnum getEffect() { + return effect; } - public void setEvidenceKind(@javax.annotation.Nullable EvidenceKindEnum evidenceKind) { - this.evidenceKind = evidenceKind; + public void setEffect(@javax.annotation.Nonnull EffectEnum effect) { + this.effect = effect; } - public StringMatchEvidence kind(@javax.annotation.Nullable KindEnum kind) { - this.kind = kind; + public StringMatchEvidence evidenceKind(@javax.annotation.Nonnull EvidenceKindEnum evidenceKind) { + this.evidenceKind = evidenceKind; return this; } /** - * Get kind - * @return kind + * Kind of evidence. + * @return evidenceKind */ - @javax.annotation.Nullable - public KindEnum getKind() { - return kind; + @javax.annotation.Nonnull + public EvidenceKindEnum getEvidenceKind() { + return evidenceKind; } - public void setKind(@javax.annotation.Nullable KindEnum kind) { - this.kind = kind; + public void setEvidenceKind(@javax.annotation.Nonnull EvidenceKindEnum evidenceKind) { + this.evidenceKind = evidenceKind; } - public StringMatchEvidence effect(@javax.annotation.Nonnull EvidenceEffect effect) { - this.effect = effect; + public StringMatchEvidence kind(@javax.annotation.Nonnull KindEnum kind) { + this.kind = kind; return this; } /** - * Get effect - * @return effect + * How the evidence was derived. + * @return kind */ @javax.annotation.Nonnull - public EvidenceEffect getEffect() { - return effect; + public KindEnum getKind() { + return kind; } - public void setEffect(@javax.annotation.Nonnull EvidenceEffect effect) { - this.effect = effect; + public void setKind(@javax.annotation.Nonnull KindEnum kind) { + this.kind = kind; } - public StringMatchEvidence strength(@javax.annotation.Nullable StrengthEnum strength) { + public StringMatchEvidence strength(@javax.annotation.Nonnull StrengthEnum strength) { this.strength = strength; return this; } /** - * Get strength + * How directly the evidence bears on the finding. * @return strength */ - @javax.annotation.Nullable + @javax.annotation.Nonnull public StrengthEnum getStrength() { return strength; } - public void setStrength(@javax.annotation.Nullable StrengthEnum strength) { + public void setStrength(@javax.annotation.Nonnull StrengthEnum strength) { this.strength = strength; } - public StringMatchEvidence strings(@javax.annotation.Nonnull List strings) { + public StringMatchEvidence strings(@javax.annotation.Nonnull List strings) { this.strings = strings; return this; } - public StringMatchEvidence addStringsItem(StringMatch stringsItem) { + public StringMatchEvidence addStringsItem(ReportStringMatch stringsItem) { if (this.strings == null) { this.strings = new ArrayList<>(); } @@ -327,15 +380,15 @@ public StringMatchEvidence addStringsItem(StringMatch stringsItem) { } /** - * Get strings + * The matched strings. * @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; } @@ -394,9 +447,9 @@ public boolean equals(Object o) { return false; } StringMatchEvidence stringMatchEvidence = (StringMatchEvidence) o; - return Objects.equals(this.evidenceKind, stringMatchEvidence.evidenceKind) && + return Objects.equals(this.effect, stringMatchEvidence.effect) && + 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); @@ -404,16 +457,16 @@ public boolean equals(Object o) { @Override public int hashCode() { - return Objects.hash(evidenceKind, kind, effect, strength, strings, additionalProperties); + return Objects.hash(effect, evidenceKind, kind, strength, strings, additionalProperties); } @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class StringMatchEvidence {\n"); + sb.append(" effect: ").append(toIndentedString(effect)).append("\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"); sb.append(" strength: ").append(toIndentedString(strength)).append("\n"); sb.append(" strings: ").append(toIndentedString(strings)).append("\n"); sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); @@ -435,10 +488,10 @@ private String toIndentedString(Object o) { static { // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(Arrays.asList("evidence_kind", "kind", "effect", "strength", "strings")); + openapiFields = new HashSet(Arrays.asList("effect", "evidence_kind", "kind", "strength", "strings")); // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(Arrays.asList("effect", "strings")); + openapiRequiredFields = new HashSet(Arrays.asList("effect", "evidence_kind", "kind", "strength", "strings")); } /** @@ -461,38 +514,31 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti } } JsonObject jsonObj = jsonElement.getAsJsonObject(); - if ((jsonObj.get("evidence_kind") != null && !jsonObj.get("evidence_kind").isJsonNull()) && !jsonObj.get("evidence_kind").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `evidence_kind` to be a primitive type in the JSON string but got `%s`", jsonObj.get("evidence_kind").toString())); + if (!jsonObj.get("effect").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `effect` to be a primitive type in the JSON string but got `%s`", jsonObj.get("effect").toString())); } - // validate the optional field `evidence_kind` - if (jsonObj.get("evidence_kind") != null && !jsonObj.get("evidence_kind").isJsonNull()) { - EvidenceKindEnum.validateJsonElement(jsonObj.get("evidence_kind")); + // validate the required field `effect` + EffectEnum.validateJsonElement(jsonObj.get("effect")); + if (!jsonObj.get("evidence_kind").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `evidence_kind` to be a primitive type in the JSON string but got `%s`", jsonObj.get("evidence_kind").toString())); } - if ((jsonObj.get("kind") != null && !jsonObj.get("kind").isJsonNull()) && !jsonObj.get("kind").isJsonPrimitive()) { + // validate the required field `evidence_kind` + EvidenceKindEnum.validateJsonElement(jsonObj.get("evidence_kind")); + if (!jsonObj.get("kind").isJsonPrimitive()) { throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `kind` to be a primitive type in the JSON string but got `%s`", jsonObj.get("kind").toString())); } - // validate the optional field `kind` - if (jsonObj.get("kind") != null && !jsonObj.get("kind").isJsonNull()) { - KindEnum.validateJsonElement(jsonObj.get("kind")); - } - // validate the required field `effect` - EvidenceEffect.validateJsonElement(jsonObj.get("effect")); - if ((jsonObj.get("strength") != null && !jsonObj.get("strength").isJsonNull()) && !jsonObj.get("strength").isJsonPrimitive()) { + // validate the required field `kind` + KindEnum.validateJsonElement(jsonObj.get("kind")); + if (!jsonObj.get("strength").isJsonPrimitive()) { throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `strength` to be a primitive type in the JSON string but got `%s`", jsonObj.get("strength").toString())); } - // validate the optional field `strength` - if (jsonObj.get("strength") != null && !jsonObj.get("strength").isJsonNull()) { - StrengthEnum.validateJsonElement(jsonObj.get("strength")); - } - if (jsonObj.get("strings") != null) { - if (!jsonObj.get("strings").isJsonArray()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `strings` to be an array in the JSON string but got `%s`", jsonObj.get("strings").toString())); - } - JsonArray jsonArraystrings = jsonObj.getAsJsonArray("strings"); - // validate the required field `strings` (array) - for (int i = 0; i < jsonArraystrings.size(); i++) { - StringMatch.validateJsonElement(jsonArraystrings.get(i)); - } + // validate the required field `strength` + StrengthEnum.validateJsonElement(jsonObj.get("strength")); + // ensure the required json array is present + if (jsonObj.get("strings") == null) { + throw new IllegalArgumentException("Expected the field `linkedContent` to be an array in the JSON string but got `null`"); + } else if (!jsonObj.get("strings").isJsonArray()) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `strings` to be an array in the JSON string but got `%s`", jsonObj.get("strings").toString())); } } diff --git a/src/main/java/ai/reveng/model/UpdateAnalysisGlobalInputBody.java b/src/main/java/ai/reveng/model/UpdateAnalysisGlobalInputBody.java new file mode 100644 index 0000000..8e6c7e6 --- /dev/null +++ b/src/main/java/ai/reveng/model/UpdateAnalysisGlobalInputBody.java @@ -0,0 +1,309 @@ +/* + * 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; + +/** + * UpdateAnalysisGlobalInputBody + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class UpdateAnalysisGlobalInputBody { + public static final String SERIALIZED_NAME_DATA_TYPE_ID = "data_type_id"; + @SerializedName(SERIALIZED_NAME_DATA_TYPE_ID) + @javax.annotation.Nullable + private Long dataTypeId; + + public static final String SERIALIZED_NAME_NAME = "name"; + @SerializedName(SERIALIZED_NAME_NAME) + @javax.annotation.Nullable + private String name; + + public UpdateAnalysisGlobalInputBody() { + } + + public UpdateAnalysisGlobalInputBody dataTypeId(@javax.annotation.Nullable Long dataTypeId) { + this.dataTypeId = dataTypeId; + return this; + } + + /** + * Analysis data type to assign. Omit to leave the type as it is. + * minimum: 0 + * @return dataTypeId + */ + @javax.annotation.Nullable + public Long getDataTypeId() { + return dataTypeId; + } + + public void setDataTypeId(@javax.annotation.Nullable Long dataTypeId) { + this.dataTypeId = dataTypeId; + } + + + public UpdateAnalysisGlobalInputBody name(@javax.annotation.Nullable String name) { + this.name = name; + return this; + } + + /** + * New name for the global. Omit to leave the name as it is. + * @return name + */ + @javax.annotation.Nullable + public String getName() { + return name; + } + + public void setName(@javax.annotation.Nullable String name) { + this.name = name; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the UpdateAnalysisGlobalInputBody instance itself + */ + public UpdateAnalysisGlobalInputBody 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; + } + UpdateAnalysisGlobalInputBody updateAnalysisGlobalInputBody = (UpdateAnalysisGlobalInputBody) o; + return Objects.equals(this.dataTypeId, updateAnalysisGlobalInputBody.dataTypeId) && + Objects.equals(this.name, updateAnalysisGlobalInputBody.name)&& + Objects.equals(this.additionalProperties, updateAnalysisGlobalInputBody.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(dataTypeId, name, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UpdateAnalysisGlobalInputBody {\n"); + sb.append(" dataTypeId: ").append(toIndentedString(dataTypeId)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + 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("data_type_id", "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 UpdateAnalysisGlobalInputBody + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!UpdateAnalysisGlobalInputBody.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 UpdateAnalysisGlobalInputBody is not found in the empty JSON string", UpdateAnalysisGlobalInputBody.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("name") != null && !jsonObj.get("name").isJsonNull()) && !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 (!UpdateAnalysisGlobalInputBody.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'UpdateAnalysisGlobalInputBody' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(UpdateAnalysisGlobalInputBody.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, UpdateAnalysisGlobalInputBody 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 UpdateAnalysisGlobalInputBody read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + UpdateAnalysisGlobalInputBody 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 UpdateAnalysisGlobalInputBody given an JSON string + * + * @param jsonString JSON string + * @return An instance of UpdateAnalysisGlobalInputBody + * @throws IOException if the JSON string is invalid with respect to UpdateAnalysisGlobalInputBody + */ + public static UpdateAnalysisGlobalInputBody fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, UpdateAnalysisGlobalInputBody.class); + } + + /** + * Convert an instance of UpdateAnalysisGlobalInputBody to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} +