diff --git a/.sdk-version b/.sdk-version index d8493eb3..21f74272 100644 --- a/.sdk-version +++ b/.sdk-version @@ -1 +1 @@ -v4.74.3 +v4.75.0 diff --git a/README.md b/README.md index 29f821b1..f5b3d89c 100644 --- a/README.md +++ b/README.md @@ -16,7 +16,7 @@ Add this dependency to your project's POM: ai.reveng sdk - 4.74.3 + 4.75.0 compile ``` @@ -31,7 +31,7 @@ repositories { } dependencies { - implementation "ai.reveng:sdk:4.74.3" + implementation "ai.reveng:sdk:4.75.0" } ``` @@ -155,8 +155,6 @@ Class | Method | HTTP request | Description *AnalysesCoreApi* | [**getAnalysisLogs**](docs/AnalysesCoreApi.md#getAnalysisLogs) | **GET** /v2/analyses/{analysis_id}/logs | Gets the logs of an analysis *AnalysesCoreApi* | [**getAnalysisParams**](docs/AnalysesCoreApi.md#getAnalysisParams) | **GET** /v2/analyses/{analysis_id}/params | Gets analysis param information *AnalysesCoreApi* | [**getAnalysisStatus**](docs/AnalysesCoreApi.md#getAnalysisStatus) | **GET** /v2/analyses/{analysis_id}/status | Gets the status of an analysis -*AnalysesCoreApi* | [**getDynamicExecutionReport**](docs/AnalysesCoreApi.md#getDynamicExecutionReport) | **GET** /v2/analyses/{analysis_id}/dynamic-execution/report | Get dynamic execution report -*AnalysesCoreApi* | [**getDynamicExecutionStatus**](docs/AnalysesCoreApi.md#getDynamicExecutionStatus) | **GET** /v2/analyses/{analysis_id}/dynamic-execution/status | Get dynamic execution status *AnalysesCoreApi* | [**insertAnalysisLog**](docs/AnalysesCoreApi.md#insertAnalysisLog) | **POST** /v2/analyses/{analysis_id}/logs | Insert a log entry for an analysis *AnalysesCoreApi* | [**listAnalyses**](docs/AnalysesCoreApi.md#listAnalyses) | **GET** /v2/analyses/list | Gets the most recent analyses *AnalysesCoreApi* | [**lookupBinaryId**](docs/AnalysesCoreApi.md#lookupBinaryId) | **GET** /v2/analyses/lookup/{binary_id} | Gets the analysis ID from binary ID @@ -166,6 +164,7 @@ Class | Method | HTTP request | Description *AnalysesCoreApi* | [**updateAnalysis**](docs/AnalysesCoreApi.md#updateAnalysis) | **PATCH** /v2/analyses/{analysis_id} | Update Analysis *AnalysesCoreApi* | [**updateAnalysisTags**](docs/AnalysesCoreApi.md#updateAnalysisTags) | **PATCH** /v2/analyses/{analysis_id}/tags | Update Analysis Tags *AnalysesCoreApi* | [**uploadFile**](docs/AnalysesCoreApi.md#uploadFile) | **POST** /v2/upload | Upload File +*AnalysesCoreApi* | [**v3CreateAnalysis**](docs/AnalysesCoreApi.md#v3CreateAnalysis) | **POST** /v3/analyses | Create an analysis *AnalysesCoreApi* | [**v3DeleteAnalysis**](docs/AnalysesCoreApi.md#v3DeleteAnalysis) | **DELETE** /v3/analyses/{analysis_id} | Delete an analysis. *AnalysesCoreApi* | [**v3DownloadBinaryExport**](docs/AnalysesCoreApi.md#v3DownloadBinaryExport) | **GET** /v3/analyses/{analysis_id}/binary-export | Download a binary export *AnalysesCoreApi* | [**v3GetAnalysis**](docs/AnalysesCoreApi.md#v3GetAnalysis) | **GET** /v3/analyses/{analysis_id} | Get an analysis. @@ -188,7 +187,9 @@ Class | Method | HTTP request | Description *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* | [**v3GrantAnalysisAccess**](docs/AnalysesCoreApi.md#v3GrantAnalysisAccess) | **POST** /v3/analyses/{analysis_id}/access-rules | Share an analysis with a user or team *AnalysesCoreApi* | [**v3ListAnalyses**](docs/AnalysesCoreApi.md#v3ListAnalyses) | **GET** /v3/analyses | List analyses +*AnalysesCoreApi* | [**v3ListAnalysisAccessRules**](docs/AnalysesCoreApi.md#v3ListAnalysisAccessRules) | **GET** /v3/analyses/{analysis_id}/access-rules | List who an analysis is shared with *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. @@ -197,6 +198,7 @@ Class | Method | HTTP request | Description *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* | [**v3RevokeAnalysisAccess**](docs/AnalysesCoreApi.md#v3RevokeAnalysisAccess) | **DELETE** /v3/analyses/{analysis_id}/access-rules | Stop sharing an analysis with a user or team *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 @@ -217,6 +219,8 @@ 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* | [**v3ListPrincipals**](docs/AuthenticationUsersApi.md#v3ListPrincipals) | **GET** /v3/principals | Search users and teams +*AuthenticationUsersApi* | [**v3ListTeams**](docs/AuthenticationUsersApi.md#v3ListTeams) | **GET** /v3/teams | Search teams *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 @@ -273,9 +277,6 @@ Class | Method | HTTP request | Description *DataTypesApi* | [**v3ListFunctionSignatures**](docs/DataTypesApi.md#v3ListFunctionSignatures) | **GET** /v3/functions/signatures | Get signatures for many functions *DataTypesApi* | [**v3UpdateAnalysisDataTypes**](docs/DataTypesApi.md#v3UpdateAnalysisDataTypes) | **PUT** /v3/analyses/{analysis_id}/data-types | Update an analysis's data types *DataTypesApi* | [**v3UpdateFunctionSignature**](docs/DataTypesApi.md#v3UpdateFunctionSignature) | **PUT** /v3/analyses/{analysis_id}/functions/{function_id}/signature | Update a function's signature -*ExternalSourcesApi* | [**createExternalTaskVt**](docs/ExternalSourcesApi.md#createExternalTaskVt) | **POST** /v2/analysis/{analysis_id}/external/vt | Pulls data from VirusTotal -*ExternalSourcesApi* | [**getVtData**](docs/ExternalSourcesApi.md#getVtData) | **GET** /v2/analysis/{analysis_id}/external/vt | Get VirusTotal data -*ExternalSourcesApi* | [**getVtTaskStatus**](docs/ExternalSourcesApi.md#getVtTaskStatus) | **GET** /v2/analysis/{analysis_id}/external/vt/status | Check the status of VirusTotal data retrieval *ExternalSourcesApi* | [**v3GetVirustotalScanOperation**](docs/ExternalSourcesApi.md#v3GetVirustotalScanOperation) | **GET** /v3/operations/virustotal-scan/{binary_id} | Get a VirusTotal scan operation. *ExternalSourcesApi* | [**v3RunVirustotalScan**](docs/ExternalSourcesApi.md#v3RunVirustotalScan) | **POST** /v3/binaries/{binary_id}/virustotal-scan:run | Trigger a VirusTotal lookup for a binary. *FunctionsAiDecompilationApi* | [**createAiDecompilation**](docs/FunctionsAiDecompilationApi.md#createAiDecompilation) | **POST** /v3/functions/{function_id}/ai-decompilation | Start AI decompilation @@ -338,6 +339,18 @@ Class | Method | HTTP request | Description *FunctionsRenamingHistoryApi* | [**revertFunctionName_0**](docs/FunctionsRenamingHistoryApi.md#revertFunctionName_0) | **POST** /v3/functions/{function_id}/history/{history_id}/revert | Revert function name *IamUsersApi* | [**getMe**](docs/IamUsersApi.md#getMe) | **GET** /v2/iam/me | Get current user *IamUsersApi* | [**getMyPermissions**](docs/IamUsersApi.md#getMyPermissions) | **GET** /v2/iam/me/permissions | Get current user permissions +*InvestigationsApi* | [**v3CreateInvestigation**](docs/InvestigationsApi.md#v3CreateInvestigation) | **POST** /v3/investigations | Create an investigation. +*InvestigationsApi* | [**v3CreateInvestigationConversation**](docs/InvestigationsApi.md#v3CreateInvestigationConversation) | **POST** /v3/investigations/{investigation_id}/conversations | Start a conversation in an investigation. +*InvestigationsApi* | [**v3DeleteInvestigation**](docs/InvestigationsApi.md#v3DeleteInvestigation) | **DELETE** /v3/investigations/{investigation_id} | Delete an investigation. +*InvestigationsApi* | [**v3GetInvestigation**](docs/InvestigationsApi.md#v3GetInvestigation) | **GET** /v3/investigations/{investigation_id} | Get an investigation. +*InvestigationsApi* | [**v3GetInvestigationFinding**](docs/InvestigationsApi.md#v3GetInvestigationFinding) | **GET** /v3/investigations/{investigation_id}/findings/{finding_id} | Get a finding of an investigation. +*InvestigationsApi* | [**v3ListInvestigationAgentRuns**](docs/InvestigationsApi.md#v3ListInvestigationAgentRuns) | **GET** /v3/investigations/agent-runs | List agent runs on investigations. +*InvestigationsApi* | [**v3ListInvestigationConversations**](docs/InvestigationsApi.md#v3ListInvestigationConversations) | **GET** /v3/investigations/{investigation_id}/conversations | List the conversations of an investigation. +*InvestigationsApi* | [**v3ListInvestigationFindings**](docs/InvestigationsApi.md#v3ListInvestigationFindings) | **GET** /v3/investigations/{investigation_id}/findings | List the findings of an investigation. +*InvestigationsApi* | [**v3ListInvestigationSpend**](docs/InvestigationsApi.md#v3ListInvestigationSpend) | **GET** /v3/investigations/{investigation_id}/spend | List what an investigation spent. +*InvestigationsApi* | [**v3ListInvestigations**](docs/InvestigationsApi.md#v3ListInvestigations) | **GET** /v3/investigations | List investigations. +*InvestigationsApi* | [**v3PatchInvestigation**](docs/InvestigationsApi.md#v3PatchInvestigation) | **PATCH** /v3/investigations/{investigation_id} | Update an investigation. +*InvestigationsApi* | [**v3SetInvestigationBudget**](docs/InvestigationsApi.md#v3SetInvestigationBudget) | **PUT** /v3/investigations/{investigation_id}/budget | Set the budget of an investigation. *ModelsApi* | [**getModels**](docs/ModelsApi.md#getModels) | **GET** /v2/models | Gets models *ReportsApi* | [**createPdfReport**](docs/ReportsApi.md#createPdfReport) | **POST** /v3/analyses/{analysis_id}/pdf | Start PDF report generation *ReportsApi* | [**downloadPdfReport**](docs/ReportsApi.md#downloadPdfReport) | **GET** /v3/analyses/{analysis_id}/pdf | Download generated PDF report @@ -350,10 +363,12 @@ Class | Method | HTTP request | Description ## Documentation for Models + - [APICombinationEvidence](docs/APICombinationEvidence.md) - [APIError](docs/APIError.md) - [AcceptTypeSuggestionsInputBody](docs/AcceptTypeSuggestionsInputBody.md) - [AcceptTypeSuggestionsOutputBody](docs/AcceptTypeSuggestionsOutputBody.md) - [AcceptedType](docs/AcceptedType.md) + - [AccessRuleBody](docs/AccessRuleBody.md) - [ActivityBody](docs/ActivityBody.md) - [AddCalleeInputBody](docs/AddCalleeInputBody.md) - [AddCollectionBinariesInputBody](docs/AddCollectionBinariesInputBody.md) @@ -363,9 +378,18 @@ Class | Method | HTTP request | Description - [AddUserStringInputBody](docs/AddUserStringInputBody.md) - [AddUserStringToFunctionInputBody](docs/AddUserStringToFunctionInputBody.md) - [AdditionalDetailsStatusResponse](docs/AdditionalDetailsStatusResponse.md) + - [AgentBody](docs/AgentBody.md) + - [AgentCompletedBody](docs/AgentCompletedBody.md) + - [AgentRunBody](docs/AgentRunBody.md) + - [AgentRunCardBody](docs/AgentRunCardBody.md) + - [AgentRunIOCBody](docs/AgentRunIOCBody.md) + - [AgentRunUpdateAgent](docs/AgentRunUpdateAgent.md) + - [AgentRunUpdateCard](docs/AgentRunUpdateCard.md) + - [AgentRunUpdateData](docs/AgentRunUpdateData.md) + - [AgentRunUpdateIOC](docs/AgentRunUpdateIOC.md) + - [AgentStatusCountsBody](docs/AgentStatusCountsBody.md) - [AgentWorkflowUsageOutputBody](docs/AgentWorkflowUsageOutputBody.md) - [AiDecompilationRating](docs/AiDecompilationRating.md) - - [AnalyseCapabilitiesBody](docs/AnalyseCapabilitiesBody.md) - [AnalysisAccessBody](docs/AnalysisAccessBody.md) - [AnalysisAccessInfo](docs/AnalysisAccessInfo.md) - [AnalysisBasicInfoOutputBody](docs/AnalysisBasicInfoOutputBody.md) @@ -409,7 +433,6 @@ Class | Method | HTTP request | Description - [AnalysisUpdateTagsResponse](docs/AnalysisUpdateTagsResponse.md) - [AnalysisXrefOutputBody](docs/AnalysisXrefOutputBody.md) - [ApiCall](docs/ApiCall.md) - - [ApiCombinationEvidence](docs/ApiCombinationEvidence.md) - [ApiKeyBody](docs/ApiKeyBody.md) - [AppApiRestV2AgentSchemaCapability](docs/AppApiRestV2AgentSchemaCapability.md) - [AppApiRestV2AnalysesEnumsOrderBy](docs/AppApiRestV2AnalysesEnumsOrderBy.md) @@ -458,7 +481,6 @@ Class | Method | HTTP request | Description - [BaseResponseConfigResponse](docs/BaseResponseConfigResponse.md) - [BaseResponseCreated](docs/BaseResponseCreated.md) - [BaseResponseDict](docs/BaseResponseDict.md) - - [BaseResponseExternalResponse](docs/BaseResponseExternalResponse.md) - [BaseResponseFunctionBlocksResponse](docs/BaseResponseFunctionBlocksResponse.md) - [BaseResponseFunctionCapabilityResponse](docs/BaseResponseFunctionCapabilityResponse.md) - [BaseResponseFunctionSearchResponse](docs/BaseResponseFunctionSearchResponse.md) @@ -481,9 +503,7 @@ Class | Method | HTTP request | Description - [BaseResponseReportAnalysisResponse](docs/BaseResponseReportAnalysisResponse.md) - [BaseResponseSecretsAgentResponse](docs/BaseResponseSecretsAgentResponse.md) - [BaseResponseStatus](docs/BaseResponseStatus.md) - - [BaseResponseStr](docs/BaseResponseStr.md) - [BaseResponseTagSearchResponse](docs/BaseResponseTagSearchResponse.md) - - [BaseResponseTaskResponse](docs/BaseResponseTaskResponse.md) - [BaseResponseTaskStatusResponse](docs/BaseResponseTaskStatusResponse.md) - [BaseResponseTriageReportResponse](docs/BaseResponseTriageReportResponse.md) - [BaseResponseUnionGetAiDecompilationRatingResponseNoneType](docs/BaseResponseUnionGetAiDecompilationRatingResponseNoneType.md) @@ -512,6 +532,7 @@ Class | Method | HTTP request | Description - [BinarySearchResultBody](docs/BinarySearchResultBody.md) - [BinaryTaskStatus](docs/BinaryTaskStatus.md) - [BitfieldDataType](docs/BitfieldDataType.md) + - [BudgetBody](docs/BudgetBody.md) - [BulkAddTagsInputBody](docs/BulkAddTagsInputBody.md) - [BulkAddTagsOutputBody](docs/BulkAddTagsOutputBody.md) - [BulkAddTagsResultBody](docs/BulkAddTagsResultBody.md) @@ -562,7 +583,9 @@ Class | Method | HTTP request | Description - [Connection](docs/Connection.md) - [ConsoleOutputEntry](docs/ConsoleOutputEntry.md) - [Context](docs/Context.md) + - [ContextCompactedData](docs/ContextCompactedData.md) - [Conversation](docs/Conversation.md) + - [ConversationBody](docs/ConversationBody.md) - [ConversationContext](docs/ConversationContext.md) - [ConversationWithEvents](docs/ConversationWithEvents.md) - [CopyFunctionSignaturesInputBody](docs/CopyFunctionSignaturesInputBody.md) @@ -576,12 +599,14 @@ Class | Method | HTTP request | Description - [CreateCheckoutSessionInputBody](docs/CreateCheckoutSessionInputBody.md) - [CreateCollectionInputBody](docs/CreateCollectionInputBody.md) - [CreateCollectionOutputBody](docs/CreateCollectionOutputBody.md) + - [CreateConversationInputBody](docs/CreateConversationInputBody.md) - [CreateConversationRequest](docs/CreateConversationRequest.md) - [CreateDataTypeEntry](docs/CreateDataTypeEntry.md) - [CreateEnumDataType](docs/CreateEnumDataType.md) - [CreateFunctionDataType](docs/CreateFunctionDataType.md) - [CreateGroupInputBody](docs/CreateGroupInputBody.md) - [CreateIdentityInputBody](docs/CreateIdentityInputBody.md) + - [CreateInvestigationInputBody](docs/CreateInvestigationInputBody.md) - [CreateIssuerInputBody](docs/CreateIssuerInputBody.md) - [CreateMetadata](docs/CreateMetadata.md) - [CreateOrganisationInputBody](docs/CreateOrganisationInputBody.md) @@ -631,7 +656,6 @@ Class | Method | HTTP request | Description - [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) @@ -644,15 +668,19 @@ Class | Method | HTTP request | Description - [ELFSymbol](docs/ELFSymbol.md) - [ElfDynamicEntry](docs/ElfDynamicEntry.md) - [Endianness](docs/Endianness.md) + - [EntityRef](docs/EntityRef.md) + - [EntityUpdate](docs/EntityUpdate.md) - [EntrypointModel](docs/EntrypointModel.md) - [EnumDataType](docs/EnumDataType.md) - [EnumDefinition](docs/EnumDefinition.md) - [ErrorBody](docs/ErrorBody.md) - [ErrorModel](docs/ErrorModel.md) - [Event](docs/Event.md) + - [EventAGENTRUNUPDATE](docs/EventAGENTRUNUPDATE.md) - [EventAttemptFailed](docs/EventAttemptFailed.md) - [EventAttemptStarted](docs/EventAttemptStarted.md) - [EventCONTEXTCOMPACTED](docs/EventCONTEXTCOMPACTED.md) + - [EventData](docs/EventData.md) - [EventDecompFailed](docs/EventDecompFailed.md) - [EventDecompFinished](docs/EventDecompFinished.md) - [EventNamesFinished](docs/EventNamesFinished.md) @@ -693,7 +721,6 @@ Class | Method | HTTP request | Description - [ExecutionScanResult](docs/ExecutionScanResult.md) - [ExecutionVerification](docs/ExecutionVerification.md) - [ExportModel](docs/ExportModel.md) - - [ExternalResponse](docs/ExternalResponse.md) - [ExtractedBinary](docs/ExtractedBinary.md) - [ExtractedURL](docs/ExtractedURL.md) - [ExtractionFailure](docs/ExtractionFailure.md) @@ -713,6 +740,8 @@ Class | Method | HTTP request | Description - [FilesystemVerification](docs/FilesystemVerification.md) - [Filters](docs/Filters.md) - [Finding](docs/Finding.md) + - [FindingBody](docs/FindingBody.md) + - [FindingCountsBody](docs/FindingCountsBody.md) - [FormFile](docs/FormFile.md) - [FunctionBlockDestinationResponse](docs/FunctionBlockDestinationResponse.md) - [FunctionBlockResponse](docs/FunctionBlockResponse.md) @@ -760,9 +789,11 @@ Class | Method | HTTP request | Description - [GetConfigOutputBody](docs/GetConfigOutputBody.md) - [GetDataTypeHistoryBody](docs/GetDataTypeHistoryBody.md) - [GetDieInfoOutputBody](docs/GetDieInfoOutputBody.md) + - [GetFindingOutputBody](docs/GetFindingOutputBody.md) - [GetFunctionMapsOutputBody](docs/GetFunctionMapsOutputBody.md) - [GetFunctionSignatureHistoryBody](docs/GetFunctionSignatureHistoryBody.md) - [GetGlobalHistoryOutputBody](docs/GetGlobalHistoryOutputBody.md) + - [GetInvestigationOutputBody](docs/GetInvestigationOutputBody.md) - [GetMatchesOutputBody](docs/GetMatchesOutputBody.md) - [GetMatchesStatusOutputBody](docs/GetMatchesStatusOutputBody.md) - [GetModelsOutputBody](docs/GetModelsOutputBody.md) @@ -776,6 +807,7 @@ Class | Method | HTTP request | Description - [GetUserActivityOutputBody](docs/GetUserActivityOutputBody.md) - [GlobalHistoryEntry](docs/GlobalHistoryEntry.md) - [GlobalVariable](docs/GlobalVariable.md) + - [GrantAccessInputBody](docs/GrantAccessInputBody.md) - [HardcodedSecretEvidence](docs/HardcodedSecretEvidence.md) - [HistoryActor](docs/HistoryActor.md) - [HistoryEntry](docs/HistoryEntry.md) @@ -785,9 +817,9 @@ 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) - [ImportedFunctionCallerEntry](docs/ImportedFunctionCallerEntry.md) - [ImportedFunctionDetailOutputBody](docs/ImportedFunctionDetailOutputBody.md) - [ImportedFunctionEntry](docs/ImportedFunctionEntry.md) @@ -796,10 +828,14 @@ Class | Method | HTTP request | Description - [InlineComment](docs/InlineComment.md) - [InputBody](docs/InputBody.md) - [InsertAnalysisLogRequest](docs/InsertAnalysisLogRequest.md) + - [InvestigationBody](docs/InvestigationBody.md) + - [InvestigationListItemBody](docs/InvestigationListItemBody.md) - [InviteUserInputBody](docs/InviteUserInputBody.md) - [IssuerAllowedDomain](docs/IssuerAllowedDomain.md) - [KnownConstantEvidence](docs/KnownConstantEvidence.md) - [LineAttributionsData](docs/LineAttributionsData.md) + - [ListAccessRulesOutputBody](docs/ListAccessRulesOutputBody.md) + - [ListAgentRunsOutputBody](docs/ListAgentRunsOutputBody.md) - [ListAnalysesOutputBody](docs/ListAnalysesOutputBody.md) - [ListAnalysisDataTypesOutputBody](docs/ListAnalysisDataTypesOutputBody.md) - [ListAnalysisFunctionsOutputBody](docs/ListAnalysisFunctionsOutputBody.md) @@ -808,16 +844,21 @@ Class | Method | HTTP request | Description - [ListArchiveContentsOutputBody](docs/ListArchiveContentsOutputBody.md) - [ListCollectionResults](docs/ListCollectionResults.md) - [ListCollectionsOutputBody](docs/ListCollectionsOutputBody.md) + - [ListConversationsOutputBody](docs/ListConversationsOutputBody.md) - [ListDataTypeFunctionsBody](docs/ListDataTypeFunctionsBody.md) - [ListExampleAnalysesOutputBody](docs/ListExampleAnalysesOutputBody.md) + - [ListFindingsOutputBody](docs/ListFindingsOutputBody.md) - [ListFunctionGlobalsOutputBody](docs/ListFunctionGlobalsOutputBody.md) - [ListFunctionSignaturesOutputBody](docs/ListFunctionSignaturesOutputBody.md) - [ListFunctionStringsOutputBody](docs/ListFunctionStringsOutputBody.md) - [ListGlobalFunctionsOutputBody](docs/ListGlobalFunctionsOutputBody.md) - [ListImportedFunctionsOutputBody](docs/ListImportedFunctionsOutputBody.md) + - [ListInvestigationsOutputBody](docs/ListInvestigationsOutputBody.md) - [ListOperationPrerequisitesOutputBody](docs/ListOperationPrerequisitesOutputBody.md) + - [ListPrincipalsOutputBody](docs/ListPrincipalsOutputBody.md) - [ListPublicUsersOutputBody](docs/ListPublicUsersOutputBody.md) - [ListSecretStoreOutputBody](docs/ListSecretStoreOutputBody.md) + - [ListSpendOutputBody](docs/ListSpendOutputBody.md) - [ListTeamsOutputBody](docs/ListTeamsOutputBody.md) - [ListUsersOutputBody](docs/ListUsersOutputBody.md) - [LocationOutputBody](docs/LocationOutputBody.md) @@ -891,6 +932,7 @@ Class | Method | HTTP request | Description - [PatchCollectionTagsInputBody](docs/PatchCollectionTagsInputBody.md) - [PatchCollectionTagsOutputBody](docs/PatchCollectionTagsOutputBody.md) - [PatchCommentBody](docs/PatchCommentBody.md) + - [PatchInvestigationInputBody](docs/PatchInvestigationInputBody.md) - [PcapBodyInfo](docs/PcapBodyInfo.md) - [Permissions](docs/Permissions.md) - [Platform](docs/Platform.md) @@ -898,6 +940,7 @@ Class | Method | HTTP request | Description - [PointerDefinition](docs/PointerDefinition.md) - [PriceOutput](docs/PriceOutput.md) - [PriceSummary](docs/PriceSummary.md) + - [PrincipalBody](docs/PrincipalBody.md) - [ProcessActivityEntry](docs/ProcessActivityEntry.md) - [ProcessMemdumps](docs/ProcessMemdumps.md) - [ProcessNode](docs/ProcessNode.md) @@ -907,6 +950,7 @@ Class | Method | HTTP request | Description - [ProgressMessage](docs/ProgressMessage.md) - [ProseEvent](docs/ProseEvent.md) - [ProtocolsAgentResponse](docs/ProtocolsAgentResponse.md) + - [PublicTeamBody](docs/PublicTeamBody.md) - [PublicUserBody](docs/PublicUserBody.md) - [PutAnalysisStringsRequest](docs/PutAnalysisStringsRequest.md) - [QueuedWorkflowTaskResponse](docs/QueuedWorkflowTaskResponse.md) @@ -953,13 +997,19 @@ Class | Method | HTTP request | Description - [ReportStringMatch](docs/ReportStringMatch.md) - [ReportSubject](docs/ReportSubject.md) - [RequestedConfigBody](docs/RequestedConfigBody.md) + - [RequestedOperation](docs/RequestedOperation.md) - [RequeueAnalysisRequest](docs/RequeueAnalysisRequest.md) - [ResendVerificationEmailInputBody](docs/ResendVerificationEmailInputBody.md) - [ResolvedEntity](docs/ResolvedEntity.md) - [ResultBody](docs/ResultBody.md) - [RevokeBody](docs/RevokeBody.md) + - [RollupBody](docs/RollupBody.md) - [RuleKind](docs/RuleKind.md) + - [RunCancelledData](docs/RunCancelledData.md) - [RunDynamicExecutionInputBody](docs/RunDynamicExecutionInputBody.md) + - [RunErrorData](docs/RunErrorData.md) + - [RunFinishedData](docs/RunFinishedData.md) + - [RunStartedData](docs/RunStartedData.md) - [SSOProvider](docs/SSOProvider.md) - [SSOProvidersOutputBody](docs/SSOProvidersOutputBody.md) - [SandboxConfig](docs/SandboxConfig.md) @@ -986,6 +1036,7 @@ Class | Method | HTTP request | Description - [ServerSentEventsInner1](docs/ServerSentEventsInner1.md) - [ServiceEntry](docs/ServiceEntry.md) - [SessionOutputBody](docs/SessionOutputBody.md) + - [SetBudgetInputBody](docs/SetBudgetInputBody.md) - [SignatureParameterEntry](docs/SignatureParameterEntry.md) - [SignatureParameterInput](docs/SignatureParameterInput.md) - [SignatureStorageEntry](docs/SignatureStorageEntry.md) @@ -997,6 +1048,8 @@ Class | Method | HTTP request | Description - [SoftwareTypeCountsBody](docs/SoftwareTypeCountsBody.md) - [SourceDeltaEvent](docs/SourceDeltaEvent.md) - [SourceResetEvent](docs/SourceResetEvent.md) + - [SpendBody](docs/SpendBody.md) + - [SseEventAgentRunUpdateData](docs/SseEventAgentRunUpdateData.md) - [SseEventContextCompactedData](docs/SseEventContextCompactedData.md) - [SseEventRunCancelledData](docs/SseEventRunCancelledData.md) - [SseEventRunErrorData](docs/SseEventRunErrorData.md) @@ -1024,6 +1077,8 @@ Class | Method | HTTP request | Description - [StatusInput](docs/StatusInput.md) - [StatusOutput](docs/StatusOutput.md) - [StatusResponse](docs/StatusResponse.md) + - [StepFinishedData](docs/StepFinishedData.md) + - [StepStartedData](docs/StepStartedData.md) - [StringFunctions](docs/StringFunctions.md) - [StringMatch](docs/StringMatch.md) - [StringMatchEvidence](docs/StringMatchEvidence.md) @@ -1050,25 +1105,32 @@ Class | Method | HTTP request | Description - [TagSearchResponse](docs/TagSearchResponse.md) - [TagSearchResult](docs/TagSearchResult.md) - [TagSearchResultBody](docs/TagSearchResultBody.md) - - [TaskResponse](docs/TaskResponse.md) - - [TaskStatus](docs/TaskStatus.md) - [TaskStatusResponse](docs/TaskStatusResponse.md) - [TcpCarvedFile](docs/TcpCarvedFile.md) - [Team](docs/Team.md) - [TeamMember](docs/TeamMember.md) - [Technique](docs/Technique.md) + - [TextMessageContentData](docs/TextMessageContentData.md) + - [TextMessageEndData](docs/TextMessageEndData.md) + - [TextMessageStartData](docs/TextMessageStartData.md) - [ThreatReportResult](docs/ThreatReportResult.md) - [TimestampModel](docs/TimestampModel.md) + - [TitleUpdatedData](docs/TitleUpdatedData.md) - [Token](docs/Token.md) - [TokenInputBody](docs/TokenInputBody.md) - [TokenResponse](docs/TokenResponse.md) - [TokenisedData](docs/TokenisedData.md) + - [ToolCallArgsDeltaData](docs/ToolCallArgsDeltaData.md) + - [ToolCallEndData](docs/ToolCallEndData.md) + - [ToolCallProgressData](docs/ToolCallProgressData.md) + - [ToolCallResultData](docs/ToolCallResultData.md) + - [ToolCallStartData](docs/ToolCallStartData.md) + - [ToolConfirmationRequiredData](docs/ToolConfirmationRequiredData.md) - [TriageFunction](docs/TriageFunction.md) - [TriageFunctionResponse](docs/TriageFunctionResponse.md) - [TriageReportResponse](docs/TriageReportResponse.md) - [TriageResult](docs/TriageResult.md) - [TriggerCryptoScanInputBody](docs/TriggerCryptoScanInputBody.md) - - [TriggerDynamicExecutionInputBody](docs/TriggerDynamicExecutionInputBody.md) - [TriggerExecutionExplainInputBody](docs/TriggerExecutionExplainInputBody.md) - [TriggerExecutionScanInputBody](docs/TriggerExecutionScanInputBody.md) - [TriggerFilesystemAnalyseInputBody](docs/TriggerFilesystemAnalyseInputBody.md) diff --git a/build.gradle b/build.gradle index da5732c4..76c2a180 100644 --- a/build.gradle +++ b/build.gradle @@ -19,7 +19,7 @@ apply plugin: 'java' apply plugin: 'com.diffplug.spotless' group = 'ai.reveng' -version = '4.74.3' +version = '4.75.0' @@ -174,7 +174,7 @@ mavenPublishing { // key, and signing without one fails the build. if (project.hasProperty("signingInMemoryKey")) signAllPublications() - coordinates("ai.reveng", "sdk", "4.74.3") + coordinates("ai.reveng", "sdk", "4.75.0") pom { name = "sdk" diff --git a/build.sbt b/build.sbt index 64f765b6..defdc1bd 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.74.3", + version := "4.75.0", scalaVersion := "2.11.12", scalacOptions ++= Seq("-feature"), compile / javacOptions ++= Seq("-Xlint:deprecation"), diff --git a/docs/ApiCombinationEvidence.md b/docs/APICombinationEvidence.md similarity index 97% rename from docs/ApiCombinationEvidence.md rename to docs/APICombinationEvidence.md index b3eb030a..adcf1d95 100644 --- a/docs/ApiCombinationEvidence.md +++ b/docs/APICombinationEvidence.md @@ -1,6 +1,6 @@ -# ApiCombinationEvidence +# APICombinationEvidence A known combination of APIs without a demonstrated semantic flow. diff --git a/docs/AccessRuleBody.md b/docs/AccessRuleBody.md new file mode 100644 index 00000000..91a7e884 --- /dev/null +++ b/docs/AccessRuleBody.md @@ -0,0 +1,27 @@ + + +# AccessRuleBody + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**permission** | [**PermissionEnum**](#PermissionEnum) | VIEW lets the principal read the analysis; EDIT also lets them modify it | | +|**teamId** | **Long** | The team the rule applies to. Set for a team rule | [optional] | +|**teamName** | **String** | The team's name. Set for a team rule | [optional] | +|**userId** | **Long** | The user the rule applies to. Set for a user rule | [optional] | +|**username** | **String** | The user's username. Set for a user rule | [optional] | + + + +## Enum: PermissionEnum + +| Name | Value | +|---- | -----| +| VIEW | "VIEW" | +| EDIT | "EDIT" | +| UNKNOWN_DEFAULT_OPEN_API | "unknown_default_open_api" | + + + diff --git a/docs/AgentBody.md b/docs/AgentBody.md new file mode 100644 index 00000000..f232fe97 --- /dev/null +++ b/docs/AgentBody.md @@ -0,0 +1,27 @@ + + +# AgentBody + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**name** | **String** | | | +|**slug** | **String** | Stable identifier of the agent. | | +|**state** | [**StateEnum**](#StateEnum) | | | + + + +## Enum: StateEnum + +| Name | Value | +|---- | -----| +| PENDING | "PENDING" | +| RUNNING | "RUNNING" | +| COMPLETED | "COMPLETED" | +| FAILED | "FAILED" | +| UNKNOWN_DEFAULT_OPEN_API | "unknown_default_open_api" | + + + diff --git a/docs/AnalyseCapabilitiesBody.md b/docs/AgentCompletedBody.md similarity index 52% rename from docs/AnalyseCapabilitiesBody.md rename to docs/AgentCompletedBody.md index d50beaac..90791865 100644 --- a/docs/AnalyseCapabilitiesBody.md +++ b/docs/AgentCompletedBody.md @@ -1,13 +1,13 @@ -# AnalyseCapabilitiesBody +# AgentCompletedBody ## Properties | Name | Type | Description | Notes | |------------ | ------------- | ------------- | -------------| -|**completed** | **Long** | ANALYSE_CAPABILITIES agent tasks completed that day | | +|**completed** | **Long** | Agent tasks completed that day | | diff --git a/docs/AgentRunBody.md b/docs/AgentRunBody.md new file mode 100644 index 00000000..ffbf08bb --- /dev/null +++ b/docs/AgentRunBody.md @@ -0,0 +1,21 @@ + + +# AgentRunBody + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**agent** | **AgentBody** | | | +|**analysisId** | **Long** | The earliest-added analysis of the file in the investigation that you may see. | | +|**binaryName** | **String** | | | +|**card** | **AgentRunCardBody** | A summary of the agent's result. Absent until the run is done, and when its result cannot be summarised. | [optional] | +|**createdAt** | **OffsetDateTime** | | | +|**error** | **String** | Why the run failed. Null unless it failed with a reason. | | +|**investigationId** | **Long** | | | +|**taskId** | **String** | | | +|**updatedAt** | **OffsetDateTime** | | | + + + diff --git a/docs/AgentRunCardBody.md b/docs/AgentRunCardBody.md new file mode 100644 index 00000000..5212a7d5 --- /dev/null +++ b/docs/AgentRunCardBody.md @@ -0,0 +1,15 @@ + + +# AgentRunCardBody + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**iocs** | **List<AgentRunIOCBody>** | | | +|**score** | **Double** | The agent's suspicion score from 0 to 1. Null when the agent gives none. | | +|**summary** | **String** | | | + + + diff --git a/docs/AgentRunIOCBody.md b/docs/AgentRunIOCBody.md new file mode 100644 index 00000000..0c8366c8 --- /dev/null +++ b/docs/AgentRunIOCBody.md @@ -0,0 +1,16 @@ + + +# AgentRunIOCBody + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**description** | **String** | | | +|**source** | **String** | Where in the binary the agent found the indicator. Empty when the agent gives no location. | | +|**type** | **String** | | | +|**value** | **String** | | | + + + diff --git a/docs/AgentRunUpdateAgent.md b/docs/AgentRunUpdateAgent.md new file mode 100644 index 00000000..a8efda21 --- /dev/null +++ b/docs/AgentRunUpdateAgent.md @@ -0,0 +1,27 @@ + + +# AgentRunUpdateAgent + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**name** | **String** | | | +|**slug** | **String** | Stable identifier of the agent. | | +|**state** | [**StateEnum**](#StateEnum) | | | + + + +## Enum: StateEnum + +| Name | Value | +|---- | -----| +| PENDING | "PENDING" | +| RUNNING | "RUNNING" | +| COMPLETED | "COMPLETED" | +| FAILED | "FAILED" | +| UNKNOWN_DEFAULT_OPEN_API | "unknown_default_open_api" | + + + diff --git a/docs/AgentRunUpdateCard.md b/docs/AgentRunUpdateCard.md new file mode 100644 index 00000000..5dbc345f --- /dev/null +++ b/docs/AgentRunUpdateCard.md @@ -0,0 +1,15 @@ + + +# AgentRunUpdateCard + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**iocs** | **List<AgentRunUpdateIOC>** | | | +|**score** | **Double** | The agent's suspicion score from 0 to 1. Null when the agent gives none. | | +|**summary** | **String** | | | + + + diff --git a/docs/AgentRunUpdateData.md b/docs/AgentRunUpdateData.md new file mode 100644 index 00000000..4071cd46 --- /dev/null +++ b/docs/AgentRunUpdateData.md @@ -0,0 +1,21 @@ + + +# AgentRunUpdateData + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**agent** | **AgentRunUpdateAgent** | | | +|**analysisId** | **Long** | The earliest-added analysis of the file in the investigation that the conversation's starter may see. | | +|**binaryName** | **String** | | | +|**card** | **AgentRunUpdateCard** | A summary of the agent's result. Absent until the run is done, and when its result cannot be summarised. | [optional] | +|**createdAt** | **OffsetDateTime** | | | +|**error** | **String** | Why the run failed. Null unless it failed with a reason. | | +|**investigationId** | **Long** | | | +|**taskId** | **String** | | | +|**updatedAt** | **OffsetDateTime** | | | + + + diff --git a/docs/AgentRunUpdateIOC.md b/docs/AgentRunUpdateIOC.md new file mode 100644 index 00000000..ec159d1e --- /dev/null +++ b/docs/AgentRunUpdateIOC.md @@ -0,0 +1,16 @@ + + +# AgentRunUpdateIOC + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**description** | **String** | | | +|**source** | **String** | Where in the binary the agent found the indicator. Empty when the agent gives no location. | | +|**type** | **String** | | | +|**value** | **String** | | | + + + diff --git a/docs/AgentStatusCountsBody.md b/docs/AgentStatusCountsBody.md new file mode 100644 index 00000000..77d78c01 --- /dev/null +++ b/docs/AgentStatusCountsBody.md @@ -0,0 +1,15 @@ + + +# AgentStatusCountsBody + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**agentsRunning** | **Long** | | | +|**complete** | **Long** | | | +|**queued** | **Long** | | | + + + diff --git a/docs/AnalysesCoreApi.md b/docs/AnalysesCoreApi.md index 467e7e1e..9b5a01b2 100644 --- a/docs/AnalysesCoreApi.md +++ b/docs/AnalysesCoreApi.md @@ -16,8 +16,6 @@ All URIs are relative to *https://api.reveng.ai* | [**getAnalysisLogs**](AnalysesCoreApi.md#getAnalysisLogs) | **GET** /v2/analyses/{analysis_id}/logs | Gets the logs of an analysis | | [**getAnalysisParams**](AnalysesCoreApi.md#getAnalysisParams) | **GET** /v2/analyses/{analysis_id}/params | Gets analysis param information | | [**getAnalysisStatus**](AnalysesCoreApi.md#getAnalysisStatus) | **GET** /v2/analyses/{analysis_id}/status | Gets the status of an analysis | -| [**getDynamicExecutionReport**](AnalysesCoreApi.md#getDynamicExecutionReport) | **GET** /v2/analyses/{analysis_id}/dynamic-execution/report | Get dynamic execution report | -| [**getDynamicExecutionStatus**](AnalysesCoreApi.md#getDynamicExecutionStatus) | **GET** /v2/analyses/{analysis_id}/dynamic-execution/status | Get dynamic execution status | | [**insertAnalysisLog**](AnalysesCoreApi.md#insertAnalysisLog) | **POST** /v2/analyses/{analysis_id}/logs | Insert a log entry for an analysis | | [**listAnalyses**](AnalysesCoreApi.md#listAnalyses) | **GET** /v2/analyses/list | Gets the most recent analyses | | [**lookupBinaryId**](AnalysesCoreApi.md#lookupBinaryId) | **GET** /v2/analyses/lookup/{binary_id} | Gets the analysis ID from binary ID | @@ -27,6 +25,7 @@ All URIs are relative to *https://api.reveng.ai* | [**updateAnalysis**](AnalysesCoreApi.md#updateAnalysis) | **PATCH** /v2/analyses/{analysis_id} | Update Analysis | | [**updateAnalysisTags**](AnalysesCoreApi.md#updateAnalysisTags) | **PATCH** /v2/analyses/{analysis_id}/tags | Update Analysis Tags | | [**uploadFile**](AnalysesCoreApi.md#uploadFile) | **POST** /v2/upload | Upload File | +| [**v3CreateAnalysis**](AnalysesCoreApi.md#v3CreateAnalysis) | **POST** /v3/analyses | Create an analysis | | [**v3DeleteAnalysis**](AnalysesCoreApi.md#v3DeleteAnalysis) | **DELETE** /v3/analyses/{analysis_id} | Delete an analysis. | | [**v3DownloadBinaryExport**](AnalysesCoreApi.md#v3DownloadBinaryExport) | **GET** /v3/analyses/{analysis_id}/binary-export | Download a binary export | | [**v3GetAnalysis**](AnalysesCoreApi.md#v3GetAnalysis) | **GET** /v3/analyses/{analysis_id} | Get an analysis. | @@ -49,7 +48,9 @@ All URIs are relative to *https://api.reveng.ai* | [**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. | +| [**v3GrantAnalysisAccess**](AnalysesCoreApi.md#v3GrantAnalysisAccess) | **POST** /v3/analyses/{analysis_id}/access-rules | Share an analysis with a user or team | | [**v3ListAnalyses**](AnalysesCoreApi.md#v3ListAnalyses) | **GET** /v3/analyses | List analyses | +| [**v3ListAnalysisAccessRules**](AnalysesCoreApi.md#v3ListAnalysisAccessRules) | **GET** /v3/analyses/{analysis_id}/access-rules | List who an analysis is shared with | | [**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. | @@ -58,6 +59,7 @@ All URIs are relative to *https://api.reveng.ai* | [**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 | +| [**v3RevokeAnalysisAccess**](AnalysesCoreApi.md#v3RevokeAnalysisAccess) | **DELETE** /v3/analyses/{analysis_id}/access-rules | Stop sharing an analysis with a user or team | | [**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 | @@ -986,159 +988,6 @@ public class Example { | **200** | Successful Response | - | | **422** | Invalid request parameters | - | - -# **getDynamicExecutionReport** -> AnalysisReport getDynamicExecutionReport(analysisId) - -Get dynamic execution report - -Returns the dynamic execution report JSON for the analysis. Requires the task to be in COMPLETED status. **Error codes:** - `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 { - AnalysisReport result = apiInstance.getDynamicExecutionReport(analysisId); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling AnalysesCoreApi#getDynamicExecutionReport"); - 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 | - | -| **409** | Conflict | - | -| **422** | Unprocessable Entity | - | -| **500** | Internal Server Error | - | - - -# **getDynamicExecutionStatus** -> DynamicExecutionStatusResponse getDynamicExecutionStatus(analysisId) - -Get dynamic execution status - -Returns the status of the most recent dynamic execution task for the analysis. Returns UNINITIALISED if no task has been started. **Error codes:** - `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 { - DynamicExecutionStatusResponse result = apiInstance.getDynamicExecutionStatus(analysisId); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling AnalysesCoreApi#getDynamicExecutionStatus"); - 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 - -[**DynamicExecutionStatusResponse**](DynamicExecutionStatusResponse.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 | - | -| **422** | Unprocessable Entity | - | -| **500** | Internal Server Error | - | - # **insertAnalysisLog** > BaseResponse insertAnalysisLog(analysisId, insertAnalysisLogRequest) @@ -1849,6 +1698,89 @@ public class Example { | **200** | Successful Response | - | | **422** | Invalid request parameters | - | + +# **v3CreateAnalysis** +> OperationCreateMetadataCreateResult v3CreateAnalysis(createRequest, xRevEngApplication) + +Create an analysis + +Queues a new Analysis for an uploaded Binary and returns the created Operation. **Error codes:** - `400` [`BAD_REQUEST`](/errors/BAD_REQUEST) — Bad Request - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `402` [`INSUFFICIENT_CREDITS`](/errors/INSUFFICIENT_CREDITS) — Insufficient Credits - `409` [`CONFLICT`](/errors/CONFLICT) — Conflict - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `413` [`REQUEST_ENTITY_TOO_LARGE`](/errors/REQUEST_ENTITY_TOO_LARGE) — Request Entity Too Large + +### 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); + CreateRequest createRequest = new CreateRequest(); // CreateRequest | + String xRevEngApplication = "xRevEngApplication_example"; // String | Identifies the calling RevEng application. Recorded on the Analysis log. + try { + OperationCreateMetadataCreateResult result = apiInstance.v3CreateAnalysis(createRequest, xRevEngApplication); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling AnalysesCoreApi#v3CreateAnalysis"); + 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 | +|------------- | ------------- | ------------- | -------------| +| **createRequest** | [**CreateRequest**](CreateRequest.md)| | | +| **xRevEngApplication** | **String**| Identifies the calling RevEng application. Recorded on the Analysis log. | [optional] | + +### 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 | - | +| **400** | Bad Request | - | +| **402** | Payment Required | - | +| **403** | Forbidden | - | +| **404** | Not Found | - | +| **409** | Conflict | - | +| **413** | Request Entity Too Large | - | +| **422** | Unprocessable Entity | - | +| **500** | Internal Server Error | - | + # **v3DeleteAnalysis** > v3DeleteAnalysis(analysisId) @@ -3573,6 +3505,85 @@ null (empty response body) | **422** | Unprocessable Entity | - | | **500** | Internal Server Error | - | + +# **v3GrantAnalysisAccess** +> v3GrantAnalysisAccess(analysisId, grantAccessInputBody) + +Share an analysis with a user or team + +Grants a user or a team access to the analysis. Sharing with a principal that already has a rule replaces its permission. The user or team must be one the caller can find through `GET /v3/principals`. The analysis owner cannot be the target of a rule. Requires edit access to the analysis. **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 + GrantAccessInputBody grantAccessInputBody = new GrantAccessInputBody(); // GrantAccessInputBody | + try { + apiInstance.v3GrantAnalysisAccess(analysisId, grantAccessInputBody); + } catch (ApiException e) { + System.err.println("Exception when calling AnalysesCoreApi#v3GrantAnalysisAccess"); + 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 | | +| **grantAccessInputBody** | [**GrantAccessInputBody**](GrantAccessInputBody.md)| | | + +### Return type + +null (empty response body) + +### Authorization + +[APIKey](../README.md#APIKey), [bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **204** | No Content | - | +| **400** | Bad Request | - | +| **403** | Forbidden | - | +| **404** | Not Found | - | +| **422** | Unprocessable Entity | - | +| **500** | Internal Server Error | - | + # **v3ListAnalyses** > ListAnalysesOutputBody v3ListAnalyses(searchTerm, analysisScope, status, modelName, usernames, sha256Hash, binaryId, platform, architecture, pageSize, nextPageToken, orderBy, order) @@ -3608,7 +3619,7 @@ public class Example { 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 analysisScope = Arrays.asList(); // List | Leave empty to search your own, your team's, all public analyses and those shared with you. SHARED_WITH_ME restricts to analyses another user or team gave you access to List status = Arrays.asList(); // List | List modelName = Arrays.asList(); // List | List usernames = Arrays.asList(); // List | @@ -3639,7 +3650,7 @@ 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] | +| **analysisScope** | [**List<String>**](String.md)| Leave empty to search your own, your team's, all public analyses and those shared with you. SHARED_WITH_ME restricts to analyses another user or team gave you access to | [optional] [enum: PRIVATE, PUBLIC, TEAM, SHARED_WITH_ME] | | **status** | [**List<String>**](String.md)| | [optional] [enum: Uploaded, Queued, Complete, Error, Processing] | | **modelName** | [**List<String>**](String.md)| | [optional] | | **usernames** | [**List<String>**](String.md)| | [optional] | @@ -3673,6 +3684,82 @@ public class Example { | **422** | Unprocessable Entity | - | | **500** | Internal Server Error | - | + +# **v3ListAnalysisAccessRules** +> ListAccessRulesOutputBody v3ListAnalysisAccessRules(analysisId) + +List who an analysis is shared with + +Returns the users and teams the analysis has been shared with and the permission each one holds. Requires read access to the analysis. **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 analysisId = 56L; // Long | Analysis ID + try { + ListAccessRulesOutputBody result = apiInstance.v3ListAnalysisAccessRules(analysisId); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling AnalysesCoreApi#v3ListAnalysisAccessRules"); + 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 + +[**ListAccessRulesOutputBody**](ListAccessRulesOutputBody.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 | - | + # **v3ListAnalysisGlobals** > ListAnalysisGlobalsOutputBody v3ListAnalysisGlobals(analysisId, page, pageSize, search, named, dataTypeId, valueKind, referenced, orderBy, sortOrder) @@ -4309,6 +4396,87 @@ public class Example { | **422** | Unprocessable Entity | - | | **500** | Internal Server Error | - | + +# **v3RevokeAnalysisAccess** +> v3RevokeAnalysisAccess(analysisId, userId, teamId) + +Stop sharing an analysis with a user or team + +Removes the access rule of one user or one team, identified by the `user_id` or `team_id` query parameter. Removing a rule that does not exist succeeds. Requires edit access to the analysis. **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 + Long userId = 56L; // Long | The user to stop sharing with. Exactly one of user_id and team_id is required + Long teamId = 56L; // Long | The team to stop sharing with. Exactly one of user_id and team_id is required + try { + apiInstance.v3RevokeAnalysisAccess(analysisId, userId, teamId); + } catch (ApiException e) { + System.err.println("Exception when calling AnalysesCoreApi#v3RevokeAnalysisAccess"); + 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 | | +| **userId** | **Long**| The user to stop sharing with. Exactly one of user_id and team_id is required | [optional] | +| **teamId** | **Long**| The team to stop sharing with. Exactly one of user_id and team_id is required | [optional] | + +### Return type + +null (empty response body) + +### Authorization + +[APIKey](../README.md#APIKey), [bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **204** | No Content | - | +| **400** | Bad Request | - | +| **403** | Forbidden | - | +| **404** | Not Found | - | +| **422** | Unprocessable Entity | - | +| **500** | Internal Server Error | - | + # **v3RunDynamicExecution** > OperationDynamicExecutionMetadataDynamicExecutionResult v3RunDynamicExecution(analysisId, runDynamicExecutionInputBody) diff --git a/docs/AnalysisCreateRequest.md b/docs/AnalysisCreateRequest.md index 3affb01b..9299ea52 100644 --- a/docs/AnalysisCreateRequest.md +++ b/docs/AnalysisCreateRequest.md @@ -15,7 +15,7 @@ |**debugHash** | **String** | Hash of the debug file | [optional] | |**analysisConfig** | [**AnalysisConfig**](AnalysisConfig.md) | The analysis config enables the configuration of optional analysis stages | [optional] | |**binaryConfig** | **BinaryConfig** | The binary config can override automatically determined values such as ISA, Platform, File Format, etc | [optional] | -|**autoRunAgents** | **AutoRunAgents** | | [optional] | +|**autoRunAgents** | [**AutoRunAgents**](AutoRunAgents.md) | | [optional] | diff --git a/docs/AnalysisDetailResponse.md b/docs/AnalysisDetailResponse.md index 323241da..2036dea0 100644 --- a/docs/AnalysisDetailResponse.md +++ b/docs/AnalysisDetailResponse.md @@ -21,7 +21,7 @@ |**debug** | **Boolean** | | | |**modelName** | **String** | | | |**sha256Hash** | **String** | | | -|**autoRunAgents** | **AutoRunAgents** | | | +|**autoRunAgents** | [**AutoRunAgents**](AutoRunAgents.md) | | | |**requestedConfig** | [**AnalysisConfigSnapshot**](AnalysisConfigSnapshot.md) | Snapshot of the configuration the analysis was submitted with. | | diff --git a/docs/AuthenticationUsersApi.md b/docs/AuthenticationUsersApi.md index 929d728a..b1d7be1d 100644 --- a/docs/AuthenticationUsersApi.md +++ b/docs/AuthenticationUsersApi.md @@ -9,6 +9,8 @@ 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 | +| [**v3ListPrincipals**](AuthenticationUsersApi.md#v3ListPrincipals) | **GET** /v3/principals | Search users and teams | +| [**v3ListTeams**](AuthenticationUsersApi.md#v3ListTeams) | **GET** /v3/teams | Search teams | | [**v3ListUsers**](AuthenticationUsersApi.md#v3ListUsers) | **GET** /v3/users | Search users | | [**v3SubmitUserFeedback**](AuthenticationUsersApi.md#v3SubmitUserFeedback) | **POST** /v3/users/feedback | Submit feedback | @@ -373,13 +375,161 @@ This endpoint does not need any parameter. | **200** | OK | - | | **0** | Error | - | + +# **v3ListPrincipals** +> ListPrincipalsOutputBody v3ListPrincipals(searchTerm) + +Search users and teams + +Returns up to 5 matching users and up to 5 matching teams whose name contains the search term (case-insensitive), scoped to the caller's organisation using the same rules as the individual user and team search endpoints. + +### 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 user's username or team's name contains (case-insensitive) + try { + ListPrincipalsOutputBody result = apiInstance.v3ListPrincipals(searchTerm); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling AuthenticationUsersApi#v3ListPrincipals"); + 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 user's username or team's name contains (case-insensitive) | | + +### Return type + +[**ListPrincipalsOutputBody**](ListPrincipalsOutputBody.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 | - | + + +# **v3ListTeams** +> ListTeamsOutputBody v3ListTeams(searchTerm) + +Search teams + +Returns up to 5 teams whose name contains the search term (case-insensitive). Returns every team in the caller's organisation, or — if the organisation is named \"Internal\" — only the teams the caller belongs to. + +### 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 team name contains (case-insensitive) + try { + ListTeamsOutputBody result = apiInstance.v3ListTeams(searchTerm); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling AuthenticationUsersApi#v3ListTeams"); + 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 team name contains (case-insensitive) | | + +### Return type + +[**ListTeamsOutputBody**](ListTeamsOutputBody.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 | - | + # **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. +Returns up to 5 active users in the caller's organisation whose username contains the search term (case-insensitive), with their ID and username, ordered by username. ### Example ```java diff --git a/docs/BaseResponseExternalResponse.md b/docs/BaseResponseExternalResponse.md deleted file mode 100644 index 4a6990d8..00000000 --- a/docs/BaseResponseExternalResponse.md +++ /dev/null @@ -1,17 +0,0 @@ - - -# BaseResponseExternalResponse - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**status** | **Boolean** | Response status on whether the request succeeded | [optional] | -|**data** | [**ExternalResponse**](ExternalResponse.md) | Response data | [optional] | -|**message** | **String** | Response message | [optional] | -|**errors** | [**List<ErrorModel>**](ErrorModel.md) | List of errors | [optional] | -|**meta** | [**MetaModel**](MetaModel.md) | Metadata | [optional] | - - - diff --git a/docs/BaseResponseStr.md b/docs/BaseResponseStr.md deleted file mode 100644 index 0b4c4e21..00000000 --- a/docs/BaseResponseStr.md +++ /dev/null @@ -1,17 +0,0 @@ - - -# BaseResponseStr - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**status** | **Boolean** | Response status on whether the request succeeded | [optional] | -|**data** | **String** | Response data | [optional] | -|**message** | **String** | Response message | [optional] | -|**errors** | [**List<ErrorModel>**](ErrorModel.md) | List of errors | [optional] | -|**meta** | [**MetaModel**](MetaModel.md) | Metadata | [optional] | - - - diff --git a/docs/BaseResponseTaskResponse.md b/docs/BaseResponseTaskResponse.md deleted file mode 100644 index ca9d0383..00000000 --- a/docs/BaseResponseTaskResponse.md +++ /dev/null @@ -1,17 +0,0 @@ - - -# BaseResponseTaskResponse - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**status** | **Boolean** | Response status on whether the request succeeded | [optional] | -|**data** | [**TaskResponse**](TaskResponse.md) | Response data | [optional] | -|**message** | **String** | Response message | [optional] | -|**errors** | [**List<ErrorModel>**](ErrorModel.md) | List of errors | [optional] | -|**meta** | [**MetaModel**](MetaModel.md) | Metadata | [optional] | - - - diff --git a/docs/BudgetBody.md b/docs/BudgetBody.md new file mode 100644 index 00000000..e70f754b --- /dev/null +++ b/docs/BudgetBody.md @@ -0,0 +1,15 @@ + + +# BudgetBody + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**creditBudget** | **Long** | The most credits the investigation may spend. Null when it has no limit. | | +|**creditsSpent** | **Double** | Credits spent on the investigation's conversations and the agents run from it. | | +|**spent** | **Boolean** | Whether the budget is spent, so nothing more that consumes credits can be started from the investigation. | | + + + diff --git a/docs/BulkAddTagsInputBody.md b/docs/BulkAddTagsInputBody.md index 65dc14d6..d7c7fab0 100644 --- a/docs/BulkAddTagsInputBody.md +++ b/docs/BulkAddTagsInputBody.md @@ -7,7 +7,7 @@ | Name | Type | Description | Notes | |------------ | ------------- | ------------- | -------------| -|**analysisIds** | **List<Long>** | IDs of the analyses to tag. The caller must own every one, or none are changed | | +|**analysisIds** | **List<Long>** | IDs of the analyses to tag. The caller must have write access to every one, or none are changed | | |**tags** | **List<String>** | Tags to add. A binary that already carries a tag, under any origin, is left as-is for that name | | diff --git a/docs/ContextCompactedData.md b/docs/ContextCompactedData.md new file mode 100644 index 00000000..4715a7d3 --- /dev/null +++ b/docs/ContextCompactedData.md @@ -0,0 +1,17 @@ + + +# ContextCompactedData + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**conversationUuid** | **String** | | [optional] | +|**messagesAfter** | **Integer** | | [optional] | +|**messagesBefore** | **Integer** | | [optional] | +|**removedTurns** | **Integer** | | [optional] | +|**strategy** | **String** | | [optional] | + + + diff --git a/docs/Conversation.md b/docs/Conversation.md index 8c8ce086..e49296b2 100644 --- a/docs/Conversation.md +++ b/docs/Conversation.md @@ -7,9 +7,10 @@ | Name | Type | Description | Notes | |------------ | ------------- | ------------- | -------------| -|**context** | **Object** | | [optional] | +|**context** | **ConversationContext** | The analysis, and optionally the function, the conversation is about. Absent when it is about neither. | [optional] | |**conversationUuid** | **String** | | | |**createdAt** | **OffsetDateTime** | | | +|**investigationId** | **Long** | The investigation the conversation belongs to. Absent for a conversation outside any investigation. | [optional] | |**title** | **String** | | | |**updatedAt** | **OffsetDateTime** | | | |**userId** | **Long** | | | diff --git a/docs/ConversationBody.md b/docs/ConversationBody.md new file mode 100644 index 00000000..25215d83 --- /dev/null +++ b/docs/ConversationBody.md @@ -0,0 +1,20 @@ + + +# ConversationBody + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**analysisId** | **Long** | The analysis the conversation is about. Null when it is about the whole investigation. | | +|**conversationUuid** | **String** | Use with the /v2/conversations endpoints to read, stream and send messages. | | +|**createdAt** | **OffsetDateTime** | | | +|**investigationId** | **Long** | | | +|**starterId** | **Long** | The user who started the conversation, and the only one who can send messages in it. | | +|**starterUsername** | **String** | | | +|**title** | **String** | | | +|**updatedAt** | **OffsetDateTime** | When the conversation was last active: its newest message or event, or a change such as a new title. | | + + + diff --git a/docs/ConversationWithEvents.md b/docs/ConversationWithEvents.md index d570b0ef..3420af4b 100644 --- a/docs/ConversationWithEvents.md +++ b/docs/ConversationWithEvents.md @@ -7,10 +7,11 @@ | Name | Type | Description | Notes | |------------ | ------------- | ------------- | -------------| -|**context** | **Object** | | [optional] | +|**context** | **ConversationContext** | The analysis, and optionally the function, the conversation is about. Absent when it is about neither. | [optional] | |**conversationUuid** | **String** | | | |**createdAt** | **OffsetDateTime** | | | |**events** | **List<Event>** | | | +|**investigationId** | **Long** | The investigation the conversation belongs to. Absent for a conversation outside any investigation. | [optional] | |**title** | **String** | | | |**updatedAt** | **OffsetDateTime** | | | |**userId** | **Long** | | | diff --git a/docs/ConversationsApi.md b/docs/ConversationsApi.md index 11563705..d2a8d3c4 100644 --- a/docs/ConversationsApi.md +++ b/docs/ConversationsApi.md @@ -19,7 +19,7 @@ All URIs are relative to *https://api.reveng.ai* Cancel an active run -Cancels the currently active agentic run for the given conversation. Returns 404 if no run is in progress. **Error codes:** - `400` [`INVALID_CONVERSATION_ID`](/errors/INVALID_CONVERSATION_ID) — Invalid Conversation ID - `404` [`CONVERSATION_NOT_FOUND`](/errors/CONVERSATION_NOT_FOUND) — Conversation Not Found - `404` [`NO_ACTIVE_RUN`](/errors/NO_ACTIVE_RUN) — No Active Run +Cancels the currently active agentic run for the given conversation. Returns 404 if no run is in progress. **Error codes:** - `400` [`INVALID_CONVERSATION_ID`](/errors/INVALID_CONVERSATION_ID) — Invalid Conversation ID - `404` [`CONVERSATION_NOT_FOUND`](/errors/CONVERSATION_NOT_FOUND) — Conversation Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `404` [`NO_ACTIVE_RUN`](/errors/NO_ACTIVE_RUN) — No Active Run ### Example ```java @@ -86,6 +86,7 @@ public class Example { |-------------|-------------|------------------| | **200** | OK | - | | **400** | Bad Request | - | +| **403** | Forbidden | - | | **404** | Not Found | - | | **422** | Unprocessable Entity | - | | **500** | Internal Server Error | - | @@ -96,7 +97,7 @@ public class Example { Approve or reject a pending tool confirmation -Responds to a pending tool confirmation request. The agent pauses before executing certain tools and emits a `TOOL_CONFIRMATION_REQUIRED` event. Use this endpoint to approve or reject the tool call. Returns 404 if no confirmation is pending. **Error codes:** - `400` [`INVALID_CONVERSATION_ID`](/errors/INVALID_CONVERSATION_ID) — Invalid Conversation ID - `404` [`CONVERSATION_NOT_FOUND`](/errors/CONVERSATION_NOT_FOUND) — Conversation Not Found - `404` [`NO_PENDING_CONFIRMATION`](/errors/NO_PENDING_CONFIRMATION) — No Pending Confirmation +Responds to a pending tool confirmation request. The agent pauses before executing certain tools and emits a `TOOL_CONFIRMATION_REQUIRED` event. Use this endpoint to approve or reject the tool call. Returns 404 if no confirmation is pending. **Error codes:** - `400` [`INVALID_CONVERSATION_ID`](/errors/INVALID_CONVERSATION_ID) — Invalid Conversation ID - `404` [`CONVERSATION_NOT_FOUND`](/errors/CONVERSATION_NOT_FOUND) — Conversation Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `404` [`NO_PENDING_CONFIRMATION`](/errors/NO_PENDING_CONFIRMATION) — No Pending Confirmation ### Example ```java @@ -165,6 +166,7 @@ public class Example { |-------------|-------------|------------------| | **200** | OK | - | | **400** | Bad Request | - | +| **403** | Forbidden | - | | **404** | Not Found | - | | **422** | Unprocessable Entity | - | | **500** | Internal Server Error | - | @@ -398,7 +400,7 @@ This endpoint does not need any parameter. Send a message and start an agentic run -Sends a user message to the conversation and kicks off an agentic processing loop in the background. Returns immediately with 202 Accepted. Subscribe to `/v2/conversations/{id}/events` via SSE to receive real-time updates including text deltas, tool calls, and run lifecycle events. **Error codes:** - `400` [`BAD_REQUEST`](/errors/BAD_REQUEST) — Bad Request - `400` [`INVALID_CONVERSATION_ID`](/errors/INVALID_CONVERSATION_ID) — Invalid Conversation ID - `404` [`CONVERSATION_NOT_FOUND`](/errors/CONVERSATION_NOT_FOUND) — Conversation Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `402` [`INSUFFICIENT_CREDITS`](/errors/INSUFFICIENT_CREDITS) — Insufficient Credits - `409` [`RUN_ALREADY_ACTIVE`](/errors/RUN_ALREADY_ACTIVE) — Run Already Active +Sends a user message to the conversation and kicks off an agentic processing loop in the background. Returns immediately with 202 Accepted. Subscribe to `/v2/conversations/{id}/events` via SSE to receive real-time updates including text deltas, tool calls, and run lifecycle events. **Error codes:** - `400` [`BAD_REQUEST`](/errors/BAD_REQUEST) — Bad Request - `400` [`INVALID_CONVERSATION_ID`](/errors/INVALID_CONVERSATION_ID) — Invalid Conversation ID - `404` [`CONVERSATION_NOT_FOUND`](/errors/CONVERSATION_NOT_FOUND) — Conversation Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `402` [`INSUFFICIENT_CREDITS`](/errors/INSUFFICIENT_CREDITS) — Insufficient Credits - `402` [`INVESTIGATION_BUDGET_SPENT`](/errors/INVESTIGATION_BUDGET_SPENT) — Investigation Budget Spent - `409` [`RUN_ALREADY_ACTIVE`](/errors/RUN_ALREADY_ACTIVE) — Run Already Active ### Example ```java diff --git a/docs/CreateConversationInputBody.md b/docs/CreateConversationInputBody.md new file mode 100644 index 00000000..b419455b --- /dev/null +++ b/docs/CreateConversationInputBody.md @@ -0,0 +1,14 @@ + + +# CreateConversationInputBody + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**analysisId** | **Long** | Scopes the conversation to one of the investigation's analyses. Omit it to cover the whole investigation. | [optional] | +|**title** | **String** | A title for the conversation. When empty, one is generated from the first message. | [optional] | + + + diff --git a/docs/CreateInvestigationInputBody.md b/docs/CreateInvestigationInputBody.md new file mode 100644 index 00000000..177ec5a4 --- /dev/null +++ b/docs/CreateInvestigationInputBody.md @@ -0,0 +1,49 @@ + + +# CreateInvestigationInputBody + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**caseType** | [**CaseTypeEnum**](#CaseTypeEnum) | | | +|**name** | **String** | Investigation name. Must contain a non-whitespace character. | | +|**scope** | [**ScopeEnum**](#ScopeEnum) | PRIVATE is visible only to you, TEAM to your whole team. Only you can modify it either way. | [optional] | +|**severity** | [**SeverityEnum**](#SeverityEnum) | Initial severity. | | + + + +## Enum: CaseTypeEnum + +| Name | Value | +|---- | -----| +| REVERSE_ENGINEERING | "REVERSE_ENGINEERING" | +| MALWARE_ANALYSIS | "MALWARE_ANALYSIS" | +| VULNERABILITY_DISCOVERY | "VULNERABILITY_DISCOVERY" | +| UNKNOWN_DEFAULT_OPEN_API | "unknown_default_open_api" | + + + +## Enum: ScopeEnum + +| Name | Value | +|---- | -----| +| PRIVATE | "PRIVATE" | +| TEAM | "TEAM" | +| UNKNOWN_DEFAULT_OPEN_API | "unknown_default_open_api" | + + + +## Enum: SeverityEnum + +| Name | Value | +|---- | -----| +| CRITICAL | "CRITICAL" | +| HIGH | "HIGH" | +| MEDIUM | "MEDIUM" | +| LOW | "LOW" | +| UNKNOWN_DEFAULT_OPEN_API | "unknown_default_open_api" | + + + diff --git a/docs/CreateRequest.md b/docs/CreateRequest.md index 2dce8d28..7b7aba72 100644 --- a/docs/CreateRequest.md +++ b/docs/CreateRequest.md @@ -9,10 +9,11 @@ |------------ | ------------- | ------------- | -------------| |**analysisConfig** | **Config** | | [optional] | |**analysisScope** | [**AnalysisScopeEnum**](#AnalysisScopeEnum) | | [optional] | -|**autoRunAgents** | **AutoRunAgents** | | [optional] | |**binaryConfig** | **BinaryConfig** | | [optional] | |**debugHash** | **String** | | [optional] | |**filename** | **String** | | | +|**investigationId** | **Long** | Adds the new analysis to this investigation, which you must own. | [optional] | +|**operations** | **List<RequestedOperation>** | Operations to run automatically once the analysis completes. Each operation's prerequisites must also be requested. | [optional] | |**sha256Hash** | **String** | | | |**symbols** | **Symbols** | | [optional] | |**tags** | **List<String>** | | [optional] | diff --git a/docs/DataTypeFunctionEntry.md b/docs/DataTypeFunctionEntry.md index 69b9e31e..d724de43 100644 --- a/docs/DataTypeFunctionEntry.md +++ b/docs/DataTypeFunctionEntry.md @@ -9,6 +9,18 @@ |------------ | ------------- | ------------- | -------------| |**functionId** | **Long** | | | |**functionName** | **String** | Current name of the function. | | +|**usageKinds** | [**List<UsageKindsEnum>**](#List<UsageKindsEnum>) | How the function uses the type, each listed once, in alphabetical order: signature (its return type or a parameter type), inline (its AI decompilation names the type in its code), member (its AI decompilation reads a struct or union member of this type, or it references a global variable of this type). | | + + + +## Enum: List<UsageKindsEnum> + +| Name | Value | +|---- | -----| +| SIGNATURE | "signature" | +| INLINE | "inline" | +| MEMBER | "member" | +| UNKNOWN_DEFAULT_OPEN_API | "unknown_default_open_api" | diff --git a/docs/DataTypesApi.md b/docs/DataTypesApi.md index a9e1c1ad..d7073465 100644 --- a/docs/DataTypesApi.md +++ b/docs/DataTypesApi.md @@ -596,7 +596,7 @@ public class Example { List the functions using a data type -Functions that use this data type as their return type or as a parameter. Matches the `data_type_id` exactly as it appears in the signature, so a function taking `sockaddr_in *` matches the pointer type rather than `sockaddr_in`. Ordered by function ID. There is no total count; page with `after_function_id`. **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 +Functions that use this data type, each listed once with how it uses it in `usage_kinds`: in its signature (return or parameter type), in-line (its AI decompilation names the type in its code), or as a member (its AI decompilation reads a struct or union member of this type, or it references a global variable of this type). A function using a pointer to, typedef of or array of the type uses the type too, so a function taking `sockaddr_in *` is listed under `sockaddr_in`. The reverse does not hold: a function using `sockaddr_in` is not listed under `sockaddr_in *`. In-line and member uses come from a function's latest AI decompilation, so a function not decompiled since this was introduced shows only its signature and global variable uses. Ordered by function ID. There is no total count; page with `after_function_id`. **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/DynamicExecutionStatusResponse.md b/docs/DynamicExecutionStatusResponse.md deleted file mode 100644 index 39bada65..00000000 --- a/docs/DynamicExecutionStatusResponse.md +++ /dev/null @@ -1,28 +0,0 @@ - - -# DynamicExecutionStatusResponse - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**errorMessage** | **String** | Error detail, set when status is FAILED | [optional] | -|**logs** | **AnalysisLogs** | Sandbox status log messages captured during the run. Empty when none have been captured yet. | | -|**status** | [**StatusEnum**](#StatusEnum) | Task status | | - - - -## 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/EntityRef.md b/docs/EntityRef.md new file mode 100644 index 00000000..9b16dd54 --- /dev/null +++ b/docs/EntityRef.md @@ -0,0 +1,15 @@ + + +# EntityRef + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**id** | **Long** | | | +|**name** | **String** | | [optional] | +|**vaddr** | **Long** | | [optional] | + + + diff --git a/docs/EntityUpdate.md b/docs/EntityUpdate.md new file mode 100644 index 00000000..8f8f3ab0 --- /dev/null +++ b/docs/EntityUpdate.md @@ -0,0 +1,15 @@ + + +# EntityUpdate + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**ids** | **List<Long>** | | [optional] | +|**refs** | **List<EntityRef>** | | [optional] | +|**type** | **String** | | [optional] | + + + diff --git a/docs/ErrorBody.md b/docs/ErrorBody.md index dc0b1d67..767da579 100644 --- a/docs/ErrorBody.md +++ b/docs/ErrorBody.md @@ -43,6 +43,7 @@ | INVALID_CREDENTIALS | "INVALID_CREDENTIALS" | | INVALID_INVITE_CODE | "INVALID_INVITE_CODE" | | INVALID_RESET_CODE | "INVALID_RESET_CODE" | +| INVESTIGATION_BUDGET_SPENT | "INVESTIGATION_BUDGET_SPENT" | | LAST_ORG_OWNER | "LAST_ORG_OWNER" | | LAST_TEAM_ADMIN | "LAST_TEAM_ADMIN" | | LAST_TEAM_MEMBER | "LAST_TEAM_MEMBER" | diff --git a/docs/Event.md b/docs/Event.md index 85620c79..7eac66aa 100644 --- a/docs/Event.md +++ b/docs/Event.md @@ -9,11 +9,37 @@ |------------ | ------------- | ------------- | -------------| |**conversationUuid** | **String** | | | |**createdAt** | **OffsetDateTime** | | | -|**data** | **Object** | | | +|**data** | [**EventData**](EventData.md) | | | |**eventId** | **Long** | | | |**role** | **Integer** | | | |**tokensUsed** | **Long** | | | -|**type** | **Integer** | | | +|**type** | [**TypeEnum**](#TypeEnum) | The event type, which decides the shape of data: 1 RUN_STARTED, 2 RUN_FINISHED, 3 RUN_ERROR, 4 STEP_STARTED, 5 STEP_FINISHED, 6 TEXT_MESSAGE_START, 7 TEXT_MESSAGE_CONTENT, 8 TEXT_MESSAGE_END, 9 TOOL_CALL_START, 10 TOOL_CALL_ARGS_DELTA, 11 TOOL_CALL_END, 12 TOOL_CALL_RESULT, 13 TITLE_UPDATED, 14 RUN_CANCELLED, 15 CONTEXT_COMPACTED, 16 TOOL_CONFIRMATION_REQUIRED, 19 TOOL_CALL_PROGRESS, 20 AGENT_RUN_UPDATE. | | + + + +## Enum: TypeEnum + +| Name | Value | +|---- | -----| +| NUMBER_1 | 1 | +| NUMBER_2 | 2 | +| NUMBER_3 | 3 | +| NUMBER_4 | 4 | +| NUMBER_5 | 5 | +| NUMBER_6 | 6 | +| NUMBER_7 | 7 | +| NUMBER_8 | 8 | +| NUMBER_9 | 9 | +| NUMBER_10 | 10 | +| NUMBER_11 | 11 | +| NUMBER_12 | 12 | +| NUMBER_13 | 13 | +| NUMBER_14 | 14 | +| NUMBER_15 | 15 | +| NUMBER_16 | 16 | +| NUMBER_19 | 19 | +| NUMBER_20 | 20 | +| NUMBER_unknown_default_open_api | 11184809 | diff --git a/docs/EventAGENTRUNUPDATE.md b/docs/EventAGENTRUNUPDATE.md new file mode 100644 index 00000000..16fd87ca --- /dev/null +++ b/docs/EventAGENTRUNUPDATE.md @@ -0,0 +1,25 @@ + + +# EventAGENTRUNUPDATE + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**data** | **SseEventAgentRunUpdateData** | | | +|**event** | [**EventEnum**](#EventEnum) | The event name. | | +|**id** | **Integer** | The event ID. | [optional] | +|**retry** | **Integer** | The retry time in milliseconds. | [optional] | + + + +## Enum: EventEnum + +| Name | Value | +|---- | -----| +| AGENT_RUN_UPDATE | "AGENT_RUN_UPDATE" | +| UNKNOWN_DEFAULT_OPEN_API | "unknown_default_open_api" | + + + diff --git a/docs/EventData.md b/docs/EventData.md new file mode 100644 index 00000000..491ae903 --- /dev/null +++ b/docs/EventData.md @@ -0,0 +1,43 @@ + + +# EventData + +The payload of the event type in type. + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**conversationUuid** | **String** | | [optional] | +|**definitionName** | **String** | | [optional] | +|**inputTokens** | **Integer** | | [optional] | +|**outputTokens** | **Integer** | | [optional] | +|**totalTokens** | **Integer** | | [optional] | +|**error** | **String** | Why the run failed. Null unless it failed with a reason. | | +|**stepIndex** | **Integer** | | [optional] | +|**finishReason** | **String** | | [optional] | +|**messageId** | **String** | | [optional] | +|**delta** | **String** | | [optional] | +|**toolArgs** | **String** | | [optional] | +|**toolCallId** | **String** | | [optional] | +|**toolName** | **String** | | [optional] | +|**isError** | **Boolean** | | [optional] | +|**result** | **String** | | [optional] | +|**updated** | **List<EntityUpdate>** | | [optional] | +|**title** | **String** | | [optional] | +|**messagesAfter** | **Integer** | | [optional] | +|**messagesBefore** | **Integer** | | [optional] | +|**removedTurns** | **Integer** | | [optional] | +|**strategy** | **String** | | [optional] | +|**message** | **String** | | [optional] | +|**agent** | **AgentRunUpdateAgent** | | | +|**analysisId** | **Long** | The earliest-added analysis of the file in the investigation that the conversation's starter may see. | | +|**binaryName** | **String** | | | +|**card** | **AgentRunUpdateCard** | A summary of the agent's result. Absent until the run is done, and when its result cannot be summarised. | [optional] | +|**createdAt** | **OffsetDateTime** | | | +|**investigationId** | **Long** | | | +|**taskId** | **String** | | | +|**updatedAt** | **OffsetDateTime** | | | + + + diff --git a/docs/ExternalResponse.md b/docs/ExternalResponse.md deleted file mode 100644 index 9b65c9b1..00000000 --- a/docs/ExternalResponse.md +++ /dev/null @@ -1,15 +0,0 @@ - - -# ExternalResponse - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**sha256Hash** | **String** | | | -|**data** | **Map<String, Object>** | | | -|**lastUpdated** | **OffsetDateTime** | | | - - - diff --git a/docs/ExternalSourcesApi.md b/docs/ExternalSourcesApi.md index 8eb03d5f..5059c0bb 100644 --- a/docs/ExternalSourcesApi.md +++ b/docs/ExternalSourcesApi.md @@ -4,231 +4,10 @@ All URIs are relative to *https://api.reveng.ai* | Method | HTTP request | Description | |------------- | ------------- | -------------| -| [**createExternalTaskVt**](ExternalSourcesApi.md#createExternalTaskVt) | **POST** /v2/analysis/{analysis_id}/external/vt | Pulls data from VirusTotal | -| [**getVtData**](ExternalSourcesApi.md#getVtData) | **GET** /v2/analysis/{analysis_id}/external/vt | Get VirusTotal data | -| [**getVtTaskStatus**](ExternalSourcesApi.md#getVtTaskStatus) | **GET** /v2/analysis/{analysis_id}/external/vt/status | Check the status of VirusTotal data retrieval | | [**v3GetVirustotalScanOperation**](ExternalSourcesApi.md#v3GetVirustotalScanOperation) | **GET** /v3/operations/virustotal-scan/{binary_id} | Get a VirusTotal scan operation. | | [**v3RunVirustotalScan**](ExternalSourcesApi.md#v3RunVirustotalScan) | **POST** /v3/binaries/{binary_id}/virustotal-scan:run | Trigger a VirusTotal lookup for a binary. | - -# **createExternalTaskVt** -> BaseResponseStr createExternalTaskVt(analysisId) - -Pulls data from VirusTotal - -### 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.ExternalSourcesApi; - -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"); - - ExternalSourcesApi apiInstance = new ExternalSourcesApi(defaultClient); - Integer analysisId = 56; // Integer | - try { - BaseResponseStr result = apiInstance.createExternalTaskVt(analysisId); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling ExternalSourcesApi#createExternalTaskVt"); - 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** | **Integer**| | | - -### Return type - -[**BaseResponseStr**](BaseResponseStr.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** | Successful Response | - | -| **422** | Invalid request parameters | - | -| **409** | Request already queued | - | - - -# **getVtData** -> BaseResponseExternalResponse getVtData(analysisId) - -Get VirusTotal data - -### 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.ExternalSourcesApi; - -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"); - - ExternalSourcesApi apiInstance = new ExternalSourcesApi(defaultClient); - Integer analysisId = 56; // Integer | - try { - BaseResponseExternalResponse result = apiInstance.getVtData(analysisId); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling ExternalSourcesApi#getVtData"); - 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** | **Integer**| | | - -### Return type - -[**BaseResponseExternalResponse**](BaseResponseExternalResponse.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** | Successful Response | - | -| **422** | Invalid request parameters | - | -| **404** | No data retrieved from VirusTotal for the given analysis_id | - | - - -# **getVtTaskStatus** -> BaseResponseTaskResponse getVtTaskStatus(analysisId) - -Check the status of VirusTotal data retrieval - -### 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.ExternalSourcesApi; - -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"); - - ExternalSourcesApi apiInstance = new ExternalSourcesApi(defaultClient); - Integer analysisId = 56; // Integer | - try { - BaseResponseTaskResponse result = apiInstance.getVtTaskStatus(analysisId); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling ExternalSourcesApi#getVtTaskStatus"); - 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** | **Integer**| | | - -### Return type - -[**BaseResponseTaskResponse**](BaseResponseTaskResponse.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** | Successful Response | - | -| **422** | Invalid request parameters | - | - # **v3GetVirustotalScanOperation** > OperationVirusTotalScanMetadataVirusTotalScanResult v3GetVirustotalScanOperation(binaryId) diff --git a/docs/ExtractedBinary.md b/docs/ExtractedBinary.md index 5007c162..63aef9a8 100644 --- a/docs/ExtractedBinary.md +++ b/docs/ExtractedBinary.md @@ -8,7 +8,7 @@ | Name | Type | Description | Notes | |------------ | ------------- | ------------- | -------------| |**filename** | **String** | Original filename inside the upload | | -|**sha256Hash** | **String** | Content hash of the recovered binary | | +|**sha256Hash** | **String** | Content hash of the recovered file | | |**size** | **Long** | File size (in bytes) | | diff --git a/docs/FindingBody.md b/docs/FindingBody.md new file mode 100644 index 00000000..830eef17 --- /dev/null +++ b/docs/FindingBody.md @@ -0,0 +1,45 @@ + + +# FindingBody + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**createdAt** | **OffsetDateTime** | | | +|**details** | **Map<String, Object>** | Fields specific to the finding type. An IOC has kind and value, a capability has name, a vulnerability has optional cve, cwe and location, and a cross-file flow has steps. | | +|**findingId** | **Long** | | | +|**findingType** | [**FindingTypeEnum**](#FindingTypeEnum) | | | +|**investigationId** | **Long** | | | +|**severity** | [**SeverityEnum**](#SeverityEnum) | | | +|**source** | **String** | The agent or tool that produced the finding. | | +|**summary** | **String** | | | +|**title** | **String** | | | + + + +## Enum: FindingTypeEnum + +| Name | Value | +|---- | -----| +| IOC | "IOC" | +| CAPABILITY | "CAPABILITY" | +| VULNERABILITY | "VULNERABILITY" | +| CROSS_FILE_FLOW | "CROSS_FILE_FLOW" | +| UNKNOWN_DEFAULT_OPEN_API | "unknown_default_open_api" | + + + +## Enum: SeverityEnum + +| Name | Value | +|---- | -----| +| CRITICAL | "CRITICAL" | +| HIGH | "HIGH" | +| MEDIUM | "MEDIUM" | +| LOW | "LOW" | +| UNKNOWN_DEFAULT_OPEN_API | "unknown_default_open_api" | + + + diff --git a/docs/FindingCountsBody.md b/docs/FindingCountsBody.md new file mode 100644 index 00000000..e8c52d0f --- /dev/null +++ b/docs/FindingCountsBody.md @@ -0,0 +1,17 @@ + + +# FindingCountsBody + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**critical** | **Long** | | | +|**high** | **Long** | | | +|**low** | **Long** | | | +|**medium** | **Long** | | | +|**total** | **Long** | | | + + + diff --git a/docs/FunctionsAiDecompilationApi.md b/docs/FunctionsAiDecompilationApi.md index 9eefe976..89750b16 100644 --- a/docs/FunctionsAiDecompilationApi.md +++ b/docs/FunctionsAiDecompilationApi.md @@ -31,7 +31,7 @@ All URIs are relative to *https://api.reveng.ai* # **createAiDecompilation** -> CreateAIDecompOutputBody createAiDecompilation(functionId, temperature, typeSuggestions, naming, applyTypes) +> CreateAIDecompOutputBody createAiDecompilation(functionId, temperature, typeSuggestions, naming, applyTypes, repair, refine) Start AI decompilation @@ -68,8 +68,10 @@ public class Example { 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. + Boolean repair = false; // Boolean | Ask a language model to replace any unmatched placeholders left in the decompilation with grounded code. Off unless requested: the pass spends several model calls on top of the decompilation, and declines outright unless it can ground every placeholder. Runs after the result is stored, so it amends a decompilation you can already read. Cannot enable the pass when the server has it off. + Boolean refine = false; // Boolean | Ask a language model to rebuild output the decompiler returned degenerate, truncated or empty, and output a requested repair pass declined. Off unless requested: the pass is a bounded tool loop that can spend a dozen model calls. Runs after the result is stored, so it amends a decompilation you can already read. Cannot enable the pass when the server has it off. try { - CreateAIDecompOutputBody result = apiInstance.createAiDecompilation(functionId, temperature, typeSuggestions, naming, applyTypes); + CreateAIDecompOutputBody result = apiInstance.createAiDecompilation(functionId, temperature, typeSuggestions, naming, applyTypes, repair, refine); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling FunctionsAiDecompilationApi#createAiDecompilation"); @@ -91,6 +93,8 @@ public class Example { | **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] | +| **repair** | **Boolean**| Ask a language model to replace any unmatched placeholders left in the decompilation with grounded code. Off unless requested: the pass spends several model calls on top of the decompilation, and declines outright unless it can ground every placeholder. Runs after the result is stored, so it amends a decompilation you can already read. Cannot enable the pass when the server has it off. | [optional] [default to false] | +| **refine** | **Boolean**| Ask a language model to rebuild output the decompiler returned degenerate, truncated or empty, and output a requested repair pass declined. Off unless requested: the pass is a bounded tool loop that can spend a dozen model calls. Runs after the result is stored, so it amends a decompilation you can already read. Cannot enable the pass when the server has it off. | [optional] [default to false] | ### Return type diff --git a/docs/GetFindingOutputBody.md b/docs/GetFindingOutputBody.md new file mode 100644 index 00000000..0c5a84a1 --- /dev/null +++ b/docs/GetFindingOutputBody.md @@ -0,0 +1,46 @@ + + +# GetFindingOutputBody + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**analysisIds** | **List<Long>** | Analyses the finding was derived from that you are permitted to see. | | +|**createdAt** | **OffsetDateTime** | | | +|**details** | **Map<String, Object>** | Fields specific to the finding type. An IOC has kind and value, a capability has name, a vulnerability has optional cve, cwe and location, and a cross-file flow has steps. | | +|**findingId** | **Long** | | | +|**findingType** | [**FindingTypeEnum**](#FindingTypeEnum) | | | +|**investigationId** | **Long** | | | +|**severity** | [**SeverityEnum**](#SeverityEnum) | | | +|**source** | **String** | The agent or tool that produced the finding. | | +|**summary** | **String** | | | +|**title** | **String** | | | + + + +## Enum: FindingTypeEnum + +| Name | Value | +|---- | -----| +| IOC | "IOC" | +| CAPABILITY | "CAPABILITY" | +| VULNERABILITY | "VULNERABILITY" | +| CROSS_FILE_FLOW | "CROSS_FILE_FLOW" | +| UNKNOWN_DEFAULT_OPEN_API | "unknown_default_open_api" | + + + +## Enum: SeverityEnum + +| Name | Value | +|---- | -----| +| CRITICAL | "CRITICAL" | +| HIGH | "HIGH" | +| MEDIUM | "MEDIUM" | +| LOW | "LOW" | +| UNKNOWN_DEFAULT_OPEN_API | "unknown_default_open_api" | + + + diff --git a/docs/GetInvestigationOutputBody.md b/docs/GetInvestigationOutputBody.md new file mode 100644 index 00000000..db2fb397 --- /dev/null +++ b/docs/GetInvestigationOutputBody.md @@ -0,0 +1,71 @@ + + +# GetInvestigationOutputBody + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**analysisIds** | **List<Long>** | Analyses in the investigation that you are permitted to see. | | +|**budget** | **BudgetBody** | | | +|**caseType** | [**CaseTypeEnum**](#CaseTypeEnum) | | | +|**createdAt** | **OffsetDateTime** | | | +|**investigationId** | **Long** | | | +|**name** | **String** | | | +|**ownerId** | **Long** | | | +|**ownerUsername** | **String** | | | +|**rollup** | **RollupBody** | | | +|**scope** | [**ScopeEnum**](#ScopeEnum) | | | +|**severity** | [**SeverityEnum**](#SeverityEnum) | | | +|**status** | [**StatusEnum**](#StatusEnum) | | | +|**teamId** | **Long** | Team the investigation belongs to; 0 when its owner had no team | | +|**updatedAt** | **OffsetDateTime** | | | + + + +## Enum: CaseTypeEnum + +| Name | Value | +|---- | -----| +| REVERSE_ENGINEERING | "REVERSE_ENGINEERING" | +| MALWARE_ANALYSIS | "MALWARE_ANALYSIS" | +| VULNERABILITY_DISCOVERY | "VULNERABILITY_DISCOVERY" | +| UNKNOWN_DEFAULT_OPEN_API | "unknown_default_open_api" | + + + +## Enum: ScopeEnum + +| Name | Value | +|---- | -----| +| PRIVATE | "PRIVATE" | +| TEAM | "TEAM" | +| UNKNOWN_DEFAULT_OPEN_API | "unknown_default_open_api" | + + + +## Enum: SeverityEnum + +| Name | Value | +|---- | -----| +| CRITICAL | "CRITICAL" | +| HIGH | "HIGH" | +| MEDIUM | "MEDIUM" | +| LOW | "LOW" | +| UNKNOWN_DEFAULT_OPEN_API | "unknown_default_open_api" | + + + +## Enum: StatusEnum + +| Name | Value | +|---- | -----| +| OPEN | "OPEN" | +| IN_PROGRESS | "IN_PROGRESS" | +| ON_HOLD | "ON_HOLD" | +| CLOSED | "CLOSED" | +| UNKNOWN_DEFAULT_OPEN_API | "unknown_default_open_api" | + + + diff --git a/docs/GetMatchesStatusOutputBody.md b/docs/GetMatchesStatusOutputBody.md index abad88e2..4ed5f0c8 100644 --- a/docs/GetMatchesStatusOutputBody.md +++ b/docs/GetMatchesStatusOutputBody.md @@ -7,6 +7,7 @@ | Name | Type | Description | Notes | |------------ | ------------- | ------------- | -------------| +|**completedAt** | **OffsetDateTime** | When this run last completed. Absent until status=COMPLETED. | [optional] | |**messages** | **List<ProgressMessage>** | Log messages emitted during execution | | |**percent** | **Long** | Overall completion as a percentage, weighted by step duration | | |**status** | [**StatusEnum**](#StatusEnum) | Current workflow status | | diff --git a/docs/GrantAccessInputBody.md b/docs/GrantAccessInputBody.md new file mode 100644 index 00000000..43527a7e --- /dev/null +++ b/docs/GrantAccessInputBody.md @@ -0,0 +1,25 @@ + + +# GrantAccessInputBody + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**permission** | [**PermissionEnum**](#PermissionEnum) | The level of access to grant | | +|**teamId** | **Long** | The team to share with. Exactly one of user_id and team_id is required | [optional] | +|**userId** | **Long** | The user to share with. Exactly one of user_id and team_id is required | [optional] | + + + +## Enum: PermissionEnum + +| Name | Value | +|---- | -----| +| VIEW | "VIEW" | +| EDIT | "EDIT" | +| UNKNOWN_DEFAULT_OPEN_API | "unknown_default_open_api" | + + + diff --git a/docs/IamUsersApi.md b/docs/IamUsersApi.md index 4dce5dc9..f70800d7 100644 --- a/docs/IamUsersApi.md +++ b/docs/IamUsersApi.md @@ -31,6 +31,12 @@ public class Example { 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"); @@ -59,7 +65,7 @@ This endpoint does not need any parameter. ### Authorization -[bearerAuth](../README.md#bearerAuth) +[APIKey](../README.md#APIKey), [bearerAuth](../README.md#bearerAuth) ### HTTP request headers @@ -96,6 +102,12 @@ public class Example { 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"); @@ -124,7 +136,7 @@ This endpoint does not need any parameter. ### Authorization -[bearerAuth](../README.md#bearerAuth) +[APIKey](../README.md#APIKey), [bearerAuth](../README.md#bearerAuth) ### HTTP request headers diff --git a/docs/ImportedApiCallEvidence.md b/docs/ImportedAPICallEvidence.md similarity index 97% rename from docs/ImportedApiCallEvidence.md rename to docs/ImportedAPICallEvidence.md index 51eaf10f..8dbddf1a 100644 --- a/docs/ImportedApiCallEvidence.md +++ b/docs/ImportedAPICallEvidence.md @@ -1,6 +1,6 @@ -# ImportedApiCallEvidence +# ImportedAPICallEvidence Imported API calls observed in the program. diff --git a/docs/InvestigationBody.md b/docs/InvestigationBody.md new file mode 100644 index 00000000..dfd72dcf --- /dev/null +++ b/docs/InvestigationBody.md @@ -0,0 +1,68 @@ + + +# InvestigationBody + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**caseType** | [**CaseTypeEnum**](#CaseTypeEnum) | | | +|**createdAt** | **OffsetDateTime** | | | +|**investigationId** | **Long** | | | +|**name** | **String** | | | +|**ownerId** | **Long** | | | +|**ownerUsername** | **String** | | | +|**scope** | [**ScopeEnum**](#ScopeEnum) | | | +|**severity** | [**SeverityEnum**](#SeverityEnum) | | | +|**status** | [**StatusEnum**](#StatusEnum) | | | +|**teamId** | **Long** | Team the investigation belongs to; 0 when its owner had no team | | +|**updatedAt** | **OffsetDateTime** | | | + + + +## Enum: CaseTypeEnum + +| Name | Value | +|---- | -----| +| REVERSE_ENGINEERING | "REVERSE_ENGINEERING" | +| MALWARE_ANALYSIS | "MALWARE_ANALYSIS" | +| VULNERABILITY_DISCOVERY | "VULNERABILITY_DISCOVERY" | +| UNKNOWN_DEFAULT_OPEN_API | "unknown_default_open_api" | + + + +## Enum: ScopeEnum + +| Name | Value | +|---- | -----| +| PRIVATE | "PRIVATE" | +| TEAM | "TEAM" | +| UNKNOWN_DEFAULT_OPEN_API | "unknown_default_open_api" | + + + +## Enum: SeverityEnum + +| Name | Value | +|---- | -----| +| CRITICAL | "CRITICAL" | +| HIGH | "HIGH" | +| MEDIUM | "MEDIUM" | +| LOW | "LOW" | +| UNKNOWN_DEFAULT_OPEN_API | "unknown_default_open_api" | + + + +## Enum: StatusEnum + +| Name | Value | +|---- | -----| +| OPEN | "OPEN" | +| IN_PROGRESS | "IN_PROGRESS" | +| ON_HOLD | "ON_HOLD" | +| CLOSED | "CLOSED" | +| UNKNOWN_DEFAULT_OPEN_API | "unknown_default_open_api" | + + + diff --git a/docs/InvestigationListItemBody.md b/docs/InvestigationListItemBody.md new file mode 100644 index 00000000..442f1dcb --- /dev/null +++ b/docs/InvestigationListItemBody.md @@ -0,0 +1,70 @@ + + +# InvestigationListItemBody + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**budget** | **BudgetBody** | | | +|**caseType** | [**CaseTypeEnum**](#CaseTypeEnum) | | | +|**createdAt** | **OffsetDateTime** | | | +|**investigationId** | **Long** | | | +|**name** | **String** | | | +|**ownerId** | **Long** | | | +|**ownerUsername** | **String** | | | +|**rollup** | **RollupBody** | | | +|**scope** | [**ScopeEnum**](#ScopeEnum) | | | +|**severity** | [**SeverityEnum**](#SeverityEnum) | | | +|**status** | [**StatusEnum**](#StatusEnum) | | | +|**teamId** | **Long** | Team the investigation belongs to; 0 when its owner had no team | | +|**updatedAt** | **OffsetDateTime** | | | + + + +## Enum: CaseTypeEnum + +| Name | Value | +|---- | -----| +| REVERSE_ENGINEERING | "REVERSE_ENGINEERING" | +| MALWARE_ANALYSIS | "MALWARE_ANALYSIS" | +| VULNERABILITY_DISCOVERY | "VULNERABILITY_DISCOVERY" | +| UNKNOWN_DEFAULT_OPEN_API | "unknown_default_open_api" | + + + +## Enum: ScopeEnum + +| Name | Value | +|---- | -----| +| PRIVATE | "PRIVATE" | +| TEAM | "TEAM" | +| UNKNOWN_DEFAULT_OPEN_API | "unknown_default_open_api" | + + + +## Enum: SeverityEnum + +| Name | Value | +|---- | -----| +| CRITICAL | "CRITICAL" | +| HIGH | "HIGH" | +| MEDIUM | "MEDIUM" | +| LOW | "LOW" | +| UNKNOWN_DEFAULT_OPEN_API | "unknown_default_open_api" | + + + +## Enum: StatusEnum + +| Name | Value | +|---- | -----| +| OPEN | "OPEN" | +| IN_PROGRESS | "IN_PROGRESS" | +| ON_HOLD | "ON_HOLD" | +| CLOSED | "CLOSED" | +| UNKNOWN_DEFAULT_OPEN_API | "unknown_default_open_api" | + + + diff --git a/docs/InvestigationsApi.md b/docs/InvestigationsApi.md new file mode 100644 index 00000000..9b6a686b --- /dev/null +++ b/docs/InvestigationsApi.md @@ -0,0 +1,983 @@ +# InvestigationsApi + +All URIs are relative to *https://api.reveng.ai* + +| Method | HTTP request | Description | +|------------- | ------------- | -------------| +| [**v3CreateInvestigation**](InvestigationsApi.md#v3CreateInvestigation) | **POST** /v3/investigations | Create an investigation. | +| [**v3CreateInvestigationConversation**](InvestigationsApi.md#v3CreateInvestigationConversation) | **POST** /v3/investigations/{investigation_id}/conversations | Start a conversation in an investigation. | +| [**v3DeleteInvestigation**](InvestigationsApi.md#v3DeleteInvestigation) | **DELETE** /v3/investigations/{investigation_id} | Delete an investigation. | +| [**v3GetInvestigation**](InvestigationsApi.md#v3GetInvestigation) | **GET** /v3/investigations/{investigation_id} | Get an investigation. | +| [**v3GetInvestigationFinding**](InvestigationsApi.md#v3GetInvestigationFinding) | **GET** /v3/investigations/{investigation_id}/findings/{finding_id} | Get a finding of an investigation. | +| [**v3ListInvestigationAgentRuns**](InvestigationsApi.md#v3ListInvestigationAgentRuns) | **GET** /v3/investigations/agent-runs | List agent runs on investigations. | +| [**v3ListInvestigationConversations**](InvestigationsApi.md#v3ListInvestigationConversations) | **GET** /v3/investigations/{investigation_id}/conversations | List the conversations of an investigation. | +| [**v3ListInvestigationFindings**](InvestigationsApi.md#v3ListInvestigationFindings) | **GET** /v3/investigations/{investigation_id}/findings | List the findings of an investigation. | +| [**v3ListInvestigationSpend**](InvestigationsApi.md#v3ListInvestigationSpend) | **GET** /v3/investigations/{investigation_id}/spend | List what an investigation spent. | +| [**v3ListInvestigations**](InvestigationsApi.md#v3ListInvestigations) | **GET** /v3/investigations | List investigations. | +| [**v3PatchInvestigation**](InvestigationsApi.md#v3PatchInvestigation) | **PATCH** /v3/investigations/{investigation_id} | Update an investigation. | +| [**v3SetInvestigationBudget**](InvestigationsApi.md#v3SetInvestigationBudget) | **PUT** /v3/investigations/{investigation_id}/budget | Set the budget of an investigation. | + + + +# **v3CreateInvestigation** +> InvestigationBody v3CreateInvestigation(createInvestigationInputBody) + +Create an investigation. + +Creates an investigation owned by the caller, initially open and empty. **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.InvestigationsApi; + +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"); + + InvestigationsApi apiInstance = new InvestigationsApi(defaultClient); + CreateInvestigationInputBody createInvestigationInputBody = new CreateInvestigationInputBody(); // CreateInvestigationInputBody | + try { + InvestigationBody result = apiInstance.v3CreateInvestigation(createInvestigationInputBody); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling InvestigationsApi#v3CreateInvestigation"); + 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 | +|------------- | ------------- | ------------- | -------------| +| **createInvestigationInputBody** | [**CreateInvestigationInputBody**](CreateInvestigationInputBody.md)| | | + +### Return type + +[**InvestigationBody**](InvestigationBody.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 | - | +| **422** | Unprocessable Entity | - | +| **500** | Internal Server Error | - | + + +# **v3CreateInvestigationConversation** +> ConversationBody v3CreateInvestigationConversation(investigationId, createConversationInputBody) + +Start a conversation in an investigation. + +Starts a chat conversation held by the investigation, about the whole investigation or about one of its analyses. Anyone who can see the investigation can start one. Read it, stream it and send messages in it with the /v2/conversations endpoints; only the user who started it can send messages in it. Deleting the investigation deletes its conversations. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `422` [`VALIDATION_FAILED`](/errors/VALIDATION_FAILED) — Validation Failed + +### Example +```java +// Import classes: +import ai.reveng.invoker.ApiClient; +import ai.reveng.invoker.ApiException; +import ai.reveng.invoker.Configuration; +import ai.reveng.invoker.auth.*; +import ai.reveng.invoker.models.*; +import ai.reveng.api.InvestigationsApi; + +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"); + + InvestigationsApi apiInstance = new InvestigationsApi(defaultClient); + Long investigationId = 56L; // Long | + CreateConversationInputBody createConversationInputBody = new CreateConversationInputBody(); // CreateConversationInputBody | + try { + ConversationBody result = apiInstance.v3CreateInvestigationConversation(investigationId, createConversationInputBody); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling InvestigationsApi#v3CreateInvestigationConversation"); + 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 | +|------------- | ------------- | ------------- | -------------| +| **investigationId** | **Long**| | | +| **createConversationInputBody** | [**CreateConversationInputBody**](CreateConversationInputBody.md)| | | + +### Return type + +[**ConversationBody**](ConversationBody.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 | - | +| **404** | Not Found | - | +| **422** | Unprocessable Entity | - | +| **500** | Internal Server Error | - | + + +# **v3DeleteInvestigation** +> v3DeleteInvestigation(investigationId) + +Delete an investigation. + +Deletes an investigation and its links to analyses. The analyses themselves are not deleted. Only the owner can delete an investigation. **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.InvestigationsApi; + +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"); + + InvestigationsApi apiInstance = new InvestigationsApi(defaultClient); + Long investigationId = 56L; // Long | + try { + apiInstance.v3DeleteInvestigation(investigationId); + } catch (ApiException e) { + System.err.println("Exception when calling InvestigationsApi#v3DeleteInvestigation"); + 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 | +|------------- | ------------- | ------------- | -------------| +| **investigationId** | **Long**| | | + +### Return type + +null (empty response body) + +### Authorization + +[APIKey](../README.md#APIKey), [bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **204** | No Content | - | +| **403** | Forbidden | - | +| **404** | Not Found | - | +| **422** | Unprocessable Entity | - | +| **500** | Internal Server Error | - | + + +# **v3GetInvestigation** +> GetInvestigationOutputBody v3GetInvestigation(investigationId) + +Get an investigation. + +Gets a single investigation, including the IDs of the analyses in it that the caller may see. **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.InvestigationsApi; + +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"); + + InvestigationsApi apiInstance = new InvestigationsApi(defaultClient); + Long investigationId = 56L; // Long | + try { + GetInvestigationOutputBody result = apiInstance.v3GetInvestigation(investigationId); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling InvestigationsApi#v3GetInvestigation"); + 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 | +|------------- | ------------- | ------------- | -------------| +| **investigationId** | **Long**| | | + +### Return type + +[**GetInvestigationOutputBody**](GetInvestigationOutputBody.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 | - | + + +# **v3GetInvestigationFinding** +> GetFindingOutputBody v3GetInvestigationFinding(investigationId, findingId) + +Get a finding of an investigation. + +Gets a single finding, including the IDs of the analyses it was derived from that the caller may see. **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.InvestigationsApi; + +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"); + + InvestigationsApi apiInstance = new InvestigationsApi(defaultClient); + Long investigationId = 56L; // Long | + Long findingId = 56L; // Long | + try { + GetFindingOutputBody result = apiInstance.v3GetInvestigationFinding(investigationId, findingId); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling InvestigationsApi#v3GetInvestigationFinding"); + 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 | +|------------- | ------------- | ------------- | -------------| +| **investigationId** | **Long**| | | +| **findingId** | **Long**| | | + +### Return type + +[**GetFindingOutputBody**](GetFindingOutputBody.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 | - | + + +# **v3ListInvestigationAgentRuns** +> ListAgentRunsOutputBody v3ListInvestigationAgentRuns(investigationId, ownerId, status, severity, search, limit, offset) + +List agent runs on investigations. + +Lists the runs of agents on the files of the investigations you can see, most recently updated first, each with a summary of its result once it is done. A run on a file held by several investigations is listed once for each. Only files you may see are included. Supports narrowing to one investigation, filtering by the investigations' owner, status, severity and name, and pagination. **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.InvestigationsApi; + +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"); + + InvestigationsApi apiInstance = new InvestigationsApi(defaultClient); + Long investigationId = 0L; // Long | Only return runs on the files of this investigation. 0 returns runs across every investigation you can see. + List ownerId = Arrays.asList(); // List | Only return runs in investigations owned by one of these user IDs. + List status = Arrays.asList(); // List | Only return runs in investigations in one of these statuses. + List severity = Arrays.asList(); // List | Only return runs in investigations with one of these severities. + String search = "search_example"; // String | Only return runs in investigations whose name contains this text, ignoring case. + Long limit = 20L; // Long | + Long offset = 0L; // Long | + try { + ListAgentRunsOutputBody result = apiInstance.v3ListInvestigationAgentRuns(investigationId, ownerId, status, severity, search, limit, offset); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling InvestigationsApi#v3ListInvestigationAgentRuns"); + 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 | +|------------- | ------------- | ------------- | -------------| +| **investigationId** | **Long**| Only return runs on the files of this investigation. 0 returns runs across every investigation you can see. | [optional] [default to 0] | +| **ownerId** | [**List<Long>**](Long.md)| Only return runs in investigations owned by one of these user IDs. | [optional] | +| **status** | [**List<String>**](String.md)| Only return runs in investigations in one of these statuses. | [optional] [enum: OPEN, IN_PROGRESS, ON_HOLD, CLOSED] | +| **severity** | [**List<String>**](String.md)| Only return runs in investigations with one of these severities. | [optional] [enum: CRITICAL, HIGH, MEDIUM, LOW] | +| **search** | **String**| Only return runs in investigations whose name contains this text, ignoring case. | [optional] | +| **limit** | **Long**| | [optional] [default to 20] | +| **offset** | **Long**| | [optional] [default to 0] | + +### Return type + +[**ListAgentRunsOutputBody**](ListAgentRunsOutputBody.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 | - | + + +# **v3ListInvestigationConversations** +> ListConversationsOutputBody v3ListInvestigationConversations(investigationId, limit, offset) + +List the conversations of an investigation. + +Lists the chat conversations held by the investigation, whoever started them, most recently active first. Visible to anyone who can see the investigation. Supports pagination. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `422` [`VALIDATION_FAILED`](/errors/VALIDATION_FAILED) — Validation Failed + +### Example +```java +// Import classes: +import ai.reveng.invoker.ApiClient; +import ai.reveng.invoker.ApiException; +import ai.reveng.invoker.Configuration; +import ai.reveng.invoker.auth.*; +import ai.reveng.invoker.models.*; +import ai.reveng.api.InvestigationsApi; + +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"); + + InvestigationsApi apiInstance = new InvestigationsApi(defaultClient); + Long investigationId = 56L; // Long | + Long limit = 20L; // Long | + Long offset = 0L; // Long | + try { + ListConversationsOutputBody result = apiInstance.v3ListInvestigationConversations(investigationId, limit, offset); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling InvestigationsApi#v3ListInvestigationConversations"); + 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 | +|------------- | ------------- | ------------- | -------------| +| **investigationId** | **Long**| | | +| **limit** | **Long**| | [optional] [default to 20] | +| **offset** | **Long**| | [optional] [default to 0] | + +### Return type + +[**ListConversationsOutputBody**](ListConversationsOutputBody.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 | - | + + +# **v3ListInvestigationFindings** +> ListFindingsOutputBody v3ListInvestigationFindings(investigationId, findingType, severity, limit, offset) + +List the findings of an investigation. + +Lists what the investigation has found, most severe first and then most recent first. Visible to anyone who can see the investigation. Supports filtering by finding type and severity, and pagination. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `422` [`VALIDATION_FAILED`](/errors/VALIDATION_FAILED) — Validation Failed + +### Example +```java +// Import classes: +import ai.reveng.invoker.ApiClient; +import ai.reveng.invoker.ApiException; +import ai.reveng.invoker.Configuration; +import ai.reveng.invoker.auth.*; +import ai.reveng.invoker.models.*; +import ai.reveng.api.InvestigationsApi; + +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"); + + InvestigationsApi apiInstance = new InvestigationsApi(defaultClient); + Long investigationId = 56L; // Long | + List findingType = Arrays.asList(); // List | Only return findings of one of these types. + List severity = Arrays.asList(); // List | Only return findings with one of these severities. + Long limit = 20L; // Long | + Long offset = 0L; // Long | + try { + ListFindingsOutputBody result = apiInstance.v3ListInvestigationFindings(investigationId, findingType, severity, limit, offset); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling InvestigationsApi#v3ListInvestigationFindings"); + 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 | +|------------- | ------------- | ------------- | -------------| +| **investigationId** | **Long**| | | +| **findingType** | [**List<String>**](String.md)| Only return findings of one of these types. | [optional] [enum: IOC, CAPABILITY, VULNERABILITY, CROSS_FILE_FLOW] | +| **severity** | [**List<String>**](String.md)| Only return findings with one of these severities. | [optional] [enum: CRITICAL, HIGH, MEDIUM, LOW] | +| **limit** | **Long**| | [optional] [default to 20] | +| **offset** | **Long**| | [optional] [default to 0] | + +### Return type + +[**ListFindingsOutputBody**](ListFindingsOutputBody.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 | - | + + +# **v3ListInvestigationSpend** +> ListSpendOutputBody v3ListInvestigationSpend(investigationId, limit, offset) + +List what an investigation spent. + +Lists the credits charged for the investigation's conversation turns and the agents run from it, newest first. Visible to anyone who can see the investigation. Supports pagination. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `422` [`VALIDATION_FAILED`](/errors/VALIDATION_FAILED) — Validation Failed + +### Example +```java +// Import classes: +import ai.reveng.invoker.ApiClient; +import ai.reveng.invoker.ApiException; +import ai.reveng.invoker.Configuration; +import ai.reveng.invoker.auth.*; +import ai.reveng.invoker.models.*; +import ai.reveng.api.InvestigationsApi; + +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"); + + InvestigationsApi apiInstance = new InvestigationsApi(defaultClient); + Long investigationId = 56L; // Long | + Long limit = 20L; // Long | + Long offset = 0L; // Long | + try { + ListSpendOutputBody result = apiInstance.v3ListInvestigationSpend(investigationId, limit, offset); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling InvestigationsApi#v3ListInvestigationSpend"); + 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 | +|------------- | ------------- | ------------- | -------------| +| **investigationId** | **Long**| | | +| **limit** | **Long**| | [optional] [default to 20] | +| **offset** | **Long**| | [optional] [default to 0] | + +### Return type + +[**ListSpendOutputBody**](ListSpendOutputBody.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 | - | + + +# **v3ListInvestigations** +> ListInvestigationsOutputBody v3ListInvestigations(status, severity, caseType, ownerId, search, orderBy, order, limit, offset) + +List investigations. + +Lists the investigations the caller owns or that are shared with the caller's team, most recently updated first by default. Supports filtering by status, severity, case type and owner, a name search, and pagination. **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.InvestigationsApi; + +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"); + + InvestigationsApi apiInstance = new InvestigationsApi(defaultClient); + List status = Arrays.asList(); // List | Only return investigations in one of these statuses. + List severity = Arrays.asList(); // List | Only return investigations with one of these severities. + List caseType = Arrays.asList(); // List | Only return investigations of one of these case types. + List ownerId = Arrays.asList(); // List | Only return investigations owned by one of these user IDs. + String search = "search_example"; // String | Only return investigations whose name contains this text, ignoring case. + String orderBy = "updated"; // String | + String order = "ASC"; // String | + Long limit = 20L; // Long | + Long offset = 0L; // Long | + try { + ListInvestigationsOutputBody result = apiInstance.v3ListInvestigations(status, severity, caseType, ownerId, search, orderBy, order, limit, offset); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling InvestigationsApi#v3ListInvestigations"); + 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 | +|------------- | ------------- | ------------- | -------------| +| **status** | [**List<String>**](String.md)| Only return investigations in one of these statuses. | [optional] [enum: OPEN, IN_PROGRESS, ON_HOLD, CLOSED] | +| **severity** | [**List<String>**](String.md)| Only return investigations with one of these severities. | [optional] [enum: CRITICAL, HIGH, MEDIUM, LOW] | +| **caseType** | [**List<String>**](String.md)| Only return investigations of one of these case types. | [optional] [enum: REVERSE_ENGINEERING, MALWARE_ANALYSIS, VULNERABILITY_DISCOVERY] | +| **ownerId** | [**List<Long>**](Long.md)| Only return investigations owned by one of these user IDs. | [optional] | +| **search** | **String**| Only return investigations whose name contains this text, ignoring case. | [optional] | +| **orderBy** | **String**| | [optional] [default to updated] [enum: updated, created, name] | +| **order** | **String**| | [optional] [default to DESC] [enum: ASC, DESC] | +| **limit** | **Long**| | [optional] [default to 20] | +| **offset** | **Long**| | [optional] [default to 0] | + +### Return type + +[**ListInvestigationsOutputBody**](ListInvestigationsOutputBody.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 | - | + + +# **v3PatchInvestigation** +> InvestigationBody v3PatchInvestigation(investigationId, patchInvestigationInputBody) + +Update an investigation. + +Updates an investigation's name, case type, severity, status and/or scope. Omitted fields keep their existing values. Only the owner can update an investigation. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `422` [`VALIDATION_FAILED`](/errors/VALIDATION_FAILED) — Validation Failed + +### Example +```java +// Import classes: +import ai.reveng.invoker.ApiClient; +import ai.reveng.invoker.ApiException; +import ai.reveng.invoker.Configuration; +import ai.reveng.invoker.auth.*; +import ai.reveng.invoker.models.*; +import ai.reveng.api.InvestigationsApi; + +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"); + + InvestigationsApi apiInstance = new InvestigationsApi(defaultClient); + Long investigationId = 56L; // Long | + PatchInvestigationInputBody patchInvestigationInputBody = new PatchInvestigationInputBody(); // PatchInvestigationInputBody | + try { + InvestigationBody result = apiInstance.v3PatchInvestigation(investigationId, patchInvestigationInputBody); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling InvestigationsApi#v3PatchInvestigation"); + 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 | +|------------- | ------------- | ------------- | -------------| +| **investigationId** | **Long**| | | +| **patchInvestigationInputBody** | [**PatchInvestigationInputBody**](PatchInvestigationInputBody.md)| | | + +### Return type + +[**InvestigationBody**](InvestigationBody.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 | - | +| **403** | Forbidden | - | +| **404** | Not Found | - | +| **422** | Unprocessable Entity | - | +| **500** | Internal Server Error | - | + + +# **v3SetInvestigationBudget** +> BudgetBody v3SetInvestigationBudget(investigationId, setBudgetInputBody) + +Set the budget of an investigation. + +Sets the most credits the investigation may spend on its conversations and the agents run from it, or removes the limit with null. Once the budget is spent, no new message or agent run is started from the investigation; work already under way finishes, so spend can go a little past the budget. Only the owner can set the budget. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `422` [`VALIDATION_FAILED`](/errors/VALIDATION_FAILED) — Validation Failed + +### Example +```java +// Import classes: +import ai.reveng.invoker.ApiClient; +import ai.reveng.invoker.ApiException; +import ai.reveng.invoker.Configuration; +import ai.reveng.invoker.auth.*; +import ai.reveng.invoker.models.*; +import ai.reveng.api.InvestigationsApi; + +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"); + + InvestigationsApi apiInstance = new InvestigationsApi(defaultClient); + Long investigationId = 56L; // Long | + SetBudgetInputBody setBudgetInputBody = new SetBudgetInputBody(); // SetBudgetInputBody | + try { + BudgetBody result = apiInstance.v3SetInvestigationBudget(investigationId, setBudgetInputBody); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling InvestigationsApi#v3SetInvestigationBudget"); + 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 | +|------------- | ------------- | ------------- | -------------| +| **investigationId** | **Long**| | | +| **setBudgetInputBody** | [**SetBudgetInputBody**](SetBudgetInputBody.md)| | | + +### Return type + +[**BudgetBody**](BudgetBody.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 | - | +| **403** | Forbidden | - | +| **404** | Not Found | - | +| **422** | Unprocessable Entity | - | +| **500** | Internal Server Error | - | + diff --git a/docs/ListAccessRulesOutputBody.md b/docs/ListAccessRulesOutputBody.md new file mode 100644 index 00000000..b6e242cb --- /dev/null +++ b/docs/ListAccessRulesOutputBody.md @@ -0,0 +1,13 @@ + + +# ListAccessRulesOutputBody + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**rules** | **List<AccessRuleBody>** | Every user and team the analysis is shared with, oldest first | | + + + diff --git a/docs/ListAgentRunsOutputBody.md b/docs/ListAgentRunsOutputBody.md new file mode 100644 index 00000000..cd3b39b6 --- /dev/null +++ b/docs/ListAgentRunsOutputBody.md @@ -0,0 +1,15 @@ + + +# ListAgentRunsOutputBody + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**hasNextPage** | **Boolean** | | | +|**results** | **List<AgentRunBody>** | | | +|**totalCount** | **Long** | Runs matching the filters across all pages. | | + + + diff --git a/docs/ListConversationsOutputBody.md b/docs/ListConversationsOutputBody.md new file mode 100644 index 00000000..445d5a27 --- /dev/null +++ b/docs/ListConversationsOutputBody.md @@ -0,0 +1,15 @@ + + +# ListConversationsOutputBody + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**hasNextPage** | **Boolean** | | | +|**results** | **List<ConversationBody>** | | | +|**totalCount** | **Long** | Conversations in the investigation across all pages. | | + + + diff --git a/docs/ListFindingsOutputBody.md b/docs/ListFindingsOutputBody.md new file mode 100644 index 00000000..23b739d7 --- /dev/null +++ b/docs/ListFindingsOutputBody.md @@ -0,0 +1,15 @@ + + +# ListFindingsOutputBody + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**hasNextPage** | **Boolean** | | | +|**results** | **List<FindingBody>** | | | +|**totalCount** | **Long** | Findings matching the filters across all pages. | | + + + diff --git a/docs/ListInvestigationsOutputBody.md b/docs/ListInvestigationsOutputBody.md new file mode 100644 index 00000000..0d6c7464 --- /dev/null +++ b/docs/ListInvestigationsOutputBody.md @@ -0,0 +1,16 @@ + + +# ListInvestigationsOutputBody + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**agentStatusCounts** | **AgentStatusCountsBody** | Open investigations you can see at each agent status, whatever the filters and page. | | +|**hasNextPage** | **Boolean** | | | +|**results** | **List<InvestigationListItemBody>** | | | +|**totalCount** | **Long** | Investigations matching the filters across all pages. | | + + + diff --git a/docs/ListPrincipalsOutputBody.md b/docs/ListPrincipalsOutputBody.md new file mode 100644 index 00000000..631e8a5c --- /dev/null +++ b/docs/ListPrincipalsOutputBody.md @@ -0,0 +1,13 @@ + + +# ListPrincipalsOutputBody + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**results** | **List<PrincipalBody>** | Up to 5 matching users followed by up to 5 matching teams, each ordered by name | | + + + diff --git a/docs/ListSpendOutputBody.md b/docs/ListSpendOutputBody.md new file mode 100644 index 00000000..51db669a --- /dev/null +++ b/docs/ListSpendOutputBody.md @@ -0,0 +1,15 @@ + + +# ListSpendOutputBody + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**hasNextPage** | **Boolean** | | | +|**results** | **List<SpendBody>** | | | +|**totalCount** | **Long** | Spend records across all pages. | | + + + diff --git a/docs/ListTeamsOutputBody.md b/docs/ListTeamsOutputBody.md index c83a5d40..c1dba8c8 100644 --- a/docs/ListTeamsOutputBody.md +++ b/docs/ListTeamsOutputBody.md @@ -7,8 +7,7 @@ | Name | Type | Description | Notes | |------------ | ------------- | ------------- | -------------| -|**teams** | **List<Team>** | | | -|**total** | **Long** | | | +|**results** | **List<PublicTeamBody>** | Up to 5 matching teams, ordered by name | | diff --git a/docs/OrganisationIssuer.md b/docs/OrganisationIssuer.md index 0e55e838..b8b7091b 100644 --- a/docs/OrganisationIssuer.md +++ b/docs/OrganisationIssuer.md @@ -11,7 +11,7 @@ |**createdAt** | **OffsetDateTime** | | | |**enabled** | **Boolean** | | | |**issuerUrl** | **String** | Search is applied to string value | | -|**jwksUri** | **String** | JSON Web Key Set URI discovered from the issuer's OIDC configuration. Populated automatically during issuer registration. | [optional] | +|**jwksUri** | **String** | JSON Web Key Set URI discovered from the issuer's OIDC configuration. Populated automatically during issuer registration. | | |**organisationId** | **Long** | | | |**organisationIssuerId** | **Long** | | | |**updatedAt** | **OffsetDateTime** | | | diff --git a/docs/PatchInvestigationInputBody.md b/docs/PatchInvestigationInputBody.md new file mode 100644 index 00000000..b181080c --- /dev/null +++ b/docs/PatchInvestigationInputBody.md @@ -0,0 +1,62 @@ + + +# PatchInvestigationInputBody + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**caseType** | [**CaseTypeEnum**](#CaseTypeEnum) | New case type. Omit to keep the existing one. | [optional] | +|**name** | **String** | New name. Omit to keep the existing one. | [optional] | +|**scope** | [**ScopeEnum**](#ScopeEnum) | New scope. Omit to keep the existing one. | [optional] | +|**severity** | [**SeverityEnum**](#SeverityEnum) | New severity. Omit to keep the existing one. | [optional] | +|**status** | [**StatusEnum**](#StatusEnum) | New status. Omit to keep the existing one. | [optional] | + + + +## Enum: CaseTypeEnum + +| Name | Value | +|---- | -----| +| REVERSE_ENGINEERING | "REVERSE_ENGINEERING" | +| MALWARE_ANALYSIS | "MALWARE_ANALYSIS" | +| VULNERABILITY_DISCOVERY | "VULNERABILITY_DISCOVERY" | +| UNKNOWN_DEFAULT_OPEN_API | "unknown_default_open_api" | + + + +## Enum: ScopeEnum + +| Name | Value | +|---- | -----| +| PRIVATE | "PRIVATE" | +| TEAM | "TEAM" | +| UNKNOWN_DEFAULT_OPEN_API | "unknown_default_open_api" | + + + +## Enum: SeverityEnum + +| Name | Value | +|---- | -----| +| CRITICAL | "CRITICAL" | +| HIGH | "HIGH" | +| MEDIUM | "MEDIUM" | +| LOW | "LOW" | +| UNKNOWN_DEFAULT_OPEN_API | "unknown_default_open_api" | + + + +## Enum: StatusEnum + +| Name | Value | +|---- | -----| +| OPEN | "OPEN" | +| IN_PROGRESS | "IN_PROGRESS" | +| ON_HOLD | "ON_HOLD" | +| CLOSED | "CLOSED" | +| UNKNOWN_DEFAULT_OPEN_API | "unknown_default_open_api" | + + + diff --git a/docs/PrincipalBody.md b/docs/PrincipalBody.md new file mode 100644 index 00000000..8fee5a1a --- /dev/null +++ b/docs/PrincipalBody.md @@ -0,0 +1,25 @@ + + +# PrincipalBody + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**id** | **Long** | The user or team's ID | | +|**name** | **String** | The user's username or the team's name | | +|**type** | [**TypeEnum**](#TypeEnum) | Whether this result is a user or a team | | + + + +## Enum: TypeEnum + +| Name | Value | +|---- | -----| +| USER | "USER" | +| TEAM | "TEAM" | +| UNKNOWN_DEFAULT_OPEN_API | "unknown_default_open_api" | + + + diff --git a/docs/PublicTeamBody.md b/docs/PublicTeamBody.md new file mode 100644 index 00000000..73a9c8be --- /dev/null +++ b/docs/PublicTeamBody.md @@ -0,0 +1,14 @@ + + +# PublicTeamBody + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**teamId** | **Long** | The team's ID | | +|**teamName** | **String** | The team's name | | + + + diff --git a/docs/RequestedConfigBody.md b/docs/RequestedConfigBody.md index a3480369..1919a061 100644 --- a/docs/RequestedConfigBody.md +++ b/docs/RequestedConfigBody.md @@ -7,8 +7,9 @@ | Name | Type | Description | Notes | |------------ | ------------- | ------------- | -------------| -|**capabilities** | **Boolean** | Whether the capabilities agent was requested | | +|**capabilities** | **Boolean** | Whether static capability extraction was requested | | |**functions** | **Boolean** | Whether the functions pipeline was requested | | +|**operations** | **List<RequestedOperation>** | Operations requested to run automatically once the analysis completes | | |**sandbox** | **Boolean** | Whether dynamic execution (sandbox) was requested | | |**scrape** | **Boolean** | Whether external-source scraping was requested | | |**triage** | **Boolean** | Whether the triage agent was requested | | diff --git a/docs/RequestedOperation.md b/docs/RequestedOperation.md new file mode 100644 index 00000000..dde5519e --- /dev/null +++ b/docs/RequestedOperation.md @@ -0,0 +1,34 @@ + + +# RequestedOperation + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**operation** | [**OperationEnum**](#OperationEnum) | | | + + + +## Enum: OperationEnum + +| Name | Value | +|---- | -----| +| TRIAGE | "triage" | +| CAPABILITIES | "capabilities" | +| REPORT_ANALYSIS | "report-analysis" | +| REMEDIATION | "remediation" | +| PROTOCOLS | "protocols" | +| SECRETS | "secrets" | +| CRYPTOGRAPHY | "cryptography" | +| RENAME_UNNAMED_FUNCTIONS | "rename-unnamed-functions" | +| SECURITY_SCAN | "security-scan" | +| CRYPTO_SCAN | "crypto-scan" | +| NETWORKING_SCAN | "networking-scan" | +| FILESYSTEM_SCAN | "filesystem-scan" | +| EXECUTION_SCAN | "execution-scan" | +| UNKNOWN_DEFAULT_OPEN_API | "unknown_default_open_api" | + + + diff --git a/docs/ResultBody.md b/docs/ResultBody.md index ec35c9e5..1b3e636d 100644 --- a/docs/ResultBody.md +++ b/docs/ResultBody.md @@ -7,10 +7,10 @@ | Name | Type | Description | Notes | |------------ | ------------- | ------------- | -------------| -|**binaries** | **List<ExtractedBinary>** | Child binaries recovered from the extraction. | | +|**binaries** | **List<ExtractedBinary>** | Every file recovered from the extraction, binary or not. | | |**extractionDepth** | **Long** | Number of nested-archive extraction passes taken. | | |**filenameToFailure** | **Map<String, ExtractionFailure>** | Per-file extraction failures, keyed by filename. | | -|**skippedFiles** | **Long** | Files skipped because they were not recognised as binaries. | | +|**skippedFiles** | **Long** | Deprecated: always 0, every file is returned. | | diff --git a/docs/RollupBody.md b/docs/RollupBody.md new file mode 100644 index 00000000..0fba43fb --- /dev/null +++ b/docs/RollupBody.md @@ -0,0 +1,43 @@ + + +# RollupBody + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**activity** | **List<Long>** | Files added and findings recorded in each of the last 24 hours, oldest first. | | +|**agentStatus** | [**AgentStatusEnum**](#AgentStatusEnum) | State of the agents as a whole: queued while every run is pending, running while any is pending or running, complete otherwise. Null when no agent has run. | | +|**agents** | **List<AgentBody>** | Agents run on the investigation's files that you may see, each with its state across the files. Empty until an agent has run. | | +|**fileCount** | **Long** | Files in the investigation that you are permitted to see. | | +|**findings** | **FindingCountsBody** | | | +|**findingsSeverity** | [**FindingsSeverityEnum**](#FindingsSeverityEnum) | The highest severity among the findings, independent of the investigation's own severity. Null when there are no findings. | | +|**firstFileName** | **String** | Name of the first file added that you are permitted to see. Null when there is none. | | +|**lastActivityAt** | **OffsetDateTime** | The latest of an edit to the investigation, a file being added and a finding being recorded. | | + + + +## Enum: AgentStatusEnum + +| Name | Value | +|---- | -----| +| QUEUED | "QUEUED" | +| AGENTS_RUNNING | "AGENTS_RUNNING" | +| COMPLETE | "COMPLETE" | +| UNKNOWN_DEFAULT_OPEN_API | "unknown_default_open_api" | + + + +## Enum: FindingsSeverityEnum + +| Name | Value | +|---- | -----| +| CRITICAL | "CRITICAL" | +| HIGH | "HIGH" | +| MEDIUM | "MEDIUM" | +| LOW | "LOW" | +| UNKNOWN_DEFAULT_OPEN_API | "unknown_default_open_api" | + + + diff --git a/docs/TaskResponse.md b/docs/RunCancelledData.md similarity index 52% rename from docs/TaskResponse.md rename to docs/RunCancelledData.md index 7fb87e27..82c6e47c 100644 --- a/docs/TaskResponse.md +++ b/docs/RunCancelledData.md @@ -1,14 +1,13 @@ -# TaskResponse +# RunCancelledData ## Properties | Name | Type | Description | Notes | |------------ | ------------- | ------------- | -------------| -|**status** | **TaskStatus** | | [optional] | -|**errorMessage** | **String** | | [optional] | +|**conversationUuid** | **String** | | [optional] | diff --git a/docs/RunErrorData.md b/docs/RunErrorData.md new file mode 100644 index 00000000..89da78b3 --- /dev/null +++ b/docs/RunErrorData.md @@ -0,0 +1,15 @@ + + +# RunErrorData + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**conversationUuid** | **String** | | [optional] | +|**definitionName** | **String** | | [optional] | +|**error** | **String** | | [optional] | + + + diff --git a/docs/RunFinishedData.md b/docs/RunFinishedData.md new file mode 100644 index 00000000..618b14b9 --- /dev/null +++ b/docs/RunFinishedData.md @@ -0,0 +1,17 @@ + + +# RunFinishedData + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**conversationUuid** | **String** | | [optional] | +|**definitionName** | **String** | | [optional] | +|**inputTokens** | **Integer** | | [optional] | +|**outputTokens** | **Integer** | | [optional] | +|**totalTokens** | **Integer** | | [optional] | + + + diff --git a/docs/RunStartedData.md b/docs/RunStartedData.md new file mode 100644 index 00000000..845af112 --- /dev/null +++ b/docs/RunStartedData.md @@ -0,0 +1,14 @@ + + +# RunStartedData + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**conversationUuid** | **String** | | [optional] | +|**definitionName** | **String** | | [optional] | + + + diff --git a/docs/SetBudgetInputBody.md b/docs/SetBudgetInputBody.md new file mode 100644 index 00000000..844df5aa --- /dev/null +++ b/docs/SetBudgetInputBody.md @@ -0,0 +1,13 @@ + + +# SetBudgetInputBody + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**creditBudget** | **Long** | The most credits the investigation may spend, up to 1,000,000,000, or null to remove the limit. | | + + + diff --git a/docs/SpendBody.md b/docs/SpendBody.md new file mode 100644 index 00000000..d77f5aa0 --- /dev/null +++ b/docs/SpendBody.md @@ -0,0 +1,30 @@ + + +# SpendBody + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**conversationUuid** | **String** | The conversation of a CHAT spend. | | +|**createdAt** | **OffsetDateTime** | | | +|**credits** | **Double** | | | +|**source** | [**SourceEnum**](#SourceEnum) | What the credits were spent on: a conversation turn or an agent run started from the investigation. | | +|**spendId** | **Long** | | | +|**taskId** | **String** | The agent run of an AGENT_RUN spend. | | +|**userId** | **Long** | Who was charged. Zero when that user has been deleted. | | +|**username** | **String** | | | + + + +## Enum: SourceEnum + +| Name | Value | +|---- | -----| +| CHAT | "CHAT" | +| AGENT_RUN | "AGENT_RUN" | +| UNKNOWN_DEFAULT_OPEN_API | "unknown_default_open_api" | + + + diff --git a/docs/SseEventAgentRunUpdateData.md b/docs/SseEventAgentRunUpdateData.md new file mode 100644 index 00000000..6e982100 --- /dev/null +++ b/docs/SseEventAgentRunUpdateData.md @@ -0,0 +1,17 @@ + + +# SseEventAgentRunUpdateData + +The event envelope, sent as the JSON of the SSE data line. Its type names the event, and its data is that event's payload. + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**data** | **AgentRunUpdateData** | The payload of the event named in type. | | +|**eventId** | **Long** | The stored event's ID, the same as the SSE id field. Pass the last one received as last_event_id to resume after a reconnection. | | +|**sourceRunId** | **String** | | [optional] | +|**type** | **String** | The event name, the same as the SSE event field. | | + + + diff --git a/docs/SseEventContextCompactedData.md b/docs/SseEventContextCompactedData.md index 686bc42e..e9eb0a55 100644 --- a/docs/SseEventContextCompactedData.md +++ b/docs/SseEventContextCompactedData.md @@ -2,15 +2,16 @@ # SseEventContextCompactedData +The event envelope, sent as the JSON of the SSE data line. Its type names the event, and its data is that event's payload. ## Properties | Name | Type | Description | Notes | |------------ | ------------- | ------------- | -------------| -|**data** | **Object** | | | -|**eventId** | **Long** | | | +|**data** | **ContextCompactedData** | The payload of the event named in type. | | +|**eventId** | **Long** | The stored event's ID, the same as the SSE id field. Pass the last one received as last_event_id to resume after a reconnection. | | |**sourceRunId** | **String** | | [optional] | -|**type** | **String** | | | +|**type** | **String** | The event name, the same as the SSE event field. | | diff --git a/docs/SseEventRunCancelledData.md b/docs/SseEventRunCancelledData.md index 0eb5d216..84068692 100644 --- a/docs/SseEventRunCancelledData.md +++ b/docs/SseEventRunCancelledData.md @@ -2,15 +2,16 @@ # SseEventRunCancelledData +The event envelope, sent as the JSON of the SSE data line. Its type names the event, and its data is that event's payload. ## Properties | Name | Type | Description | Notes | |------------ | ------------- | ------------- | -------------| -|**data** | **Object** | | | -|**eventId** | **Long** | | | +|**data** | **RunCancelledData** | The payload of the event named in type. | | +|**eventId** | **Long** | The stored event's ID, the same as the SSE id field. Pass the last one received as last_event_id to resume after a reconnection. | | |**sourceRunId** | **String** | | [optional] | -|**type** | **String** | | | +|**type** | **String** | The event name, the same as the SSE event field. | | diff --git a/docs/SseEventRunErrorData.md b/docs/SseEventRunErrorData.md index 95f477e4..e3ca1343 100644 --- a/docs/SseEventRunErrorData.md +++ b/docs/SseEventRunErrorData.md @@ -2,15 +2,16 @@ # SseEventRunErrorData +The event envelope, sent as the JSON of the SSE data line. Its type names the event, and its data is that event's payload. ## Properties | Name | Type | Description | Notes | |------------ | ------------- | ------------- | -------------| -|**data** | **Object** | | | -|**eventId** | **Long** | | | +|**data** | **RunErrorData** | The payload of the event named in type. | | +|**eventId** | **Long** | The stored event's ID, the same as the SSE id field. Pass the last one received as last_event_id to resume after a reconnection. | | |**sourceRunId** | **String** | | [optional] | -|**type** | **String** | | | +|**type** | **String** | The event name, the same as the SSE event field. | | diff --git a/docs/SseEventRunFinishedData.md b/docs/SseEventRunFinishedData.md index 9472e9f0..c9dec4f6 100644 --- a/docs/SseEventRunFinishedData.md +++ b/docs/SseEventRunFinishedData.md @@ -2,15 +2,16 @@ # SseEventRunFinishedData +The event envelope, sent as the JSON of the SSE data line. Its type names the event, and its data is that event's payload. ## Properties | Name | Type | Description | Notes | |------------ | ------------- | ------------- | -------------| -|**data** | **Object** | | | -|**eventId** | **Long** | | | +|**data** | **RunFinishedData** | The payload of the event named in type. | | +|**eventId** | **Long** | The stored event's ID, the same as the SSE id field. Pass the last one received as last_event_id to resume after a reconnection. | | |**sourceRunId** | **String** | | [optional] | -|**type** | **String** | | | +|**type** | **String** | The event name, the same as the SSE event field. | | diff --git a/docs/SseEventRunStartedData.md b/docs/SseEventRunStartedData.md index e8f42d38..b197a10d 100644 --- a/docs/SseEventRunStartedData.md +++ b/docs/SseEventRunStartedData.md @@ -2,15 +2,16 @@ # SseEventRunStartedData +The event envelope, sent as the JSON of the SSE data line. Its type names the event, and its data is that event's payload. ## Properties | Name | Type | Description | Notes | |------------ | ------------- | ------------- | -------------| -|**data** | **Object** | | | -|**eventId** | **Long** | | | +|**data** | **RunStartedData** | The payload of the event named in type. | | +|**eventId** | **Long** | The stored event's ID, the same as the SSE id field. Pass the last one received as last_event_id to resume after a reconnection. | | |**sourceRunId** | **String** | | [optional] | -|**type** | **String** | | | +|**type** | **String** | The event name, the same as the SSE event field. | | diff --git a/docs/SseEventStepFinishedData.md b/docs/SseEventStepFinishedData.md index 30139e32..da78e34a 100644 --- a/docs/SseEventStepFinishedData.md +++ b/docs/SseEventStepFinishedData.md @@ -2,15 +2,16 @@ # SseEventStepFinishedData +The event envelope, sent as the JSON of the SSE data line. Its type names the event, and its data is that event's payload. ## Properties | Name | Type | Description | Notes | |------------ | ------------- | ------------- | -------------| -|**data** | **Object** | | | -|**eventId** | **Long** | | | +|**data** | **StepFinishedData** | The payload of the event named in type. | | +|**eventId** | **Long** | The stored event's ID, the same as the SSE id field. Pass the last one received as last_event_id to resume after a reconnection. | | |**sourceRunId** | **String** | | [optional] | -|**type** | **String** | | | +|**type** | **String** | The event name, the same as the SSE event field. | | diff --git a/docs/SseEventStepStartedData.md b/docs/SseEventStepStartedData.md index 3c7c5c14..69823105 100644 --- a/docs/SseEventStepStartedData.md +++ b/docs/SseEventStepStartedData.md @@ -2,15 +2,16 @@ # SseEventStepStartedData +The event envelope, sent as the JSON of the SSE data line. Its type names the event, and its data is that event's payload. ## Properties | Name | Type | Description | Notes | |------------ | ------------- | ------------- | -------------| -|**data** | **Object** | | | -|**eventId** | **Long** | | | +|**data** | **StepStartedData** | The payload of the event named in type. | | +|**eventId** | **Long** | The stored event's ID, the same as the SSE id field. Pass the last one received as last_event_id to resume after a reconnection. | | |**sourceRunId** | **String** | | [optional] | -|**type** | **String** | | | +|**type** | **String** | The event name, the same as the SSE event field. | | diff --git a/docs/SseEventTextMessageContentData.md b/docs/SseEventTextMessageContentData.md index 800626f9..1192c68e 100644 --- a/docs/SseEventTextMessageContentData.md +++ b/docs/SseEventTextMessageContentData.md @@ -2,15 +2,16 @@ # SseEventTextMessageContentData +The event envelope, sent as the JSON of the SSE data line. Its type names the event, and its data is that event's payload. ## Properties | Name | Type | Description | Notes | |------------ | ------------- | ------------- | -------------| -|**data** | **Object** | | | -|**eventId** | **Long** | | | +|**data** | **TextMessageContentData** | The payload of the event named in type. | | +|**eventId** | **Long** | The stored event's ID, the same as the SSE id field. Pass the last one received as last_event_id to resume after a reconnection. | | |**sourceRunId** | **String** | | [optional] | -|**type** | **String** | | | +|**type** | **String** | The event name, the same as the SSE event field. | | diff --git a/docs/SseEventTextMessageEndData.md b/docs/SseEventTextMessageEndData.md index 88acbe7c..4dfac7cb 100644 --- a/docs/SseEventTextMessageEndData.md +++ b/docs/SseEventTextMessageEndData.md @@ -2,15 +2,16 @@ # SseEventTextMessageEndData +The event envelope, sent as the JSON of the SSE data line. Its type names the event, and its data is that event's payload. ## Properties | Name | Type | Description | Notes | |------------ | ------------- | ------------- | -------------| -|**data** | **Object** | | | -|**eventId** | **Long** | | | +|**data** | **TextMessageEndData** | The payload of the event named in type. | | +|**eventId** | **Long** | The stored event's ID, the same as the SSE id field. Pass the last one received as last_event_id to resume after a reconnection. | | |**sourceRunId** | **String** | | [optional] | -|**type** | **String** | | | +|**type** | **String** | The event name, the same as the SSE event field. | | diff --git a/docs/SseEventTextMessageStartData.md b/docs/SseEventTextMessageStartData.md index 54d4841a..336b9489 100644 --- a/docs/SseEventTextMessageStartData.md +++ b/docs/SseEventTextMessageStartData.md @@ -2,15 +2,16 @@ # SseEventTextMessageStartData +The event envelope, sent as the JSON of the SSE data line. Its type names the event, and its data is that event's payload. ## Properties | Name | Type | Description | Notes | |------------ | ------------- | ------------- | -------------| -|**data** | **Object** | | | -|**eventId** | **Long** | | | +|**data** | **TextMessageStartData** | The payload of the event named in type. | | +|**eventId** | **Long** | The stored event's ID, the same as the SSE id field. Pass the last one received as last_event_id to resume after a reconnection. | | |**sourceRunId** | **String** | | [optional] | -|**type** | **String** | | | +|**type** | **String** | The event name, the same as the SSE event field. | | diff --git a/docs/SseEventTitleUpdatedData.md b/docs/SseEventTitleUpdatedData.md index 43b16cd8..9e6af0f3 100644 --- a/docs/SseEventTitleUpdatedData.md +++ b/docs/SseEventTitleUpdatedData.md @@ -2,15 +2,16 @@ # SseEventTitleUpdatedData +The event envelope, sent as the JSON of the SSE data line. Its type names the event, and its data is that event's payload. ## Properties | Name | Type | Description | Notes | |------------ | ------------- | ------------- | -------------| -|**data** | **Object** | | | -|**eventId** | **Long** | | | +|**data** | **TitleUpdatedData** | The payload of the event named in type. | | +|**eventId** | **Long** | The stored event's ID, the same as the SSE id field. Pass the last one received as last_event_id to resume after a reconnection. | | |**sourceRunId** | **String** | | [optional] | -|**type** | **String** | | | +|**type** | **String** | The event name, the same as the SSE event field. | | diff --git a/docs/SseEventToolCallArgsDeltaData.md b/docs/SseEventToolCallArgsDeltaData.md index 3682d91c..80eccf8f 100644 --- a/docs/SseEventToolCallArgsDeltaData.md +++ b/docs/SseEventToolCallArgsDeltaData.md @@ -2,15 +2,16 @@ # SseEventToolCallArgsDeltaData +The event envelope, sent as the JSON of the SSE data line. Its type names the event, and its data is that event's payload. ## Properties | Name | Type | Description | Notes | |------------ | ------------- | ------------- | -------------| -|**data** | **Object** | | | -|**eventId** | **Long** | | | +|**data** | **ToolCallArgsDeltaData** | The payload of the event named in type. | | +|**eventId** | **Long** | The stored event's ID, the same as the SSE id field. Pass the last one received as last_event_id to resume after a reconnection. | | |**sourceRunId** | **String** | | [optional] | -|**type** | **String** | | | +|**type** | **String** | The event name, the same as the SSE event field. | | diff --git a/docs/SseEventToolCallEndData.md b/docs/SseEventToolCallEndData.md index 3ae4e0a8..e28f857f 100644 --- a/docs/SseEventToolCallEndData.md +++ b/docs/SseEventToolCallEndData.md @@ -2,15 +2,16 @@ # SseEventToolCallEndData +The event envelope, sent as the JSON of the SSE data line. Its type names the event, and its data is that event's payload. ## Properties | Name | Type | Description | Notes | |------------ | ------------- | ------------- | -------------| -|**data** | **Object** | | | -|**eventId** | **Long** | | | +|**data** | **ToolCallEndData** | The payload of the event named in type. | | +|**eventId** | **Long** | The stored event's ID, the same as the SSE id field. Pass the last one received as last_event_id to resume after a reconnection. | | |**sourceRunId** | **String** | | [optional] | -|**type** | **String** | | | +|**type** | **String** | The event name, the same as the SSE event field. | | diff --git a/docs/SseEventToolCallProgressData.md b/docs/SseEventToolCallProgressData.md index 10fbd67b..5fcf19a3 100644 --- a/docs/SseEventToolCallProgressData.md +++ b/docs/SseEventToolCallProgressData.md @@ -2,15 +2,16 @@ # SseEventToolCallProgressData +The event envelope, sent as the JSON of the SSE data line. Its type names the event, and its data is that event's payload. ## Properties | Name | Type | Description | Notes | |------------ | ------------- | ------------- | -------------| -|**data** | **Object** | | | -|**eventId** | **Long** | | | +|**data** | **ToolCallProgressData** | The payload of the event named in type. | | +|**eventId** | **Long** | The stored event's ID, the same as the SSE id field. Pass the last one received as last_event_id to resume after a reconnection. | | |**sourceRunId** | **String** | | [optional] | -|**type** | **String** | | | +|**type** | **String** | The event name, the same as the SSE event field. | | diff --git a/docs/SseEventToolCallResultData.md b/docs/SseEventToolCallResultData.md index 7e30518f..0a72a3cb 100644 --- a/docs/SseEventToolCallResultData.md +++ b/docs/SseEventToolCallResultData.md @@ -2,15 +2,16 @@ # SseEventToolCallResultData +The event envelope, sent as the JSON of the SSE data line. Its type names the event, and its data is that event's payload. ## Properties | Name | Type | Description | Notes | |------------ | ------------- | ------------- | -------------| -|**data** | **Object** | | | -|**eventId** | **Long** | | | +|**data** | **ToolCallResultData** | The payload of the event named in type. | | +|**eventId** | **Long** | The stored event's ID, the same as the SSE id field. Pass the last one received as last_event_id to resume after a reconnection. | | |**sourceRunId** | **String** | | [optional] | -|**type** | **String** | | | +|**type** | **String** | The event name, the same as the SSE event field. | | diff --git a/docs/SseEventToolCallStartData.md b/docs/SseEventToolCallStartData.md index ae06de45..267307e0 100644 --- a/docs/SseEventToolCallStartData.md +++ b/docs/SseEventToolCallStartData.md @@ -2,15 +2,16 @@ # SseEventToolCallStartData +The event envelope, sent as the JSON of the SSE data line. Its type names the event, and its data is that event's payload. ## Properties | Name | Type | Description | Notes | |------------ | ------------- | ------------- | -------------| -|**data** | **Object** | | | -|**eventId** | **Long** | | | +|**data** | **ToolCallStartData** | The payload of the event named in type. | | +|**eventId** | **Long** | The stored event's ID, the same as the SSE id field. Pass the last one received as last_event_id to resume after a reconnection. | | |**sourceRunId** | **String** | | [optional] | -|**type** | **String** | | | +|**type** | **String** | The event name, the same as the SSE event field. | | diff --git a/docs/SseEventToolConfirmationRequiredData.md b/docs/SseEventToolConfirmationRequiredData.md index 1b7b61d1..dc1f8f0f 100644 --- a/docs/SseEventToolConfirmationRequiredData.md +++ b/docs/SseEventToolConfirmationRequiredData.md @@ -2,15 +2,16 @@ # SseEventToolConfirmationRequiredData +The event envelope, sent as the JSON of the SSE data line. Its type names the event, and its data is that event's payload. ## Properties | Name | Type | Description | Notes | |------------ | ------------- | ------------- | -------------| -|**data** | **Object** | | | -|**eventId** | **Long** | | | +|**data** | **ToolConfirmationRequiredData** | The payload of the event named in type. | | +|**eventId** | **Long** | The stored event's ID, the same as the SSE id field. Pass the last one received as last_event_id to resume after a reconnection. | | |**sourceRunId** | **String** | | [optional] | -|**type** | **String** | | | +|**type** | **String** | The event name, the same as the SSE event field. | | diff --git a/docs/Status.md b/docs/Status.md index d4d775c2..c07461d9 100644 --- a/docs/Status.md +++ b/docs/Status.md @@ -43,6 +43,7 @@ | INVALID_CREDENTIALS | "INVALID_CREDENTIALS" | | INVALID_INVITE_CODE | "INVALID_INVITE_CODE" | | INVALID_RESET_CODE | "INVALID_RESET_CODE" | +| INVESTIGATION_BUDGET_SPENT | "INVESTIGATION_BUDGET_SPENT" | | LAST_ORG_OWNER | "LAST_ORG_OWNER" | | LAST_TEAM_ADMIN | "LAST_TEAM_ADMIN" | | LAST_TEAM_MEMBER | "LAST_TEAM_MEMBER" | diff --git a/docs/StepFinishedData.md b/docs/StepFinishedData.md new file mode 100644 index 00000000..d9046a0f --- /dev/null +++ b/docs/StepFinishedData.md @@ -0,0 +1,14 @@ + + +# StepFinishedData + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**finishReason** | **String** | | [optional] | +|**stepIndex** | **Integer** | | [optional] | + + + diff --git a/docs/StepStartedData.md b/docs/StepStartedData.md new file mode 100644 index 00000000..256cd91a --- /dev/null +++ b/docs/StepStartedData.md @@ -0,0 +1,13 @@ + + +# StepStartedData + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**stepIndex** | **Integer** | | [optional] | + + + diff --git a/docs/TaskStatus.md b/docs/TaskStatus.md deleted file mode 100644 index d9ca5517..00000000 --- a/docs/TaskStatus.md +++ /dev/null @@ -1,21 +0,0 @@ - - -# TaskStatus - -## Enum - - -* `UNINITIALISED` (value: `"UNINITIALISED"`) - -* `PENDING` (value: `"PENDING"`) - -* `RUNNING` (value: `"RUNNING"`) - -* `COMPLETED` (value: `"COMPLETED"`) - -* `FAILED` (value: `"FAILED"`) - -* `UNKNOWN_DEFAULT_OPEN_API` (value: `"unknown_default_open_api"`) - - - diff --git a/docs/Team.md b/docs/Team.md index e836ea0f..e5b96570 100644 --- a/docs/Team.md +++ b/docs/Team.md @@ -10,7 +10,7 @@ |**organisationId** | **Long** | Organisation this team belongs to, if any | [optional] | |**plan** | [**PlanEnum**](#PlanEnum) | | | |**teamId** | **Long** | | | -|**teamName** | **String** | | | +|**teamName** | **String** | Search is applied to string value | | diff --git a/docs/TextMessageContentData.md b/docs/TextMessageContentData.md new file mode 100644 index 00000000..a2824b28 --- /dev/null +++ b/docs/TextMessageContentData.md @@ -0,0 +1,14 @@ + + +# TextMessageContentData + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**delta** | **String** | | [optional] | +|**messageId** | **String** | | [optional] | + + + diff --git a/docs/TextMessageEndData.md b/docs/TextMessageEndData.md new file mode 100644 index 00000000..06137034 --- /dev/null +++ b/docs/TextMessageEndData.md @@ -0,0 +1,13 @@ + + +# TextMessageEndData + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**messageId** | **String** | | [optional] | + + + diff --git a/docs/TextMessageStartData.md b/docs/TextMessageStartData.md new file mode 100644 index 00000000..bba161ad --- /dev/null +++ b/docs/TextMessageStartData.md @@ -0,0 +1,13 @@ + + +# TextMessageStartData + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**messageId** | **String** | | [optional] | + + + diff --git a/docs/TitleUpdatedData.md b/docs/TitleUpdatedData.md new file mode 100644 index 00000000..41eb679f --- /dev/null +++ b/docs/TitleUpdatedData.md @@ -0,0 +1,13 @@ + + +# TitleUpdatedData + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**title** | **String** | | [optional] | + + + diff --git a/docs/ToolCallArgsDeltaData.md b/docs/ToolCallArgsDeltaData.md new file mode 100644 index 00000000..2d9dc140 --- /dev/null +++ b/docs/ToolCallArgsDeltaData.md @@ -0,0 +1,14 @@ + + +# ToolCallArgsDeltaData + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**delta** | **String** | | [optional] | +|**toolCallId** | **String** | | [optional] | + + + diff --git a/docs/ToolCallEndData.md b/docs/ToolCallEndData.md new file mode 100644 index 00000000..a0550be3 --- /dev/null +++ b/docs/ToolCallEndData.md @@ -0,0 +1,13 @@ + + +# ToolCallEndData + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**toolCallId** | **String** | | [optional] | + + + diff --git a/docs/ToolCallProgressData.md b/docs/ToolCallProgressData.md new file mode 100644 index 00000000..03ece8a2 --- /dev/null +++ b/docs/ToolCallProgressData.md @@ -0,0 +1,14 @@ + + +# ToolCallProgressData + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**message** | **String** | | [optional] | +|**toolCallId** | **String** | | [optional] | + + + diff --git a/docs/ToolCallResultData.md b/docs/ToolCallResultData.md new file mode 100644 index 00000000..b71988df --- /dev/null +++ b/docs/ToolCallResultData.md @@ -0,0 +1,17 @@ + + +# ToolCallResultData + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**isError** | **Boolean** | | [optional] | +|**result** | **String** | | [optional] | +|**toolCallId** | **String** | | [optional] | +|**toolName** | **String** | | [optional] | +|**updated** | **List<EntityUpdate>** | | [optional] | + + + diff --git a/docs/ToolCallStartData.md b/docs/ToolCallStartData.md new file mode 100644 index 00000000..b3d474e7 --- /dev/null +++ b/docs/ToolCallStartData.md @@ -0,0 +1,15 @@ + + +# ToolCallStartData + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**toolArgs** | **String** | | [optional] | +|**toolCallId** | **String** | | [optional] | +|**toolName** | **String** | | [optional] | + + + diff --git a/docs/ToolConfirmationRequiredData.md b/docs/ToolConfirmationRequiredData.md new file mode 100644 index 00000000..f8a9beb2 --- /dev/null +++ b/docs/ToolConfirmationRequiredData.md @@ -0,0 +1,16 @@ + + +# ToolConfirmationRequiredData + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**message** | **String** | | [optional] | +|**toolArgs** | **String** | | [optional] | +|**toolCallId** | **String** | | [optional] | +|**toolName** | **String** | | [optional] | + + + diff --git a/docs/TriggerDynamicExecutionInputBody.md b/docs/TriggerDynamicExecutionInputBody.md deleted file mode 100644 index 1feccc3f..00000000 --- a/docs/TriggerDynamicExecutionInputBody.md +++ /dev/null @@ -1,40 +0,0 @@ - - -# TriggerDynamicExecutionInputBody - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**archiveEntryPath** | **String** | Relative path of the entry inside the archive to execute | [optional] | -|**archivePassword** | **String** | Password for an encrypted archive | [optional] | -|**archiveSha256Hash** | **String** | SHA-256 of the archive object to send to the sandbox instead of the analysed binary | [optional] | -|**commandLineArgs** | **String** | Command-line arguments passed to the sample when the sandbox launches it | [optional] | -|**startMethod** | [**StartMethodEnum**](#StartMethodEnum) | How the sandbox launches the sample. Defaults to the sandbox's standard behaviour when omitted. | [optional] | -|**timeout** | [**TimeoutEnum**](#TimeoutEnum) | Maximum sandbox execution time in seconds | [optional] | - - - -## Enum: StartMethodEnum - -| Name | Value | -|---- | -----| -| STANDARD_USER_PROCESS | "standard_user_process" | -| ADMINISTRATOR_PROCESS | "administrator_process" | -| UNKNOWN_DEFAULT_OPEN_API | "unknown_default_open_api" | - - - -## Enum: TimeoutEnum - -| Name | Value | -|---- | -----| -| NUMBER_120 | 120l | -| NUMBER_180 | 180l | -| NUMBER_300 | 300l | -| NUMBER_600 | 600l | -| NUMBER_unknown_default_open_api | 11184809l | - - - diff --git a/docs/UpdateProfileInputBody.md b/docs/UpdateProfileInputBody.md index 2993ce10..4b3dcfb2 100644 --- a/docs/UpdateProfileInputBody.md +++ b/docs/UpdateProfileInputBody.md @@ -9,6 +9,7 @@ |------------ | ------------- | ------------- | -------------| |**defaultTeamId** | **Long** | Default team ID | [optional] | |**firstName** | **String** | First name | [optional] | +|**hideAiDecompilationComments** | **Boolean** | Hide AI decompilation comments across the platform | [optional] | |**hideExampleBinaries** | **Boolean** | Hide the Examples tab in the analyses listing | [optional] | |**lastName** | **String** | Last name | [optional] | |**timeZone** | **String** | IANA time zone | [optional] | diff --git a/docs/UpdateUserInputBody.md b/docs/UpdateUserInputBody.md index 9e194cca..77d899b7 100644 --- a/docs/UpdateUserInputBody.md +++ b/docs/UpdateUserInputBody.md @@ -9,6 +9,7 @@ |------------ | ------------- | ------------- | -------------| |**email** | **String** | Email address | [optional] | |**firstName** | **String** | First name | [optional] | +|**isActive** | **Boolean** | Whether the user can authenticate (SUPERADMIN only) | [optional] | |**lastName** | **String** | Last name | [optional] | |**role** | [**RoleEnum**](#RoleEnum) | User role (SUPERADMIN only) | [optional] | |**tier** | [**TierEnum**](#TierEnum) | User tier (SUPERADMIN only) | [optional] | diff --git a/docs/User.md b/docs/User.md index a389d682..684f782e 100644 --- a/docs/User.md +++ b/docs/User.md @@ -9,6 +9,7 @@ |------------ | ------------- | ------------- | -------------| |**createdAt** | **OffsetDateTime** | | | |**email** | **String** | | | +|**isActive** | **Boolean** | Inactive users cannot authenticate | | |**profile** | **UserProfile** | | | |**role** | [**RoleEnum**](#RoleEnum) | | | |**tier** | [**TierEnum**](#TierEnum) | | [optional] | diff --git a/docs/UserProfile.md b/docs/UserProfile.md index 152cea67..eaa6ba5c 100644 --- a/docs/UserProfile.md +++ b/docs/UserProfile.md @@ -9,6 +9,7 @@ |------------ | ------------- | ------------- | -------------| |**defaultTeamId** | **Long** | | [optional] | |**firstName** | **String** | | | +|**hideAiDecompilationComments** | **Boolean** | | | |**hideExampleBinaries** | **Boolean** | | | |**lastName** | **String** | | | |**timeZone** | **String** | | | diff --git a/docs/WorkflowDayBody.md b/docs/WorkflowDayBody.md index a7841fcf..9bc4f0cb 100644 --- a/docs/WorkflowDayBody.md +++ b/docs/WorkflowDayBody.md @@ -7,9 +7,20 @@ | Name | Type | Description | Notes | |------------ | ------------- | ------------- | -------------| -|**analyseCapabilities** | **AnalyseCapabilitiesBody** | ANALYSE_CAPABILITIES agent-task stats for the day | | +|**analyseCapabilities** | **AgentCompletedBody** | ANALYSE_CAPABILITIES agent-task stats for the day | | +|**cryptoScan** | **AgentCompletedBody** | CRYPTOGRAPHY agent-task stats for the day | | +|**cryptographyBinary** | **AgentCompletedBody** | CRYPTOGRAPHY_BINARY agent-task stats for the day | | |**date** | **String** | Day this entry covers | | +|**executionScan** | **AgentCompletedBody** | EXECUTION agent-task stats for the day | | +|**filesystemScan** | **AgentCompletedBody** | FILESYSTEM agent-task stats for the day | | +|**networkingScan** | **AgentCompletedBody** | NETWORKING agent-task stats for the day | | +|**protocols** | **AgentCompletedBody** | PROTOCOLS agent-task stats for the day | | +|**remediation** | **AgentCompletedBody** | REMEDIATION agent-task stats for the day | | +|**renameUnnamedFunctions** | **AgentCompletedBody** | RENAME_UNNAMED_FUNCTIONS agent-task stats for the day | | |**reportAnalysis** | **ReportAnalysisBody** | REPORT_ANALYSIS agent-task stats for the day | | +|**secrets** | **AgentCompletedBody** | SECRETS agent-task stats for the day | | +|**securityScan** | **AgentCompletedBody** | SECURITY_SCAN agent-task stats for the day | | +|**triage** | **AgentCompletedBody** | TRIAGE agent-task stats for the day | | diff --git a/pom.xml b/pom.xml index 82b9bae3..d006aae5 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ sdk jar sdk - 4.74.3 + 4.75.0 https://github.com/RevEngAI/sdk-java Java SDK for the RevEng.AI API diff --git a/src/main/java/ai/reveng/api/AnalysesCoreApi.java b/src/main/java/ai/reveng/api/AnalysesCoreApi.java index e57a0bf3..91f5ec6b 100644 --- a/src/main/java/ai/reveng/api/AnalysesCoreApi.java +++ b/src/main/java/ai/reveng/api/AnalysesCoreApi.java @@ -51,8 +51,8 @@ import ai.reveng.model.BaseResponseRecent; import ai.reveng.model.BaseResponseStatus; import ai.reveng.model.BaseResponseUploadResponse; +import ai.reveng.model.CreateRequest; import ai.reveng.model.DynamicExecutionStatus; -import ai.reveng.model.DynamicExecutionStatusResponse; import ai.reveng.model.DynamicExecutionSummary; import java.io.File; import ai.reveng.model.FunctionsProgressOutputBody; @@ -62,7 +62,9 @@ import ai.reveng.model.GetMatchesOutputBody; import ai.reveng.model.GetMatchesStatusOutputBody; import ai.reveng.model.GlobalVariable; +import ai.reveng.model.GrantAccessInputBody; import ai.reveng.model.InsertAnalysisLogRequest; +import ai.reveng.model.ListAccessRulesOutputBody; import ai.reveng.model.ListAnalysesOutputBody; import ai.reveng.model.ListAnalysisGlobalsOutputBody; import ai.reveng.model.ListAnalysisStringsOutputBody; @@ -1896,306 +1898,6 @@ public okhttp3.Call getAnalysisStatusAsync(@javax.annotation.Nonnull Integer ana localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } - /** - * Build call for getDynamicExecutionReport - * @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 -
409 Conflict -
422 Unprocessable Entity -
500 Internal Server Error -
- * @deprecated - */ - @Deprecated - public okhttp3.Call getDynamicExecutionReportCall(@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 = "/v2/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); - } - - @Deprecated - @SuppressWarnings("rawtypes") - private okhttp3.Call getDynamicExecutionReportValidateBeforeCall(@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 getDynamicExecutionReport(Async)"); - } - - return getDynamicExecutionReportCall(analysisId, _callback); - - } - - /** - * Get dynamic execution report - * Returns the dynamic execution report JSON for the analysis. Requires the task to be in COMPLETED status. **Error codes:** - `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 -
409 Conflict -
422 Unprocessable Entity -
500 Internal Server Error -
- * @deprecated - */ - @Deprecated - public AnalysisReport getDynamicExecutionReport(@javax.annotation.Nonnull Long analysisId) throws ApiException { - ApiResponse localVarResp = getDynamicExecutionReportWithHttpInfo(analysisId); - return localVarResp.getData(); - } - - /** - * Get dynamic execution report - * Returns the dynamic execution report JSON for the analysis. Requires the task to be in COMPLETED status. **Error codes:** - `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 -
409 Conflict -
422 Unprocessable Entity -
500 Internal Server Error -
- * @deprecated - */ - @Deprecated - public ApiResponse getDynamicExecutionReportWithHttpInfo(@javax.annotation.Nonnull Long analysisId) throws ApiException { - okhttp3.Call localVarCall = getDynamicExecutionReportValidateBeforeCall(analysisId, null); - Type localVarReturnType = new TypeToken(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * Get dynamic execution report (asynchronously) - * Returns the dynamic execution report JSON for the analysis. Requires the task to be in COMPLETED status. **Error codes:** - `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 -
409 Conflict -
422 Unprocessable Entity -
500 Internal Server Error -
- * @deprecated - */ - @Deprecated - public okhttp3.Call getDynamicExecutionReportAsync(@javax.annotation.Nonnull Long analysisId, final ApiCallback _callback) throws ApiException { - - okhttp3.Call localVarCall = getDynamicExecutionReportValidateBeforeCall(analysisId, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); - return localVarCall; - } - /** - * Build call for getDynamicExecutionStatus - * @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 -
422 Unprocessable Entity -
500 Internal Server Error -
- * @deprecated - */ - @Deprecated - public okhttp3.Call getDynamicExecutionStatusCall(@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 = "/v2/analyses/{analysis_id}/dynamic-execution/status" - .replace("{" + "analysis_id" + "}", localVarApiClient.escapeString(analysisId.toString())); - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = { - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - - String[] localVarAuthNames = new String[] { "APIKey", "bearerAuth" }; - return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); - } - - @Deprecated - @SuppressWarnings("rawtypes") - private okhttp3.Call getDynamicExecutionStatusValidateBeforeCall(@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 getDynamicExecutionStatus(Async)"); - } - - return getDynamicExecutionStatusCall(analysisId, _callback); - - } - - /** - * Get dynamic execution status - * Returns the status of the most recent dynamic execution task for the analysis. Returns UNINITIALISED if no task has been started. **Error codes:** - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - * @param analysisId Analysis ID (required) - * @return DynamicExecutionStatusResponse - * @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 -
422 Unprocessable Entity -
500 Internal Server Error -
- * @deprecated - */ - @Deprecated - public DynamicExecutionStatusResponse getDynamicExecutionStatus(@javax.annotation.Nonnull Long analysisId) throws ApiException { - ApiResponse localVarResp = getDynamicExecutionStatusWithHttpInfo(analysisId); - return localVarResp.getData(); - } - - /** - * Get dynamic execution status - * Returns the status of the most recent dynamic execution task for the analysis. Returns UNINITIALISED if no task has been started. **Error codes:** - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - * @param analysisId Analysis ID (required) - * @return ApiResponse<DynamicExecutionStatusResponse> - * @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 -
422 Unprocessable Entity -
500 Internal Server Error -
- * @deprecated - */ - @Deprecated - public ApiResponse getDynamicExecutionStatusWithHttpInfo(@javax.annotation.Nonnull Long analysisId) throws ApiException { - okhttp3.Call localVarCall = getDynamicExecutionStatusValidateBeforeCall(analysisId, null); - Type localVarReturnType = new TypeToken(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * Get dynamic execution status (asynchronously) - * Returns the status of the most recent dynamic execution task for the analysis. Returns UNINITIALISED if no task has been started. **Error codes:** - `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 -
422 Unprocessable Entity -
500 Internal Server Error -
- * @deprecated - */ - @Deprecated - public okhttp3.Call getDynamicExecutionStatusAsync(@javax.annotation.Nonnull Long analysisId, final ApiCallback _callback) throws ApiException { - - okhttp3.Call localVarCall = getDynamicExecutionStatusValidateBeforeCall(analysisId, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); - return localVarCall; - } /** * Build call for insertAnalysisLog * @param analysisId (required) @@ -3464,17 +3166,188 @@ public ApiResponse updateAnalysisTagsWit @Deprecated public okhttp3.Call updateAnalysisTagsAsync(@javax.annotation.Nonnull Integer analysisId, @javax.annotation.Nonnull AnalysisUpdateTagsRequest analysisUpdateTagsRequest, final ApiCallback _callback) throws ApiException { - okhttp3.Call localVarCall = updateAnalysisTagsValidateBeforeCall(analysisId, analysisUpdateTagsRequest, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); + okhttp3.Call localVarCall = updateAnalysisTagsValidateBeforeCall(analysisId, analysisUpdateTagsRequest, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for uploadFile + * @param uploadFileType (required) + * @param _file (required) + * @param packedPassword (optional) + * @param forceOverwrite (optional, default to false) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + +
Response Details
Status Code Description Response Headers
200 Successful Response -
422 Invalid request parameters -
+ * @deprecated + */ + @Deprecated + public okhttp3.Call uploadFileCall(@javax.annotation.Nonnull UploadFileType uploadFileType, @javax.annotation.Nonnull File _file, @javax.annotation.Nullable String packedPassword, @javax.annotation.Nullable Boolean forceOverwrite, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // 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 = "/v2/upload"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + if (uploadFileType != null) { + localVarFormParams.put("upload_file_type", uploadFileType); + } + + if (_file != null) { + localVarFormParams.put("file", _file); + } + + if (forceOverwrite != null) { + localVarFormParams.put("force_overwrite", forceOverwrite); + } + + if (packedPassword != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("packed_password", packedPassword)); + } + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "multipart/form-data" + }; + 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); + } + + @Deprecated + @SuppressWarnings("rawtypes") + private okhttp3.Call uploadFileValidateBeforeCall(@javax.annotation.Nonnull UploadFileType uploadFileType, @javax.annotation.Nonnull File _file, @javax.annotation.Nullable String packedPassword, @javax.annotation.Nullable Boolean forceOverwrite, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'uploadFileType' is set + if (uploadFileType == null) { + throw new ApiException("Missing the required parameter 'uploadFileType' when calling uploadFile(Async)"); + } + + // verify the required parameter '_file' is set + if (_file == null) { + throw new ApiException("Missing the required parameter '_file' when calling uploadFile(Async)"); + } + + return uploadFileCall(uploadFileType, _file, packedPassword, forceOverwrite, _callback); + + } + + /** + * Upload File + * + * @param uploadFileType (required) + * @param _file (required) + * @param packedPassword (optional) + * @param forceOverwrite (optional, default to false) + * @return BaseResponseUploadResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + +
Response Details
Status Code Description Response Headers
200 Successful Response -
422 Invalid request parameters -
+ * @deprecated + */ + @Deprecated + public BaseResponseUploadResponse uploadFile(@javax.annotation.Nonnull UploadFileType uploadFileType, @javax.annotation.Nonnull File _file, @javax.annotation.Nullable String packedPassword, @javax.annotation.Nullable Boolean forceOverwrite) throws ApiException { + ApiResponse localVarResp = uploadFileWithHttpInfo(uploadFileType, _file, packedPassword, forceOverwrite); + return localVarResp.getData(); + } + + /** + * Upload File + * + * @param uploadFileType (required) + * @param _file (required) + * @param packedPassword (optional) + * @param forceOverwrite (optional, default to false) + * @return ApiResponse<BaseResponseUploadResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + +
Response Details
Status Code Description Response Headers
200 Successful Response -
422 Invalid request parameters -
+ * @deprecated + */ + @Deprecated + public ApiResponse uploadFileWithHttpInfo(@javax.annotation.Nonnull UploadFileType uploadFileType, @javax.annotation.Nonnull File _file, @javax.annotation.Nullable String packedPassword, @javax.annotation.Nullable Boolean forceOverwrite) throws ApiException { + okhttp3.Call localVarCall = uploadFileValidateBeforeCall(uploadFileType, _file, packedPassword, forceOverwrite, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Upload File (asynchronously) + * + * @param uploadFileType (required) + * @param _file (required) + * @param packedPassword (optional) + * @param forceOverwrite (optional, default to false) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + + +
Response Details
Status Code Description Response Headers
200 Successful Response -
422 Invalid request parameters -
+ * @deprecated + */ + @Deprecated + public okhttp3.Call uploadFileAsync(@javax.annotation.Nonnull UploadFileType uploadFileType, @javax.annotation.Nonnull File _file, @javax.annotation.Nullable String packedPassword, @javax.annotation.Nullable Boolean forceOverwrite, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = uploadFileValidateBeforeCall(uploadFileType, _file, packedPassword, forceOverwrite, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } /** - * Build call for uploadFile - * @param uploadFileType (required) - * @param _file (required) - * @param packedPassword (optional) - * @param forceOverwrite (optional, default to false) + * Build call for v3CreateAnalysis + * @param createRequest (required) + * @param xRevEngApplication Identifies the calling RevEng application. Recorded on the Analysis log. (optional) * @param _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object @@ -3482,13 +3355,18 @@ public okhttp3.Call updateAnalysisTagsAsync(@javax.annotation.Nonnull Integer an - - + + + + + + + + +
Response Details
Status Code Description Response Headers
200 Successful Response -
422 Invalid request parameters -
201 Created -
400 Bad Request -
402 Payment Required -
403 Forbidden -
404 Not Found -
409 Conflict -
413 Request Entity Too Large -
422 Unprocessable Entity -
500 Internal Server Error -
- * @deprecated */ - @Deprecated - public okhttp3.Call uploadFileCall(@javax.annotation.Nonnull UploadFileType uploadFileType, @javax.annotation.Nonnull File _file, @javax.annotation.Nullable String packedPassword, @javax.annotation.Nullable Boolean forceOverwrite, final ApiCallback _callback) throws ApiException { + public okhttp3.Call v3CreateAnalysisCall(@javax.annotation.Nonnull CreateRequest createRequest, @javax.annotation.Nullable String xRevEngApplication, final ApiCallback _callback) throws ApiException { String basePath = null; // Operation Servers String[] localBasePaths = new String[] { }; @@ -3502,10 +3380,10 @@ public okhttp3.Call uploadFileCall(@javax.annotation.Nonnull UploadFileType uplo basePath = null; } - Object localVarPostBody = null; + Object localVarPostBody = createRequest; // create path and map variables - String localVarPath = "/v2/upload"; + String localVarPath = "/v3/analyses"; List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -3513,22 +3391,6 @@ public okhttp3.Call uploadFileCall(@javax.annotation.Nonnull UploadFileType uplo Map localVarCookieParams = new HashMap(); Map localVarFormParams = new HashMap(); - if (uploadFileType != null) { - localVarFormParams.put("upload_file_type", uploadFileType); - } - - if (_file != null) { - localVarFormParams.put("file", _file); - } - - if (forceOverwrite != null) { - localVarFormParams.put("force_overwrite", forceOverwrite); - } - - if (packedPassword != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("packed_password", packedPassword)); - } - final String[] localVarAccepts = { "application/json" }; @@ -3538,90 +3400,93 @@ public okhttp3.Call uploadFileCall(@javax.annotation.Nonnull UploadFileType uplo } final String[] localVarContentTypes = { - "multipart/form-data" + "application/json" }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } + if (xRevEngApplication != null) { + localVarHeaderParams.put("X-RevEng-Application", localVarApiClient.parameterToString(xRevEngApplication)); + } + + String[] localVarAuthNames = new String[] { "APIKey", "bearerAuth" }; return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } - @Deprecated @SuppressWarnings("rawtypes") - private okhttp3.Call uploadFileValidateBeforeCall(@javax.annotation.Nonnull UploadFileType uploadFileType, @javax.annotation.Nonnull File _file, @javax.annotation.Nullable String packedPassword, @javax.annotation.Nullable Boolean forceOverwrite, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'uploadFileType' is set - if (uploadFileType == null) { - throw new ApiException("Missing the required parameter 'uploadFileType' when calling uploadFile(Async)"); - } - - // verify the required parameter '_file' is set - if (_file == null) { - throw new ApiException("Missing the required parameter '_file' when calling uploadFile(Async)"); + private okhttp3.Call v3CreateAnalysisValidateBeforeCall(@javax.annotation.Nonnull CreateRequest createRequest, @javax.annotation.Nullable String xRevEngApplication, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'createRequest' is set + if (createRequest == null) { + throw new ApiException("Missing the required parameter 'createRequest' when calling v3CreateAnalysis(Async)"); } - return uploadFileCall(uploadFileType, _file, packedPassword, forceOverwrite, _callback); + return v3CreateAnalysisCall(createRequest, xRevEngApplication, _callback); } /** - * Upload File - * - * @param uploadFileType (required) - * @param _file (required) - * @param packedPassword (optional) - * @param forceOverwrite (optional, default to false) - * @return BaseResponseUploadResponse + * Create an analysis + * Queues a new Analysis for an uploaded Binary and returns the created Operation. **Error codes:** - `400` [`BAD_REQUEST`](/errors/BAD_REQUEST) — Bad Request - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `402` [`INSUFFICIENT_CREDITS`](/errors/INSUFFICIENT_CREDITS) — Insufficient Credits - `409` [`CONFLICT`](/errors/CONFLICT) — Conflict - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `413` [`REQUEST_ENTITY_TOO_LARGE`](/errors/REQUEST_ENTITY_TOO_LARGE) — Request Entity Too Large + * @param createRequest (required) + * @param xRevEngApplication Identifies the calling RevEng application. Recorded on the Analysis log. (optional) + * @return OperationCreateMetadataCreateResult * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details - - + + + + + + + + +
Response Details
Status Code Description Response Headers
200 Successful Response -
422 Invalid request parameters -
201 Created -
400 Bad Request -
402 Payment Required -
403 Forbidden -
404 Not Found -
409 Conflict -
413 Request Entity Too Large -
422 Unprocessable Entity -
500 Internal Server Error -
- * @deprecated */ - @Deprecated - public BaseResponseUploadResponse uploadFile(@javax.annotation.Nonnull UploadFileType uploadFileType, @javax.annotation.Nonnull File _file, @javax.annotation.Nullable String packedPassword, @javax.annotation.Nullable Boolean forceOverwrite) throws ApiException { - ApiResponse localVarResp = uploadFileWithHttpInfo(uploadFileType, _file, packedPassword, forceOverwrite); + public OperationCreateMetadataCreateResult v3CreateAnalysis(@javax.annotation.Nonnull CreateRequest createRequest, @javax.annotation.Nullable String xRevEngApplication) throws ApiException { + ApiResponse localVarResp = v3CreateAnalysisWithHttpInfo(createRequest, xRevEngApplication); return localVarResp.getData(); } /** - * Upload File - * - * @param uploadFileType (required) - * @param _file (required) - * @param packedPassword (optional) - * @param forceOverwrite (optional, default to false) - * @return ApiResponse<BaseResponseUploadResponse> + * Create an analysis + * Queues a new Analysis for an uploaded Binary and returns the created Operation. **Error codes:** - `400` [`BAD_REQUEST`](/errors/BAD_REQUEST) — Bad Request - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `402` [`INSUFFICIENT_CREDITS`](/errors/INSUFFICIENT_CREDITS) — Insufficient Credits - `409` [`CONFLICT`](/errors/CONFLICT) — Conflict - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `413` [`REQUEST_ENTITY_TOO_LARGE`](/errors/REQUEST_ENTITY_TOO_LARGE) — Request Entity Too Large + * @param createRequest (required) + * @param xRevEngApplication Identifies the calling RevEng application. Recorded on the Analysis log. (optional) + * @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 Successful Response -
422 Invalid request parameters -
201 Created -
400 Bad Request -
402 Payment Required -
403 Forbidden -
404 Not Found -
409 Conflict -
413 Request Entity Too Large -
422 Unprocessable Entity -
500 Internal Server Error -
- * @deprecated */ - @Deprecated - public ApiResponse uploadFileWithHttpInfo(@javax.annotation.Nonnull UploadFileType uploadFileType, @javax.annotation.Nonnull File _file, @javax.annotation.Nullable String packedPassword, @javax.annotation.Nullable Boolean forceOverwrite) throws ApiException { - okhttp3.Call localVarCall = uploadFileValidateBeforeCall(uploadFileType, _file, packedPassword, forceOverwrite, null); - Type localVarReturnType = new TypeToken(){}.getType(); + public ApiResponse v3CreateAnalysisWithHttpInfo(@javax.annotation.Nonnull CreateRequest createRequest, @javax.annotation.Nullable String xRevEngApplication) throws ApiException { + okhttp3.Call localVarCall = v3CreateAnalysisValidateBeforeCall(createRequest, xRevEngApplication, null); + Type localVarReturnType = new TypeToken(){}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } /** - * Upload File (asynchronously) - * - * @param uploadFileType (required) - * @param _file (required) - * @param packedPassword (optional) - * @param forceOverwrite (optional, default to false) + * Create an analysis (asynchronously) + * Queues a new Analysis for an uploaded Binary and returns the created Operation. **Error codes:** - `400` [`BAD_REQUEST`](/errors/BAD_REQUEST) — Bad Request - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `402` [`INSUFFICIENT_CREDITS`](/errors/INSUFFICIENT_CREDITS) — Insufficient Credits - `409` [`CONFLICT`](/errors/CONFLICT) — Conflict - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `413` [`REQUEST_ENTITY_TOO_LARGE`](/errors/REQUEST_ENTITY_TOO_LARGE) — Request Entity Too Large + * @param createRequest (required) + * @param xRevEngApplication Identifies the calling RevEng application. Recorded on the Analysis log. (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 @@ -3629,16 +3494,21 @@ public ApiResponse uploadFileWithHttpInfo(@javax.ann - - + + + + + + + + +
Response Details
Status Code Description Response Headers
200 Successful Response -
422 Invalid request parameters -
201 Created -
400 Bad Request -
402 Payment Required -
403 Forbidden -
404 Not Found -
409 Conflict -
413 Request Entity Too Large -
422 Unprocessable Entity -
500 Internal Server Error -
- * @deprecated */ - @Deprecated - public okhttp3.Call uploadFileAsync(@javax.annotation.Nonnull UploadFileType uploadFileType, @javax.annotation.Nonnull File _file, @javax.annotation.Nullable String packedPassword, @javax.annotation.Nullable Boolean forceOverwrite, final ApiCallback _callback) throws ApiException { + public okhttp3.Call v3CreateAnalysisAsync(@javax.annotation.Nonnull CreateRequest createRequest, @javax.annotation.Nullable String xRevEngApplication, final ApiCallback _callback) throws ApiException { - okhttp3.Call localVarCall = uploadFileValidateBeforeCall(uploadFileType, _file, packedPassword, forceOverwrite, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); + okhttp3.Call localVarCall = v3CreateAnalysisValidateBeforeCall(createRequest, xRevEngApplication, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } @@ -6893,15 +6763,168 @@ public void v3GetDynamicExecutionWiresharkKeys(@javax.annotation.Nonnull Long an 500 Internal Server Error - */ - public ApiResponse v3GetDynamicExecutionWiresharkKeysWithHttpInfo(@javax.annotation.Nonnull Long analysisId) throws ApiException { - okhttp3.Call localVarCall = v3GetDynamicExecutionWiresharkKeysValidateBeforeCall(analysisId, null); + 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 v3GrantAnalysisAccess + * @param analysisId Analysis ID (required) + * @param grantAccessInputBody (required) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + + + + + +
Response Details
Status Code Description Response Headers
204 No Content -
400 Bad Request -
403 Forbidden -
404 Not Found -
422 Unprocessable Entity -
500 Internal Server Error -
+ */ + public okhttp3.Call v3GrantAnalysisAccessCall(@javax.annotation.Nonnull Long analysisId, @javax.annotation.Nonnull GrantAccessInputBody grantAccessInputBody, 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 = grantAccessInputBody; + + // create path and map variables + String localVarPath = "/v3/analyses/{analysis_id}/access-rules" + .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 v3GrantAnalysisAccessValidateBeforeCall(@javax.annotation.Nonnull Long analysisId, @javax.annotation.Nonnull GrantAccessInputBody grantAccessInputBody, 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 v3GrantAnalysisAccess(Async)"); + } + + // verify the required parameter 'grantAccessInputBody' is set + if (grantAccessInputBody == null) { + throw new ApiException("Missing the required parameter 'grantAccessInputBody' when calling v3GrantAnalysisAccess(Async)"); + } + + return v3GrantAnalysisAccessCall(analysisId, grantAccessInputBody, _callback); + + } + + /** + * Share an analysis with a user or team + * Grants a user or a team access to the analysis. Sharing with a principal that already has a rule replaces its permission. The user or team must be one the caller can find through `GET /v3/principals`. The analysis owner cannot be the target of a rule. Requires edit access to the analysis. **Error codes:** - `400` [`BAD_REQUEST`](/errors/BAD_REQUEST) — Bad Request - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied + * @param analysisId Analysis ID (required) + * @param grantAccessInputBody (required) + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + + + + +
Response Details
Status Code Description Response Headers
204 No Content -
400 Bad Request -
403 Forbidden -
404 Not Found -
422 Unprocessable Entity -
500 Internal Server Error -
+ */ + public void v3GrantAnalysisAccess(@javax.annotation.Nonnull Long analysisId, @javax.annotation.Nonnull GrantAccessInputBody grantAccessInputBody) throws ApiException { + v3GrantAnalysisAccessWithHttpInfo(analysisId, grantAccessInputBody); + } + + /** + * Share an analysis with a user or team + * Grants a user or a team access to the analysis. Sharing with a principal that already has a rule replaces its permission. The user or team must be one the caller can find through `GET /v3/principals`. The analysis owner cannot be the target of a rule. Requires edit access to the analysis. **Error codes:** - `400` [`BAD_REQUEST`](/errors/BAD_REQUEST) — Bad Request - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied + * @param analysisId Analysis ID (required) + * @param grantAccessInputBody (required) + * @return ApiResponse<Void> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + + + + +
Response Details
Status Code Description Response Headers
204 No Content -
400 Bad Request -
403 Forbidden -
404 Not Found -
422 Unprocessable Entity -
500 Internal Server Error -
+ */ + public ApiResponse v3GrantAnalysisAccessWithHttpInfo(@javax.annotation.Nonnull Long analysisId, @javax.annotation.Nonnull GrantAccessInputBody grantAccessInputBody) throws ApiException { + okhttp3.Call localVarCall = v3GrantAnalysisAccessValidateBeforeCall(analysisId, grantAccessInputBody, 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 + * Share an analysis with a user or team (asynchronously) + * Grants a user or a team access to the analysis. Sharing with a principal that already has a rule replaces its permission. The user or team must be one the caller can find through `GET /v3/principals`. The analysis owner cannot be the target of a rule. Requires edit access to the analysis. **Error codes:** - `400` [`BAD_REQUEST`](/errors/BAD_REQUEST) — Bad Request - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied * @param analysisId Analysis ID (required) + * @param grantAccessInputBody (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 @@ -6909,24 +6932,24 @@ public ApiResponse v3GetDynamicExecutionWiresharkKeysWithHttpInfo(@javax.a - + + -
Response Details
Status Code Description Response Headers
200 OK -
204 No Content -
400 Bad Request -
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 { + public okhttp3.Call v3GrantAnalysisAccessAsync(@javax.annotation.Nonnull Long analysisId, @javax.annotation.Nonnull GrantAccessInputBody grantAccessInputBody, final ApiCallback _callback) throws ApiException { - okhttp3.Call localVarCall = v3GetDynamicExecutionWiresharkKeysValidateBeforeCall(analysisId, _callback); + okhttp3.Call localVarCall = v3GrantAnalysisAccessValidateBeforeCall(analysisId, grantAccessInputBody, _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 analysisScope Leave empty to search your own, your team's, all public analyses and those shared with you. SHARED_WITH_ME restricts to analyses another user or team gave you access to (optional) * @param status (optional) * @param modelName (optional) * @param usernames (optional) @@ -7057,7 +7080,7 @@ private okhttp3.Call v3ListAnalysesValidateBeforeCall(@javax.annotation.Nullable * 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 analysisScope Leave empty to search your own, your team's, all public analyses and those shared with you. SHARED_WITH_ME restricts to analyses another user or team gave you access to (optional) * @param status (optional) * @param modelName (optional) * @param usernames (optional) @@ -7090,7 +7113,7 @@ public ListAnalysesOutputBody v3ListAnalyses(@javax.annotation.Nullable String s * 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 analysisScope Leave empty to search your own, your team's, all public analyses and those shared with you. SHARED_WITH_ME restricts to analyses another user or team gave you access to (optional) * @param status (optional) * @param modelName (optional) * @param usernames (optional) @@ -7124,7 +7147,7 @@ public ApiResponse v3ListAnalysesWithHttpInfo(@javax.ann * 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 analysisScope Leave empty to search your own, your team's, all public analyses and those shared with you. SHARED_WITH_ME restricts to analyses another user or team gave you access to (optional) * @param status (optional) * @param modelName (optional) * @param usernames (optional) @@ -7156,6 +7179,145 @@ public okhttp3.Call v3ListAnalysesAsync(@javax.annotation.Nullable String search localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } + /** + * Build call for v3ListAnalysisAccessRules + * @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 -
404 Not Found -
422 Unprocessable Entity -
500 Internal Server Error -
+ */ + public okhttp3.Call v3ListAnalysisAccessRulesCall(@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}/access-rules" + .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 v3ListAnalysisAccessRulesValidateBeforeCall(@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 v3ListAnalysisAccessRules(Async)"); + } + + return v3ListAnalysisAccessRulesCall(analysisId, _callback); + + } + + /** + * List who an analysis is shared with + * Returns the users and teams the analysis has been shared with and the permission each one holds. Requires read access to the analysis. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found + * @param analysisId Analysis ID (required) + * @return ListAccessRulesOutputBody + * @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 ListAccessRulesOutputBody v3ListAnalysisAccessRules(@javax.annotation.Nonnull Long analysisId) throws ApiException { + ApiResponse localVarResp = v3ListAnalysisAccessRulesWithHttpInfo(analysisId); + return localVarResp.getData(); + } + + /** + * List who an analysis is shared with + * Returns the users and teams the analysis has been shared with and the permission each one holds. Requires read access to the analysis. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found + * @param analysisId Analysis ID (required) + * @return ApiResponse<ListAccessRulesOutputBody> + * @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 v3ListAnalysisAccessRulesWithHttpInfo(@javax.annotation.Nonnull Long analysisId) throws ApiException { + okhttp3.Call localVarCall = v3ListAnalysisAccessRulesValidateBeforeCall(analysisId, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * List who an analysis is shared with (asynchronously) + * Returns the users and teams the analysis has been shared with and the permission each one holds. Requires read access to the analysis. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found + * @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 -
404 Not Found -
422 Unprocessable Entity -
500 Internal Server Error -
+ */ + public okhttp3.Call v3ListAnalysisAccessRulesAsync(@javax.annotation.Nonnull Long analysisId, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = v3ListAnalysisAccessRulesValidateBeforeCall(analysisId, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } /** * Build call for v3ListAnalysisGlobals * @param analysisId Analysis ID (required) @@ -8390,6 +8552,165 @@ public okhttp3.Call v3RequeueAnalysisAsync(@javax.annotation.Nonnull Long analys localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } + /** + * Build call for v3RevokeAnalysisAccess + * @param analysisId Analysis ID (required) + * @param userId The user to stop sharing with. Exactly one of user_id and team_id is required (optional) + * @param teamId The team to stop sharing with. Exactly one of user_id and team_id is required (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + + + + + +
Response Details
Status Code Description Response Headers
204 No Content -
400 Bad Request -
403 Forbidden -
404 Not Found -
422 Unprocessable Entity -
500 Internal Server Error -
+ */ + public okhttp3.Call v3RevokeAnalysisAccessCall(@javax.annotation.Nonnull Long analysisId, @javax.annotation.Nullable Long userId, @javax.annotation.Nullable Long teamId, 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}/access-rules" + .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 (userId != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("user_id", userId)); + } + + if (teamId != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("team_id", teamId)); + } + + 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, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call v3RevokeAnalysisAccessValidateBeforeCall(@javax.annotation.Nonnull Long analysisId, @javax.annotation.Nullable Long userId, @javax.annotation.Nullable Long teamId, 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 v3RevokeAnalysisAccess(Async)"); + } + + return v3RevokeAnalysisAccessCall(analysisId, userId, teamId, _callback); + + } + + /** + * Stop sharing an analysis with a user or team + * Removes the access rule of one user or one team, identified by the `user_id` or `team_id` query parameter. Removing a rule that does not exist succeeds. Requires edit access to the analysis. **Error codes:** - `400` [`BAD_REQUEST`](/errors/BAD_REQUEST) — Bad Request - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied + * @param analysisId Analysis ID (required) + * @param userId The user to stop sharing with. Exactly one of user_id and team_id is required (optional) + * @param teamId The team to stop sharing with. Exactly one of user_id and team_id is required (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
204 No Content -
400 Bad Request -
403 Forbidden -
404 Not Found -
422 Unprocessable Entity -
500 Internal Server Error -
+ */ + public void v3RevokeAnalysisAccess(@javax.annotation.Nonnull Long analysisId, @javax.annotation.Nullable Long userId, @javax.annotation.Nullable Long teamId) throws ApiException { + v3RevokeAnalysisAccessWithHttpInfo(analysisId, userId, teamId); + } + + /** + * Stop sharing an analysis with a user or team + * Removes the access rule of one user or one team, identified by the `user_id` or `team_id` query parameter. Removing a rule that does not exist succeeds. Requires edit access to the analysis. **Error codes:** - `400` [`BAD_REQUEST`](/errors/BAD_REQUEST) — Bad Request - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied + * @param analysisId Analysis ID (required) + * @param userId The user to stop sharing with. Exactly one of user_id and team_id is required (optional) + * @param teamId The team to stop sharing with. Exactly one of user_id and team_id is required (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
204 No Content -
400 Bad Request -
403 Forbidden -
404 Not Found -
422 Unprocessable Entity -
500 Internal Server Error -
+ */ + public ApiResponse v3RevokeAnalysisAccessWithHttpInfo(@javax.annotation.Nonnull Long analysisId, @javax.annotation.Nullable Long userId, @javax.annotation.Nullable Long teamId) throws ApiException { + okhttp3.Call localVarCall = v3RevokeAnalysisAccessValidateBeforeCall(analysisId, userId, teamId, null); + return localVarApiClient.execute(localVarCall); + } + + /** + * Stop sharing an analysis with a user or team (asynchronously) + * Removes the access rule of one user or one team, identified by the `user_id` or `team_id` query parameter. Removing a rule that does not exist succeeds. Requires edit access to the analysis. **Error codes:** - `400` [`BAD_REQUEST`](/errors/BAD_REQUEST) — Bad Request - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied + * @param analysisId Analysis ID (required) + * @param userId The user to stop sharing with. Exactly one of user_id and team_id is required (optional) + * @param teamId The team to stop sharing with. Exactly one of user_id and team_id is required (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
204 No Content -
400 Bad Request -
403 Forbidden -
404 Not Found -
422 Unprocessable Entity -
500 Internal Server Error -
+ */ + public okhttp3.Call v3RevokeAnalysisAccessAsync(@javax.annotation.Nonnull Long analysisId, @javax.annotation.Nullable Long userId, @javax.annotation.Nullable Long teamId, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = v3RevokeAnalysisAccessValidateBeforeCall(analysisId, userId, teamId, _callback); + localVarApiClient.executeAsync(localVarCall, _callback); + return localVarCall; + } /** * Build call for v3RunDynamicExecution * @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 d47cb91a..bfd90d17 100644 --- a/src/main/java/ai/reveng/api/AuthenticationUsersApi.java +++ b/src/main/java/ai/reveng/api/AuthenticationUsersApi.java @@ -32,7 +32,9 @@ import ai.reveng.model.BaseResponseListUserActivityResponse; import ai.reveng.model.GetPublicUserOutputBody; import ai.reveng.model.GetUserActivityOutputBody; +import ai.reveng.model.ListPrincipalsOutputBody; import ai.reveng.model.ListPublicUsersOutputBody; +import ai.reveng.model.ListTeamsOutputBody; import ai.reveng.model.SubmitFeedbackBody; import ai.reveng.model.SubmitFeedbackOutputBody; import ai.reveng.model.SubmitUserFeedbackRequest; @@ -750,6 +752,274 @@ public okhttp3.Call v3GetUserActivityAsync(final ApiCallback + Response Details + Status Code Description Response Headers + 200 OK - + 0 Error - + + */ + public okhttp3.Call v3ListPrincipalsCall(@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 = "/v3/principals"; + + 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 v3ListPrincipalsValidateBeforeCall(@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 v3ListPrincipals(Async)"); + } + + return v3ListPrincipalsCall(searchTerm, _callback); + + } + + /** + * Search users and teams + * Returns up to 5 matching users and up to 5 matching teams whose name contains the search term (case-insensitive), scoped to the caller's organisation using the same rules as the individual user and team search endpoints. + * @param searchTerm Text the user's username or team's name contains (case-insensitive) (required) + * @return ListPrincipalsOutputBody + * @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 ListPrincipalsOutputBody v3ListPrincipals(@javax.annotation.Nonnull String searchTerm) throws ApiException { + ApiResponse localVarResp = v3ListPrincipalsWithHttpInfo(searchTerm); + return localVarResp.getData(); + } + + /** + * Search users and teams + * Returns up to 5 matching users and up to 5 matching teams whose name contains the search term (case-insensitive), scoped to the caller's organisation using the same rules as the individual user and team search endpoints. + * @param searchTerm Text the user's username or team's name contains (case-insensitive) (required) + * @return ApiResponse<ListPrincipalsOutputBody> + * @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 v3ListPrincipalsWithHttpInfo(@javax.annotation.Nonnull String searchTerm) throws ApiException { + okhttp3.Call localVarCall = v3ListPrincipalsValidateBeforeCall(searchTerm, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Search users and teams (asynchronously) + * Returns up to 5 matching users and up to 5 matching teams whose name contains the search term (case-insensitive), scoped to the caller's organisation using the same rules as the individual user and team search endpoints. + * @param searchTerm Text the user's username or team's name 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 v3ListPrincipalsAsync(@javax.annotation.Nonnull String searchTerm, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = v3ListPrincipalsValidateBeforeCall(searchTerm, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for v3ListTeams + * @param searchTerm Text the team name contains (case-insensitive) (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 -
0 Error -
+ */ + public okhttp3.Call v3ListTeamsCall(@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 = "/v3/teams"; + + 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 v3ListTeamsValidateBeforeCall(@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 v3ListTeams(Async)"); + } + + return v3ListTeamsCall(searchTerm, _callback); + + } + + /** + * Search teams + * Returns up to 5 teams whose name contains the search term (case-insensitive). Returns every team in the caller's organisation, or — if the organisation is named \"Internal\" — only the teams the caller belongs to. + * @param searchTerm Text the team name contains (case-insensitive) (required) + * @return ListTeamsOutputBody + * @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 ListTeamsOutputBody v3ListTeams(@javax.annotation.Nonnull String searchTerm) throws ApiException { + ApiResponse localVarResp = v3ListTeamsWithHttpInfo(searchTerm); + return localVarResp.getData(); + } + + /** + * Search teams + * Returns up to 5 teams whose name contains the search term (case-insensitive). Returns every team in the caller's organisation, or — if the organisation is named \"Internal\" — only the teams the caller belongs to. + * @param searchTerm Text the team name contains (case-insensitive) (required) + * @return ApiResponse<ListTeamsOutputBody> + * @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 v3ListTeamsWithHttpInfo(@javax.annotation.Nonnull String searchTerm) throws ApiException { + okhttp3.Call localVarCall = v3ListTeamsValidateBeforeCall(searchTerm, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Search teams (asynchronously) + * Returns up to 5 teams whose name contains the search term (case-insensitive). Returns every team in the caller's organisation, or — if the organisation is named \"Internal\" — only the teams the caller belongs to. + * @param searchTerm Text the team name 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 v3ListTeamsAsync(@javax.annotation.Nonnull String searchTerm, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = v3ListTeamsValidateBeforeCall(searchTerm, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } /** * Build call for v3ListUsers * @param searchTerm Text the username contains (case-insensitive) (required) @@ -825,7 +1095,7 @@ private okhttp3.Call v3ListUsersValidateBeforeCall(@javax.annotation.Nonnull Str /** * Search users - * Returns up to 5 active users whose username contains the search term (case-insensitive), with their ID and username, ordered by username. + * Returns up to 5 active users in the caller's organisation 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 @@ -844,7 +1114,7 @@ public ListPublicUsersOutputBody v3ListUsers(@javax.annotation.Nonnull String se /** * Search users - * Returns up to 5 active users whose username contains the search term (case-insensitive), with their ID and username, ordered by username. + * Returns up to 5 active users in the caller's organisation 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 @@ -864,7 +1134,7 @@ public ApiResponse v3ListUsersWithHttpInfo(@javax.ann /** * 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. + * Returns up to 5 active users in the caller's organisation 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 diff --git a/src/main/java/ai/reveng/api/ConversationsApi.java b/src/main/java/ai/reveng/api/ConversationsApi.java index 2601e9df..95e82291 100644 --- a/src/main/java/ai/reveng/api/ConversationsApi.java +++ b/src/main/java/ai/reveng/api/ConversationsApi.java @@ -91,6 +91,7 @@ public void setCustomBaseUrl(String customBaseUrl) { Status Code Description Response Headers 200 OK - 400 Bad Request - + 403 Forbidden - 404 Not Found - 422 Unprocessable Entity - 500 Internal Server Error - @@ -154,7 +155,7 @@ private okhttp3.Call cancelRunValidateBeforeCall(@javax.annotation.Nonnull UUID /** * Cancel an active run - * Cancels the currently active agentic run for the given conversation. Returns 404 if no run is in progress. **Error codes:** - `400` [`INVALID_CONVERSATION_ID`](/errors/INVALID_CONVERSATION_ID) — Invalid Conversation ID - `404` [`CONVERSATION_NOT_FOUND`](/errors/CONVERSATION_NOT_FOUND) — Conversation Not Found - `404` [`NO_ACTIVE_RUN`](/errors/NO_ACTIVE_RUN) — No Active Run + * Cancels the currently active agentic run for the given conversation. Returns 404 if no run is in progress. **Error codes:** - `400` [`INVALID_CONVERSATION_ID`](/errors/INVALID_CONVERSATION_ID) — Invalid Conversation ID - `404` [`CONVERSATION_NOT_FOUND`](/errors/CONVERSATION_NOT_FOUND) — Conversation Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `404` [`NO_ACTIVE_RUN`](/errors/NO_ACTIVE_RUN) — No Active Run * @param id Conversation UUID (required) * @return StatusResponse * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body @@ -164,6 +165,7 @@ private okhttp3.Call cancelRunValidateBeforeCall(@javax.annotation.Nonnull UUID Status Code Description Response Headers 200 OK - 400 Bad Request - + 403 Forbidden - 404 Not Found - 422 Unprocessable Entity - 500 Internal Server Error - @@ -176,7 +178,7 @@ public StatusResponse cancelRun(@javax.annotation.Nonnull UUID id) throws ApiExc /** * Cancel an active run - * Cancels the currently active agentic run for the given conversation. Returns 404 if no run is in progress. **Error codes:** - `400` [`INVALID_CONVERSATION_ID`](/errors/INVALID_CONVERSATION_ID) — Invalid Conversation ID - `404` [`CONVERSATION_NOT_FOUND`](/errors/CONVERSATION_NOT_FOUND) — Conversation Not Found - `404` [`NO_ACTIVE_RUN`](/errors/NO_ACTIVE_RUN) — No Active Run + * Cancels the currently active agentic run for the given conversation. Returns 404 if no run is in progress. **Error codes:** - `400` [`INVALID_CONVERSATION_ID`](/errors/INVALID_CONVERSATION_ID) — Invalid Conversation ID - `404` [`CONVERSATION_NOT_FOUND`](/errors/CONVERSATION_NOT_FOUND) — Conversation Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `404` [`NO_ACTIVE_RUN`](/errors/NO_ACTIVE_RUN) — No Active Run * @param id Conversation UUID (required) * @return ApiResponse<StatusResponse> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body @@ -186,6 +188,7 @@ public StatusResponse cancelRun(@javax.annotation.Nonnull UUID id) throws ApiExc Status Code Description Response Headers 200 OK - 400 Bad Request - + 403 Forbidden - 404 Not Found - 422 Unprocessable Entity - 500 Internal Server Error - @@ -199,7 +202,7 @@ public ApiResponse cancelRunWithHttpInfo(@javax.annotation.Nonnu /** * Cancel an active run (asynchronously) - * Cancels the currently active agentic run for the given conversation. Returns 404 if no run is in progress. **Error codes:** - `400` [`INVALID_CONVERSATION_ID`](/errors/INVALID_CONVERSATION_ID) — Invalid Conversation ID - `404` [`CONVERSATION_NOT_FOUND`](/errors/CONVERSATION_NOT_FOUND) — Conversation Not Found - `404` [`NO_ACTIVE_RUN`](/errors/NO_ACTIVE_RUN) — No Active Run + * Cancels the currently active agentic run for the given conversation. Returns 404 if no run is in progress. **Error codes:** - `400` [`INVALID_CONVERSATION_ID`](/errors/INVALID_CONVERSATION_ID) — Invalid Conversation ID - `404` [`CONVERSATION_NOT_FOUND`](/errors/CONVERSATION_NOT_FOUND) — Conversation Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `404` [`NO_ACTIVE_RUN`](/errors/NO_ACTIVE_RUN) — No Active Run * @param id Conversation UUID (required) * @param _callback The callback to be executed when the API call finishes * @return The request call @@ -210,6 +213,7 @@ public ApiResponse cancelRunWithHttpInfo(@javax.annotation.Nonnu Status Code Description Response Headers 200 OK - 400 Bad Request - + 403 Forbidden - 404 Not Found - 422 Unprocessable Entity - 500 Internal Server Error - @@ -235,6 +239,7 @@ public okhttp3.Call cancelRunAsync(@javax.annotation.Nonnull UUID id, final ApiC Status Code Description Response Headers 200 OK - 400 Bad Request - + 403 Forbidden - 404 Not Found - 422 Unprocessable Entity - 500 Internal Server Error - @@ -304,7 +309,7 @@ private okhttp3.Call confirmToolValidateBeforeCall(@javax.annotation.Nonnull UUI /** * Approve or reject a pending tool confirmation - * Responds to a pending tool confirmation request. The agent pauses before executing certain tools and emits a `TOOL_CONFIRMATION_REQUIRED` event. Use this endpoint to approve or reject the tool call. Returns 404 if no confirmation is pending. **Error codes:** - `400` [`INVALID_CONVERSATION_ID`](/errors/INVALID_CONVERSATION_ID) — Invalid Conversation ID - `404` [`CONVERSATION_NOT_FOUND`](/errors/CONVERSATION_NOT_FOUND) — Conversation Not Found - `404` [`NO_PENDING_CONFIRMATION`](/errors/NO_PENDING_CONFIRMATION) — No Pending Confirmation + * Responds to a pending tool confirmation request. The agent pauses before executing certain tools and emits a `TOOL_CONFIRMATION_REQUIRED` event. Use this endpoint to approve or reject the tool call. Returns 404 if no confirmation is pending. **Error codes:** - `400` [`INVALID_CONVERSATION_ID`](/errors/INVALID_CONVERSATION_ID) — Invalid Conversation ID - `404` [`CONVERSATION_NOT_FOUND`](/errors/CONVERSATION_NOT_FOUND) — Conversation Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `404` [`NO_PENDING_CONFIRMATION`](/errors/NO_PENDING_CONFIRMATION) — No Pending Confirmation * @param id Conversation UUID (required) * @param confirmToolInputBody (required) * @return StatusResponse @@ -315,6 +320,7 @@ private okhttp3.Call confirmToolValidateBeforeCall(@javax.annotation.Nonnull UUI Status Code Description Response Headers 200 OK - 400 Bad Request - + 403 Forbidden - 404 Not Found - 422 Unprocessable Entity - 500 Internal Server Error - @@ -327,7 +333,7 @@ public StatusResponse confirmTool(@javax.annotation.Nonnull UUID id, @javax.anno /** * Approve or reject a pending tool confirmation - * Responds to a pending tool confirmation request. The agent pauses before executing certain tools and emits a `TOOL_CONFIRMATION_REQUIRED` event. Use this endpoint to approve or reject the tool call. Returns 404 if no confirmation is pending. **Error codes:** - `400` [`INVALID_CONVERSATION_ID`](/errors/INVALID_CONVERSATION_ID) — Invalid Conversation ID - `404` [`CONVERSATION_NOT_FOUND`](/errors/CONVERSATION_NOT_FOUND) — Conversation Not Found - `404` [`NO_PENDING_CONFIRMATION`](/errors/NO_PENDING_CONFIRMATION) — No Pending Confirmation + * Responds to a pending tool confirmation request. The agent pauses before executing certain tools and emits a `TOOL_CONFIRMATION_REQUIRED` event. Use this endpoint to approve or reject the tool call. Returns 404 if no confirmation is pending. **Error codes:** - `400` [`INVALID_CONVERSATION_ID`](/errors/INVALID_CONVERSATION_ID) — Invalid Conversation ID - `404` [`CONVERSATION_NOT_FOUND`](/errors/CONVERSATION_NOT_FOUND) — Conversation Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `404` [`NO_PENDING_CONFIRMATION`](/errors/NO_PENDING_CONFIRMATION) — No Pending Confirmation * @param id Conversation UUID (required) * @param confirmToolInputBody (required) * @return ApiResponse<StatusResponse> @@ -338,6 +344,7 @@ public StatusResponse confirmTool(@javax.annotation.Nonnull UUID id, @javax.anno Status Code Description Response Headers 200 OK - 400 Bad Request - + 403 Forbidden - 404 Not Found - 422 Unprocessable Entity - 500 Internal Server Error - @@ -351,7 +358,7 @@ public ApiResponse confirmToolWithHttpInfo(@javax.annotation.Non /** * Approve or reject a pending tool confirmation (asynchronously) - * Responds to a pending tool confirmation request. The agent pauses before executing certain tools and emits a `TOOL_CONFIRMATION_REQUIRED` event. Use this endpoint to approve or reject the tool call. Returns 404 if no confirmation is pending. **Error codes:** - `400` [`INVALID_CONVERSATION_ID`](/errors/INVALID_CONVERSATION_ID) — Invalid Conversation ID - `404` [`CONVERSATION_NOT_FOUND`](/errors/CONVERSATION_NOT_FOUND) — Conversation Not Found - `404` [`NO_PENDING_CONFIRMATION`](/errors/NO_PENDING_CONFIRMATION) — No Pending Confirmation + * Responds to a pending tool confirmation request. The agent pauses before executing certain tools and emits a `TOOL_CONFIRMATION_REQUIRED` event. Use this endpoint to approve or reject the tool call. Returns 404 if no confirmation is pending. **Error codes:** - `400` [`INVALID_CONVERSATION_ID`](/errors/INVALID_CONVERSATION_ID) — Invalid Conversation ID - `404` [`CONVERSATION_NOT_FOUND`](/errors/CONVERSATION_NOT_FOUND) — Conversation Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `404` [`NO_PENDING_CONFIRMATION`](/errors/NO_PENDING_CONFIRMATION) — No Pending Confirmation * @param id Conversation UUID (required) * @param confirmToolInputBody (required) * @param _callback The callback to be executed when the API call finishes @@ -363,6 +370,7 @@ public ApiResponse confirmToolWithHttpInfo(@javax.annotation.Non Status Code Description Response Headers 200 OK - 400 Bad Request - + 403 Forbidden - 404 Not Found - 422 Unprocessable Entity - 500 Internal Server Error - @@ -863,7 +871,7 @@ private okhttp3.Call sendMessageValidateBeforeCall(@javax.annotation.Nonnull UUI /** * Send a message and start an agentic run - * Sends a user message to the conversation and kicks off an agentic processing loop in the background. Returns immediately with 202 Accepted. Subscribe to `/v2/conversations/{id}/events` via SSE to receive real-time updates including text deltas, tool calls, and run lifecycle events. **Error codes:** - `400` [`BAD_REQUEST`](/errors/BAD_REQUEST) — Bad Request - `400` [`INVALID_CONVERSATION_ID`](/errors/INVALID_CONVERSATION_ID) — Invalid Conversation ID - `404` [`CONVERSATION_NOT_FOUND`](/errors/CONVERSATION_NOT_FOUND) — Conversation Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `402` [`INSUFFICIENT_CREDITS`](/errors/INSUFFICIENT_CREDITS) — Insufficient Credits - `409` [`RUN_ALREADY_ACTIVE`](/errors/RUN_ALREADY_ACTIVE) — Run Already Active + * Sends a user message to the conversation and kicks off an agentic processing loop in the background. Returns immediately with 202 Accepted. Subscribe to `/v2/conversations/{id}/events` via SSE to receive real-time updates including text deltas, tool calls, and run lifecycle events. **Error codes:** - `400` [`BAD_REQUEST`](/errors/BAD_REQUEST) — Bad Request - `400` [`INVALID_CONVERSATION_ID`](/errors/INVALID_CONVERSATION_ID) — Invalid Conversation ID - `404` [`CONVERSATION_NOT_FOUND`](/errors/CONVERSATION_NOT_FOUND) — Conversation Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `402` [`INSUFFICIENT_CREDITS`](/errors/INSUFFICIENT_CREDITS) — Insufficient Credits - `402` [`INVESTIGATION_BUDGET_SPENT`](/errors/INVESTIGATION_BUDGET_SPENT) — Investigation Budget Spent - `409` [`RUN_ALREADY_ACTIVE`](/errors/RUN_ALREADY_ACTIVE) — Run Already Active * @param id Conversation UUID (required) * @param sendMessageRequest (required) * @return StatusResponse @@ -889,7 +897,7 @@ public StatusResponse sendMessage(@javax.annotation.Nonnull UUID id, @javax.anno /** * Send a message and start an agentic run - * Sends a user message to the conversation and kicks off an agentic processing loop in the background. Returns immediately with 202 Accepted. Subscribe to `/v2/conversations/{id}/events` via SSE to receive real-time updates including text deltas, tool calls, and run lifecycle events. **Error codes:** - `400` [`BAD_REQUEST`](/errors/BAD_REQUEST) — Bad Request - `400` [`INVALID_CONVERSATION_ID`](/errors/INVALID_CONVERSATION_ID) — Invalid Conversation ID - `404` [`CONVERSATION_NOT_FOUND`](/errors/CONVERSATION_NOT_FOUND) — Conversation Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `402` [`INSUFFICIENT_CREDITS`](/errors/INSUFFICIENT_CREDITS) — Insufficient Credits - `409` [`RUN_ALREADY_ACTIVE`](/errors/RUN_ALREADY_ACTIVE) — Run Already Active + * Sends a user message to the conversation and kicks off an agentic processing loop in the background. Returns immediately with 202 Accepted. Subscribe to `/v2/conversations/{id}/events` via SSE to receive real-time updates including text deltas, tool calls, and run lifecycle events. **Error codes:** - `400` [`BAD_REQUEST`](/errors/BAD_REQUEST) — Bad Request - `400` [`INVALID_CONVERSATION_ID`](/errors/INVALID_CONVERSATION_ID) — Invalid Conversation ID - `404` [`CONVERSATION_NOT_FOUND`](/errors/CONVERSATION_NOT_FOUND) — Conversation Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `402` [`INSUFFICIENT_CREDITS`](/errors/INSUFFICIENT_CREDITS) — Insufficient Credits - `402` [`INVESTIGATION_BUDGET_SPENT`](/errors/INVESTIGATION_BUDGET_SPENT) — Investigation Budget Spent - `409` [`RUN_ALREADY_ACTIVE`](/errors/RUN_ALREADY_ACTIVE) — Run Already Active * @param id Conversation UUID (required) * @param sendMessageRequest (required) * @return ApiResponse<StatusResponse> @@ -916,7 +924,7 @@ public ApiResponse sendMessageWithHttpInfo(@javax.annotation.Non /** * Send a message and start an agentic run (asynchronously) - * Sends a user message to the conversation and kicks off an agentic processing loop in the background. Returns immediately with 202 Accepted. Subscribe to `/v2/conversations/{id}/events` via SSE to receive real-time updates including text deltas, tool calls, and run lifecycle events. **Error codes:** - `400` [`BAD_REQUEST`](/errors/BAD_REQUEST) — Bad Request - `400` [`INVALID_CONVERSATION_ID`](/errors/INVALID_CONVERSATION_ID) — Invalid Conversation ID - `404` [`CONVERSATION_NOT_FOUND`](/errors/CONVERSATION_NOT_FOUND) — Conversation Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `402` [`INSUFFICIENT_CREDITS`](/errors/INSUFFICIENT_CREDITS) — Insufficient Credits - `409` [`RUN_ALREADY_ACTIVE`](/errors/RUN_ALREADY_ACTIVE) — Run Already Active + * Sends a user message to the conversation and kicks off an agentic processing loop in the background. Returns immediately with 202 Accepted. Subscribe to `/v2/conversations/{id}/events` via SSE to receive real-time updates including text deltas, tool calls, and run lifecycle events. **Error codes:** - `400` [`BAD_REQUEST`](/errors/BAD_REQUEST) — Bad Request - `400` [`INVALID_CONVERSATION_ID`](/errors/INVALID_CONVERSATION_ID) — Invalid Conversation ID - `404` [`CONVERSATION_NOT_FOUND`](/errors/CONVERSATION_NOT_FOUND) — Conversation Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `402` [`INSUFFICIENT_CREDITS`](/errors/INSUFFICIENT_CREDITS) — Insufficient Credits - `402` [`INVESTIGATION_BUDGET_SPENT`](/errors/INVESTIGATION_BUDGET_SPENT) — Investigation Budget Spent - `409` [`RUN_ALREADY_ACTIVE`](/errors/RUN_ALREADY_ACTIVE) — Run Already Active * @param id Conversation UUID (required) * @param sendMessageRequest (required) * @param _callback The callback to be executed when the API call finishes diff --git a/src/main/java/ai/reveng/api/DataTypesApi.java b/src/main/java/ai/reveng/api/DataTypesApi.java index 1bac6050..d9c39083 100644 --- a/src/main/java/ai/reveng/api/DataTypesApi.java +++ b/src/main/java/ai/reveng/api/DataTypesApi.java @@ -1326,7 +1326,7 @@ private okhttp3.Call v3ListDataTypeFunctionsValidateBeforeCall(@javax.annotation /** * List the functions using a data type - * Functions that use this data type as their return type or as a parameter. Matches the `data_type_id` exactly as it appears in the signature, so a function taking `sockaddr_in *` matches the pointer type rather than `sockaddr_in`. Ordered by function ID. There is no total count; page with `after_function_id`. **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 + * Functions that use this data type, each listed once with how it uses it in `usage_kinds`: in its signature (return or parameter type), in-line (its AI decompilation names the type in its code), or as a member (its AI decompilation reads a struct or union member of this type, or it references a global variable of this type). A function using a pointer to, typedef of or array of the type uses the type too, so a function taking `sockaddr_in *` is listed under `sockaddr_in`. The reverse does not hold: a function using `sockaddr_in` is not listed under `sockaddr_in *`. In-line and member uses come from a function's latest AI decompilation, so a function not decompiled since this was introduced shows only its signature and global variable uses. Ordered by function ID. There is no total count; page with `after_function_id`. **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 analysisId Analysis ID (required) * @param dataTypeId Data type ID, as returned by the data types list for this analysis. 0 is a valid id. (required) * @param pageSize Page size. (optional, default to 50) @@ -1351,7 +1351,7 @@ public ListDataTypeFunctionsBody v3ListDataTypeFunctions(@javax.annotation.Nonnu /** * List the functions using a data type - * Functions that use this data type as their return type or as a parameter. Matches the `data_type_id` exactly as it appears in the signature, so a function taking `sockaddr_in *` matches the pointer type rather than `sockaddr_in`. Ordered by function ID. There is no total count; page with `after_function_id`. **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 + * Functions that use this data type, each listed once with how it uses it in `usage_kinds`: in its signature (return or parameter type), in-line (its AI decompilation names the type in its code), or as a member (its AI decompilation reads a struct or union member of this type, or it references a global variable of this type). A function using a pointer to, typedef of or array of the type uses the type too, so a function taking `sockaddr_in *` is listed under `sockaddr_in`. The reverse does not hold: a function using `sockaddr_in` is not listed under `sockaddr_in *`. In-line and member uses come from a function's latest AI decompilation, so a function not decompiled since this was introduced shows only its signature and global variable uses. Ordered by function ID. There is no total count; page with `after_function_id`. **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 analysisId Analysis ID (required) * @param dataTypeId Data type ID, as returned by the data types list for this analysis. 0 is a valid id. (required) * @param pageSize Page size. (optional, default to 50) @@ -1377,7 +1377,7 @@ public ApiResponse v3ListDataTypeFunctionsWithHttpInf /** * List the functions using a data type (asynchronously) - * Functions that use this data type as their return type or as a parameter. Matches the `data_type_id` exactly as it appears in the signature, so a function taking `sockaddr_in *` matches the pointer type rather than `sockaddr_in`. Ordered by function ID. There is no total count; page with `after_function_id`. **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 + * Functions that use this data type, each listed once with how it uses it in `usage_kinds`: in its signature (return or parameter type), in-line (its AI decompilation names the type in its code), or as a member (its AI decompilation reads a struct or union member of this type, or it references a global variable of this type). A function using a pointer to, typedef of or array of the type uses the type too, so a function taking `sockaddr_in *` is listed under `sockaddr_in`. The reverse does not hold: a function using `sockaddr_in` is not listed under `sockaddr_in *`. In-line and member uses come from a function's latest AI decompilation, so a function not decompiled since this was introduced shows only its signature and global variable uses. Ordered by function ID. There is no total count; page with `after_function_id`. **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 analysisId Analysis ID (required) * @param dataTypeId Data type ID, as returned by the data types list for this analysis. 0 is a valid id. (required) * @param pageSize Page size. (optional, default to 50) diff --git a/src/main/java/ai/reveng/api/ExternalSourcesApi.java b/src/main/java/ai/reveng/api/ExternalSourcesApi.java index 4d05a19f..b670fb6b 100644 --- a/src/main/java/ai/reveng/api/ExternalSourcesApi.java +++ b/src/main/java/ai/reveng/api/ExternalSourcesApi.java @@ -27,10 +27,6 @@ import ai.reveng.model.APIError; -import ai.reveng.model.BaseResponse; -import ai.reveng.model.BaseResponseExternalResponse; -import ai.reveng.model.BaseResponseStr; -import ai.reveng.model.BaseResponseTaskResponse; import ai.reveng.model.OperationVirusTotalScanMetadataVirusTotalScanResult; import java.lang.reflect.Type; @@ -76,434 +72,6 @@ public void setCustomBaseUrl(String customBaseUrl) { this.localCustomBaseUrl = customBaseUrl; } - /** - * Build call for createExternalTaskVt - * @param analysisId (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 Successful Response -
422 Invalid request parameters -
409 Request already queued -
- * @deprecated - */ - @Deprecated - public okhttp3.Call createExternalTaskVtCall(@javax.annotation.Nonnull Integer 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 = "/v2/analysis/{analysis_id}/external/vt" - .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); - } - - @Deprecated - @SuppressWarnings("rawtypes") - private okhttp3.Call createExternalTaskVtValidateBeforeCall(@javax.annotation.Nonnull Integer 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 createExternalTaskVt(Async)"); - } - - return createExternalTaskVtCall(analysisId, _callback); - - } - - /** - * Pulls data from VirusTotal - * - * @param analysisId (required) - * @return BaseResponseStr - * @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 Successful Response -
422 Invalid request parameters -
409 Request already queued -
- * @deprecated - */ - @Deprecated - public BaseResponseStr createExternalTaskVt(@javax.annotation.Nonnull Integer analysisId) throws ApiException { - ApiResponse localVarResp = createExternalTaskVtWithHttpInfo(analysisId); - return localVarResp.getData(); - } - - /** - * Pulls data from VirusTotal - * - * @param analysisId (required) - * @return ApiResponse<BaseResponseStr> - * @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 Successful Response -
422 Invalid request parameters -
409 Request already queued -
- * @deprecated - */ - @Deprecated - public ApiResponse createExternalTaskVtWithHttpInfo(@javax.annotation.Nonnull Integer analysisId) throws ApiException { - okhttp3.Call localVarCall = createExternalTaskVtValidateBeforeCall(analysisId, null); - Type localVarReturnType = new TypeToken(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * Pulls data from VirusTotal (asynchronously) - * - * @param analysisId (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 Successful Response -
422 Invalid request parameters -
409 Request already queued -
- * @deprecated - */ - @Deprecated - public okhttp3.Call createExternalTaskVtAsync(@javax.annotation.Nonnull Integer analysisId, final ApiCallback _callback) throws ApiException { - - okhttp3.Call localVarCall = createExternalTaskVtValidateBeforeCall(analysisId, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); - return localVarCall; - } - /** - * Build call for getVtData - * @param analysisId (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 Successful Response -
422 Invalid request parameters -
404 No data retrieved from VirusTotal for the given analysis_id -
- * @deprecated - */ - @Deprecated - public okhttp3.Call getVtDataCall(@javax.annotation.Nonnull Integer 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 = "/v2/analysis/{analysis_id}/external/vt" - .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); - } - - @Deprecated - @SuppressWarnings("rawtypes") - private okhttp3.Call getVtDataValidateBeforeCall(@javax.annotation.Nonnull Integer 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 getVtData(Async)"); - } - - return getVtDataCall(analysisId, _callback); - - } - - /** - * Get VirusTotal data - * - * @param analysisId (required) - * @return BaseResponseExternalResponse - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - - - -
Response Details
Status Code Description Response Headers
200 Successful Response -
422 Invalid request parameters -
404 No data retrieved from VirusTotal for the given analysis_id -
- * @deprecated - */ - @Deprecated - public BaseResponseExternalResponse getVtData(@javax.annotation.Nonnull Integer analysisId) throws ApiException { - ApiResponse localVarResp = getVtDataWithHttpInfo(analysisId); - return localVarResp.getData(); - } - - /** - * Get VirusTotal data - * - * @param analysisId (required) - * @return ApiResponse<BaseResponseExternalResponse> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - - - -
Response Details
Status Code Description Response Headers
200 Successful Response -
422 Invalid request parameters -
404 No data retrieved from VirusTotal for the given analysis_id -
- * @deprecated - */ - @Deprecated - public ApiResponse getVtDataWithHttpInfo(@javax.annotation.Nonnull Integer analysisId) throws ApiException { - okhttp3.Call localVarCall = getVtDataValidateBeforeCall(analysisId, null); - Type localVarReturnType = new TypeToken(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * Get VirusTotal data (asynchronously) - * - * @param analysisId (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 Successful Response -
422 Invalid request parameters -
404 No data retrieved from VirusTotal for the given analysis_id -
- * @deprecated - */ - @Deprecated - public okhttp3.Call getVtDataAsync(@javax.annotation.Nonnull Integer analysisId, final ApiCallback _callback) throws ApiException { - - okhttp3.Call localVarCall = getVtDataValidateBeforeCall(analysisId, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); - return localVarCall; - } - /** - * Build call for getVtTaskStatus - * @param analysisId (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 Successful Response -
422 Invalid request parameters -
- * @deprecated - */ - @Deprecated - public okhttp3.Call getVtTaskStatusCall(@javax.annotation.Nonnull Integer 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 = "/v2/analysis/{analysis_id}/external/vt/status" - .replace("{" + "analysis_id" + "}", localVarApiClient.escapeString(analysisId.toString())); - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = { - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - - String[] localVarAuthNames = new String[] { "APIKey", "bearerAuth" }; - return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); - } - - @Deprecated - @SuppressWarnings("rawtypes") - private okhttp3.Call getVtTaskStatusValidateBeforeCall(@javax.annotation.Nonnull Integer 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 getVtTaskStatus(Async)"); - } - - return getVtTaskStatusCall(analysisId, _callback); - - } - - /** - * Check the status of VirusTotal data retrieval - * - * @param analysisId (required) - * @return BaseResponseTaskResponse - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - - -
Response Details
Status Code Description Response Headers
200 Successful Response -
422 Invalid request parameters -
- * @deprecated - */ - @Deprecated - public BaseResponseTaskResponse getVtTaskStatus(@javax.annotation.Nonnull Integer analysisId) throws ApiException { - ApiResponse localVarResp = getVtTaskStatusWithHttpInfo(analysisId); - return localVarResp.getData(); - } - - /** - * Check the status of VirusTotal data retrieval - * - * @param analysisId (required) - * @return ApiResponse<BaseResponseTaskResponse> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - - -
Response Details
Status Code Description Response Headers
200 Successful Response -
422 Invalid request parameters -
- * @deprecated - */ - @Deprecated - public ApiResponse getVtTaskStatusWithHttpInfo(@javax.annotation.Nonnull Integer analysisId) throws ApiException { - okhttp3.Call localVarCall = getVtTaskStatusValidateBeforeCall(analysisId, null); - Type localVarReturnType = new TypeToken(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * Check the status of VirusTotal data retrieval (asynchronously) - * - * @param analysisId (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 Successful Response -
422 Invalid request parameters -
- * @deprecated - */ - @Deprecated - public okhttp3.Call getVtTaskStatusAsync(@javax.annotation.Nonnull Integer analysisId, final ApiCallback _callback) throws ApiException { - - okhttp3.Call localVarCall = getVtTaskStatusValidateBeforeCall(analysisId, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); - return localVarCall; - } /** * Build call for v3GetVirustotalScanOperation * @param binaryId Binary ID (required) diff --git a/src/main/java/ai/reveng/api/FunctionsAiDecompilationApi.java b/src/main/java/ai/reveng/api/FunctionsAiDecompilationApi.java index 4e84bb57..41c81348 100644 --- a/src/main/java/ai/reveng/api/FunctionsAiDecompilationApi.java +++ b/src/main/java/ai/reveng/api/FunctionsAiDecompilationApi.java @@ -98,6 +98,8 @@ public void setCustomBaseUrl(String customBaseUrl) { * @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 repair Ask a language model to replace any unmatched placeholders left in the decompilation with grounded code. Off unless requested: the pass spends several model calls on top of the decompilation, and declines outright unless it can ground every placeholder. Runs after the result is stored, so it amends a decompilation you can already read. Cannot enable the pass when the server has it off. (optional, default to false) + * @param refine Ask a language model to rebuild output the decompiler returned degenerate, truncated or empty, and output a requested repair pass declined. Off unless requested: the pass is a bounded tool loop that can spend a dozen model calls. Runs after the result is stored, so it amends a decompilation you can already read. Cannot enable the pass when the server has it off. (optional, default to false) * @param _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object @@ -115,7 +117,7 @@ public void setCustomBaseUrl(String customBaseUrl) { 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 naming, @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, @javax.annotation.Nullable Boolean repair, @javax.annotation.Nullable Boolean refine, final ApiCallback _callback) throws ApiException { String basePath = null; // Operation Servers String[] localBasePaths = new String[] { }; @@ -157,6 +159,14 @@ public okhttp3.Call createAiDecompilationCall(@javax.annotation.Nonnull Long fun localVarQueryParams.addAll(localVarApiClient.parameterToPair("apply_types", applyTypes)); } + if (repair != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("repair", repair)); + } + + if (refine != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("refine", refine)); + } + final String[] localVarAccepts = { "application/json" }; @@ -177,13 +187,13 @@ 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 naming, @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, @javax.annotation.Nullable Boolean repair, @javax.annotation.Nullable Boolean refine, 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, naming, applyTypes, _callback); + return createAiDecompilationCall(functionId, temperature, typeSuggestions, naming, applyTypes, repair, refine, _callback); } @@ -195,6 +205,8 @@ private okhttp3.Call createAiDecompilationValidateBeforeCall(@javax.annotation.N * @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 repair Ask a language model to replace any unmatched placeholders left in the decompilation with grounded code. Off unless requested: the pass spends several model calls on top of the decompilation, and declines outright unless it can ground every placeholder. Runs after the result is stored, so it amends a decompilation you can already read. Cannot enable the pass when the server has it off. (optional, default to false) + * @param refine Ask a language model to rebuild output the decompiler returned degenerate, truncated or empty, and output a requested repair pass declined. Off unless requested: the pass is a bounded tool loop that can spend a dozen model calls. Runs after the result is stored, so it amends a decompilation you can already read. Cannot enable the pass when the server has it off. (optional, default to false) * @return CreateAIDecompOutputBody * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details @@ -211,8 +223,8 @@ private okhttp3.Call createAiDecompilationValidateBeforeCall(@javax.annotation.N 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 naming, @javax.annotation.Nullable Boolean applyTypes) throws ApiException { - ApiResponse localVarResp = createAiDecompilationWithHttpInfo(functionId, temperature, typeSuggestions, naming, 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, @javax.annotation.Nullable Boolean repair, @javax.annotation.Nullable Boolean refine) throws ApiException { + ApiResponse localVarResp = createAiDecompilationWithHttpInfo(functionId, temperature, typeSuggestions, naming, applyTypes, repair, refine); return localVarResp.getData(); } @@ -224,6 +236,8 @@ public CreateAIDecompOutputBody createAiDecompilation(@javax.annotation.Nonnull * @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 repair Ask a language model to replace any unmatched placeholders left in the decompilation with grounded code. Off unless requested: the pass spends several model calls on top of the decompilation, and declines outright unless it can ground every placeholder. Runs after the result is stored, so it amends a decompilation you can already read. Cannot enable the pass when the server has it off. (optional, default to false) + * @param refine Ask a language model to rebuild output the decompiler returned degenerate, truncated or empty, and output a requested repair pass declined. Off unless requested: the pass is a bounded tool loop that can spend a dozen model calls. Runs after the result is stored, so it amends a decompilation you can already read. Cannot enable the pass when the server has it off. (optional, default to false) * @return ApiResponse<CreateAIDecompOutputBody> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details @@ -240,8 +254,8 @@ public CreateAIDecompOutputBody createAiDecompilation(@javax.annotation.Nonnull 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 naming, @javax.annotation.Nullable Boolean applyTypes) throws ApiException { - okhttp3.Call localVarCall = createAiDecompilationValidateBeforeCall(functionId, temperature, typeSuggestions, naming, 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, @javax.annotation.Nullable Boolean repair, @javax.annotation.Nullable Boolean refine) throws ApiException { + okhttp3.Call localVarCall = createAiDecompilationValidateBeforeCall(functionId, temperature, typeSuggestions, naming, applyTypes, repair, refine, null); Type localVarReturnType = new TypeToken(){}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } @@ -254,6 +268,8 @@ public ApiResponse createAiDecompilationWithHttpInfo(@ * @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 repair Ask a language model to replace any unmatched placeholders left in the decompilation with grounded code. Off unless requested: the pass spends several model calls on top of the decompilation, and declines outright unless it can ground every placeholder. Runs after the result is stored, so it amends a decompilation you can already read. Cannot enable the pass when the server has it off. (optional, default to false) + * @param refine Ask a language model to rebuild output the decompiler returned degenerate, truncated or empty, and output a requested repair pass declined. Off unless requested: the pass is a bounded tool loop that can spend a dozen model calls. Runs after the result is stored, so it amends a decompilation you can already read. Cannot enable the pass when the server has it off. (optional, default to false) * @param _callback The callback to be executed when the API call finishes * @return The request call * @throws ApiException If fail to process the API call, e.g. serializing the request body object @@ -271,9 +287,9 @@ public ApiResponse createAiDecompilationWithHttpInfo(@ 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 naming, @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, @javax.annotation.Nullable Boolean repair, @javax.annotation.Nullable Boolean refine, final ApiCallback _callback) throws ApiException { - okhttp3.Call localVarCall = createAiDecompilationValidateBeforeCall(functionId, temperature, typeSuggestions, naming, applyTypes, _callback); + okhttp3.Call localVarCall = createAiDecompilationValidateBeforeCall(functionId, temperature, typeSuggestions, naming, applyTypes, repair, refine, _callback); Type localVarReturnType = new TypeToken(){}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; diff --git a/src/main/java/ai/reveng/api/IamUsersApi.java b/src/main/java/ai/reveng/api/IamUsersApi.java index 1d62d732..bb910d6d 100644 --- a/src/main/java/ai/reveng/api/IamUsersApi.java +++ b/src/main/java/ai/reveng/api/IamUsersApi.java @@ -127,7 +127,7 @@ public okhttp3.Call getMeCall(final ApiCallback _callback) throws ApiException { localVarHeaderParams.put("Content-Type", localVarContentType); } - String[] localVarAuthNames = new String[] { "bearerAuth" }; + String[] localVarAuthNames = new String[] { "APIKey", "bearerAuth" }; return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @@ -251,7 +251,7 @@ public okhttp3.Call getMyPermissionsCall(final ApiCallback _callback) throws Api localVarHeaderParams.put("Content-Type", localVarContentType); } - String[] localVarAuthNames = new String[] { "bearerAuth" }; + String[] localVarAuthNames = new String[] { "APIKey", "bearerAuth" }; return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } diff --git a/src/main/java/ai/reveng/api/InvestigationsApi.java b/src/main/java/ai/reveng/api/InvestigationsApi.java new file mode 100644 index 00000000..48e0ebac --- /dev/null +++ b/src/main/java/ai/reveng/api/InvestigationsApi.java @@ -0,0 +1,1964 @@ +/* + * RevEng.AI API + * RevEng.AI is an AI-powered binary analysis platform for reverse engineering and malware analysis. It provides similarity search across executable binaries and functions, AI-driven decompilation, dynamic execution analysis, firmware unpacking, and integration with external threat intelligence sources like VirusTotal. + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package ai.reveng.api; + +import ai.reveng.invoker.ApiCallback; +import ai.reveng.invoker.ApiClient; +import ai.reveng.invoker.ApiException; +import ai.reveng.invoker.ApiResponse; +import ai.reveng.invoker.Configuration; +import ai.reveng.invoker.Pair; +import ai.reveng.invoker.ProgressRequestBody; +import ai.reveng.invoker.ProgressResponseBody; + +import com.google.gson.reflect.TypeToken; + +import java.io.IOException; + + +import ai.reveng.model.APIError; +import ai.reveng.model.BudgetBody; +import ai.reveng.model.ConversationBody; +import ai.reveng.model.CreateConversationInputBody; +import ai.reveng.model.CreateInvestigationInputBody; +import ai.reveng.model.GetFindingOutputBody; +import ai.reveng.model.GetInvestigationOutputBody; +import ai.reveng.model.InvestigationBody; +import ai.reveng.model.ListAgentRunsOutputBody; +import ai.reveng.model.ListConversationsOutputBody; +import ai.reveng.model.ListFindingsOutputBody; +import ai.reveng.model.ListInvestigationsOutputBody; +import ai.reveng.model.ListSpendOutputBody; +import ai.reveng.model.PatchInvestigationInputBody; +import ai.reveng.model.SetBudgetInputBody; + +import java.lang.reflect.Type; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +public class InvestigationsApi { + private ApiClient localVarApiClient; + private int localHostIndex; + private String localCustomBaseUrl; + + public InvestigationsApi() { + this(Configuration.getDefaultApiClient()); + } + + public InvestigationsApi(ApiClient apiClient) { + this.localVarApiClient = apiClient; + } + + public ApiClient getApiClient() { + return localVarApiClient; + } + + public void setApiClient(ApiClient apiClient) { + this.localVarApiClient = apiClient; + } + + public int getHostIndex() { + return localHostIndex; + } + + public void setHostIndex(int hostIndex) { + this.localHostIndex = hostIndex; + } + + public String getCustomBaseUrl() { + return localCustomBaseUrl; + } + + public void setCustomBaseUrl(String customBaseUrl) { + this.localCustomBaseUrl = customBaseUrl; + } + + /** + * Build call for v3CreateInvestigation + * @param createInvestigationInputBody (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 -
422 Unprocessable Entity -
500 Internal Server Error -
+ */ + public okhttp3.Call v3CreateInvestigationCall(@javax.annotation.Nonnull CreateInvestigationInputBody createInvestigationInputBody, 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 = createInvestigationInputBody; + + // create path and map variables + String localVarPath = "/v3/investigations"; + + 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 v3CreateInvestigationValidateBeforeCall(@javax.annotation.Nonnull CreateInvestigationInputBody createInvestigationInputBody, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'createInvestigationInputBody' is set + if (createInvestigationInputBody == null) { + throw new ApiException("Missing the required parameter 'createInvestigationInputBody' when calling v3CreateInvestigation(Async)"); + } + + return v3CreateInvestigationCall(createInvestigationInputBody, _callback); + + } + + /** + * Create an investigation. + * Creates an investigation owned by the caller, initially open and empty. **Error codes:** - `422` [`VALIDATION_FAILED`](/errors/VALIDATION_FAILED) — Validation Failed + * @param createInvestigationInputBody (required) + * @return InvestigationBody + * @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 -
422 Unprocessable Entity -
500 Internal Server Error -
+ */ + public InvestigationBody v3CreateInvestigation(@javax.annotation.Nonnull CreateInvestigationInputBody createInvestigationInputBody) throws ApiException { + ApiResponse localVarResp = v3CreateInvestigationWithHttpInfo(createInvestigationInputBody); + return localVarResp.getData(); + } + + /** + * Create an investigation. + * Creates an investigation owned by the caller, initially open and empty. **Error codes:** - `422` [`VALIDATION_FAILED`](/errors/VALIDATION_FAILED) — Validation Failed + * @param createInvestigationInputBody (required) + * @return ApiResponse<InvestigationBody> + * @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 -
422 Unprocessable Entity -
500 Internal Server Error -
+ */ + public ApiResponse v3CreateInvestigationWithHttpInfo(@javax.annotation.Nonnull CreateInvestigationInputBody createInvestigationInputBody) throws ApiException { + okhttp3.Call localVarCall = v3CreateInvestigationValidateBeforeCall(createInvestigationInputBody, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Create an investigation. (asynchronously) + * Creates an investigation owned by the caller, initially open and empty. **Error codes:** - `422` [`VALIDATION_FAILED`](/errors/VALIDATION_FAILED) — Validation Failed + * @param createInvestigationInputBody (required) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + + + +
Response Details
Status Code Description Response Headers
201 Created -
422 Unprocessable Entity -
500 Internal Server Error -
+ */ + public okhttp3.Call v3CreateInvestigationAsync(@javax.annotation.Nonnull CreateInvestigationInputBody createInvestigationInputBody, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = v3CreateInvestigationValidateBeforeCall(createInvestigationInputBody, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for v3CreateInvestigationConversation + * @param investigationId (required) + * @param createConversationInputBody (required) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + + + +
Response Details
Status Code Description Response Headers
201 Created -
404 Not Found -
422 Unprocessable Entity -
500 Internal Server Error -
+ */ + public okhttp3.Call v3CreateInvestigationConversationCall(@javax.annotation.Nonnull Long investigationId, @javax.annotation.Nonnull CreateConversationInputBody createConversationInputBody, 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 = createConversationInputBody; + + // create path and map variables + String localVarPath = "/v3/investigations/{investigation_id}/conversations" + .replace("{" + "investigation_id" + "}", localVarApiClient.escapeString(investigationId.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 v3CreateInvestigationConversationValidateBeforeCall(@javax.annotation.Nonnull Long investigationId, @javax.annotation.Nonnull CreateConversationInputBody createConversationInputBody, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'investigationId' is set + if (investigationId == null) { + throw new ApiException("Missing the required parameter 'investigationId' when calling v3CreateInvestigationConversation(Async)"); + } + + // verify the required parameter 'createConversationInputBody' is set + if (createConversationInputBody == null) { + throw new ApiException("Missing the required parameter 'createConversationInputBody' when calling v3CreateInvestigationConversation(Async)"); + } + + return v3CreateInvestigationConversationCall(investigationId, createConversationInputBody, _callback); + + } + + /** + * Start a conversation in an investigation. + * Starts a chat conversation held by the investigation, about the whole investigation or about one of its analyses. Anyone who can see the investigation can start one. Read it, stream it and send messages in it with the /v2/conversations endpoints; only the user who started it can send messages in it. Deleting the investigation deletes its conversations. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `422` [`VALIDATION_FAILED`](/errors/VALIDATION_FAILED) — Validation Failed + * @param investigationId (required) + * @param createConversationInputBody (required) + * @return ConversationBody + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + + +
Response Details
Status Code Description Response Headers
201 Created -
404 Not Found -
422 Unprocessable Entity -
500 Internal Server Error -
+ */ + public ConversationBody v3CreateInvestigationConversation(@javax.annotation.Nonnull Long investigationId, @javax.annotation.Nonnull CreateConversationInputBody createConversationInputBody) throws ApiException { + ApiResponse localVarResp = v3CreateInvestigationConversationWithHttpInfo(investigationId, createConversationInputBody); + return localVarResp.getData(); + } + + /** + * Start a conversation in an investigation. + * Starts a chat conversation held by the investigation, about the whole investigation or about one of its analyses. Anyone who can see the investigation can start one. Read it, stream it and send messages in it with the /v2/conversations endpoints; only the user who started it can send messages in it. Deleting the investigation deletes its conversations. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `422` [`VALIDATION_FAILED`](/errors/VALIDATION_FAILED) — Validation Failed + * @param investigationId (required) + * @param createConversationInputBody (required) + * @return ApiResponse<ConversationBody> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + + +
Response Details
Status Code Description Response Headers
201 Created -
404 Not Found -
422 Unprocessable Entity -
500 Internal Server Error -
+ */ + public ApiResponse v3CreateInvestigationConversationWithHttpInfo(@javax.annotation.Nonnull Long investigationId, @javax.annotation.Nonnull CreateConversationInputBody createConversationInputBody) throws ApiException { + okhttp3.Call localVarCall = v3CreateInvestigationConversationValidateBeforeCall(investigationId, createConversationInputBody, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Start a conversation in an investigation. (asynchronously) + * Starts a chat conversation held by the investigation, about the whole investigation or about one of its analyses. Anyone who can see the investigation can start one. Read it, stream it and send messages in it with the /v2/conversations endpoints; only the user who started it can send messages in it. Deleting the investigation deletes its conversations. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `422` [`VALIDATION_FAILED`](/errors/VALIDATION_FAILED) — Validation Failed + * @param investigationId (required) + * @param createConversationInputBody (required) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + + + + +
Response Details
Status Code Description Response Headers
201 Created -
404 Not Found -
422 Unprocessable Entity -
500 Internal Server Error -
+ */ + public okhttp3.Call v3CreateInvestigationConversationAsync(@javax.annotation.Nonnull Long investigationId, @javax.annotation.Nonnull CreateConversationInputBody createConversationInputBody, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = v3CreateInvestigationConversationValidateBeforeCall(investigationId, createConversationInputBody, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for v3DeleteInvestigation + * @param investigationId (required) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + + + + +
Response Details
Status Code Description Response Headers
204 No Content -
403 Forbidden -
404 Not Found -
422 Unprocessable Entity -
500 Internal Server Error -
+ */ + public okhttp3.Call v3DeleteInvestigationCall(@javax.annotation.Nonnull Long investigationId, 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/investigations/{investigation_id}" + .replace("{" + "investigation_id" + "}", localVarApiClient.escapeString(investigationId.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, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call v3DeleteInvestigationValidateBeforeCall(@javax.annotation.Nonnull Long investigationId, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'investigationId' is set + if (investigationId == null) { + throw new ApiException("Missing the required parameter 'investigationId' when calling v3DeleteInvestigation(Async)"); + } + + return v3DeleteInvestigationCall(investigationId, _callback); + + } + + /** + * Delete an investigation. + * Deletes an investigation and its links to analyses. The analyses themselves are not deleted. Only the owner can delete an investigation. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied + * @param investigationId (required) + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + + + +
Response Details
Status Code Description Response Headers
204 No Content -
403 Forbidden -
404 Not Found -
422 Unprocessable Entity -
500 Internal Server Error -
+ */ + public void v3DeleteInvestigation(@javax.annotation.Nonnull Long investigationId) throws ApiException { + v3DeleteInvestigationWithHttpInfo(investigationId); + } + + /** + * Delete an investigation. + * Deletes an investigation and its links to analyses. The analyses themselves are not deleted. Only the owner can delete an investigation. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied + * @param investigationId (required) + * @return ApiResponse<Void> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + + + +
Response Details
Status Code Description Response Headers
204 No Content -
403 Forbidden -
404 Not Found -
422 Unprocessable Entity -
500 Internal Server Error -
+ */ + public ApiResponse v3DeleteInvestigationWithHttpInfo(@javax.annotation.Nonnull Long investigationId) throws ApiException { + okhttp3.Call localVarCall = v3DeleteInvestigationValidateBeforeCall(investigationId, null); + return localVarApiClient.execute(localVarCall); + } + + /** + * Delete an investigation. (asynchronously) + * Deletes an investigation and its links to analyses. The analyses themselves are not deleted. Only the owner can delete an investigation. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied + * @param investigationId (required) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + + + + + +
Response Details
Status Code Description Response Headers
204 No Content -
403 Forbidden -
404 Not Found -
422 Unprocessable Entity -
500 Internal Server Error -
+ */ + public okhttp3.Call v3DeleteInvestigationAsync(@javax.annotation.Nonnull Long investigationId, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = v3DeleteInvestigationValidateBeforeCall(investigationId, _callback); + localVarApiClient.executeAsync(localVarCall, _callback); + return localVarCall; + } + /** + * Build call for v3GetInvestigation + * @param investigationId (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 v3GetInvestigationCall(@javax.annotation.Nonnull Long investigationId, 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/investigations/{investigation_id}" + .replace("{" + "investigation_id" + "}", localVarApiClient.escapeString(investigationId.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 v3GetInvestigationValidateBeforeCall(@javax.annotation.Nonnull Long investigationId, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'investigationId' is set + if (investigationId == null) { + throw new ApiException("Missing the required parameter 'investigationId' when calling v3GetInvestigation(Async)"); + } + + return v3GetInvestigationCall(investigationId, _callback); + + } + + /** + * Get an investigation. + * Gets a single investigation, including the IDs of the analyses in it that the caller may see. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found + * @param investigationId (required) + * @return GetInvestigationOutputBody + * @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 GetInvestigationOutputBody v3GetInvestigation(@javax.annotation.Nonnull Long investigationId) throws ApiException { + ApiResponse localVarResp = v3GetInvestigationWithHttpInfo(investigationId); + return localVarResp.getData(); + } + + /** + * Get an investigation. + * Gets a single investigation, including the IDs of the analyses in it that the caller may see. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found + * @param investigationId (required) + * @return ApiResponse<GetInvestigationOutputBody> + * @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 v3GetInvestigationWithHttpInfo(@javax.annotation.Nonnull Long investigationId) throws ApiException { + okhttp3.Call localVarCall = v3GetInvestigationValidateBeforeCall(investigationId, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Get an investigation. (asynchronously) + * Gets a single investigation, including the IDs of the analyses in it that the caller may see. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found + * @param investigationId (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 v3GetInvestigationAsync(@javax.annotation.Nonnull Long investigationId, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = v3GetInvestigationValidateBeforeCall(investigationId, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for v3GetInvestigationFinding + * @param investigationId (required) + * @param findingId (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 v3GetInvestigationFindingCall(@javax.annotation.Nonnull Long investigationId, @javax.annotation.Nonnull Long findingId, 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/investigations/{investigation_id}/findings/{finding_id}" + .replace("{" + "investigation_id" + "}", localVarApiClient.escapeString(investigationId.toString())) + .replace("{" + "finding_id" + "}", localVarApiClient.escapeString(findingId.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 v3GetInvestigationFindingValidateBeforeCall(@javax.annotation.Nonnull Long investigationId, @javax.annotation.Nonnull Long findingId, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'investigationId' is set + if (investigationId == null) { + throw new ApiException("Missing the required parameter 'investigationId' when calling v3GetInvestigationFinding(Async)"); + } + + // verify the required parameter 'findingId' is set + if (findingId == null) { + throw new ApiException("Missing the required parameter 'findingId' when calling v3GetInvestigationFinding(Async)"); + } + + return v3GetInvestigationFindingCall(investigationId, findingId, _callback); + + } + + /** + * Get a finding of an investigation. + * Gets a single finding, including the IDs of the analyses it was derived from that the caller may see. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found + * @param investigationId (required) + * @param findingId (required) + * @return GetFindingOutputBody + * @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 GetFindingOutputBody v3GetInvestigationFinding(@javax.annotation.Nonnull Long investigationId, @javax.annotation.Nonnull Long findingId) throws ApiException { + ApiResponse localVarResp = v3GetInvestigationFindingWithHttpInfo(investigationId, findingId); + return localVarResp.getData(); + } + + /** + * Get a finding of an investigation. + * Gets a single finding, including the IDs of the analyses it was derived from that the caller may see. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found + * @param investigationId (required) + * @param findingId (required) + * @return ApiResponse<GetFindingOutputBody> + * @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 v3GetInvestigationFindingWithHttpInfo(@javax.annotation.Nonnull Long investigationId, @javax.annotation.Nonnull Long findingId) throws ApiException { + okhttp3.Call localVarCall = v3GetInvestigationFindingValidateBeforeCall(investigationId, findingId, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Get a finding of an investigation. (asynchronously) + * Gets a single finding, including the IDs of the analyses it was derived from that the caller may see. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found + * @param investigationId (required) + * @param findingId (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 v3GetInvestigationFindingAsync(@javax.annotation.Nonnull Long investigationId, @javax.annotation.Nonnull Long findingId, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = v3GetInvestigationFindingValidateBeforeCall(investigationId, findingId, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for v3ListInvestigationAgentRuns + * @param investigationId Only return runs on the files of this investigation. 0 returns runs across every investigation you can see. (optional, default to 0) + * @param ownerId Only return runs in investigations owned by one of these user IDs. (optional) + * @param status Only return runs in investigations in one of these statuses. (optional) + * @param severity Only return runs in investigations with one of these severities. (optional) + * @param search Only return runs in investigations whose name contains this text, ignoring case. (optional) + * @param limit (optional, default to 20) + * @param offset (optional, default to 0) + * @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 -
422 Unprocessable Entity -
500 Internal Server Error -
+ */ + public okhttp3.Call v3ListInvestigationAgentRunsCall(@javax.annotation.Nullable Long investigationId, @javax.annotation.Nullable List ownerId, @javax.annotation.Nullable List status, @javax.annotation.Nullable List severity, @javax.annotation.Nullable String search, @javax.annotation.Nullable Long limit, @javax.annotation.Nullable Long offset, 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/investigations/agent-runs"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + if (investigationId != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("investigation_id", investigationId)); + } + + if (ownerId != null) { + localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "owner_id", ownerId)); + } + + if (status != null) { + localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "status", status)); + } + + if (severity != null) { + localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "severity", severity)); + } + + if (search != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("search", search)); + } + + if (limit != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("limit", limit)); + } + + if (offset != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("offset", offset)); + } + + 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 v3ListInvestigationAgentRunsValidateBeforeCall(@javax.annotation.Nullable Long investigationId, @javax.annotation.Nullable List ownerId, @javax.annotation.Nullable List status, @javax.annotation.Nullable List severity, @javax.annotation.Nullable String search, @javax.annotation.Nullable Long limit, @javax.annotation.Nullable Long offset, final ApiCallback _callback) throws ApiException { + return v3ListInvestigationAgentRunsCall(investigationId, ownerId, status, severity, search, limit, offset, _callback); + + } + + /** + * List agent runs on investigations. + * Lists the runs of agents on the files of the investigations you can see, most recently updated first, each with a summary of its result once it is done. A run on a file held by several investigations is listed once for each. Only files you may see are included. Supports narrowing to one investigation, filtering by the investigations' owner, status, severity and name, and pagination. **Error codes:** - `422` [`VALIDATION_FAILED`](/errors/VALIDATION_FAILED) — Validation Failed + * @param investigationId Only return runs on the files of this investigation. 0 returns runs across every investigation you can see. (optional, default to 0) + * @param ownerId Only return runs in investigations owned by one of these user IDs. (optional) + * @param status Only return runs in investigations in one of these statuses. (optional) + * @param severity Only return runs in investigations with one of these severities. (optional) + * @param search Only return runs in investigations whose name contains this text, ignoring case. (optional) + * @param limit (optional, default to 20) + * @param offset (optional, default to 0) + * @return ListAgentRunsOutputBody + * @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 -
422 Unprocessable Entity -
500 Internal Server Error -
+ */ + public ListAgentRunsOutputBody v3ListInvestigationAgentRuns(@javax.annotation.Nullable Long investigationId, @javax.annotation.Nullable List ownerId, @javax.annotation.Nullable List status, @javax.annotation.Nullable List severity, @javax.annotation.Nullable String search, @javax.annotation.Nullable Long limit, @javax.annotation.Nullable Long offset) throws ApiException { + ApiResponse localVarResp = v3ListInvestigationAgentRunsWithHttpInfo(investigationId, ownerId, status, severity, search, limit, offset); + return localVarResp.getData(); + } + + /** + * List agent runs on investigations. + * Lists the runs of agents on the files of the investigations you can see, most recently updated first, each with a summary of its result once it is done. A run on a file held by several investigations is listed once for each. Only files you may see are included. Supports narrowing to one investigation, filtering by the investigations' owner, status, severity and name, and pagination. **Error codes:** - `422` [`VALIDATION_FAILED`](/errors/VALIDATION_FAILED) — Validation Failed + * @param investigationId Only return runs on the files of this investigation. 0 returns runs across every investigation you can see. (optional, default to 0) + * @param ownerId Only return runs in investigations owned by one of these user IDs. (optional) + * @param status Only return runs in investigations in one of these statuses. (optional) + * @param severity Only return runs in investigations with one of these severities. (optional) + * @param search Only return runs in investigations whose name contains this text, ignoring case. (optional) + * @param limit (optional, default to 20) + * @param offset (optional, default to 0) + * @return ApiResponse<ListAgentRunsOutputBody> + * @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 -
422 Unprocessable Entity -
500 Internal Server Error -
+ */ + public ApiResponse v3ListInvestigationAgentRunsWithHttpInfo(@javax.annotation.Nullable Long investigationId, @javax.annotation.Nullable List ownerId, @javax.annotation.Nullable List status, @javax.annotation.Nullable List severity, @javax.annotation.Nullable String search, @javax.annotation.Nullable Long limit, @javax.annotation.Nullable Long offset) throws ApiException { + okhttp3.Call localVarCall = v3ListInvestigationAgentRunsValidateBeforeCall(investigationId, ownerId, status, severity, search, limit, offset, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * List agent runs on investigations. (asynchronously) + * Lists the runs of agents on the files of the investigations you can see, most recently updated first, each with a summary of its result once it is done. A run on a file held by several investigations is listed once for each. Only files you may see are included. Supports narrowing to one investigation, filtering by the investigations' owner, status, severity and name, and pagination. **Error codes:** - `422` [`VALIDATION_FAILED`](/errors/VALIDATION_FAILED) — Validation Failed + * @param investigationId Only return runs on the files of this investigation. 0 returns runs across every investigation you can see. (optional, default to 0) + * @param ownerId Only return runs in investigations owned by one of these user IDs. (optional) + * @param status Only return runs in investigations in one of these statuses. (optional) + * @param severity Only return runs in investigations with one of these severities. (optional) + * @param search Only return runs in investigations whose name contains this text, ignoring case. (optional) + * @param limit (optional, default to 20) + * @param offset (optional, default to 0) + * @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 -
422 Unprocessable Entity -
500 Internal Server Error -
+ */ + public okhttp3.Call v3ListInvestigationAgentRunsAsync(@javax.annotation.Nullable Long investigationId, @javax.annotation.Nullable List ownerId, @javax.annotation.Nullable List status, @javax.annotation.Nullable List severity, @javax.annotation.Nullable String search, @javax.annotation.Nullable Long limit, @javax.annotation.Nullable Long offset, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = v3ListInvestigationAgentRunsValidateBeforeCall(investigationId, ownerId, status, severity, search, limit, offset, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for v3ListInvestigationConversations + * @param investigationId (required) + * @param limit (optional, default to 20) + * @param offset (optional, default to 0) + * @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 v3ListInvestigationConversationsCall(@javax.annotation.Nonnull Long investigationId, @javax.annotation.Nullable Long limit, @javax.annotation.Nullable Long offset, 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/investigations/{investigation_id}/conversations" + .replace("{" + "investigation_id" + "}", localVarApiClient.escapeString(investigationId.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + if (limit != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("limit", limit)); + } + + if (offset != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("offset", offset)); + } + + 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 v3ListInvestigationConversationsValidateBeforeCall(@javax.annotation.Nonnull Long investigationId, @javax.annotation.Nullable Long limit, @javax.annotation.Nullable Long offset, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'investigationId' is set + if (investigationId == null) { + throw new ApiException("Missing the required parameter 'investigationId' when calling v3ListInvestigationConversations(Async)"); + } + + return v3ListInvestigationConversationsCall(investigationId, limit, offset, _callback); + + } + + /** + * List the conversations of an investigation. + * Lists the chat conversations held by the investigation, whoever started them, most recently active first. Visible to anyone who can see the investigation. Supports pagination. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `422` [`VALIDATION_FAILED`](/errors/VALIDATION_FAILED) — Validation Failed + * @param investigationId (required) + * @param limit (optional, default to 20) + * @param offset (optional, default to 0) + * @return ListConversationsOutputBody + * @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 ListConversationsOutputBody v3ListInvestigationConversations(@javax.annotation.Nonnull Long investigationId, @javax.annotation.Nullable Long limit, @javax.annotation.Nullable Long offset) throws ApiException { + ApiResponse localVarResp = v3ListInvestigationConversationsWithHttpInfo(investigationId, limit, offset); + return localVarResp.getData(); + } + + /** + * List the conversations of an investigation. + * Lists the chat conversations held by the investigation, whoever started them, most recently active first. Visible to anyone who can see the investigation. Supports pagination. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `422` [`VALIDATION_FAILED`](/errors/VALIDATION_FAILED) — Validation Failed + * @param investigationId (required) + * @param limit (optional, default to 20) + * @param offset (optional, default to 0) + * @return ApiResponse<ListConversationsOutputBody> + * @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 v3ListInvestigationConversationsWithHttpInfo(@javax.annotation.Nonnull Long investigationId, @javax.annotation.Nullable Long limit, @javax.annotation.Nullable Long offset) throws ApiException { + okhttp3.Call localVarCall = v3ListInvestigationConversationsValidateBeforeCall(investigationId, limit, offset, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * List the conversations of an investigation. (asynchronously) + * Lists the chat conversations held by the investigation, whoever started them, most recently active first. Visible to anyone who can see the investigation. Supports pagination. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `422` [`VALIDATION_FAILED`](/errors/VALIDATION_FAILED) — Validation Failed + * @param investigationId (required) + * @param limit (optional, default to 20) + * @param offset (optional, default to 0) + * @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 v3ListInvestigationConversationsAsync(@javax.annotation.Nonnull Long investigationId, @javax.annotation.Nullable Long limit, @javax.annotation.Nullable Long offset, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = v3ListInvestigationConversationsValidateBeforeCall(investigationId, limit, offset, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for v3ListInvestigationFindings + * @param investigationId (required) + * @param findingType Only return findings of one of these types. (optional) + * @param severity Only return findings with one of these severities. (optional) + * @param limit (optional, default to 20) + * @param offset (optional, default to 0) + * @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 v3ListInvestigationFindingsCall(@javax.annotation.Nonnull Long investigationId, @javax.annotation.Nullable List findingType, @javax.annotation.Nullable List severity, @javax.annotation.Nullable Long limit, @javax.annotation.Nullable Long offset, 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/investigations/{investigation_id}/findings" + .replace("{" + "investigation_id" + "}", localVarApiClient.escapeString(investigationId.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + if (findingType != null) { + localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "finding_type", findingType)); + } + + if (severity != null) { + localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "severity", severity)); + } + + if (limit != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("limit", limit)); + } + + if (offset != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("offset", offset)); + } + + 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 v3ListInvestigationFindingsValidateBeforeCall(@javax.annotation.Nonnull Long investigationId, @javax.annotation.Nullable List findingType, @javax.annotation.Nullable List severity, @javax.annotation.Nullable Long limit, @javax.annotation.Nullable Long offset, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'investigationId' is set + if (investigationId == null) { + throw new ApiException("Missing the required parameter 'investigationId' when calling v3ListInvestigationFindings(Async)"); + } + + return v3ListInvestigationFindingsCall(investigationId, findingType, severity, limit, offset, _callback); + + } + + /** + * List the findings of an investigation. + * Lists what the investigation has found, most severe first and then most recent first. Visible to anyone who can see the investigation. Supports filtering by finding type and severity, and pagination. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `422` [`VALIDATION_FAILED`](/errors/VALIDATION_FAILED) — Validation Failed + * @param investigationId (required) + * @param findingType Only return findings of one of these types. (optional) + * @param severity Only return findings with one of these severities. (optional) + * @param limit (optional, default to 20) + * @param offset (optional, default to 0) + * @return ListFindingsOutputBody + * @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 ListFindingsOutputBody v3ListInvestigationFindings(@javax.annotation.Nonnull Long investigationId, @javax.annotation.Nullable List findingType, @javax.annotation.Nullable List severity, @javax.annotation.Nullable Long limit, @javax.annotation.Nullable Long offset) throws ApiException { + ApiResponse localVarResp = v3ListInvestigationFindingsWithHttpInfo(investigationId, findingType, severity, limit, offset); + return localVarResp.getData(); + } + + /** + * List the findings of an investigation. + * Lists what the investigation has found, most severe first and then most recent first. Visible to anyone who can see the investigation. Supports filtering by finding type and severity, and pagination. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `422` [`VALIDATION_FAILED`](/errors/VALIDATION_FAILED) — Validation Failed + * @param investigationId (required) + * @param findingType Only return findings of one of these types. (optional) + * @param severity Only return findings with one of these severities. (optional) + * @param limit (optional, default to 20) + * @param offset (optional, default to 0) + * @return ApiResponse<ListFindingsOutputBody> + * @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 v3ListInvestigationFindingsWithHttpInfo(@javax.annotation.Nonnull Long investigationId, @javax.annotation.Nullable List findingType, @javax.annotation.Nullable List severity, @javax.annotation.Nullable Long limit, @javax.annotation.Nullable Long offset) throws ApiException { + okhttp3.Call localVarCall = v3ListInvestigationFindingsValidateBeforeCall(investigationId, findingType, severity, limit, offset, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * List the findings of an investigation. (asynchronously) + * Lists what the investigation has found, most severe first and then most recent first. Visible to anyone who can see the investigation. Supports filtering by finding type and severity, and pagination. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `422` [`VALIDATION_FAILED`](/errors/VALIDATION_FAILED) — Validation Failed + * @param investigationId (required) + * @param findingType Only return findings of one of these types. (optional) + * @param severity Only return findings with one of these severities. (optional) + * @param limit (optional, default to 20) + * @param offset (optional, default to 0) + * @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 v3ListInvestigationFindingsAsync(@javax.annotation.Nonnull Long investigationId, @javax.annotation.Nullable List findingType, @javax.annotation.Nullable List severity, @javax.annotation.Nullable Long limit, @javax.annotation.Nullable Long offset, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = v3ListInvestigationFindingsValidateBeforeCall(investigationId, findingType, severity, limit, offset, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for v3ListInvestigationSpend + * @param investigationId (required) + * @param limit (optional, default to 20) + * @param offset (optional, default to 0) + * @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 v3ListInvestigationSpendCall(@javax.annotation.Nonnull Long investigationId, @javax.annotation.Nullable Long limit, @javax.annotation.Nullable Long offset, 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/investigations/{investigation_id}/spend" + .replace("{" + "investigation_id" + "}", localVarApiClient.escapeString(investigationId.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + if (limit != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("limit", limit)); + } + + if (offset != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("offset", offset)); + } + + 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 v3ListInvestigationSpendValidateBeforeCall(@javax.annotation.Nonnull Long investigationId, @javax.annotation.Nullable Long limit, @javax.annotation.Nullable Long offset, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'investigationId' is set + if (investigationId == null) { + throw new ApiException("Missing the required parameter 'investigationId' when calling v3ListInvestigationSpend(Async)"); + } + + return v3ListInvestigationSpendCall(investigationId, limit, offset, _callback); + + } + + /** + * List what an investigation spent. + * Lists the credits charged for the investigation's conversation turns and the agents run from it, newest first. Visible to anyone who can see the investigation. Supports pagination. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `422` [`VALIDATION_FAILED`](/errors/VALIDATION_FAILED) — Validation Failed + * @param investigationId (required) + * @param limit (optional, default to 20) + * @param offset (optional, default to 0) + * @return ListSpendOutputBody + * @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 ListSpendOutputBody v3ListInvestigationSpend(@javax.annotation.Nonnull Long investigationId, @javax.annotation.Nullable Long limit, @javax.annotation.Nullable Long offset) throws ApiException { + ApiResponse localVarResp = v3ListInvestigationSpendWithHttpInfo(investigationId, limit, offset); + return localVarResp.getData(); + } + + /** + * List what an investigation spent. + * Lists the credits charged for the investigation's conversation turns and the agents run from it, newest first. Visible to anyone who can see the investigation. Supports pagination. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `422` [`VALIDATION_FAILED`](/errors/VALIDATION_FAILED) — Validation Failed + * @param investigationId (required) + * @param limit (optional, default to 20) + * @param offset (optional, default to 0) + * @return ApiResponse<ListSpendOutputBody> + * @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 v3ListInvestigationSpendWithHttpInfo(@javax.annotation.Nonnull Long investigationId, @javax.annotation.Nullable Long limit, @javax.annotation.Nullable Long offset) throws ApiException { + okhttp3.Call localVarCall = v3ListInvestigationSpendValidateBeforeCall(investigationId, limit, offset, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * List what an investigation spent. (asynchronously) + * Lists the credits charged for the investigation's conversation turns and the agents run from it, newest first. Visible to anyone who can see the investigation. Supports pagination. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `422` [`VALIDATION_FAILED`](/errors/VALIDATION_FAILED) — Validation Failed + * @param investigationId (required) + * @param limit (optional, default to 20) + * @param offset (optional, default to 0) + * @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 v3ListInvestigationSpendAsync(@javax.annotation.Nonnull Long investigationId, @javax.annotation.Nullable Long limit, @javax.annotation.Nullable Long offset, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = v3ListInvestigationSpendValidateBeforeCall(investigationId, limit, offset, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for v3ListInvestigations + * @param status Only return investigations in one of these statuses. (optional) + * @param severity Only return investigations with one of these severities. (optional) + * @param caseType Only return investigations of one of these case types. (optional) + * @param ownerId Only return investigations owned by one of these user IDs. (optional) + * @param search Only return investigations whose name contains this text, ignoring case. (optional) + * @param orderBy (optional, default to updated) + * @param order (optional, default to DESC) + * @param limit (optional, default to 20) + * @param offset (optional, default to 0) + * @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 -
422 Unprocessable Entity -
500 Internal Server Error -
+ */ + public okhttp3.Call v3ListInvestigationsCall(@javax.annotation.Nullable List status, @javax.annotation.Nullable List severity, @javax.annotation.Nullable List caseType, @javax.annotation.Nullable List ownerId, @javax.annotation.Nullable String search, @javax.annotation.Nullable String orderBy, @javax.annotation.Nullable String order, @javax.annotation.Nullable Long limit, @javax.annotation.Nullable Long offset, 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/investigations"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + if (status != null) { + localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "status", status)); + } + + if (severity != null) { + localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "severity", severity)); + } + + if (caseType != null) { + localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "case_type", caseType)); + } + + if (ownerId != null) { + localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "owner_id", ownerId)); + } + + if (search != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("search", search)); + } + + if (orderBy != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("order_by", orderBy)); + } + + if (order != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("order", order)); + } + + if (limit != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("limit", limit)); + } + + if (offset != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("offset", offset)); + } + + 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 v3ListInvestigationsValidateBeforeCall(@javax.annotation.Nullable List status, @javax.annotation.Nullable List severity, @javax.annotation.Nullable List caseType, @javax.annotation.Nullable List ownerId, @javax.annotation.Nullable String search, @javax.annotation.Nullable String orderBy, @javax.annotation.Nullable String order, @javax.annotation.Nullable Long limit, @javax.annotation.Nullable Long offset, final ApiCallback _callback) throws ApiException { + return v3ListInvestigationsCall(status, severity, caseType, ownerId, search, orderBy, order, limit, offset, _callback); + + } + + /** + * List investigations. + * Lists the investigations the caller owns or that are shared with the caller's team, most recently updated first by default. Supports filtering by status, severity, case type and owner, a name search, and pagination. **Error codes:** - `422` [`VALIDATION_FAILED`](/errors/VALIDATION_FAILED) — Validation Failed + * @param status Only return investigations in one of these statuses. (optional) + * @param severity Only return investigations with one of these severities. (optional) + * @param caseType Only return investigations of one of these case types. (optional) + * @param ownerId Only return investigations owned by one of these user IDs. (optional) + * @param search Only return investigations whose name contains this text, ignoring case. (optional) + * @param orderBy (optional, default to updated) + * @param order (optional, default to DESC) + * @param limit (optional, default to 20) + * @param offset (optional, default to 0) + * @return ListInvestigationsOutputBody + * @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 -
422 Unprocessable Entity -
500 Internal Server Error -
+ */ + public ListInvestigationsOutputBody v3ListInvestigations(@javax.annotation.Nullable List status, @javax.annotation.Nullable List severity, @javax.annotation.Nullable List caseType, @javax.annotation.Nullable List ownerId, @javax.annotation.Nullable String search, @javax.annotation.Nullable String orderBy, @javax.annotation.Nullable String order, @javax.annotation.Nullable Long limit, @javax.annotation.Nullable Long offset) throws ApiException { + ApiResponse localVarResp = v3ListInvestigationsWithHttpInfo(status, severity, caseType, ownerId, search, orderBy, order, limit, offset); + return localVarResp.getData(); + } + + /** + * List investigations. + * Lists the investigations the caller owns or that are shared with the caller's team, most recently updated first by default. Supports filtering by status, severity, case type and owner, a name search, and pagination. **Error codes:** - `422` [`VALIDATION_FAILED`](/errors/VALIDATION_FAILED) — Validation Failed + * @param status Only return investigations in one of these statuses. (optional) + * @param severity Only return investigations with one of these severities. (optional) + * @param caseType Only return investigations of one of these case types. (optional) + * @param ownerId Only return investigations owned by one of these user IDs. (optional) + * @param search Only return investigations whose name contains this text, ignoring case. (optional) + * @param orderBy (optional, default to updated) + * @param order (optional, default to DESC) + * @param limit (optional, default to 20) + * @param offset (optional, default to 0) + * @return ApiResponse<ListInvestigationsOutputBody> + * @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 -
422 Unprocessable Entity -
500 Internal Server Error -
+ */ + public ApiResponse v3ListInvestigationsWithHttpInfo(@javax.annotation.Nullable List status, @javax.annotation.Nullable List severity, @javax.annotation.Nullable List caseType, @javax.annotation.Nullable List ownerId, @javax.annotation.Nullable String search, @javax.annotation.Nullable String orderBy, @javax.annotation.Nullable String order, @javax.annotation.Nullable Long limit, @javax.annotation.Nullable Long offset) throws ApiException { + okhttp3.Call localVarCall = v3ListInvestigationsValidateBeforeCall(status, severity, caseType, ownerId, search, orderBy, order, limit, offset, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * List investigations. (asynchronously) + * Lists the investigations the caller owns or that are shared with the caller's team, most recently updated first by default. Supports filtering by status, severity, case type and owner, a name search, and pagination. **Error codes:** - `422` [`VALIDATION_FAILED`](/errors/VALIDATION_FAILED) — Validation Failed + * @param status Only return investigations in one of these statuses. (optional) + * @param severity Only return investigations with one of these severities. (optional) + * @param caseType Only return investigations of one of these case types. (optional) + * @param ownerId Only return investigations owned by one of these user IDs. (optional) + * @param search Only return investigations whose name contains this text, ignoring case. (optional) + * @param orderBy (optional, default to updated) + * @param order (optional, default to DESC) + * @param limit (optional, default to 20) + * @param offset (optional, default to 0) + * @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 -
422 Unprocessable Entity -
500 Internal Server Error -
+ */ + public okhttp3.Call v3ListInvestigationsAsync(@javax.annotation.Nullable List status, @javax.annotation.Nullable List severity, @javax.annotation.Nullable List caseType, @javax.annotation.Nullable List ownerId, @javax.annotation.Nullable String search, @javax.annotation.Nullable String orderBy, @javax.annotation.Nullable String order, @javax.annotation.Nullable Long limit, @javax.annotation.Nullable Long offset, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = v3ListInvestigationsValidateBeforeCall(status, severity, caseType, ownerId, search, orderBy, order, limit, offset, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for v3PatchInvestigation + * @param investigationId (required) + * @param patchInvestigationInputBody (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 v3PatchInvestigationCall(@javax.annotation.Nonnull Long investigationId, @javax.annotation.Nonnull PatchInvestigationInputBody patchInvestigationInputBody, 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 = patchInvestigationInputBody; + + // create path and map variables + String localVarPath = "/v3/investigations/{investigation_id}" + .replace("{" + "investigation_id" + "}", localVarApiClient.escapeString(investigationId.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 v3PatchInvestigationValidateBeforeCall(@javax.annotation.Nonnull Long investigationId, @javax.annotation.Nonnull PatchInvestigationInputBody patchInvestigationInputBody, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'investigationId' is set + if (investigationId == null) { + throw new ApiException("Missing the required parameter 'investigationId' when calling v3PatchInvestigation(Async)"); + } + + // verify the required parameter 'patchInvestigationInputBody' is set + if (patchInvestigationInputBody == null) { + throw new ApiException("Missing the required parameter 'patchInvestigationInputBody' when calling v3PatchInvestigation(Async)"); + } + + return v3PatchInvestigationCall(investigationId, patchInvestigationInputBody, _callback); + + } + + /** + * Update an investigation. + * Updates an investigation's name, case type, severity, status and/or scope. Omitted fields keep their existing values. Only the owner can update an investigation. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `422` [`VALIDATION_FAILED`](/errors/VALIDATION_FAILED) — Validation Failed + * @param investigationId (required) + * @param patchInvestigationInputBody (required) + * @return InvestigationBody + * @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 InvestigationBody v3PatchInvestigation(@javax.annotation.Nonnull Long investigationId, @javax.annotation.Nonnull PatchInvestigationInputBody patchInvestigationInputBody) throws ApiException { + ApiResponse localVarResp = v3PatchInvestigationWithHttpInfo(investigationId, patchInvestigationInputBody); + return localVarResp.getData(); + } + + /** + * Update an investigation. + * Updates an investigation's name, case type, severity, status and/or scope. Omitted fields keep their existing values. Only the owner can update an investigation. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `422` [`VALIDATION_FAILED`](/errors/VALIDATION_FAILED) — Validation Failed + * @param investigationId (required) + * @param patchInvestigationInputBody (required) + * @return ApiResponse<InvestigationBody> + * @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 v3PatchInvestigationWithHttpInfo(@javax.annotation.Nonnull Long investigationId, @javax.annotation.Nonnull PatchInvestigationInputBody patchInvestigationInputBody) throws ApiException { + okhttp3.Call localVarCall = v3PatchInvestigationValidateBeforeCall(investigationId, patchInvestigationInputBody, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Update an investigation. (asynchronously) + * Updates an investigation's name, case type, severity, status and/or scope. Omitted fields keep their existing values. Only the owner can update an investigation. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `422` [`VALIDATION_FAILED`](/errors/VALIDATION_FAILED) — Validation Failed + * @param investigationId (required) + * @param patchInvestigationInputBody (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 v3PatchInvestigationAsync(@javax.annotation.Nonnull Long investigationId, @javax.annotation.Nonnull PatchInvestigationInputBody patchInvestigationInputBody, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = v3PatchInvestigationValidateBeforeCall(investigationId, patchInvestigationInputBody, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for v3SetInvestigationBudget + * @param investigationId (required) + * @param setBudgetInputBody (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 v3SetInvestigationBudgetCall(@javax.annotation.Nonnull Long investigationId, @javax.annotation.Nonnull SetBudgetInputBody setBudgetInputBody, 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 = setBudgetInputBody; + + // create path and map variables + String localVarPath = "/v3/investigations/{investigation_id}/budget" + .replace("{" + "investigation_id" + "}", localVarApiClient.escapeString(investigationId.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, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call v3SetInvestigationBudgetValidateBeforeCall(@javax.annotation.Nonnull Long investigationId, @javax.annotation.Nonnull SetBudgetInputBody setBudgetInputBody, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'investigationId' is set + if (investigationId == null) { + throw new ApiException("Missing the required parameter 'investigationId' when calling v3SetInvestigationBudget(Async)"); + } + + // verify the required parameter 'setBudgetInputBody' is set + if (setBudgetInputBody == null) { + throw new ApiException("Missing the required parameter 'setBudgetInputBody' when calling v3SetInvestigationBudget(Async)"); + } + + return v3SetInvestigationBudgetCall(investigationId, setBudgetInputBody, _callback); + + } + + /** + * Set the budget of an investigation. + * Sets the most credits the investigation may spend on its conversations and the agents run from it, or removes the limit with null. Once the budget is spent, no new message or agent run is started from the investigation; work already under way finishes, so spend can go a little past the budget. Only the owner can set the budget. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `422` [`VALIDATION_FAILED`](/errors/VALIDATION_FAILED) — Validation Failed + * @param investigationId (required) + * @param setBudgetInputBody (required) + * @return BudgetBody + * @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 BudgetBody v3SetInvestigationBudget(@javax.annotation.Nonnull Long investigationId, @javax.annotation.Nonnull SetBudgetInputBody setBudgetInputBody) throws ApiException { + ApiResponse localVarResp = v3SetInvestigationBudgetWithHttpInfo(investigationId, setBudgetInputBody); + return localVarResp.getData(); + } + + /** + * Set the budget of an investigation. + * Sets the most credits the investigation may spend on its conversations and the agents run from it, or removes the limit with null. Once the budget is spent, no new message or agent run is started from the investigation; work already under way finishes, so spend can go a little past the budget. Only the owner can set the budget. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `422` [`VALIDATION_FAILED`](/errors/VALIDATION_FAILED) — Validation Failed + * @param investigationId (required) + * @param setBudgetInputBody (required) + * @return ApiResponse<BudgetBody> + * @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 v3SetInvestigationBudgetWithHttpInfo(@javax.annotation.Nonnull Long investigationId, @javax.annotation.Nonnull SetBudgetInputBody setBudgetInputBody) throws ApiException { + okhttp3.Call localVarCall = v3SetInvestigationBudgetValidateBeforeCall(investigationId, setBudgetInputBody, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Set the budget of an investigation. (asynchronously) + * Sets the most credits the investigation may spend on its conversations and the agents run from it, or removes the limit with null. Once the budget is spent, no new message or agent run is started from the investigation; work already under way finishes, so spend can go a little past the budget. Only the owner can set the budget. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `422` [`VALIDATION_FAILED`](/errors/VALIDATION_FAILED) — Validation Failed + * @param investigationId (required) + * @param setBudgetInputBody (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 v3SetInvestigationBudgetAsync(@javax.annotation.Nonnull Long investigationId, @javax.annotation.Nonnull SetBudgetInputBody setBudgetInputBody, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = v3SetInvestigationBudgetValidateBeforeCall(investigationId, setBudgetInputBody, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } +} diff --git a/src/main/java/ai/reveng/invoker/ApiClient.java b/src/main/java/ai/reveng/invoker/ApiClient.java index 52f53f4c..1e5eeada 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.74.3/java"); + setUserAgent("OpenAPI-Generator/4.75.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 def38c2d..6a0b760a 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.74.3"; + public static final String VERSION = "4.75.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 d1f8f0e1..3b48a111 100644 --- a/src/main/java/ai/reveng/invoker/JSON.java +++ b/src/main/java/ai/reveng/invoker/JSON.java @@ -105,12 +105,12 @@ public Class getClassForElement(JsonEle @Override public Class getClassForElement(JsonElement readElement) { Map classByDiscriminatorValue = new HashMap(); - classByDiscriminatorValue.put("api_combination", ai.reveng.model.ApiCombinationEvidence.class); + 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("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("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); @@ -194,10 +194,12 @@ 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()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.AcceptedType.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.AccessRuleBody.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.ActivityBody.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.AddCalleeInputBody.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.AddCollectionBinariesInputBody.CustomTypeAdapterFactory()); @@ -207,8 +209,17 @@ private static Class getClassByDiscriminator(Map classByDiscriminatorValue, Stri gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.AddUserStringInputBody.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.AddUserStringToFunctionInputBody.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.AdditionalDetailsStatusResponse.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.AgentBody.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.AgentCompletedBody.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.AgentRunBody.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.AgentRunCardBody.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.AgentRunIOCBody.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.AgentRunUpdateAgent.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.AgentRunUpdateCard.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.AgentRunUpdateData.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.AgentRunUpdateIOC.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.AgentStatusCountsBody.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.AgentWorkflowUsageOutputBody.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.AnalyseCapabilitiesBody.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.AnalysisAccessBody.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.AnalysisAccessInfo.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.AnalysisBasicInfoOutputBody.CustomTypeAdapterFactory()); @@ -251,7 +262,6 @@ private static Class getClassByDiscriminator(Map classByDiscriminatorValue, Stri gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.AnalysisUpdateTagsResponse.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.AnalysisXrefOutputBody.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.ApiCall.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.ApiCombinationEvidence.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.ApiKeyBody.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.AppApiRestV2AgentSchemaCapability.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.AppApiRestV2FunctionsResponsesFunction.CustomTypeAdapterFactory()); @@ -298,7 +308,6 @@ private static Class getClassByDiscriminator(Map classByDiscriminatorValue, Stri gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.BaseResponseConfigResponse.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.BaseResponseCreated.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.BaseResponseDict.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.BaseResponseExternalResponse.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.BaseResponseFunctionBlocksResponse.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.BaseResponseFunctionCapabilityResponse.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.BaseResponseFunctionSearchResponse.CustomTypeAdapterFactory()); @@ -321,9 +330,7 @@ private static Class getClassByDiscriminator(Map classByDiscriminatorValue, Stri gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.BaseResponseReportAnalysisResponse.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.BaseResponseSecretsAgentResponse.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.BaseResponseStatus.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.BaseResponseStr.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.BaseResponseTagSearchResponse.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.BaseResponseTaskResponse.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.BaseResponseTaskStatusResponse.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.BaseResponseTriageReportResponse.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.BaseResponseUnionGetAiDecompilationRatingResponseNoneType.CustomTypeAdapterFactory()); @@ -350,6 +357,7 @@ private static Class getClassByDiscriminator(Map classByDiscriminatorValue, Stri gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.BinarySearchResult.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.BinarySearchResultBody.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.BitfieldDataType.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.BudgetBody.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.BulkAddTagsInputBody.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.BulkAddTagsOutputBody.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.BulkAddTagsResultBody.CustomTypeAdapterFactory()); @@ -399,7 +407,9 @@ private static Class getClassByDiscriminator(Map classByDiscriminatorValue, Stri gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.Connection.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.ConsoleOutputEntry.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.Context.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.ContextCompactedData.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.Conversation.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.ConversationBody.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.ConversationContext.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.ConversationWithEvents.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.CopyFunctionSignaturesInputBody.CustomTypeAdapterFactory()); @@ -413,12 +423,14 @@ private static Class getClassByDiscriminator(Map classByDiscriminatorValue, Stri gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.CreateCheckoutSessionInputBody.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.CreateCollectionInputBody.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.CreateCollectionOutputBody.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.CreateConversationInputBody.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.CreateConversationRequest.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.CreateDataTypeEntry.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.CreateEnumDataType.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.CreateFunctionDataType.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.CreateGroupInputBody.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.CreateIdentityInputBody.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.CreateInvestigationInputBody.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.CreateIssuerInputBody.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.CreateMetadata.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.CreateOrganisationInputBody.CustomTypeAdapterFactory()); @@ -466,7 +478,6 @@ private static Class getClassByDiscriminator(Map classByDiscriminatorValue, Stri 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()); @@ -478,15 +489,19 @@ private static Class getClassByDiscriminator(Map classByDiscriminatorValue, Stri gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.ELFSegment.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.ELFSymbol.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.ElfDynamicEntry.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.EntityRef.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.EntityUpdate.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.EntrypointModel.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.EnumDataType.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.EnumDefinition.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.ErrorBody.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.ErrorModel.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.Event.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.EventAGENTRUNUPDATE.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.EventAttemptFailed.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.EventAttemptStarted.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.EventCONTEXTCOMPACTED.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.EventData.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.EventDecompFailed.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.EventDecompFinished.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.EventNamesFinished.CustomTypeAdapterFactory()); @@ -525,7 +540,6 @@ private static Class getClassByDiscriminator(Map classByDiscriminatorValue, Stri gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.ExecutionScanResult.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.ExecutionVerification.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.ExportModel.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.ExternalResponse.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.ExtractedBinary.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.ExtractedURL.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.ExtractionFailure.CustomTypeAdapterFactory()); @@ -543,6 +557,8 @@ private static Class getClassByDiscriminator(Map classByDiscriminatorValue, Stri gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.FilesystemScanResult.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.FilesystemVerification.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.Finding.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.FindingBody.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.FindingCountsBody.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.FormFile.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.FunctionBlockDestinationResponse.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.FunctionBlockResponse.CustomTypeAdapterFactory()); @@ -589,9 +605,11 @@ private static Class getClassByDiscriminator(Map classByDiscriminatorValue, Stri gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.GetConfigOutputBody.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.GetDataTypeHistoryBody.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.GetDieInfoOutputBody.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.GetFindingOutputBody.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.GetInvestigationOutputBody.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()); @@ -605,6 +623,7 @@ private static Class getClassByDiscriminator(Map classByDiscriminatorValue, Stri 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.GrantAccessInputBody.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()); @@ -613,9 +632,9 @@ 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()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.ImportedFunctionCallerEntry.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.ImportedFunctionDetailOutputBody.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.ImportedFunctionEntry.CustomTypeAdapterFactory()); @@ -624,10 +643,14 @@ private static Class getClassByDiscriminator(Map classByDiscriminatorValue, Stri gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.InlineComment.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.InputBody.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.InsertAnalysisLogRequest.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.InvestigationBody.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.InvestigationListItemBody.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.InviteUserInputBody.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.IssuerAllowedDomain.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.KnownConstantEvidence.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.LineAttributionsData.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.ListAccessRulesOutputBody.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.ListAgentRunsOutputBody.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.ListAnalysesOutputBody.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.ListAnalysisDataTypesOutputBody.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.ListAnalysisFunctionsOutputBody.CustomTypeAdapterFactory()); @@ -636,16 +659,21 @@ private static Class getClassByDiscriminator(Map classByDiscriminatorValue, Stri 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.ListConversationsOutputBody.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.ListDataTypeFunctionsBody.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.ListExampleAnalysesOutputBody.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.ListFindingsOutputBody.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.ListInvestigationsOutputBody.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.ListOperationPrerequisitesOutputBody.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.ListPrincipalsOutputBody.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.ListPublicUsersOutputBody.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.ListSecretStoreOutputBody.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.ListSpendOutputBody.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.ListTeamsOutputBody.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.ListUsersOutputBody.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.LocationOutputBody.CustomTypeAdapterFactory()); @@ -717,12 +745,14 @@ private static Class getClassByDiscriminator(Map classByDiscriminatorValue, Stri gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.PatchCollectionTagsInputBody.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.PatchCollectionTagsOutputBody.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.PatchCommentBody.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.PatchInvestigationInputBody.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.PcapBodyInfo.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.Permissions.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.PointerDataType.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.PointerDefinition.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.PriceOutput.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.PriceSummary.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.PrincipalBody.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.ProcessActivityEntry.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.ProcessMemdumps.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.ProcessNode.CustomTypeAdapterFactory()); @@ -732,6 +762,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.PublicTeamBody.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()); @@ -777,12 +808,18 @@ private static Class getClassByDiscriminator(Map classByDiscriminatorValue, Stri 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.RequestedOperation.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()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.RevokeBody.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.RollupBody.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.RunCancelledData.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.RunDynamicExecutionInputBody.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.RunErrorData.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.RunFinishedData.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.RunStartedData.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.SSOProvider.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.SSOProvidersOutputBody.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.SandboxConfig.CustomTypeAdapterFactory()); @@ -807,6 +844,7 @@ private static Class getClassByDiscriminator(Map classByDiscriminatorValue, Stri gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.ServerSentEventsInner1.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.ServiceEntry.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.SessionOutputBody.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.SetBudgetInputBody.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.SignatureParameterEntry.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.SignatureParameterInput.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.SignatureStorageEntry.CustomTypeAdapterFactory()); @@ -818,6 +856,8 @@ private static Class getClassByDiscriminator(Map classByDiscriminatorValue, Stri gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.SoftwareTypeCountsBody.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.SourceDeltaEvent.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.SourceResetEvent.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.SpendBody.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.SseEventAgentRunUpdateData.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.SseEventContextCompactedData.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.SseEventRunCancelledData.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.SseEventRunErrorData.CustomTypeAdapterFactory()); @@ -844,6 +884,8 @@ private static Class getClassByDiscriminator(Map classByDiscriminatorValue, Stri gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.StatusBody.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.StatusOutput.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.StatusResponse.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.StepFinishedData.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.StepStartedData.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.StringFunctions.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.StringMatch.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.StringMatchEvidence.CustomTypeAdapterFactory()); @@ -869,24 +911,32 @@ private static Class getClassByDiscriminator(Map classByDiscriminatorValue, Stri gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.TagSearchResponse.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.TagSearchResult.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.TagSearchResultBody.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.TaskResponse.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.TaskStatusResponse.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.TcpCarvedFile.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.Team.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.TeamMember.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.Technique.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.TextMessageContentData.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.TextMessageEndData.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.TextMessageStartData.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.ThreatReportResult.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.TimestampModel.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.TitleUpdatedData.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.Token.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.TokenInputBody.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.TokenResponse.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.TokenisedData.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.ToolCallArgsDeltaData.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.ToolCallEndData.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.ToolCallProgressData.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.ToolCallResultData.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.ToolCallStartData.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.ToolConfirmationRequiredData.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.TriageFunction.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.TriageFunctionResponse.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.TriageReportResponse.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.TriageResult.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.TriggerCryptoScanInputBody.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.TriggerDynamicExecutionInputBody.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.TriggerExecutionExplainInputBody.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.TriggerExecutionScanInputBody.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.TriggerFilesystemAnalyseInputBody.CustomTypeAdapterFactory()); diff --git a/src/main/java/ai/reveng/model/ApiCombinationEvidence.java b/src/main/java/ai/reveng/model/APICombinationEvidence.java similarity index 89% rename from src/main/java/ai/reveng/model/ApiCombinationEvidence.java rename to src/main/java/ai/reveng/model/APICombinationEvidence.java index 45e52919..7986d9ee 100644 --- a/src/main/java/ai/reveng/model/ApiCombinationEvidence.java +++ b/src/main/java/ai/reveng/model/APICombinationEvidence.java @@ -52,7 +52,7 @@ * A known combination of APIs without a demonstrated semantic flow. */ @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class ApiCombinationEvidence { +public class APICombinationEvidence { /** * Gets or Sets evidenceKind */ @@ -234,10 +234,10 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti @javax.annotation.Nonnull private List apis = new ArrayList<>(); - public ApiCombinationEvidence() { + public APICombinationEvidence() { } - public ApiCombinationEvidence evidenceKind(@javax.annotation.Nullable EvidenceKindEnum evidenceKind) { + public APICombinationEvidence evidenceKind(@javax.annotation.Nullable EvidenceKindEnum evidenceKind) { this.evidenceKind = evidenceKind; return this; } @@ -256,7 +256,7 @@ public void setEvidenceKind(@javax.annotation.Nullable EvidenceKindEnum evidence } - public ApiCombinationEvidence kind(@javax.annotation.Nullable KindEnum kind) { + public APICombinationEvidence kind(@javax.annotation.Nullable KindEnum kind) { this.kind = kind; return this; } @@ -275,7 +275,7 @@ public void setKind(@javax.annotation.Nullable KindEnum kind) { } - public ApiCombinationEvidence effect(@javax.annotation.Nonnull EvidenceEffect effect) { + public APICombinationEvidence effect(@javax.annotation.Nonnull EvidenceEffect effect) { this.effect = effect; return this; } @@ -294,7 +294,7 @@ public void setEffect(@javax.annotation.Nonnull EvidenceEffect effect) { } - public ApiCombinationEvidence strength(@javax.annotation.Nullable StrengthEnum strength) { + public APICombinationEvidence strength(@javax.annotation.Nullable StrengthEnum strength) { this.strength = strength; return this; } @@ -313,12 +313,12 @@ public void setStrength(@javax.annotation.Nullable StrengthEnum strength) { } - public ApiCombinationEvidence apis(@javax.annotation.Nonnull List apis) { + public APICombinationEvidence apis(@javax.annotation.Nonnull List apis) { this.apis = apis; return this; } - public ApiCombinationEvidence addApisItem(ImportedApi apisItem) { + public APICombinationEvidence addApisItem(ImportedApi apisItem) { if (this.apis == null) { this.apis = new ArrayList<>(); } @@ -352,9 +352,9 @@ public void setApis(@javax.annotation.Nonnull List apis) { * * @param key name of the property * @param value value of the property - * @return the ApiCombinationEvidence instance itself + * @return the APICombinationEvidence instance itself */ - public ApiCombinationEvidence putAdditionalProperty(String key, Object value) { + public APICombinationEvidence putAdditionalProperty(String key, Object value) { if (this.additionalProperties == null) { this.additionalProperties = new HashMap(); } @@ -393,13 +393,13 @@ public boolean equals(Object o) { if (o == null || getClass() != o.getClass()) { return false; } - ApiCombinationEvidence apiCombinationEvidence = (ApiCombinationEvidence) o; - return Objects.equals(this.evidenceKind, apiCombinationEvidence.evidenceKind) && - Objects.equals(this.kind, apiCombinationEvidence.kind) && - Objects.equals(this.effect, apiCombinationEvidence.effect) && - Objects.equals(this.strength, apiCombinationEvidence.strength) && - Objects.equals(this.apis, apiCombinationEvidence.apis)&& - Objects.equals(this.additionalProperties, apiCombinationEvidence.additionalProperties); + APICombinationEvidence apICombinationEvidence = (APICombinationEvidence) o; + return Objects.equals(this.evidenceKind, apICombinationEvidence.evidenceKind) && + Objects.equals(this.kind, apICombinationEvidence.kind) && + Objects.equals(this.effect, apICombinationEvidence.effect) && + Objects.equals(this.strength, apICombinationEvidence.strength) && + Objects.equals(this.apis, apICombinationEvidence.apis)&& + Objects.equals(this.additionalProperties, apICombinationEvidence.additionalProperties); } @Override @@ -410,7 +410,7 @@ public int hashCode() { @Override public String toString() { StringBuilder sb = new StringBuilder(); - sb.append("class ApiCombinationEvidence {\n"); + sb.append("class APICombinationEvidence {\n"); sb.append(" evidenceKind: ").append(toIndentedString(evidenceKind)).append("\n"); sb.append(" kind: ").append(toIndentedString(kind)).append("\n"); sb.append(" effect: ").append(toIndentedString(effect)).append("\n"); @@ -445,17 +445,17 @@ private String toIndentedString(Object o) { * Validates the JSON Element and throws an exception if issues found * * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to ApiCombinationEvidence + * @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())); + 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) { + 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())); } @@ -500,16 +500,16 @@ 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 + 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)); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(APICombinationEvidence.class)); - return (TypeAdapter) new TypeAdapter() { + return (TypeAdapter) new TypeAdapter() { @Override - public void write(JsonWriter out, ApiCombinationEvidence value) throws IOException { + public void write(JsonWriter out, APICombinationEvidence value) throws IOException { JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); obj.remove("additionalProperties"); // serialize additional properties @@ -537,12 +537,12 @@ else if (entry.getValue() instanceof Character) } @Override - public ApiCombinationEvidence read(JsonReader in) throws IOException { + 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); + APICombinationEvidence instance = thisAdapter.fromJsonTree(jsonObj); for (Map.Entry entry : jsonObj.entrySet()) { if (!openapiFields.contains(entry.getKey())) { if (entry.getValue().isJsonPrimitive()) { // primitive type @@ -569,18 +569,18 @@ else if (entry.getValue().getAsJsonPrimitive().isBoolean()) } /** - * Create an instance of ApiCombinationEvidence given an JSON string + * 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 + * @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); + public static APICombinationEvidence fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, APICombinationEvidence.class); } /** - * Convert an instance of ApiCombinationEvidence to an JSON string + * Convert an instance of APICombinationEvidence to an JSON string * * @return JSON string */ diff --git a/src/main/java/ai/reveng/model/BaseResponseExternalResponse.java b/src/main/java/ai/reveng/model/AccessRuleBody.java similarity index 52% rename from src/main/java/ai/reveng/model/BaseResponseExternalResponse.java rename to src/main/java/ai/reveng/model/AccessRuleBody.java index 923da4ab..0e2db7f3 100644 --- a/src/main/java/ai/reveng/model/BaseResponseExternalResponse.java +++ b/src/main/java/ai/reveng/model/AccessRuleBody.java @@ -13,19 +13,13 @@ package ai.reveng.model; import java.util.Objects; -import ai.reveng.model.ErrorModel; -import ai.reveng.model.ExternalResponse; -import ai.reveng.model.MetaModel; 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; @@ -51,138 +45,184 @@ import ai.reveng.invoker.JSON; /** - * BaseResponseExternalResponse + * AccessRuleBody */ @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class BaseResponseExternalResponse { - public static final String SERIALIZED_NAME_STATUS = "status"; - @SerializedName(SERIALIZED_NAME_STATUS) - @javax.annotation.Nullable - private Boolean status = true; +public class AccessRuleBody { + /** + * VIEW lets the principal read the analysis; EDIT also lets them modify it + */ + @JsonAdapter(PermissionEnum.Adapter.class) + public enum PermissionEnum { + VIEW("VIEW"), + + EDIT("EDIT"), + + UNKNOWN_DEFAULT_OPEN_API("unknown_default_open_api"); + + private String value; + + PermissionEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static PermissionEnum fromValue(String value) { + for (PermissionEnum b : PermissionEnum.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 PermissionEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public PermissionEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return PermissionEnum.fromValue(value); + } + } - public static final String SERIALIZED_NAME_DATA = "data"; - @SerializedName(SERIALIZED_NAME_DATA) + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + PermissionEnum.fromValue(value); + } + } + + public static final String SERIALIZED_NAME_PERMISSION = "permission"; + @SerializedName(SERIALIZED_NAME_PERMISSION) + @javax.annotation.Nonnull + private PermissionEnum permission; + + public static final String SERIALIZED_NAME_TEAM_ID = "team_id"; + @SerializedName(SERIALIZED_NAME_TEAM_ID) @javax.annotation.Nullable - private ExternalResponse data; + private Long teamId; - public static final String SERIALIZED_NAME_MESSAGE = "message"; - @SerializedName(SERIALIZED_NAME_MESSAGE) + public static final String SERIALIZED_NAME_TEAM_NAME = "team_name"; + @SerializedName(SERIALIZED_NAME_TEAM_NAME) @javax.annotation.Nullable - private String message; + private String teamName; - public static final String SERIALIZED_NAME_ERRORS = "errors"; - @SerializedName(SERIALIZED_NAME_ERRORS) + public static final String SERIALIZED_NAME_USER_ID = "user_id"; + @SerializedName(SERIALIZED_NAME_USER_ID) @javax.annotation.Nullable - private List errors; + private Long userId; - public static final String SERIALIZED_NAME_META = "meta"; - @SerializedName(SERIALIZED_NAME_META) + public static final String SERIALIZED_NAME_USERNAME = "username"; + @SerializedName(SERIALIZED_NAME_USERNAME) @javax.annotation.Nullable - private MetaModel meta; + private String username; - public BaseResponseExternalResponse() { + public AccessRuleBody() { } - public BaseResponseExternalResponse status(@javax.annotation.Nullable Boolean status) { - this.status = status; + public AccessRuleBody permission(@javax.annotation.Nonnull PermissionEnum permission) { + this.permission = permission; return this; } /** - * Response status on whether the request succeeded - * @return status + * VIEW lets the principal read the analysis; EDIT also lets them modify it + * @return permission */ - @javax.annotation.Nullable - public Boolean getStatus() { - return status; + @javax.annotation.Nonnull + public PermissionEnum getPermission() { + return permission; } - public void setStatus(@javax.annotation.Nullable Boolean status) { - this.status = status; + public void setPermission(@javax.annotation.Nonnull PermissionEnum permission) { + this.permission = permission; } - public BaseResponseExternalResponse data(@javax.annotation.Nullable ExternalResponse data) { - this.data = data; + public AccessRuleBody teamId(@javax.annotation.Nullable Long teamId) { + this.teamId = teamId; return this; } /** - * Response data - * @return data + * The team the rule applies to. Set for a team rule + * @return teamId */ @javax.annotation.Nullable - public ExternalResponse getData() { - return data; + public Long getTeamId() { + return teamId; } - public void setData(@javax.annotation.Nullable ExternalResponse data) { - this.data = data; + public void setTeamId(@javax.annotation.Nullable Long teamId) { + this.teamId = teamId; } - public BaseResponseExternalResponse message(@javax.annotation.Nullable String message) { - this.message = message; + public AccessRuleBody teamName(@javax.annotation.Nullable String teamName) { + this.teamName = teamName; return this; } /** - * Response message - * @return message + * The team's name. Set for a team rule + * @return teamName */ @javax.annotation.Nullable - public String getMessage() { - return message; + public String getTeamName() { + return teamName; } - public void setMessage(@javax.annotation.Nullable String message) { - this.message = message; + public void setTeamName(@javax.annotation.Nullable String teamName) { + this.teamName = teamName; } - public BaseResponseExternalResponse errors(@javax.annotation.Nullable List errors) { - this.errors = errors; - return this; - } - - public BaseResponseExternalResponse addErrorsItem(ErrorModel errorsItem) { - if (this.errors == null) { - this.errors = new ArrayList<>(); - } - this.errors.add(errorsItem); + public AccessRuleBody userId(@javax.annotation.Nullable Long userId) { + this.userId = userId; return this; } /** - * List of errors - * @return errors + * The user the rule applies to. Set for a user rule + * @return userId */ @javax.annotation.Nullable - public List getErrors() { - return errors; + public Long getUserId() { + return userId; } - public void setErrors(@javax.annotation.Nullable List errors) { - this.errors = errors; + public void setUserId(@javax.annotation.Nullable Long userId) { + this.userId = userId; } - public BaseResponseExternalResponse meta(@javax.annotation.Nullable MetaModel meta) { - this.meta = meta; + public AccessRuleBody username(@javax.annotation.Nullable String username) { + this.username = username; return this; } /** - * Metadata - * @return meta + * The user's username. Set for a user rule + * @return username */ @javax.annotation.Nullable - public MetaModel getMeta() { - return meta; + public String getUsername() { + return username; } - public void setMeta(@javax.annotation.Nullable MetaModel meta) { - this.meta = meta; + public void setUsername(@javax.annotation.Nullable String username) { + this.username = username; } /** @@ -198,9 +238,9 @@ public void setMeta(@javax.annotation.Nullable MetaModel meta) { * * @param key name of the property * @param value value of the property - * @return the BaseResponseExternalResponse instance itself + * @return the AccessRuleBody instance itself */ - public BaseResponseExternalResponse putAdditionalProperty(String key, Object value) { + public AccessRuleBody putAdditionalProperty(String key, Object value) { if (this.additionalProperties == null) { this.additionalProperties = new HashMap(); } @@ -239,40 +279,29 @@ public boolean equals(Object o) { if (o == null || getClass() != o.getClass()) { return false; } - BaseResponseExternalResponse baseResponseExternalResponse = (BaseResponseExternalResponse) o; - return Objects.equals(this.status, baseResponseExternalResponse.status) && - Objects.equals(this.data, baseResponseExternalResponse.data) && - Objects.equals(this.message, baseResponseExternalResponse.message) && - Objects.equals(this.errors, baseResponseExternalResponse.errors) && - Objects.equals(this.meta, baseResponseExternalResponse.meta)&& - Objects.equals(this.additionalProperties, baseResponseExternalResponse.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())); + AccessRuleBody accessRuleBody = (AccessRuleBody) o; + return Objects.equals(this.permission, accessRuleBody.permission) && + Objects.equals(this.teamId, accessRuleBody.teamId) && + Objects.equals(this.teamName, accessRuleBody.teamName) && + Objects.equals(this.userId, accessRuleBody.userId) && + Objects.equals(this.username, accessRuleBody.username)&& + Objects.equals(this.additionalProperties, accessRuleBody.additionalProperties); } @Override public int hashCode() { - return Objects.hash(status, data, message, errors, meta, additionalProperties); - } - - private static int hashCodeNullable(JsonNullable a) { - if (a == null) { - return 1; - } - return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + return Objects.hash(permission, teamId, teamName, userId, username, additionalProperties); } @Override public String toString() { StringBuilder sb = new StringBuilder(); - sb.append("class BaseResponseExternalResponse {\n"); - sb.append(" status: ").append(toIndentedString(status)).append("\n"); - sb.append(" data: ").append(toIndentedString(data)).append("\n"); - sb.append(" message: ").append(toIndentedString(message)).append("\n"); - sb.append(" errors: ").append(toIndentedString(errors)).append("\n"); - sb.append(" meta: ").append(toIndentedString(meta)).append("\n"); + sb.append("class AccessRuleBody {\n"); + sb.append(" permission: ").append(toIndentedString(permission)).append("\n"); + sb.append(" teamId: ").append(toIndentedString(teamId)).append("\n"); + sb.append(" teamName: ").append(toIndentedString(teamName)).append("\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(); @@ -292,49 +321,42 @@ private String toIndentedString(Object o) { static { // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(Arrays.asList("status", "data", "message", "errors", "meta")); + openapiFields = new HashSet(Arrays.asList("permission", "team_id", "team_name", "user_id", "username")); // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(0); + openapiRequiredFields = new HashSet(Arrays.asList("permission")); } /** * 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 BaseResponseExternalResponse + * @throws IOException if the JSON Element is invalid with respect to AccessRuleBody */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (jsonElement == null) { - if (!BaseResponseExternalResponse.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 BaseResponseExternalResponse is not found in the empty JSON string", BaseResponseExternalResponse.openapiRequiredFields.toString())); + if (!AccessRuleBody.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 AccessRuleBody is not found in the empty JSON string", AccessRuleBody.openapiRequiredFields.toString())); } } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // validate the optional field `data` - if (jsonObj.get("data") != null && !jsonObj.get("data").isJsonNull()) { - ExternalResponse.validateJsonElement(jsonObj.get("data")); + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : AccessRuleBody.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())); + } } - if ((jsonObj.get("message") != null && !jsonObj.get("message").isJsonNull()) && !jsonObj.get("message").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `message` to be a primitive type in the JSON string but got `%s`", jsonObj.get("message").toString())); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("permission").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `permission` to be a primitive type in the JSON string but got `%s`", jsonObj.get("permission").toString())); } - if (jsonObj.get("errors") != null && !jsonObj.get("errors").isJsonNull()) { - JsonArray jsonArrayerrors = jsonObj.getAsJsonArray("errors"); - if (jsonArrayerrors != null) { - // ensure the json data is an array - if (!jsonObj.get("errors").isJsonArray()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `errors` to be an array in the JSON string but got `%s`", jsonObj.get("errors").toString())); - } - - // validate the optional field `errors` (array) - for (int i = 0; i < jsonArrayerrors.size(); i++) { - ErrorModel.validateJsonElement(jsonArrayerrors.get(i)); - }; - } + // validate the required field `permission` + PermissionEnum.validateJsonElement(jsonObj.get("permission")); + if ((jsonObj.get("team_name") != null && !jsonObj.get("team_name").isJsonNull()) && !jsonObj.get("team_name").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `team_name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("team_name").toString())); } - // validate the optional field `meta` - if (jsonObj.get("meta") != null && !jsonObj.get("meta").isJsonNull()) { - MetaModel.validateJsonElement(jsonObj.get("meta")); + if ((jsonObj.get("username") != null && !jsonObj.get("username").isJsonNull()) && !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())); } } @@ -342,16 +364,16 @@ public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @SuppressWarnings("unchecked") @Override public TypeAdapter create(Gson gson, TypeToken type) { - if (!BaseResponseExternalResponse.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'BaseResponseExternalResponse' and its subtypes + if (!AccessRuleBody.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'AccessRuleBody' and its subtypes } final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(BaseResponseExternalResponse.class)); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(AccessRuleBody.class)); - return (TypeAdapter) new TypeAdapter() { + return (TypeAdapter) new TypeAdapter() { @Override - public void write(JsonWriter out, BaseResponseExternalResponse value) throws IOException { + public void write(JsonWriter out, AccessRuleBody value) throws IOException { JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); obj.remove("additionalProperties"); // serialize additional properties @@ -379,12 +401,12 @@ else if (entry.getValue() instanceof Character) } @Override - public BaseResponseExternalResponse read(JsonReader in) throws IOException { + public AccessRuleBody read(JsonReader in) throws IOException { JsonElement jsonElement = elementAdapter.read(in); validateJsonElement(jsonElement); JsonObject jsonObj = jsonElement.getAsJsonObject(); // store additional fields in the deserialized instance - BaseResponseExternalResponse instance = thisAdapter.fromJsonTree(jsonObj); + AccessRuleBody instance = thisAdapter.fromJsonTree(jsonObj); for (Map.Entry entry : jsonObj.entrySet()) { if (!openapiFields.contains(entry.getKey())) { if (entry.getValue().isJsonPrimitive()) { // primitive type @@ -411,18 +433,18 @@ else if (entry.getValue().getAsJsonPrimitive().isBoolean()) } /** - * Create an instance of BaseResponseExternalResponse given an JSON string + * Create an instance of AccessRuleBody given an JSON string * * @param jsonString JSON string - * @return An instance of BaseResponseExternalResponse - * @throws IOException if the JSON string is invalid with respect to BaseResponseExternalResponse + * @return An instance of AccessRuleBody + * @throws IOException if the JSON string is invalid with respect to AccessRuleBody */ - public static BaseResponseExternalResponse fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, BaseResponseExternalResponse.class); + public static AccessRuleBody fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, AccessRuleBody.class); } /** - * Convert an instance of BaseResponseExternalResponse to an JSON string + * Convert an instance of AccessRuleBody to an JSON string * * @return JSON string */ diff --git a/src/main/java/ai/reveng/model/AgentBody.java b/src/main/java/ai/reveng/model/AgentBody.java new file mode 100644 index 00000000..37cf08f6 --- /dev/null +++ b/src/main/java/ai/reveng/model/AgentBody.java @@ -0,0 +1,407 @@ +/* + * 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; + +/** + * AgentBody + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class AgentBody { + public static final String SERIALIZED_NAME_NAME = "name"; + @SerializedName(SERIALIZED_NAME_NAME) + @javax.annotation.Nonnull + private String name; + + public static final String SERIALIZED_NAME_SLUG = "slug"; + @SerializedName(SERIALIZED_NAME_SLUG) + @javax.annotation.Nonnull + private String slug; + + /** + * Gets or Sets state + */ + @JsonAdapter(StateEnum.Adapter.class) + public enum StateEnum { + PENDING("PENDING"), + + RUNNING("RUNNING"), + + COMPLETED("COMPLETED"), + + FAILED("FAILED"), + + UNKNOWN_DEFAULT_OPEN_API("unknown_default_open_api"); + + private String value; + + StateEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static StateEnum fromValue(String value) { + for (StateEnum b : StateEnum.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 StateEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public StateEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return StateEnum.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + StateEnum.fromValue(value); + } + } + + public static final String SERIALIZED_NAME_STATE = "state"; + @SerializedName(SERIALIZED_NAME_STATE) + @javax.annotation.Nonnull + private StateEnum state; + + public AgentBody() { + } + + public AgentBody name(@javax.annotation.Nonnull String name) { + this.name = name; + return this; + } + + /** + * Get name + * @return name + */ + @javax.annotation.Nonnull + public String getName() { + return name; + } + + public void setName(@javax.annotation.Nonnull String name) { + this.name = name; + } + + + public AgentBody slug(@javax.annotation.Nonnull String slug) { + this.slug = slug; + return this; + } + + /** + * Stable identifier of the agent. + * @return slug + */ + @javax.annotation.Nonnull + public String getSlug() { + return slug; + } + + public void setSlug(@javax.annotation.Nonnull String slug) { + this.slug = slug; + } + + + public AgentBody state(@javax.annotation.Nonnull StateEnum state) { + this.state = state; + return this; + } + + /** + * Get state + * @return state + */ + @javax.annotation.Nonnull + public StateEnum getState() { + return state; + } + + public void setState(@javax.annotation.Nonnull StateEnum state) { + this.state = state; + } + + /** + * 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 AgentBody instance itself + */ + public AgentBody 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; + } + AgentBody agentBody = (AgentBody) o; + return Objects.equals(this.name, agentBody.name) && + Objects.equals(this.slug, agentBody.slug) && + Objects.equals(this.state, agentBody.state)&& + Objects.equals(this.additionalProperties, agentBody.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(name, slug, state, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AgentBody {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" slug: ").append(toIndentedString(slug)).append("\n"); + sb.append(" state: ").append(toIndentedString(state)).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", "slug", "state")); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(Arrays.asList("name", "slug", "state")); + } + + /** + * 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 AgentBody + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!AgentBody.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 AgentBody is not found in the empty JSON string", AgentBody.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : AgentBody.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("slug").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `slug` to be a primitive type in the JSON string but got `%s`", jsonObj.get("slug").toString())); + } + if (!jsonObj.get("state").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `state` to be a primitive type in the JSON string but got `%s`", jsonObj.get("state").toString())); + } + // validate the required field `state` + StateEnum.validateJsonElement(jsonObj.get("state")); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!AgentBody.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'AgentBody' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(AgentBody.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, AgentBody 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 AgentBody read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + AgentBody 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 AgentBody given an JSON string + * + * @param jsonString JSON string + * @return An instance of AgentBody + * @throws IOException if the JSON string is invalid with respect to AgentBody + */ + public static AgentBody fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, AgentBody.class); + } + + /** + * Convert an instance of AgentBody to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/ai/reveng/model/AnalyseCapabilitiesBody.java b/src/main/java/ai/reveng/model/AgentCompletedBody.java similarity index 81% rename from src/main/java/ai/reveng/model/AnalyseCapabilitiesBody.java rename to src/main/java/ai/reveng/model/AgentCompletedBody.java index ff7a6698..8d77cf35 100644 --- a/src/main/java/ai/reveng/model/AnalyseCapabilitiesBody.java +++ b/src/main/java/ai/reveng/model/AgentCompletedBody.java @@ -45,25 +45,25 @@ import ai.reveng.invoker.JSON; /** - * AnalyseCapabilitiesBody + * AgentCompletedBody */ @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class AnalyseCapabilitiesBody { +public class AgentCompletedBody { public static final String SERIALIZED_NAME_COMPLETED = "completed"; @SerializedName(SERIALIZED_NAME_COMPLETED) @javax.annotation.Nonnull private Long completed; - public AnalyseCapabilitiesBody() { + public AgentCompletedBody() { } - public AnalyseCapabilitiesBody completed(@javax.annotation.Nonnull Long completed) { + public AgentCompletedBody completed(@javax.annotation.Nonnull Long completed) { this.completed = completed; return this; } /** - * ANALYSE_CAPABILITIES agent tasks completed that day + * Agent tasks completed that day * @return completed */ @javax.annotation.Nonnull @@ -88,9 +88,9 @@ public void setCompleted(@javax.annotation.Nonnull Long completed) { * * @param key name of the property * @param value value of the property - * @return the AnalyseCapabilitiesBody instance itself + * @return the AgentCompletedBody instance itself */ - public AnalyseCapabilitiesBody putAdditionalProperty(String key, Object value) { + public AgentCompletedBody putAdditionalProperty(String key, Object value) { if (this.additionalProperties == null) { this.additionalProperties = new HashMap(); } @@ -129,9 +129,9 @@ public boolean equals(Object o) { if (o == null || getClass() != o.getClass()) { return false; } - AnalyseCapabilitiesBody analyseCapabilitiesBody = (AnalyseCapabilitiesBody) o; - return Objects.equals(this.completed, analyseCapabilitiesBody.completed)&& - Objects.equals(this.additionalProperties, analyseCapabilitiesBody.additionalProperties); + AgentCompletedBody agentCompletedBody = (AgentCompletedBody) o; + return Objects.equals(this.completed, agentCompletedBody.completed)&& + Objects.equals(this.additionalProperties, agentCompletedBody.additionalProperties); } @Override @@ -142,7 +142,7 @@ public int hashCode() { @Override public String toString() { StringBuilder sb = new StringBuilder(); - sb.append("class AnalyseCapabilitiesBody {\n"); + sb.append("class AgentCompletedBody {\n"); sb.append(" completed: ").append(toIndentedString(completed)).append("\n"); sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); sb.append("}"); @@ -173,17 +173,17 @@ private String toIndentedString(Object o) { * Validates the JSON Element and throws an exception if issues found * * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to AnalyseCapabilitiesBody + * @throws IOException if the JSON Element is invalid with respect to AgentCompletedBody */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (jsonElement == null) { - if (!AnalyseCapabilitiesBody.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 AnalyseCapabilitiesBody is not found in the empty JSON string", AnalyseCapabilitiesBody.openapiRequiredFields.toString())); + if (!AgentCompletedBody.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 AgentCompletedBody is not found in the empty JSON string", AgentCompletedBody.openapiRequiredFields.toString())); } } // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : AnalyseCapabilitiesBody.openapiRequiredFields) { + for (String requiredField : AgentCompletedBody.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())); } @@ -195,16 +195,16 @@ public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @SuppressWarnings("unchecked") @Override public TypeAdapter create(Gson gson, TypeToken type) { - if (!AnalyseCapabilitiesBody.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'AnalyseCapabilitiesBody' and its subtypes + if (!AgentCompletedBody.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'AgentCompletedBody' and its subtypes } final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(AnalyseCapabilitiesBody.class)); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(AgentCompletedBody.class)); - return (TypeAdapter) new TypeAdapter() { + return (TypeAdapter) new TypeAdapter() { @Override - public void write(JsonWriter out, AnalyseCapabilitiesBody value) throws IOException { + public void write(JsonWriter out, AgentCompletedBody value) throws IOException { JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); obj.remove("additionalProperties"); // serialize additional properties @@ -232,12 +232,12 @@ else if (entry.getValue() instanceof Character) } @Override - public AnalyseCapabilitiesBody read(JsonReader in) throws IOException { + public AgentCompletedBody read(JsonReader in) throws IOException { JsonElement jsonElement = elementAdapter.read(in); validateJsonElement(jsonElement); JsonObject jsonObj = jsonElement.getAsJsonObject(); // store additional fields in the deserialized instance - AnalyseCapabilitiesBody instance = thisAdapter.fromJsonTree(jsonObj); + AgentCompletedBody instance = thisAdapter.fromJsonTree(jsonObj); for (Map.Entry entry : jsonObj.entrySet()) { if (!openapiFields.contains(entry.getKey())) { if (entry.getValue().isJsonPrimitive()) { // primitive type @@ -264,18 +264,18 @@ else if (entry.getValue().getAsJsonPrimitive().isBoolean()) } /** - * Create an instance of AnalyseCapabilitiesBody given an JSON string + * Create an instance of AgentCompletedBody given an JSON string * * @param jsonString JSON string - * @return An instance of AnalyseCapabilitiesBody - * @throws IOException if the JSON string is invalid with respect to AnalyseCapabilitiesBody + * @return An instance of AgentCompletedBody + * @throws IOException if the JSON string is invalid with respect to AgentCompletedBody */ - public static AnalyseCapabilitiesBody fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, AnalyseCapabilitiesBody.class); + public static AgentCompletedBody fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, AgentCompletedBody.class); } /** - * Convert an instance of AnalyseCapabilitiesBody to an JSON string + * Convert an instance of AgentCompletedBody to an JSON string * * @return JSON string */ diff --git a/src/main/java/ai/reveng/model/AgentRunBody.java b/src/main/java/ai/reveng/model/AgentRunBody.java new file mode 100644 index 00000000..3c530000 --- /dev/null +++ b/src/main/java/ai/reveng/model/AgentRunBody.java @@ -0,0 +1,506 @@ +/* + * 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.AgentBody; +import ai.reveng.model.AgentRunCardBody; +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; + +/** + * AgentRunBody + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class AgentRunBody { + public static final String SERIALIZED_NAME_AGENT = "agent"; + @SerializedName(SERIALIZED_NAME_AGENT) + @javax.annotation.Nonnull + private AgentBody agent; + + public static final String SERIALIZED_NAME_ANALYSIS_ID = "analysis_id"; + @SerializedName(SERIALIZED_NAME_ANALYSIS_ID) + @javax.annotation.Nonnull + private Long analysisId; + + public static final String SERIALIZED_NAME_BINARY_NAME = "binary_name"; + @SerializedName(SERIALIZED_NAME_BINARY_NAME) + @javax.annotation.Nonnull + private String binaryName; + + public static final String SERIALIZED_NAME_CARD = "card"; + @SerializedName(SERIALIZED_NAME_CARD) + @javax.annotation.Nullable + private AgentRunCardBody card; + + public static final String SERIALIZED_NAME_CREATED_AT = "created_at"; + @SerializedName(SERIALIZED_NAME_CREATED_AT) + @javax.annotation.Nonnull + private OffsetDateTime createdAt; + + public static final String SERIALIZED_NAME_ERROR = "error"; + @SerializedName(SERIALIZED_NAME_ERROR) + @javax.annotation.Nullable + private String error; + + public static final String SERIALIZED_NAME_INVESTIGATION_ID = "investigation_id"; + @SerializedName(SERIALIZED_NAME_INVESTIGATION_ID) + @javax.annotation.Nonnull + private Long investigationId; + + public static final String SERIALIZED_NAME_TASK_ID = "task_id"; + @SerializedName(SERIALIZED_NAME_TASK_ID) + @javax.annotation.Nonnull + private String taskId; + + public static final String SERIALIZED_NAME_UPDATED_AT = "updated_at"; + @SerializedName(SERIALIZED_NAME_UPDATED_AT) + @javax.annotation.Nonnull + private OffsetDateTime updatedAt; + + public AgentRunBody() { + } + + public AgentRunBody agent(@javax.annotation.Nonnull AgentBody agent) { + this.agent = agent; + return this; + } + + /** + * Get agent + * @return agent + */ + @javax.annotation.Nonnull + public AgentBody getAgent() { + return agent; + } + + public void setAgent(@javax.annotation.Nonnull AgentBody agent) { + this.agent = agent; + } + + + public AgentRunBody analysisId(@javax.annotation.Nonnull Long analysisId) { + this.analysisId = analysisId; + return this; + } + + /** + * The earliest-added analysis of the file in the investigation that you may see. + * @return analysisId + */ + @javax.annotation.Nonnull + public Long getAnalysisId() { + return analysisId; + } + + public void setAnalysisId(@javax.annotation.Nonnull Long analysisId) { + this.analysisId = analysisId; + } + + + public AgentRunBody binaryName(@javax.annotation.Nonnull String binaryName) { + this.binaryName = binaryName; + return this; + } + + /** + * Get binaryName + * @return binaryName + */ + @javax.annotation.Nonnull + public String getBinaryName() { + return binaryName; + } + + public void setBinaryName(@javax.annotation.Nonnull String binaryName) { + this.binaryName = binaryName; + } + + + public AgentRunBody card(@javax.annotation.Nullable AgentRunCardBody card) { + this.card = card; + return this; + } + + /** + * A summary of the agent's result. Absent until the run is done, and when its result cannot be summarised. + * @return card + */ + @javax.annotation.Nullable + public AgentRunCardBody getCard() { + return card; + } + + public void setCard(@javax.annotation.Nullable AgentRunCardBody card) { + this.card = card; + } + + + public AgentRunBody createdAt(@javax.annotation.Nonnull OffsetDateTime createdAt) { + this.createdAt = createdAt; + return this; + } + + /** + * Get createdAt + * @return createdAt + */ + @javax.annotation.Nonnull + public OffsetDateTime getCreatedAt() { + return createdAt; + } + + public void setCreatedAt(@javax.annotation.Nonnull OffsetDateTime createdAt) { + this.createdAt = createdAt; + } + + + public AgentRunBody error(@javax.annotation.Nullable String error) { + this.error = error; + return this; + } + + /** + * Why the run failed. Null unless it failed with a reason. + * @return error + */ + @javax.annotation.Nullable + public String getError() { + return error; + } + + public void setError(@javax.annotation.Nullable String error) { + this.error = error; + } + + + public AgentRunBody investigationId(@javax.annotation.Nonnull Long investigationId) { + this.investigationId = investigationId; + return this; + } + + /** + * Get investigationId + * @return investigationId + */ + @javax.annotation.Nonnull + public Long getInvestigationId() { + return investigationId; + } + + public void setInvestigationId(@javax.annotation.Nonnull Long investigationId) { + this.investigationId = investigationId; + } + + + public AgentRunBody taskId(@javax.annotation.Nonnull String taskId) { + this.taskId = taskId; + return this; + } + + /** + * Get taskId + * @return taskId + */ + @javax.annotation.Nonnull + public String getTaskId() { + return taskId; + } + + public void setTaskId(@javax.annotation.Nonnull String taskId) { + this.taskId = taskId; + } + + + public AgentRunBody updatedAt(@javax.annotation.Nonnull OffsetDateTime updatedAt) { + this.updatedAt = updatedAt; + return this; + } + + /** + * Get updatedAt + * @return updatedAt + */ + @javax.annotation.Nonnull + public OffsetDateTime getUpdatedAt() { + return updatedAt; + } + + public void setUpdatedAt(@javax.annotation.Nonnull OffsetDateTime updatedAt) { + this.updatedAt = updatedAt; + } + + /** + * 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 AgentRunBody instance itself + */ + public AgentRunBody 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; + } + AgentRunBody agentRunBody = (AgentRunBody) o; + return Objects.equals(this.agent, agentRunBody.agent) && + Objects.equals(this.analysisId, agentRunBody.analysisId) && + Objects.equals(this.binaryName, agentRunBody.binaryName) && + Objects.equals(this.card, agentRunBody.card) && + Objects.equals(this.createdAt, agentRunBody.createdAt) && + Objects.equals(this.error, agentRunBody.error) && + Objects.equals(this.investigationId, agentRunBody.investigationId) && + Objects.equals(this.taskId, agentRunBody.taskId) && + Objects.equals(this.updatedAt, agentRunBody.updatedAt)&& + Objects.equals(this.additionalProperties, agentRunBody.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(agent, analysisId, binaryName, card, createdAt, error, investigationId, taskId, updatedAt, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AgentRunBody {\n"); + sb.append(" agent: ").append(toIndentedString(agent)).append("\n"); + sb.append(" analysisId: ").append(toIndentedString(analysisId)).append("\n"); + sb.append(" binaryName: ").append(toIndentedString(binaryName)).append("\n"); + sb.append(" card: ").append(toIndentedString(card)).append("\n"); + sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); + sb.append(" error: ").append(toIndentedString(error)).append("\n"); + sb.append(" investigationId: ").append(toIndentedString(investigationId)).append("\n"); + sb.append(" taskId: ").append(toIndentedString(taskId)).append("\n"); + sb.append(" updatedAt: ").append(toIndentedString(updatedAt)).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("agent", "analysis_id", "binary_name", "card", "created_at", "error", "investigation_id", "task_id", "updated_at")); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(Arrays.asList("agent", "analysis_id", "binary_name", "created_at", "error", "investigation_id", "task_id", "updated_at")); + } + + /** + * 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 AgentRunBody + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!AgentRunBody.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 AgentRunBody is not found in the empty JSON string", AgentRunBody.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : AgentRunBody.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("binary_name").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `binary_name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("binary_name").toString())); + } + if ((jsonObj.get("error") != null && !jsonObj.get("error").isJsonNull()) && !jsonObj.get("error").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `error` to be a primitive type in the JSON string but got `%s`", jsonObj.get("error").toString())); + } + if (!jsonObj.get("task_id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `task_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("task_id").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!AgentRunBody.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'AgentRunBody' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(AgentRunBody.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, AgentRunBody 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 AgentRunBody read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + AgentRunBody 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 AgentRunBody given an JSON string + * + * @param jsonString JSON string + * @return An instance of AgentRunBody + * @throws IOException if the JSON string is invalid with respect to AgentRunBody + */ + public static AgentRunBody fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, AgentRunBody.class); + } + + /** + * Convert an instance of AgentRunBody to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/ai/reveng/model/ExternalResponse.java b/src/main/java/ai/reveng/model/AgentRunCardBody.java similarity index 66% rename from src/main/java/ai/reveng/model/ExternalResponse.java rename to src/main/java/ai/reveng/model/AgentRunCardBody.java index 2f94c4e2..e67458bb 100644 --- a/src/main/java/ai/reveng/model/ExternalResponse.java +++ b/src/main/java/ai/reveng/model/AgentRunCardBody.java @@ -13,16 +13,16 @@ package ai.reveng.model; import java.util.Objects; +import ai.reveng.model.AgentRunIOCBody; import com.google.gson.TypeAdapter; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import java.io.IOException; -import java.time.OffsetDateTime; +import java.util.ArrayList; import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; +import java.util.List; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -48,90 +48,92 @@ import ai.reveng.invoker.JSON; /** - * ExternalResponse + * AgentRunCardBody */ @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class ExternalResponse { - public static final String SERIALIZED_NAME_SHA256_HASH = "sha_256_hash"; - @SerializedName(SERIALIZED_NAME_SHA256_HASH) +public class AgentRunCardBody { + public static final String SERIALIZED_NAME_IOCS = "iocs"; + @SerializedName(SERIALIZED_NAME_IOCS) @javax.annotation.Nonnull - private String sha256Hash; + private List iocs = new ArrayList<>(); - public static final String SERIALIZED_NAME_DATA = "data"; - @SerializedName(SERIALIZED_NAME_DATA) - @javax.annotation.Nonnull - private Map data = new HashMap<>(); + public static final String SERIALIZED_NAME_SCORE = "score"; + @SerializedName(SERIALIZED_NAME_SCORE) + @javax.annotation.Nullable + private Double score; - public static final String SERIALIZED_NAME_LAST_UPDATED = "last_updated"; - @SerializedName(SERIALIZED_NAME_LAST_UPDATED) + public static final String SERIALIZED_NAME_SUMMARY = "summary"; + @SerializedName(SERIALIZED_NAME_SUMMARY) @javax.annotation.Nonnull - private OffsetDateTime lastUpdated; + private String summary; - public ExternalResponse() { + public AgentRunCardBody() { + } + + public AgentRunCardBody iocs(@javax.annotation.Nonnull List iocs) { + this.iocs = iocs; + return this; } - public ExternalResponse sha256Hash(@javax.annotation.Nonnull String sha256Hash) { - this.sha256Hash = sha256Hash; + public AgentRunCardBody addIocsItem(AgentRunIOCBody iocsItem) { + if (this.iocs == null) { + this.iocs = new ArrayList<>(); + } + this.iocs.add(iocsItem); return this; } /** - * Get sha256Hash - * @return sha256Hash + * Get iocs + * @return iocs */ @javax.annotation.Nonnull - public String getSha256Hash() { - return sha256Hash; + public List getIocs() { + return iocs; } - public void setSha256Hash(@javax.annotation.Nonnull String sha256Hash) { - this.sha256Hash = sha256Hash; + public void setIocs(@javax.annotation.Nonnull List iocs) { + this.iocs = iocs; } - public ExternalResponse data(@javax.annotation.Nonnull Map data) { - this.data = data; - return this; - } - - public ExternalResponse putDataItem(String key, Object dataItem) { - if (this.data == null) { - this.data = new HashMap<>(); - } - this.data.put(key, dataItem); + public AgentRunCardBody score(@javax.annotation.Nullable Double score) { + this.score = score; return this; } /** - * Get data - * @return data + * The agent's suspicion score from 0 to 1. Null when the agent gives none. + * minimum: 0 + * maximum: 1 + * @return score */ - @javax.annotation.Nonnull - public Map getData() { - return data; + @javax.annotation.Nullable + public Double getScore() { + return score; } - public void setData(@javax.annotation.Nonnull Map data) { - this.data = data; + public void setScore(@javax.annotation.Nullable Double score) { + this.score = score; } - public ExternalResponse lastUpdated(@javax.annotation.Nonnull OffsetDateTime lastUpdated) { - this.lastUpdated = lastUpdated; + public AgentRunCardBody summary(@javax.annotation.Nonnull String summary) { + this.summary = summary; return this; } /** - * Get lastUpdated - * @return lastUpdated + * Get summary + * @return summary */ @javax.annotation.Nonnull - public OffsetDateTime getLastUpdated() { - return lastUpdated; + public String getSummary() { + return summary; } - public void setLastUpdated(@javax.annotation.Nonnull OffsetDateTime lastUpdated) { - this.lastUpdated = lastUpdated; + public void setSummary(@javax.annotation.Nonnull String summary) { + this.summary = summary; } /** @@ -147,9 +149,9 @@ public void setLastUpdated(@javax.annotation.Nonnull OffsetDateTime lastUpdated) * * @param key name of the property * @param value value of the property - * @return the ExternalResponse instance itself + * @return the AgentRunCardBody instance itself */ - public ExternalResponse putAdditionalProperty(String key, Object value) { + public AgentRunCardBody putAdditionalProperty(String key, Object value) { if (this.additionalProperties == null) { this.additionalProperties = new HashMap(); } @@ -188,25 +190,25 @@ public boolean equals(Object o) { if (o == null || getClass() != o.getClass()) { return false; } - ExternalResponse externalResponse = (ExternalResponse) o; - return Objects.equals(this.sha256Hash, externalResponse.sha256Hash) && - Objects.equals(this.data, externalResponse.data) && - Objects.equals(this.lastUpdated, externalResponse.lastUpdated)&& - Objects.equals(this.additionalProperties, externalResponse.additionalProperties); + AgentRunCardBody agentRunCardBody = (AgentRunCardBody) o; + return Objects.equals(this.iocs, agentRunCardBody.iocs) && + Objects.equals(this.score, agentRunCardBody.score) && + Objects.equals(this.summary, agentRunCardBody.summary)&& + Objects.equals(this.additionalProperties, agentRunCardBody.additionalProperties); } @Override public int hashCode() { - return Objects.hash(sha256Hash, data, lastUpdated, additionalProperties); + return Objects.hash(iocs, score, summary, additionalProperties); } @Override public String toString() { StringBuilder sb = new StringBuilder(); - sb.append("class ExternalResponse {\n"); - sb.append(" sha256Hash: ").append(toIndentedString(sha256Hash)).append("\n"); - sb.append(" data: ").append(toIndentedString(data)).append("\n"); - sb.append(" lastUpdated: ").append(toIndentedString(lastUpdated)).append("\n"); + sb.append("class AgentRunCardBody {\n"); + sb.append(" iocs: ").append(toIndentedString(iocs)).append("\n"); + sb.append(" score: ").append(toIndentedString(score)).append("\n"); + sb.append(" summary: ").append(toIndentedString(summary)).append("\n"); sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); sb.append("}"); return sb.toString(); @@ -226,34 +228,40 @@ private String toIndentedString(Object o) { static { // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(Arrays.asList("sha_256_hash", "data", "last_updated")); + openapiFields = new HashSet(Arrays.asList("iocs", "score", "summary")); // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(Arrays.asList("sha_256_hash", "data", "last_updated")); + openapiRequiredFields = new HashSet(Arrays.asList("iocs", "score", "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 ExternalResponse + * @throws IOException if the JSON Element is invalid with respect to AgentRunCardBody */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (jsonElement == null) { - if (!ExternalResponse.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 ExternalResponse is not found in the empty JSON string", ExternalResponse.openapiRequiredFields.toString())); + if (!AgentRunCardBody.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 AgentRunCardBody is not found in the empty JSON string", AgentRunCardBody.openapiRequiredFields.toString())); } } // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : ExternalResponse.openapiRequiredFields) { + for (String requiredField : AgentRunCardBody.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("sha_256_hash").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `sha_256_hash` to be a primitive type in the JSON string but got `%s`", jsonObj.get("sha_256_hash").toString())); + // ensure the required json array is present + if (jsonObj.get("iocs") == null) { + throw new IllegalArgumentException("Expected the field `linkedContent` to be an array in the JSON string but got `null`"); + } else if (!jsonObj.get("iocs").isJsonArray()) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `iocs` to be an array in the JSON string but got `%s`", jsonObj.get("iocs").toString())); + } + 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())); } } @@ -261,16 +269,16 @@ public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @SuppressWarnings("unchecked") @Override public TypeAdapter create(Gson gson, TypeToken type) { - if (!ExternalResponse.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'ExternalResponse' and its subtypes + if (!AgentRunCardBody.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'AgentRunCardBody' and its subtypes } final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(ExternalResponse.class)); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(AgentRunCardBody.class)); - return (TypeAdapter) new TypeAdapter() { + return (TypeAdapter) new TypeAdapter() { @Override - public void write(JsonWriter out, ExternalResponse value) throws IOException { + public void write(JsonWriter out, AgentRunCardBody value) throws IOException { JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); obj.remove("additionalProperties"); // serialize additional properties @@ -298,12 +306,12 @@ else if (entry.getValue() instanceof Character) } @Override - public ExternalResponse read(JsonReader in) throws IOException { + public AgentRunCardBody read(JsonReader in) throws IOException { JsonElement jsonElement = elementAdapter.read(in); validateJsonElement(jsonElement); JsonObject jsonObj = jsonElement.getAsJsonObject(); // store additional fields in the deserialized instance - ExternalResponse instance = thisAdapter.fromJsonTree(jsonObj); + AgentRunCardBody instance = thisAdapter.fromJsonTree(jsonObj); for (Map.Entry entry : jsonObj.entrySet()) { if (!openapiFields.contains(entry.getKey())) { if (entry.getValue().isJsonPrimitive()) { // primitive type @@ -330,18 +338,18 @@ else if (entry.getValue().getAsJsonPrimitive().isBoolean()) } /** - * Create an instance of ExternalResponse given an JSON string + * Create an instance of AgentRunCardBody given an JSON string * * @param jsonString JSON string - * @return An instance of ExternalResponse - * @throws IOException if the JSON string is invalid with respect to ExternalResponse + * @return An instance of AgentRunCardBody + * @throws IOException if the JSON string is invalid with respect to AgentRunCardBody */ - public static ExternalResponse fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, ExternalResponse.class); + public static AgentRunCardBody fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, AgentRunCardBody.class); } /** - * Convert an instance of ExternalResponse to an JSON string + * Convert an instance of AgentRunCardBody to an JSON string * * @return JSON string */ diff --git a/src/main/java/ai/reveng/model/AgentRunIOCBody.java b/src/main/java/ai/reveng/model/AgentRunIOCBody.java new file mode 100644 index 00000000..e9153f82 --- /dev/null +++ b/src/main/java/ai/reveng/model/AgentRunIOCBody.java @@ -0,0 +1,376 @@ +/* + * 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; + +/** + * AgentRunIOCBody + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class AgentRunIOCBody { + public static final String SERIALIZED_NAME_DESCRIPTION = "description"; + @SerializedName(SERIALIZED_NAME_DESCRIPTION) + @javax.annotation.Nonnull + private String description; + + public static final String SERIALIZED_NAME_SOURCE = "source"; + @SerializedName(SERIALIZED_NAME_SOURCE) + @javax.annotation.Nonnull + private String source; + + public static final String SERIALIZED_NAME_TYPE = "type"; + @SerializedName(SERIALIZED_NAME_TYPE) + @javax.annotation.Nonnull + private String type; + + public static final String SERIALIZED_NAME_VALUE = "value"; + @SerializedName(SERIALIZED_NAME_VALUE) + @javax.annotation.Nonnull + private String value; + + public AgentRunIOCBody() { + } + + public AgentRunIOCBody description(@javax.annotation.Nonnull String description) { + this.description = description; + return this; + } + + /** + * Get description + * @return description + */ + @javax.annotation.Nonnull + public String getDescription() { + return description; + } + + public void setDescription(@javax.annotation.Nonnull String description) { + this.description = description; + } + + + public AgentRunIOCBody source(@javax.annotation.Nonnull String source) { + this.source = source; + return this; + } + + /** + * Where in the binary the agent found the indicator. Empty when the agent gives no location. + * @return source + */ + @javax.annotation.Nonnull + public String getSource() { + return source; + } + + public void setSource(@javax.annotation.Nonnull String source) { + this.source = source; + } + + + public AgentRunIOCBody type(@javax.annotation.Nonnull String type) { + this.type = type; + return this; + } + + /** + * Get type + * @return type + */ + @javax.annotation.Nonnull + public String getType() { + return type; + } + + public void setType(@javax.annotation.Nonnull String type) { + this.type = type; + } + + + public AgentRunIOCBody value(@javax.annotation.Nonnull String value) { + this.value = value; + return this; + } + + /** + * Get value + * @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 AgentRunIOCBody instance itself + */ + public AgentRunIOCBody 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; + } + AgentRunIOCBody agentRunIOCBody = (AgentRunIOCBody) o; + return Objects.equals(this.description, agentRunIOCBody.description) && + Objects.equals(this.source, agentRunIOCBody.source) && + Objects.equals(this.type, agentRunIOCBody.type) && + Objects.equals(this.value, agentRunIOCBody.value)&& + Objects.equals(this.additionalProperties, agentRunIOCBody.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(description, source, type, value, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AgentRunIOCBody {\n"); + sb.append(" description: ").append(toIndentedString(description)).append("\n"); + sb.append(" source: ").append(toIndentedString(source)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).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("description", "source", "type", "value")); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(Arrays.asList("description", "source", "type", "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 AgentRunIOCBody + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!AgentRunIOCBody.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 AgentRunIOCBody is not found in the empty JSON string", AgentRunIOCBody.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : AgentRunIOCBody.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("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("source").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `source` to be a primitive type in the JSON string but got `%s`", jsonObj.get("source").toString())); + } + if (!jsonObj.get("type").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("type").toString())); + } + 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 (!AgentRunIOCBody.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'AgentRunIOCBody' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(AgentRunIOCBody.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, AgentRunIOCBody 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 AgentRunIOCBody read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + AgentRunIOCBody 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 AgentRunIOCBody given an JSON string + * + * @param jsonString JSON string + * @return An instance of AgentRunIOCBody + * @throws IOException if the JSON string is invalid with respect to AgentRunIOCBody + */ + public static AgentRunIOCBody fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, AgentRunIOCBody.class); + } + + /** + * Convert an instance of AgentRunIOCBody to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/ai/reveng/model/DynamicExecutionStatusResponse.java b/src/main/java/ai/reveng/model/AgentRunUpdateAgent.java similarity index 63% rename from src/main/java/ai/reveng/model/DynamicExecutionStatusResponse.java rename to src/main/java/ai/reveng/model/AgentRunUpdateAgent.java index 7e926851..32a5f833 100644 --- a/src/main/java/ai/reveng/model/DynamicExecutionStatusResponse.java +++ b/src/main/java/ai/reveng/model/AgentRunUpdateAgent.java @@ -13,7 +13,6 @@ package ai.reveng.model; import java.util.Objects; -import ai.reveng.model.AnalysisLogs; import com.google.gson.TypeAdapter; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; @@ -46,27 +45,25 @@ import ai.reveng.invoker.JSON; /** - * DynamicExecutionStatusResponse + * AgentRunUpdateAgent */ @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class DynamicExecutionStatusResponse { - public static final String SERIALIZED_NAME_ERROR_MESSAGE = "error_message"; - @SerializedName(SERIALIZED_NAME_ERROR_MESSAGE) - @javax.annotation.Nullable - private String errorMessage; - - public static final String SERIALIZED_NAME_LOGS = "logs"; - @SerializedName(SERIALIZED_NAME_LOGS) +public class AgentRunUpdateAgent { + public static final String SERIALIZED_NAME_NAME = "name"; + @SerializedName(SERIALIZED_NAME_NAME) @javax.annotation.Nonnull - private AnalysisLogs logs; + private String name; + + public static final String SERIALIZED_NAME_SLUG = "slug"; + @SerializedName(SERIALIZED_NAME_SLUG) + @javax.annotation.Nonnull + private String slug; /** - * Task status + * Gets or Sets state */ - @JsonAdapter(StatusEnum.Adapter.class) - public enum StatusEnum { - UNINITIALISED("UNINITIALISED"), - + @JsonAdapter(StateEnum.Adapter.class) + public enum StateEnum { PENDING("PENDING"), RUNNING("RUNNING"), @@ -79,7 +76,7 @@ public enum StatusEnum { private String value; - StatusEnum(String value) { + StateEnum(String value) { this.value = value; } @@ -92,8 +89,8 @@ public String toString() { return String.valueOf(value); } - public static StatusEnum fromValue(String value) { - for (StatusEnum b : StatusEnum.values()) { + public static StateEnum fromValue(String value) { + for (StateEnum b : StateEnum.values()) { if (b.value.equals(value)) { return b; } @@ -101,87 +98,87 @@ public static StatusEnum 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 StatusEnum enumeration) throws IOException { + public void write(final JsonWriter jsonWriter, final StateEnum enumeration) throws IOException { jsonWriter.value(enumeration.getValue()); } @Override - public StatusEnum read(final JsonReader jsonReader) throws IOException { + public StateEnum read(final JsonReader jsonReader) throws IOException { String value = jsonReader.nextString(); - return StatusEnum.fromValue(value); + return StateEnum.fromValue(value); } } public static void validateJsonElement(JsonElement jsonElement) throws IOException { String value = jsonElement.getAsString(); - StatusEnum.fromValue(value); + StateEnum.fromValue(value); } } - public static final String SERIALIZED_NAME_STATUS = "status"; - @SerializedName(SERIALIZED_NAME_STATUS) + public static final String SERIALIZED_NAME_STATE = "state"; + @SerializedName(SERIALIZED_NAME_STATE) @javax.annotation.Nonnull - private StatusEnum status; + private StateEnum state; - public DynamicExecutionStatusResponse() { + public AgentRunUpdateAgent() { } - public DynamicExecutionStatusResponse errorMessage(@javax.annotation.Nullable String errorMessage) { - this.errorMessage = errorMessage; + public AgentRunUpdateAgent name(@javax.annotation.Nonnull String name) { + this.name = name; return this; } /** - * Error detail, set when status is FAILED - * @return errorMessage + * Get name + * @return name */ - @javax.annotation.Nullable - public String getErrorMessage() { - return errorMessage; + @javax.annotation.Nonnull + public String getName() { + return name; } - public void setErrorMessage(@javax.annotation.Nullable String errorMessage) { - this.errorMessage = errorMessage; + public void setName(@javax.annotation.Nonnull String name) { + this.name = name; } - public DynamicExecutionStatusResponse logs(@javax.annotation.Nonnull AnalysisLogs logs) { - this.logs = logs; + public AgentRunUpdateAgent slug(@javax.annotation.Nonnull String slug) { + this.slug = slug; return this; } /** - * Sandbox status log messages captured during the run. Empty when none have been captured yet. - * @return logs + * Stable identifier of the agent. + * @return slug */ @javax.annotation.Nonnull - public AnalysisLogs getLogs() { - return logs; + public String getSlug() { + return slug; } - public void setLogs(@javax.annotation.Nonnull AnalysisLogs logs) { - this.logs = logs; + public void setSlug(@javax.annotation.Nonnull String slug) { + this.slug = slug; } - public DynamicExecutionStatusResponse status(@javax.annotation.Nonnull StatusEnum status) { - this.status = status; + public AgentRunUpdateAgent state(@javax.annotation.Nonnull StateEnum state) { + this.state = state; return this; } /** - * Task status - * @return status + * Get state + * @return state */ @javax.annotation.Nonnull - public StatusEnum getStatus() { - return status; + public StateEnum getState() { + return state; } - public void setStatus(@javax.annotation.Nonnull StatusEnum status) { - this.status = status; + public void setState(@javax.annotation.Nonnull StateEnum state) { + this.state = state; } /** @@ -197,9 +194,9 @@ public void setStatus(@javax.annotation.Nonnull StatusEnum status) { * * @param key name of the property * @param value value of the property - * @return the DynamicExecutionStatusResponse instance itself + * @return the AgentRunUpdateAgent instance itself */ - public DynamicExecutionStatusResponse putAdditionalProperty(String key, Object value) { + public AgentRunUpdateAgent putAdditionalProperty(String key, Object value) { if (this.additionalProperties == null) { this.additionalProperties = new HashMap(); } @@ -238,25 +235,25 @@ public boolean equals(Object o) { if (o == null || getClass() != o.getClass()) { return false; } - DynamicExecutionStatusResponse dynamicExecutionStatusResponse = (DynamicExecutionStatusResponse) o; - return Objects.equals(this.errorMessage, dynamicExecutionStatusResponse.errorMessage) && - Objects.equals(this.logs, dynamicExecutionStatusResponse.logs) && - Objects.equals(this.status, dynamicExecutionStatusResponse.status)&& - Objects.equals(this.additionalProperties, dynamicExecutionStatusResponse.additionalProperties); + AgentRunUpdateAgent agentRunUpdateAgent = (AgentRunUpdateAgent) o; + return Objects.equals(this.name, agentRunUpdateAgent.name) && + Objects.equals(this.slug, agentRunUpdateAgent.slug) && + Objects.equals(this.state, agentRunUpdateAgent.state)&& + Objects.equals(this.additionalProperties, agentRunUpdateAgent.additionalProperties); } @Override public int hashCode() { - return Objects.hash(errorMessage, logs, status, additionalProperties); + return Objects.hash(name, slug, state, additionalProperties); } @Override public String toString() { StringBuilder sb = new StringBuilder(); - sb.append("class DynamicExecutionStatusResponse {\n"); - sb.append(" errorMessage: ").append(toIndentedString(errorMessage)).append("\n"); - sb.append(" logs: ").append(toIndentedString(logs)).append("\n"); - sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append("class AgentRunUpdateAgent {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" slug: ").append(toIndentedString(slug)).append("\n"); + sb.append(" state: ").append(toIndentedString(state)).append("\n"); sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); sb.append("}"); return sb.toString(); @@ -276,56 +273,59 @@ private String toIndentedString(Object o) { static { // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(Arrays.asList("error_message", "logs", "status")); + openapiFields = new HashSet(Arrays.asList("name", "slug", "state")); // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(Arrays.asList("logs", "status")); + openapiRequiredFields = new HashSet(Arrays.asList("name", "slug", "state")); } /** * 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 DynamicExecutionStatusResponse + * @throws IOException if the JSON Element is invalid with respect to AgentRunUpdateAgent */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (jsonElement == null) { - if (!DynamicExecutionStatusResponse.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 DynamicExecutionStatusResponse is not found in the empty JSON string", DynamicExecutionStatusResponse.openapiRequiredFields.toString())); + if (!AgentRunUpdateAgent.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 AgentRunUpdateAgent is not found in the empty JSON string", AgentRunUpdateAgent.openapiRequiredFields.toString())); } } // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : DynamicExecutionStatusResponse.openapiRequiredFields) { + for (String requiredField : AgentRunUpdateAgent.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("error_message") != null && !jsonObj.get("error_message").isJsonNull()) && !jsonObj.get("error_message").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `error_message` to be a primitive type in the JSON string but got `%s`", jsonObj.get("error_message").toString())); + 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("slug").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `slug` to be a primitive type in the JSON string but got `%s`", jsonObj.get("slug").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())); + if (!jsonObj.get("state").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `state` to be a primitive type in the JSON string but got `%s`", jsonObj.get("state").toString())); } - // validate the required field `status` - StatusEnum.validateJsonElement(jsonObj.get("status")); + // validate the required field `state` + StateEnum.validateJsonElement(jsonObj.get("state")); } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @SuppressWarnings("unchecked") @Override public TypeAdapter create(Gson gson, TypeToken type) { - if (!DynamicExecutionStatusResponse.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'DynamicExecutionStatusResponse' and its subtypes + if (!AgentRunUpdateAgent.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'AgentRunUpdateAgent' and its subtypes } final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(DynamicExecutionStatusResponse.class)); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(AgentRunUpdateAgent.class)); - return (TypeAdapter) new TypeAdapter() { + return (TypeAdapter) new TypeAdapter() { @Override - public void write(JsonWriter out, DynamicExecutionStatusResponse value) throws IOException { + public void write(JsonWriter out, AgentRunUpdateAgent value) throws IOException { JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); obj.remove("additionalProperties"); // serialize additional properties @@ -353,12 +353,12 @@ else if (entry.getValue() instanceof Character) } @Override - public DynamicExecutionStatusResponse read(JsonReader in) throws IOException { + public AgentRunUpdateAgent read(JsonReader in) throws IOException { JsonElement jsonElement = elementAdapter.read(in); validateJsonElement(jsonElement); JsonObject jsonObj = jsonElement.getAsJsonObject(); // store additional fields in the deserialized instance - DynamicExecutionStatusResponse instance = thisAdapter.fromJsonTree(jsonObj); + AgentRunUpdateAgent instance = thisAdapter.fromJsonTree(jsonObj); for (Map.Entry entry : jsonObj.entrySet()) { if (!openapiFields.contains(entry.getKey())) { if (entry.getValue().isJsonPrimitive()) { // primitive type @@ -385,18 +385,18 @@ else if (entry.getValue().getAsJsonPrimitive().isBoolean()) } /** - * Create an instance of DynamicExecutionStatusResponse given an JSON string + * Create an instance of AgentRunUpdateAgent given an JSON string * * @param jsonString JSON string - * @return An instance of DynamicExecutionStatusResponse - * @throws IOException if the JSON string is invalid with respect to DynamicExecutionStatusResponse + * @return An instance of AgentRunUpdateAgent + * @throws IOException if the JSON string is invalid with respect to AgentRunUpdateAgent */ - public static DynamicExecutionStatusResponse fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, DynamicExecutionStatusResponse.class); + public static AgentRunUpdateAgent fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, AgentRunUpdateAgent.class); } /** - * Convert an instance of DynamicExecutionStatusResponse to an JSON string + * Convert an instance of AgentRunUpdateAgent to an JSON string * * @return JSON string */ diff --git a/src/main/java/ai/reveng/model/AgentRunUpdateCard.java b/src/main/java/ai/reveng/model/AgentRunUpdateCard.java new file mode 100644 index 00000000..17752284 --- /dev/null +++ b/src/main/java/ai/reveng/model/AgentRunUpdateCard.java @@ -0,0 +1,360 @@ +/* + * 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.AgentRunUpdateIOC; +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; + +/** + * AgentRunUpdateCard + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class AgentRunUpdateCard { + public static final String SERIALIZED_NAME_IOCS = "iocs"; + @SerializedName(SERIALIZED_NAME_IOCS) + @javax.annotation.Nonnull + private List iocs = new ArrayList<>(); + + public static final String SERIALIZED_NAME_SCORE = "score"; + @SerializedName(SERIALIZED_NAME_SCORE) + @javax.annotation.Nullable + private Double score; + + public static final String SERIALIZED_NAME_SUMMARY = "summary"; + @SerializedName(SERIALIZED_NAME_SUMMARY) + @javax.annotation.Nonnull + private String summary; + + public AgentRunUpdateCard() { + } + + public AgentRunUpdateCard iocs(@javax.annotation.Nonnull List iocs) { + this.iocs = iocs; + return this; + } + + public AgentRunUpdateCard addIocsItem(AgentRunUpdateIOC iocsItem) { + if (this.iocs == null) { + this.iocs = new ArrayList<>(); + } + this.iocs.add(iocsItem); + return this; + } + + /** + * Get iocs + * @return iocs + */ + @javax.annotation.Nonnull + public List getIocs() { + return iocs; + } + + public void setIocs(@javax.annotation.Nonnull List iocs) { + this.iocs = iocs; + } + + + public AgentRunUpdateCard score(@javax.annotation.Nullable Double score) { + this.score = score; + return this; + } + + /** + * The agent's suspicion score from 0 to 1. Null when the agent gives none. + * minimum: 0 + * maximum: 1 + * @return score + */ + @javax.annotation.Nullable + public Double getScore() { + return score; + } + + public void setScore(@javax.annotation.Nullable Double score) { + this.score = score; + } + + + public AgentRunUpdateCard summary(@javax.annotation.Nonnull String summary) { + this.summary = summary; + return this; + } + + /** + * Get summary + * @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 AgentRunUpdateCard instance itself + */ + public AgentRunUpdateCard 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; + } + AgentRunUpdateCard agentRunUpdateCard = (AgentRunUpdateCard) o; + return Objects.equals(this.iocs, agentRunUpdateCard.iocs) && + Objects.equals(this.score, agentRunUpdateCard.score) && + Objects.equals(this.summary, agentRunUpdateCard.summary)&& + Objects.equals(this.additionalProperties, agentRunUpdateCard.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(iocs, score, summary, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AgentRunUpdateCard {\n"); + sb.append(" iocs: ").append(toIndentedString(iocs)).append("\n"); + sb.append(" score: ").append(toIndentedString(score)).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("iocs", "score", "summary")); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(Arrays.asList("iocs", "score", "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 AgentRunUpdateCard + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!AgentRunUpdateCard.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 AgentRunUpdateCard is not found in the empty JSON string", AgentRunUpdateCard.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : AgentRunUpdateCard.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("iocs") == null) { + throw new IllegalArgumentException("Expected the field `linkedContent` to be an array in the JSON string but got `null`"); + } else if (!jsonObj.get("iocs").isJsonArray()) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `iocs` to be an array in the JSON string but got `%s`", jsonObj.get("iocs").toString())); + } + 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 (!AgentRunUpdateCard.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'AgentRunUpdateCard' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(AgentRunUpdateCard.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, AgentRunUpdateCard 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 AgentRunUpdateCard read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + AgentRunUpdateCard 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 AgentRunUpdateCard given an JSON string + * + * @param jsonString JSON string + * @return An instance of AgentRunUpdateCard + * @throws IOException if the JSON string is invalid with respect to AgentRunUpdateCard + */ + public static AgentRunUpdateCard fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, AgentRunUpdateCard.class); + } + + /** + * Convert an instance of AgentRunUpdateCard to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/ai/reveng/model/AgentRunUpdateData.java b/src/main/java/ai/reveng/model/AgentRunUpdateData.java new file mode 100644 index 00000000..0309a518 --- /dev/null +++ b/src/main/java/ai/reveng/model/AgentRunUpdateData.java @@ -0,0 +1,506 @@ +/* + * 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.AgentRunUpdateAgent; +import ai.reveng.model.AgentRunUpdateCard; +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; + +/** + * AgentRunUpdateData + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class AgentRunUpdateData { + public static final String SERIALIZED_NAME_AGENT = "agent"; + @SerializedName(SERIALIZED_NAME_AGENT) + @javax.annotation.Nonnull + private AgentRunUpdateAgent agent; + + public static final String SERIALIZED_NAME_ANALYSIS_ID = "analysis_id"; + @SerializedName(SERIALIZED_NAME_ANALYSIS_ID) + @javax.annotation.Nonnull + private Long analysisId; + + public static final String SERIALIZED_NAME_BINARY_NAME = "binary_name"; + @SerializedName(SERIALIZED_NAME_BINARY_NAME) + @javax.annotation.Nonnull + private String binaryName; + + public static final String SERIALIZED_NAME_CARD = "card"; + @SerializedName(SERIALIZED_NAME_CARD) + @javax.annotation.Nullable + private AgentRunUpdateCard card; + + public static final String SERIALIZED_NAME_CREATED_AT = "created_at"; + @SerializedName(SERIALIZED_NAME_CREATED_AT) + @javax.annotation.Nonnull + private OffsetDateTime createdAt; + + public static final String SERIALIZED_NAME_ERROR = "error"; + @SerializedName(SERIALIZED_NAME_ERROR) + @javax.annotation.Nullable + private String error; + + public static final String SERIALIZED_NAME_INVESTIGATION_ID = "investigation_id"; + @SerializedName(SERIALIZED_NAME_INVESTIGATION_ID) + @javax.annotation.Nonnull + private Long investigationId; + + public static final String SERIALIZED_NAME_TASK_ID = "task_id"; + @SerializedName(SERIALIZED_NAME_TASK_ID) + @javax.annotation.Nonnull + private String taskId; + + public static final String SERIALIZED_NAME_UPDATED_AT = "updated_at"; + @SerializedName(SERIALIZED_NAME_UPDATED_AT) + @javax.annotation.Nonnull + private OffsetDateTime updatedAt; + + public AgentRunUpdateData() { + } + + public AgentRunUpdateData agent(@javax.annotation.Nonnull AgentRunUpdateAgent agent) { + this.agent = agent; + return this; + } + + /** + * Get agent + * @return agent + */ + @javax.annotation.Nonnull + public AgentRunUpdateAgent getAgent() { + return agent; + } + + public void setAgent(@javax.annotation.Nonnull AgentRunUpdateAgent agent) { + this.agent = agent; + } + + + public AgentRunUpdateData analysisId(@javax.annotation.Nonnull Long analysisId) { + this.analysisId = analysisId; + return this; + } + + /** + * The earliest-added analysis of the file in the investigation that the conversation's starter may see. + * @return analysisId + */ + @javax.annotation.Nonnull + public Long getAnalysisId() { + return analysisId; + } + + public void setAnalysisId(@javax.annotation.Nonnull Long analysisId) { + this.analysisId = analysisId; + } + + + public AgentRunUpdateData binaryName(@javax.annotation.Nonnull String binaryName) { + this.binaryName = binaryName; + return this; + } + + /** + * Get binaryName + * @return binaryName + */ + @javax.annotation.Nonnull + public String getBinaryName() { + return binaryName; + } + + public void setBinaryName(@javax.annotation.Nonnull String binaryName) { + this.binaryName = binaryName; + } + + + public AgentRunUpdateData card(@javax.annotation.Nullable AgentRunUpdateCard card) { + this.card = card; + return this; + } + + /** + * A summary of the agent's result. Absent until the run is done, and when its result cannot be summarised. + * @return card + */ + @javax.annotation.Nullable + public AgentRunUpdateCard getCard() { + return card; + } + + public void setCard(@javax.annotation.Nullable AgentRunUpdateCard card) { + this.card = card; + } + + + public AgentRunUpdateData createdAt(@javax.annotation.Nonnull OffsetDateTime createdAt) { + this.createdAt = createdAt; + return this; + } + + /** + * Get createdAt + * @return createdAt + */ + @javax.annotation.Nonnull + public OffsetDateTime getCreatedAt() { + return createdAt; + } + + public void setCreatedAt(@javax.annotation.Nonnull OffsetDateTime createdAt) { + this.createdAt = createdAt; + } + + + public AgentRunUpdateData error(@javax.annotation.Nullable String error) { + this.error = error; + return this; + } + + /** + * Why the run failed. Null unless it failed with a reason. + * @return error + */ + @javax.annotation.Nullable + public String getError() { + return error; + } + + public void setError(@javax.annotation.Nullable String error) { + this.error = error; + } + + + public AgentRunUpdateData investigationId(@javax.annotation.Nonnull Long investigationId) { + this.investigationId = investigationId; + return this; + } + + /** + * Get investigationId + * @return investigationId + */ + @javax.annotation.Nonnull + public Long getInvestigationId() { + return investigationId; + } + + public void setInvestigationId(@javax.annotation.Nonnull Long investigationId) { + this.investigationId = investigationId; + } + + + public AgentRunUpdateData taskId(@javax.annotation.Nonnull String taskId) { + this.taskId = taskId; + return this; + } + + /** + * Get taskId + * @return taskId + */ + @javax.annotation.Nonnull + public String getTaskId() { + return taskId; + } + + public void setTaskId(@javax.annotation.Nonnull String taskId) { + this.taskId = taskId; + } + + + public AgentRunUpdateData updatedAt(@javax.annotation.Nonnull OffsetDateTime updatedAt) { + this.updatedAt = updatedAt; + return this; + } + + /** + * Get updatedAt + * @return updatedAt + */ + @javax.annotation.Nonnull + public OffsetDateTime getUpdatedAt() { + return updatedAt; + } + + public void setUpdatedAt(@javax.annotation.Nonnull OffsetDateTime updatedAt) { + this.updatedAt = updatedAt; + } + + /** + * 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 AgentRunUpdateData instance itself + */ + public AgentRunUpdateData 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; + } + AgentRunUpdateData agentRunUpdateData = (AgentRunUpdateData) o; + return Objects.equals(this.agent, agentRunUpdateData.agent) && + Objects.equals(this.analysisId, agentRunUpdateData.analysisId) && + Objects.equals(this.binaryName, agentRunUpdateData.binaryName) && + Objects.equals(this.card, agentRunUpdateData.card) && + Objects.equals(this.createdAt, agentRunUpdateData.createdAt) && + Objects.equals(this.error, agentRunUpdateData.error) && + Objects.equals(this.investigationId, agentRunUpdateData.investigationId) && + Objects.equals(this.taskId, agentRunUpdateData.taskId) && + Objects.equals(this.updatedAt, agentRunUpdateData.updatedAt)&& + Objects.equals(this.additionalProperties, agentRunUpdateData.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(agent, analysisId, binaryName, card, createdAt, error, investigationId, taskId, updatedAt, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AgentRunUpdateData {\n"); + sb.append(" agent: ").append(toIndentedString(agent)).append("\n"); + sb.append(" analysisId: ").append(toIndentedString(analysisId)).append("\n"); + sb.append(" binaryName: ").append(toIndentedString(binaryName)).append("\n"); + sb.append(" card: ").append(toIndentedString(card)).append("\n"); + sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); + sb.append(" error: ").append(toIndentedString(error)).append("\n"); + sb.append(" investigationId: ").append(toIndentedString(investigationId)).append("\n"); + sb.append(" taskId: ").append(toIndentedString(taskId)).append("\n"); + sb.append(" updatedAt: ").append(toIndentedString(updatedAt)).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("agent", "analysis_id", "binary_name", "card", "created_at", "error", "investigation_id", "task_id", "updated_at")); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(Arrays.asList("agent", "analysis_id", "binary_name", "created_at", "error", "investigation_id", "task_id", "updated_at")); + } + + /** + * 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 AgentRunUpdateData + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!AgentRunUpdateData.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 AgentRunUpdateData is not found in the empty JSON string", AgentRunUpdateData.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : AgentRunUpdateData.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("binary_name").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `binary_name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("binary_name").toString())); + } + if ((jsonObj.get("error") != null && !jsonObj.get("error").isJsonNull()) && !jsonObj.get("error").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `error` to be a primitive type in the JSON string but got `%s`", jsonObj.get("error").toString())); + } + if (!jsonObj.get("task_id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `task_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("task_id").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!AgentRunUpdateData.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'AgentRunUpdateData' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(AgentRunUpdateData.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, AgentRunUpdateData 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 AgentRunUpdateData read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + AgentRunUpdateData 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 AgentRunUpdateData given an JSON string + * + * @param jsonString JSON string + * @return An instance of AgentRunUpdateData + * @throws IOException if the JSON string is invalid with respect to AgentRunUpdateData + */ + public static AgentRunUpdateData fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, AgentRunUpdateData.class); + } + + /** + * Convert an instance of AgentRunUpdateData to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/ai/reveng/model/AgentRunUpdateIOC.java b/src/main/java/ai/reveng/model/AgentRunUpdateIOC.java new file mode 100644 index 00000000..58deeb1f --- /dev/null +++ b/src/main/java/ai/reveng/model/AgentRunUpdateIOC.java @@ -0,0 +1,376 @@ +/* + * 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; + +/** + * AgentRunUpdateIOC + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class AgentRunUpdateIOC { + public static final String SERIALIZED_NAME_DESCRIPTION = "description"; + @SerializedName(SERIALIZED_NAME_DESCRIPTION) + @javax.annotation.Nonnull + private String description; + + public static final String SERIALIZED_NAME_SOURCE = "source"; + @SerializedName(SERIALIZED_NAME_SOURCE) + @javax.annotation.Nonnull + private String source; + + public static final String SERIALIZED_NAME_TYPE = "type"; + @SerializedName(SERIALIZED_NAME_TYPE) + @javax.annotation.Nonnull + private String type; + + public static final String SERIALIZED_NAME_VALUE = "value"; + @SerializedName(SERIALIZED_NAME_VALUE) + @javax.annotation.Nonnull + private String value; + + public AgentRunUpdateIOC() { + } + + public AgentRunUpdateIOC description(@javax.annotation.Nonnull String description) { + this.description = description; + return this; + } + + /** + * Get description + * @return description + */ + @javax.annotation.Nonnull + public String getDescription() { + return description; + } + + public void setDescription(@javax.annotation.Nonnull String description) { + this.description = description; + } + + + public AgentRunUpdateIOC source(@javax.annotation.Nonnull String source) { + this.source = source; + return this; + } + + /** + * Where in the binary the agent found the indicator. Empty when the agent gives no location. + * @return source + */ + @javax.annotation.Nonnull + public String getSource() { + return source; + } + + public void setSource(@javax.annotation.Nonnull String source) { + this.source = source; + } + + + public AgentRunUpdateIOC type(@javax.annotation.Nonnull String type) { + this.type = type; + return this; + } + + /** + * Get type + * @return type + */ + @javax.annotation.Nonnull + public String getType() { + return type; + } + + public void setType(@javax.annotation.Nonnull String type) { + this.type = type; + } + + + public AgentRunUpdateIOC value(@javax.annotation.Nonnull String value) { + this.value = value; + return this; + } + + /** + * Get value + * @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 AgentRunUpdateIOC instance itself + */ + public AgentRunUpdateIOC 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; + } + AgentRunUpdateIOC agentRunUpdateIOC = (AgentRunUpdateIOC) o; + return Objects.equals(this.description, agentRunUpdateIOC.description) && + Objects.equals(this.source, agentRunUpdateIOC.source) && + Objects.equals(this.type, agentRunUpdateIOC.type) && + Objects.equals(this.value, agentRunUpdateIOC.value)&& + Objects.equals(this.additionalProperties, agentRunUpdateIOC.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(description, source, type, value, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AgentRunUpdateIOC {\n"); + sb.append(" description: ").append(toIndentedString(description)).append("\n"); + sb.append(" source: ").append(toIndentedString(source)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).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("description", "source", "type", "value")); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(Arrays.asList("description", "source", "type", "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 AgentRunUpdateIOC + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!AgentRunUpdateIOC.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 AgentRunUpdateIOC is not found in the empty JSON string", AgentRunUpdateIOC.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : AgentRunUpdateIOC.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("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("source").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `source` to be a primitive type in the JSON string but got `%s`", jsonObj.get("source").toString())); + } + if (!jsonObj.get("type").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("type").toString())); + } + 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 (!AgentRunUpdateIOC.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'AgentRunUpdateIOC' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(AgentRunUpdateIOC.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, AgentRunUpdateIOC 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 AgentRunUpdateIOC read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + AgentRunUpdateIOC 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 AgentRunUpdateIOC given an JSON string + * + * @param jsonString JSON string + * @return An instance of AgentRunUpdateIOC + * @throws IOException if the JSON string is invalid with respect to AgentRunUpdateIOC + */ + public static AgentRunUpdateIOC fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, AgentRunUpdateIOC.class); + } + + /** + * Convert an instance of AgentRunUpdateIOC to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/ai/reveng/model/AgentStatusCountsBody.java b/src/main/java/ai/reveng/model/AgentStatusCountsBody.java new file mode 100644 index 00000000..43a12f25 --- /dev/null +++ b/src/main/java/ai/reveng/model/AgentStatusCountsBody.java @@ -0,0 +1,338 @@ +/* + * 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; + +/** + * AgentStatusCountsBody + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class AgentStatusCountsBody { + public static final String SERIALIZED_NAME_AGENTS_RUNNING = "agents_running"; + @SerializedName(SERIALIZED_NAME_AGENTS_RUNNING) + @javax.annotation.Nonnull + private Long agentsRunning; + + public static final String SERIALIZED_NAME_COMPLETE = "complete"; + @SerializedName(SERIALIZED_NAME_COMPLETE) + @javax.annotation.Nonnull + private Long complete; + + public static final String SERIALIZED_NAME_QUEUED = "queued"; + @SerializedName(SERIALIZED_NAME_QUEUED) + @javax.annotation.Nonnull + private Long queued; + + public AgentStatusCountsBody() { + } + + public AgentStatusCountsBody agentsRunning(@javax.annotation.Nonnull Long agentsRunning) { + this.agentsRunning = agentsRunning; + return this; + } + + /** + * Get agentsRunning + * @return agentsRunning + */ + @javax.annotation.Nonnull + public Long getAgentsRunning() { + return agentsRunning; + } + + public void setAgentsRunning(@javax.annotation.Nonnull Long agentsRunning) { + this.agentsRunning = agentsRunning; + } + + + public AgentStatusCountsBody complete(@javax.annotation.Nonnull Long complete) { + this.complete = complete; + return this; + } + + /** + * Get complete + * @return complete + */ + @javax.annotation.Nonnull + public Long getComplete() { + return complete; + } + + public void setComplete(@javax.annotation.Nonnull Long complete) { + this.complete = complete; + } + + + public AgentStatusCountsBody queued(@javax.annotation.Nonnull Long queued) { + this.queued = queued; + return this; + } + + /** + * Get queued + * @return queued + */ + @javax.annotation.Nonnull + public Long getQueued() { + return queued; + } + + public void setQueued(@javax.annotation.Nonnull Long queued) { + this.queued = queued; + } + + /** + * 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 AgentStatusCountsBody instance itself + */ + public AgentStatusCountsBody 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; + } + AgentStatusCountsBody agentStatusCountsBody = (AgentStatusCountsBody) o; + return Objects.equals(this.agentsRunning, agentStatusCountsBody.agentsRunning) && + Objects.equals(this.complete, agentStatusCountsBody.complete) && + Objects.equals(this.queued, agentStatusCountsBody.queued)&& + Objects.equals(this.additionalProperties, agentStatusCountsBody.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(agentsRunning, complete, queued, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AgentStatusCountsBody {\n"); + sb.append(" agentsRunning: ").append(toIndentedString(agentsRunning)).append("\n"); + sb.append(" complete: ").append(toIndentedString(complete)).append("\n"); + sb.append(" queued: ").append(toIndentedString(queued)).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("agents_running", "complete", "queued")); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(Arrays.asList("agents_running", "complete", "queued")); + } + + /** + * 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 AgentStatusCountsBody + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!AgentStatusCountsBody.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 AgentStatusCountsBody is not found in the empty JSON string", AgentStatusCountsBody.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : AgentStatusCountsBody.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 (!AgentStatusCountsBody.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'AgentStatusCountsBody' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(AgentStatusCountsBody.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, AgentStatusCountsBody 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 AgentStatusCountsBody read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + AgentStatusCountsBody 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 AgentStatusCountsBody given an JSON string + * + * @param jsonString JSON string + * @return An instance of AgentStatusCountsBody + * @throws IOException if the JSON string is invalid with respect to AgentStatusCountsBody + */ + public static AgentStatusCountsBody fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, AgentStatusCountsBody.class); + } + + /** + * Convert an instance of AgentStatusCountsBody to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/ai/reveng/model/AnalysisCreateRequest.java b/src/main/java/ai/reveng/model/AnalysisCreateRequest.java index fb083499..722ce1cb 100644 --- a/src/main/java/ai/reveng/model/AnalysisCreateRequest.java +++ b/src/main/java/ai/reveng/model/AnalysisCreateRequest.java @@ -456,6 +456,10 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti if (jsonObj.get("analysis_config") != null && !jsonObj.get("analysis_config").isJsonNull()) { AnalysisConfig.validateJsonElement(jsonObj.get("analysis_config")); } + // validate the optional field `auto_run_agents` + if (jsonObj.get("auto_run_agents") != null && !jsonObj.get("auto_run_agents").isJsonNull()) { + AutoRunAgents.validateJsonElement(jsonObj.get("auto_run_agents")); + } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { diff --git a/src/main/java/ai/reveng/model/AnalysisDetailResponse.java b/src/main/java/ai/reveng/model/AnalysisDetailResponse.java index 739328b2..53672693 100644 --- a/src/main/java/ai/reveng/model/AnalysisDetailResponse.java +++ b/src/main/java/ai/reveng/model/AnalysisDetailResponse.java @@ -611,6 +611,8 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti if (!jsonObj.get("sha_256_hash").isJsonPrimitive()) { throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `sha_256_hash` to be a primitive type in the JSON string but got `%s`", jsonObj.get("sha_256_hash").toString())); } + // validate the required field `auto_run_agents` + AutoRunAgents.validateJsonElement(jsonObj.get("auto_run_agents")); // validate the required field `requested_config` AnalysisConfigSnapshot.validateJsonElement(jsonObj.get("requested_config")); } diff --git a/src/main/java/ai/reveng/model/AutoRunAgents.java b/src/main/java/ai/reveng/model/AutoRunAgents.java index fc3cad0c..6395eca3 100644 --- a/src/main/java/ai/reveng/model/AutoRunAgents.java +++ b/src/main/java/ai/reveng/model/AutoRunAgents.java @@ -52,7 +52,7 @@ public class AutoRunAgents { public static final String SERIALIZED_NAME_TRIAGE = "triage"; @SerializedName(SERIALIZED_NAME_TRIAGE) @javax.annotation.Nullable - private Boolean triage; + private Boolean triage = false; public AutoRunAgents() { } diff --git a/src/main/java/ai/reveng/model/BudgetBody.java b/src/main/java/ai/reveng/model/BudgetBody.java new file mode 100644 index 00000000..4f7f40fe --- /dev/null +++ b/src/main/java/ai/reveng/model/BudgetBody.java @@ -0,0 +1,338 @@ +/* + * 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; + +/** + * BudgetBody + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class BudgetBody { + public static final String SERIALIZED_NAME_CREDIT_BUDGET = "credit_budget"; + @SerializedName(SERIALIZED_NAME_CREDIT_BUDGET) + @javax.annotation.Nullable + private Long creditBudget; + + public static final String SERIALIZED_NAME_CREDITS_SPENT = "credits_spent"; + @SerializedName(SERIALIZED_NAME_CREDITS_SPENT) + @javax.annotation.Nonnull + private Double creditsSpent; + + public static final String SERIALIZED_NAME_SPENT = "spent"; + @SerializedName(SERIALIZED_NAME_SPENT) + @javax.annotation.Nonnull + private Boolean spent; + + public BudgetBody() { + } + + public BudgetBody creditBudget(@javax.annotation.Nullable Long creditBudget) { + this.creditBudget = creditBudget; + return this; + } + + /** + * The most credits the investigation may spend. Null when it has no limit. + * @return creditBudget + */ + @javax.annotation.Nullable + public Long getCreditBudget() { + return creditBudget; + } + + public void setCreditBudget(@javax.annotation.Nullable Long creditBudget) { + this.creditBudget = creditBudget; + } + + + public BudgetBody creditsSpent(@javax.annotation.Nonnull Double creditsSpent) { + this.creditsSpent = creditsSpent; + return this; + } + + /** + * Credits spent on the investigation's conversations and the agents run from it. + * @return creditsSpent + */ + @javax.annotation.Nonnull + public Double getCreditsSpent() { + return creditsSpent; + } + + public void setCreditsSpent(@javax.annotation.Nonnull Double creditsSpent) { + this.creditsSpent = creditsSpent; + } + + + public BudgetBody spent(@javax.annotation.Nonnull Boolean spent) { + this.spent = spent; + return this; + } + + /** + * Whether the budget is spent, so nothing more that consumes credits can be started from the investigation. + * @return spent + */ + @javax.annotation.Nonnull + public Boolean getSpent() { + return spent; + } + + public void setSpent(@javax.annotation.Nonnull Boolean spent) { + this.spent = spent; + } + + /** + * 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 BudgetBody instance itself + */ + public BudgetBody 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; + } + BudgetBody budgetBody = (BudgetBody) o; + return Objects.equals(this.creditBudget, budgetBody.creditBudget) && + Objects.equals(this.creditsSpent, budgetBody.creditsSpent) && + Objects.equals(this.spent, budgetBody.spent)&& + Objects.equals(this.additionalProperties, budgetBody.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(creditBudget, creditsSpent, spent, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class BudgetBody {\n"); + sb.append(" creditBudget: ").append(toIndentedString(creditBudget)).append("\n"); + sb.append(" creditsSpent: ").append(toIndentedString(creditsSpent)).append("\n"); + sb.append(" spent: ").append(toIndentedString(spent)).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("credit_budget", "credits_spent", "spent")); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(Arrays.asList("credit_budget", "credits_spent", "spent")); + } + + /** + * 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 BudgetBody + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!BudgetBody.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 BudgetBody is not found in the empty JSON string", BudgetBody.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : BudgetBody.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 (!BudgetBody.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'BudgetBody' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(BudgetBody.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, BudgetBody 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 BudgetBody read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + BudgetBody 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 BudgetBody given an JSON string + * + * @param jsonString JSON string + * @return An instance of BudgetBody + * @throws IOException if the JSON string is invalid with respect to BudgetBody + */ + public static BudgetBody fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, BudgetBody.class); + } + + /** + * Convert an instance of BudgetBody to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/ai/reveng/model/BulkAddTagsInputBody.java b/src/main/java/ai/reveng/model/BulkAddTagsInputBody.java index f58ce308..cfa44b88 100644 --- a/src/main/java/ai/reveng/model/BulkAddTagsInputBody.java +++ b/src/main/java/ai/reveng/model/BulkAddTagsInputBody.java @@ -78,7 +78,7 @@ public BulkAddTagsInputBody addAnalysisIdsItem(Long analysisIdsItem) { } /** - * IDs of the analyses to tag. The caller must own every one, or none are changed + * IDs of the analyses to tag. The caller must have write access to every one, or none are changed * @return analysisIds */ @javax.annotation.Nullable diff --git a/src/main/java/ai/reveng/model/ContextCompactedData.java b/src/main/java/ai/reveng/model/ContextCompactedData.java new file mode 100644 index 00000000..e26caf03 --- /dev/null +++ b/src/main/java/ai/reveng/model/ContextCompactedData.java @@ -0,0 +1,389 @@ +/* + * 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; + +/** + * ContextCompactedData + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class ContextCompactedData { + public static final String SERIALIZED_NAME_CONVERSATION_UUID = "conversation_uuid"; + @SerializedName(SERIALIZED_NAME_CONVERSATION_UUID) + @javax.annotation.Nullable + private String conversationUuid; + + public static final String SERIALIZED_NAME_MESSAGES_AFTER = "messages_after"; + @SerializedName(SERIALIZED_NAME_MESSAGES_AFTER) + @javax.annotation.Nullable + private Integer messagesAfter; + + public static final String SERIALIZED_NAME_MESSAGES_BEFORE = "messages_before"; + @SerializedName(SERIALIZED_NAME_MESSAGES_BEFORE) + @javax.annotation.Nullable + private Integer messagesBefore; + + public static final String SERIALIZED_NAME_REMOVED_TURNS = "removed_turns"; + @SerializedName(SERIALIZED_NAME_REMOVED_TURNS) + @javax.annotation.Nullable + private Integer removedTurns; + + public static final String SERIALIZED_NAME_STRATEGY = "strategy"; + @SerializedName(SERIALIZED_NAME_STRATEGY) + @javax.annotation.Nullable + private String strategy; + + public ContextCompactedData() { + } + + public ContextCompactedData conversationUuid(@javax.annotation.Nullable String conversationUuid) { + this.conversationUuid = conversationUuid; + return this; + } + + /** + * Get conversationUuid + * @return conversationUuid + */ + @javax.annotation.Nullable + public String getConversationUuid() { + return conversationUuid; + } + + public void setConversationUuid(@javax.annotation.Nullable String conversationUuid) { + this.conversationUuid = conversationUuid; + } + + + public ContextCompactedData messagesAfter(@javax.annotation.Nullable Integer messagesAfter) { + this.messagesAfter = messagesAfter; + return this; + } + + /** + * Get messagesAfter + * @return messagesAfter + */ + @javax.annotation.Nullable + public Integer getMessagesAfter() { + return messagesAfter; + } + + public void setMessagesAfter(@javax.annotation.Nullable Integer messagesAfter) { + this.messagesAfter = messagesAfter; + } + + + public ContextCompactedData messagesBefore(@javax.annotation.Nullable Integer messagesBefore) { + this.messagesBefore = messagesBefore; + return this; + } + + /** + * Get messagesBefore + * @return messagesBefore + */ + @javax.annotation.Nullable + public Integer getMessagesBefore() { + return messagesBefore; + } + + public void setMessagesBefore(@javax.annotation.Nullable Integer messagesBefore) { + this.messagesBefore = messagesBefore; + } + + + public ContextCompactedData removedTurns(@javax.annotation.Nullable Integer removedTurns) { + this.removedTurns = removedTurns; + return this; + } + + /** + * Get removedTurns + * @return removedTurns + */ + @javax.annotation.Nullable + public Integer getRemovedTurns() { + return removedTurns; + } + + public void setRemovedTurns(@javax.annotation.Nullable Integer removedTurns) { + this.removedTurns = removedTurns; + } + + + public ContextCompactedData strategy(@javax.annotation.Nullable String strategy) { + this.strategy = strategy; + return this; + } + + /** + * Get strategy + * @return strategy + */ + @javax.annotation.Nullable + public String getStrategy() { + return strategy; + } + + public void setStrategy(@javax.annotation.Nullable String strategy) { + this.strategy = strategy; + } + + /** + * 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 ContextCompactedData instance itself + */ + public ContextCompactedData 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; + } + ContextCompactedData contextCompactedData = (ContextCompactedData) o; + return Objects.equals(this.conversationUuid, contextCompactedData.conversationUuid) && + Objects.equals(this.messagesAfter, contextCompactedData.messagesAfter) && + Objects.equals(this.messagesBefore, contextCompactedData.messagesBefore) && + Objects.equals(this.removedTurns, contextCompactedData.removedTurns) && + Objects.equals(this.strategy, contextCompactedData.strategy)&& + Objects.equals(this.additionalProperties, contextCompactedData.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(conversationUuid, messagesAfter, messagesBefore, removedTurns, strategy, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ContextCompactedData {\n"); + sb.append(" conversationUuid: ").append(toIndentedString(conversationUuid)).append("\n"); + sb.append(" messagesAfter: ").append(toIndentedString(messagesAfter)).append("\n"); + sb.append(" messagesBefore: ").append(toIndentedString(messagesBefore)).append("\n"); + sb.append(" removedTurns: ").append(toIndentedString(removedTurns)).append("\n"); + sb.append(" strategy: ").append(toIndentedString(strategy)).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("conversation_uuid", "messages_after", "messages_before", "removed_turns", "strategy")); + + // 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 ContextCompactedData + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ContextCompactedData.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 ContextCompactedData is not found in the empty JSON string", ContextCompactedData.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("conversation_uuid") != null && !jsonObj.get("conversation_uuid").isJsonNull()) && !jsonObj.get("conversation_uuid").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `conversation_uuid` to be a primitive type in the JSON string but got `%s`", jsonObj.get("conversation_uuid").toString())); + } + if ((jsonObj.get("strategy") != null && !jsonObj.get("strategy").isJsonNull()) && !jsonObj.get("strategy").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `strategy` to be a primitive type in the JSON string but got `%s`", jsonObj.get("strategy").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ContextCompactedData.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ContextCompactedData' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ContextCompactedData.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, ContextCompactedData 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 ContextCompactedData read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + ContextCompactedData 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 ContextCompactedData given an JSON string + * + * @param jsonString JSON string + * @return An instance of ContextCompactedData + * @throws IOException if the JSON string is invalid with respect to ContextCompactedData + */ + public static ContextCompactedData fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ContextCompactedData.class); + } + + /** + * Convert an instance of ContextCompactedData to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/ai/reveng/model/Conversation.java b/src/main/java/ai/reveng/model/Conversation.java index 75ba6e23..3c7c2e37 100644 --- a/src/main/java/ai/reveng/model/Conversation.java +++ b/src/main/java/ai/reveng/model/Conversation.java @@ -13,6 +13,7 @@ package ai.reveng.model; import java.util.Objects; +import ai.reveng.model.ConversationContext; import com.google.gson.TypeAdapter; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; @@ -21,7 +22,6 @@ import java.io.IOException; import java.time.OffsetDateTime; import java.util.Arrays; -import org.openapitools.jackson.nullable.JsonNullable; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -54,7 +54,7 @@ public class Conversation { public static final String SERIALIZED_NAME_CONTEXT = "context"; @SerializedName(SERIALIZED_NAME_CONTEXT) @javax.annotation.Nullable - private Object context = null; + private ConversationContext context; public static final String SERIALIZED_NAME_CONVERSATION_UUID = "conversation_uuid"; @SerializedName(SERIALIZED_NAME_CONVERSATION_UUID) @@ -66,6 +66,11 @@ public class Conversation { @javax.annotation.Nonnull private OffsetDateTime createdAt; + public static final String SERIALIZED_NAME_INVESTIGATION_ID = "investigation_id"; + @SerializedName(SERIALIZED_NAME_INVESTIGATION_ID) + @javax.annotation.Nullable + private Long investigationId; + public static final String SERIALIZED_NAME_TITLE = "title"; @SerializedName(SERIALIZED_NAME_TITLE) @javax.annotation.Nonnull @@ -84,21 +89,21 @@ public class Conversation { public Conversation() { } - public Conversation context(@javax.annotation.Nullable Object context) { + public Conversation context(@javax.annotation.Nullable ConversationContext context) { this.context = context; return this; } /** - * Get context + * The analysis, and optionally the function, the conversation is about. Absent when it is about neither. * @return context */ @javax.annotation.Nullable - public Object getContext() { + public ConversationContext getContext() { return context; } - public void setContext(@javax.annotation.Nullable Object context) { + public void setContext(@javax.annotation.Nullable ConversationContext context) { this.context = context; } @@ -141,6 +146,25 @@ public void setCreatedAt(@javax.annotation.Nonnull OffsetDateTime createdAt) { } + public Conversation investigationId(@javax.annotation.Nullable Long investigationId) { + this.investigationId = investigationId; + return this; + } + + /** + * The investigation the conversation belongs to. Absent for a conversation outside any investigation. + * @return investigationId + */ + @javax.annotation.Nullable + public Long getInvestigationId() { + return investigationId; + } + + public void setInvestigationId(@javax.annotation.Nullable Long investigationId) { + this.investigationId = investigationId; + } + + public Conversation title(@javax.annotation.Nonnull String title) { this.title = title; return this; @@ -255,26 +279,16 @@ public boolean equals(Object o) { return Objects.equals(this.context, conversation.context) && Objects.equals(this.conversationUuid, conversation.conversationUuid) && Objects.equals(this.createdAt, conversation.createdAt) && + Objects.equals(this.investigationId, conversation.investigationId) && Objects.equals(this.title, conversation.title) && Objects.equals(this.updatedAt, conversation.updatedAt) && Objects.equals(this.userId, conversation.userId)&& Objects.equals(this.additionalProperties, conversation.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(context, conversationUuid, createdAt, title, updatedAt, userId, additionalProperties); - } - - private static int hashCodeNullable(JsonNullable a) { - if (a == null) { - return 1; - } - return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + return Objects.hash(context, conversationUuid, createdAt, investigationId, title, updatedAt, userId, additionalProperties); } @Override @@ -284,6 +298,7 @@ public String toString() { sb.append(" context: ").append(toIndentedString(context)).append("\n"); sb.append(" conversationUuid: ").append(toIndentedString(conversationUuid)).append("\n"); sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); + sb.append(" investigationId: ").append(toIndentedString(investigationId)).append("\n"); sb.append(" title: ").append(toIndentedString(title)).append("\n"); sb.append(" updatedAt: ").append(toIndentedString(updatedAt)).append("\n"); sb.append(" userId: ").append(toIndentedString(userId)).append("\n"); @@ -306,7 +321,7 @@ private String toIndentedString(Object o) { static { // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(Arrays.asList("context", "conversation_uuid", "created_at", "title", "updated_at", "user_id")); + openapiFields = new HashSet(Arrays.asList("context", "conversation_uuid", "created_at", "investigation_id", "title", "updated_at", "user_id")); // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(Arrays.asList("conversation_uuid", "created_at", "title", "updated_at", "user_id")); diff --git a/src/main/java/ai/reveng/model/ConversationBody.java b/src/main/java/ai/reveng/model/ConversationBody.java new file mode 100644 index 00000000..1f67ed6b --- /dev/null +++ b/src/main/java/ai/reveng/model/ConversationBody.java @@ -0,0 +1,478 @@ +/* + * 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.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; + +/** + * ConversationBody + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class ConversationBody { + public static final String SERIALIZED_NAME_ANALYSIS_ID = "analysis_id"; + @SerializedName(SERIALIZED_NAME_ANALYSIS_ID) + @javax.annotation.Nullable + private Long analysisId; + + public static final String SERIALIZED_NAME_CONVERSATION_UUID = "conversation_uuid"; + @SerializedName(SERIALIZED_NAME_CONVERSATION_UUID) + @javax.annotation.Nonnull + private String conversationUuid; + + public static final String SERIALIZED_NAME_CREATED_AT = "created_at"; + @SerializedName(SERIALIZED_NAME_CREATED_AT) + @javax.annotation.Nonnull + private OffsetDateTime createdAt; + + public static final String SERIALIZED_NAME_INVESTIGATION_ID = "investigation_id"; + @SerializedName(SERIALIZED_NAME_INVESTIGATION_ID) + @javax.annotation.Nonnull + private Long investigationId; + + public static final String SERIALIZED_NAME_STARTER_ID = "starter_id"; + @SerializedName(SERIALIZED_NAME_STARTER_ID) + @javax.annotation.Nonnull + private Long starterId; + + public static final String SERIALIZED_NAME_STARTER_USERNAME = "starter_username"; + @SerializedName(SERIALIZED_NAME_STARTER_USERNAME) + @javax.annotation.Nonnull + private String starterUsername; + + public static final String SERIALIZED_NAME_TITLE = "title"; + @SerializedName(SERIALIZED_NAME_TITLE) + @javax.annotation.Nonnull + private String title; + + public static final String SERIALIZED_NAME_UPDATED_AT = "updated_at"; + @SerializedName(SERIALIZED_NAME_UPDATED_AT) + @javax.annotation.Nonnull + private OffsetDateTime updatedAt; + + public ConversationBody() { + } + + public ConversationBody analysisId(@javax.annotation.Nullable Long analysisId) { + this.analysisId = analysisId; + return this; + } + + /** + * The analysis the conversation is about. Null when it is about the whole investigation. + * @return analysisId + */ + @javax.annotation.Nullable + public Long getAnalysisId() { + return analysisId; + } + + public void setAnalysisId(@javax.annotation.Nullable Long analysisId) { + this.analysisId = analysisId; + } + + + public ConversationBody conversationUuid(@javax.annotation.Nonnull String conversationUuid) { + this.conversationUuid = conversationUuid; + return this; + } + + /** + * Use with the /v2/conversations endpoints to read, stream and send messages. + * @return conversationUuid + */ + @javax.annotation.Nonnull + public String getConversationUuid() { + return conversationUuid; + } + + public void setConversationUuid(@javax.annotation.Nonnull String conversationUuid) { + this.conversationUuid = conversationUuid; + } + + + public ConversationBody createdAt(@javax.annotation.Nonnull OffsetDateTime createdAt) { + this.createdAt = createdAt; + return this; + } + + /** + * Get createdAt + * @return createdAt + */ + @javax.annotation.Nonnull + public OffsetDateTime getCreatedAt() { + return createdAt; + } + + public void setCreatedAt(@javax.annotation.Nonnull OffsetDateTime createdAt) { + this.createdAt = createdAt; + } + + + public ConversationBody investigationId(@javax.annotation.Nonnull Long investigationId) { + this.investigationId = investigationId; + return this; + } + + /** + * Get investigationId + * @return investigationId + */ + @javax.annotation.Nonnull + public Long getInvestigationId() { + return investigationId; + } + + public void setInvestigationId(@javax.annotation.Nonnull Long investigationId) { + this.investigationId = investigationId; + } + + + public ConversationBody starterId(@javax.annotation.Nonnull Long starterId) { + this.starterId = starterId; + return this; + } + + /** + * The user who started the conversation, and the only one who can send messages in it. + * @return starterId + */ + @javax.annotation.Nonnull + public Long getStarterId() { + return starterId; + } + + public void setStarterId(@javax.annotation.Nonnull Long starterId) { + this.starterId = starterId; + } + + + public ConversationBody starterUsername(@javax.annotation.Nonnull String starterUsername) { + this.starterUsername = starterUsername; + return this; + } + + /** + * Get starterUsername + * @return starterUsername + */ + @javax.annotation.Nonnull + public String getStarterUsername() { + return starterUsername; + } + + public void setStarterUsername(@javax.annotation.Nonnull String starterUsername) { + this.starterUsername = starterUsername; + } + + + public ConversationBody title(@javax.annotation.Nonnull String title) { + this.title = title; + return this; + } + + /** + * Get title + * @return title + */ + @javax.annotation.Nonnull + public String getTitle() { + return title; + } + + public void setTitle(@javax.annotation.Nonnull String title) { + this.title = title; + } + + + public ConversationBody updatedAt(@javax.annotation.Nonnull OffsetDateTime updatedAt) { + this.updatedAt = updatedAt; + return this; + } + + /** + * When the conversation was last active: its newest message or event, or a change such as a new title. + * @return updatedAt + */ + @javax.annotation.Nonnull + public OffsetDateTime getUpdatedAt() { + return updatedAt; + } + + public void setUpdatedAt(@javax.annotation.Nonnull OffsetDateTime updatedAt) { + this.updatedAt = updatedAt; + } + + /** + * 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 ConversationBody instance itself + */ + public ConversationBody 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; + } + ConversationBody conversationBody = (ConversationBody) o; + return Objects.equals(this.analysisId, conversationBody.analysisId) && + Objects.equals(this.conversationUuid, conversationBody.conversationUuid) && + Objects.equals(this.createdAt, conversationBody.createdAt) && + Objects.equals(this.investigationId, conversationBody.investigationId) && + Objects.equals(this.starterId, conversationBody.starterId) && + Objects.equals(this.starterUsername, conversationBody.starterUsername) && + Objects.equals(this.title, conversationBody.title) && + Objects.equals(this.updatedAt, conversationBody.updatedAt)&& + Objects.equals(this.additionalProperties, conversationBody.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(analysisId, conversationUuid, createdAt, investigationId, starterId, starterUsername, title, updatedAt, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ConversationBody {\n"); + sb.append(" analysisId: ").append(toIndentedString(analysisId)).append("\n"); + sb.append(" conversationUuid: ").append(toIndentedString(conversationUuid)).append("\n"); + sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); + sb.append(" investigationId: ").append(toIndentedString(investigationId)).append("\n"); + sb.append(" starterId: ").append(toIndentedString(starterId)).append("\n"); + sb.append(" starterUsername: ").append(toIndentedString(starterUsername)).append("\n"); + sb.append(" title: ").append(toIndentedString(title)).append("\n"); + sb.append(" updatedAt: ").append(toIndentedString(updatedAt)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + return o == null ? "null" : o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(Arrays.asList("analysis_id", "conversation_uuid", "created_at", "investigation_id", "starter_id", "starter_username", "title", "updated_at")); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(Arrays.asList("analysis_id", "conversation_uuid", "created_at", "investigation_id", "starter_id", "starter_username", "title", "updated_at")); + } + + /** + * 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 ConversationBody + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ConversationBody.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 ConversationBody is not found in the empty JSON string", ConversationBody.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : ConversationBody.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("conversation_uuid").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `conversation_uuid` to be a primitive type in the JSON string but got `%s`", jsonObj.get("conversation_uuid").toString())); + } + if (!jsonObj.get("starter_username").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `starter_username` to be a primitive type in the JSON string but got `%s`", jsonObj.get("starter_username").toString())); + } + if (!jsonObj.get("title").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `title` to be a primitive type in the JSON string but got `%s`", jsonObj.get("title").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ConversationBody.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ConversationBody' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ConversationBody.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, ConversationBody 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 ConversationBody read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + ConversationBody 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 ConversationBody given an JSON string + * + * @param jsonString JSON string + * @return An instance of ConversationBody + * @throws IOException if the JSON string is invalid with respect to ConversationBody + */ + public static ConversationBody fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ConversationBody.class); + } + + /** + * Convert an instance of ConversationBody to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/ai/reveng/model/ConversationWithEvents.java b/src/main/java/ai/reveng/model/ConversationWithEvents.java index 75584fd0..2b0b683f 100644 --- a/src/main/java/ai/reveng/model/ConversationWithEvents.java +++ b/src/main/java/ai/reveng/model/ConversationWithEvents.java @@ -13,6 +13,7 @@ package ai.reveng.model; import java.util.Objects; +import ai.reveng.model.ConversationContext; import ai.reveng.model.Event; import com.google.gson.TypeAdapter; import com.google.gson.annotations.JsonAdapter; @@ -24,7 +25,6 @@ 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; @@ -57,7 +57,7 @@ public class ConversationWithEvents { public static final String SERIALIZED_NAME_CONTEXT = "context"; @SerializedName(SERIALIZED_NAME_CONTEXT) @javax.annotation.Nullable - private Object context = null; + private ConversationContext context; public static final String SERIALIZED_NAME_CONVERSATION_UUID = "conversation_uuid"; @SerializedName(SERIALIZED_NAME_CONVERSATION_UUID) @@ -74,6 +74,11 @@ public class ConversationWithEvents { @javax.annotation.Nullable private List events; + public static final String SERIALIZED_NAME_INVESTIGATION_ID = "investigation_id"; + @SerializedName(SERIALIZED_NAME_INVESTIGATION_ID) + @javax.annotation.Nullable + private Long investigationId; + public static final String SERIALIZED_NAME_TITLE = "title"; @SerializedName(SERIALIZED_NAME_TITLE) @javax.annotation.Nonnull @@ -92,21 +97,21 @@ public class ConversationWithEvents { public ConversationWithEvents() { } - public ConversationWithEvents context(@javax.annotation.Nullable Object context) { + public ConversationWithEvents context(@javax.annotation.Nullable ConversationContext context) { this.context = context; return this; } /** - * Get context + * The analysis, and optionally the function, the conversation is about. Absent when it is about neither. * @return context */ @javax.annotation.Nullable - public Object getContext() { + public ConversationContext getContext() { return context; } - public void setContext(@javax.annotation.Nullable Object context) { + public void setContext(@javax.annotation.Nullable ConversationContext context) { this.context = context; } @@ -176,6 +181,25 @@ public void setEvents(@javax.annotation.Nullable List events) { } + public ConversationWithEvents investigationId(@javax.annotation.Nullable Long investigationId) { + this.investigationId = investigationId; + return this; + } + + /** + * The investigation the conversation belongs to. Absent for a conversation outside any investigation. + * @return investigationId + */ + @javax.annotation.Nullable + public Long getInvestigationId() { + return investigationId; + } + + public void setInvestigationId(@javax.annotation.Nullable Long investigationId) { + this.investigationId = investigationId; + } + + public ConversationWithEvents title(@javax.annotation.Nonnull String title) { this.title = title; return this; @@ -291,26 +315,16 @@ public boolean equals(Object o) { Objects.equals(this.conversationUuid, conversationWithEvents.conversationUuid) && Objects.equals(this.createdAt, conversationWithEvents.createdAt) && Objects.equals(this.events, conversationWithEvents.events) && + Objects.equals(this.investigationId, conversationWithEvents.investigationId) && Objects.equals(this.title, conversationWithEvents.title) && Objects.equals(this.updatedAt, conversationWithEvents.updatedAt) && Objects.equals(this.userId, conversationWithEvents.userId)&& Objects.equals(this.additionalProperties, conversationWithEvents.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(context, conversationUuid, createdAt, events, title, updatedAt, userId, additionalProperties); - } - - private static int hashCodeNullable(JsonNullable a) { - if (a == null) { - return 1; - } - return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + return Objects.hash(context, conversationUuid, createdAt, events, investigationId, title, updatedAt, userId, additionalProperties); } @Override @@ -321,6 +335,7 @@ public String toString() { sb.append(" conversationUuid: ").append(toIndentedString(conversationUuid)).append("\n"); sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); sb.append(" events: ").append(toIndentedString(events)).append("\n"); + sb.append(" investigationId: ").append(toIndentedString(investigationId)).append("\n"); sb.append(" title: ").append(toIndentedString(title)).append("\n"); sb.append(" updatedAt: ").append(toIndentedString(updatedAt)).append("\n"); sb.append(" userId: ").append(toIndentedString(userId)).append("\n"); @@ -343,7 +358,7 @@ private String toIndentedString(Object o) { static { // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(Arrays.asList("context", "conversation_uuid", "created_at", "events", "title", "updated_at", "user_id")); + openapiFields = new HashSet(Arrays.asList("context", "conversation_uuid", "created_at", "events", "investigation_id", "title", "updated_at", "user_id")); // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(Arrays.asList("conversation_uuid", "created_at", "events", "title", "updated_at", "user_id")); diff --git a/src/main/java/ai/reveng/model/CreateConversationInputBody.java b/src/main/java/ai/reveng/model/CreateConversationInputBody.java new file mode 100644 index 00000000..48f2bb6a --- /dev/null +++ b/src/main/java/ai/reveng/model/CreateConversationInputBody.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; + +/** + * CreateConversationInputBody + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class CreateConversationInputBody { + public static final String SERIALIZED_NAME_ANALYSIS_ID = "analysis_id"; + @SerializedName(SERIALIZED_NAME_ANALYSIS_ID) + @javax.annotation.Nullable + private Long analysisId; + + public static final String SERIALIZED_NAME_TITLE = "title"; + @SerializedName(SERIALIZED_NAME_TITLE) + @javax.annotation.Nullable + private String title; + + public CreateConversationInputBody() { + } + + public CreateConversationInputBody analysisId(@javax.annotation.Nullable Long analysisId) { + this.analysisId = analysisId; + return this; + } + + /** + * Scopes the conversation to one of the investigation's analyses. Omit it to cover the whole investigation. + * minimum: 0 + * @return analysisId + */ + @javax.annotation.Nullable + public Long getAnalysisId() { + return analysisId; + } + + public void setAnalysisId(@javax.annotation.Nullable Long analysisId) { + this.analysisId = analysisId; + } + + + public CreateConversationInputBody title(@javax.annotation.Nullable String title) { + this.title = title; + return this; + } + + /** + * A title for the conversation. When empty, one is generated from the first message. + * @return title + */ + @javax.annotation.Nullable + public String getTitle() { + return title; + } + + public void setTitle(@javax.annotation.Nullable String title) { + this.title = title; + } + + /** + * 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 CreateConversationInputBody instance itself + */ + public CreateConversationInputBody 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; + } + CreateConversationInputBody createConversationInputBody = (CreateConversationInputBody) o; + return Objects.equals(this.analysisId, createConversationInputBody.analysisId) && + Objects.equals(this.title, createConversationInputBody.title)&& + Objects.equals(this.additionalProperties, createConversationInputBody.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(analysisId, title, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CreateConversationInputBody {\n"); + sb.append(" analysisId: ").append(toIndentedString(analysisId)).append("\n"); + sb.append(" title: ").append(toIndentedString(title)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + return o == null ? "null" : o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(Arrays.asList("analysis_id", "title")); + + // 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 CreateConversationInputBody + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!CreateConversationInputBody.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 CreateConversationInputBody is not found in the empty JSON string", CreateConversationInputBody.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("title") != null && !jsonObj.get("title").isJsonNull()) && !jsonObj.get("title").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `title` to be a primitive type in the JSON string but got `%s`", jsonObj.get("title").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!CreateConversationInputBody.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'CreateConversationInputBody' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(CreateConversationInputBody.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, CreateConversationInputBody 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 CreateConversationInputBody read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + CreateConversationInputBody 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 CreateConversationInputBody given an JSON string + * + * @param jsonString JSON string + * @return An instance of CreateConversationInputBody + * @throws IOException if the JSON string is invalid with respect to CreateConversationInputBody + */ + public static CreateConversationInputBody fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, CreateConversationInputBody.class); + } + + /** + * Convert an instance of CreateConversationInputBody to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/ai/reveng/model/CreateInvestigationInputBody.java b/src/main/java/ai/reveng/model/CreateInvestigationInputBody.java new file mode 100644 index 00000000..943947a0 --- /dev/null +++ b/src/main/java/ai/reveng/model/CreateInvestigationInputBody.java @@ -0,0 +1,552 @@ +/* + * RevEng.AI API + * RevEng.AI is an AI-powered binary analysis platform for reverse engineering and malware analysis. It provides similarity search across executable binaries and functions, AI-driven decompilation, dynamic execution analysis, firmware unpacking, and integration with external threat intelligence sources like VirusTotal. + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package ai.reveng.model; + +import java.util.Objects; +import 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; + +/** + * CreateInvestigationInputBody + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class CreateInvestigationInputBody { + /** + * Gets or Sets caseType + */ + @JsonAdapter(CaseTypeEnum.Adapter.class) + public enum CaseTypeEnum { + REVERSE_ENGINEERING("REVERSE_ENGINEERING"), + + MALWARE_ANALYSIS("MALWARE_ANALYSIS"), + + VULNERABILITY_DISCOVERY("VULNERABILITY_DISCOVERY"), + + UNKNOWN_DEFAULT_OPEN_API("unknown_default_open_api"); + + private String value; + + CaseTypeEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static CaseTypeEnum fromValue(String value) { + for (CaseTypeEnum b : CaseTypeEnum.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 CaseTypeEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public CaseTypeEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return CaseTypeEnum.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + CaseTypeEnum.fromValue(value); + } + } + + public static final String SERIALIZED_NAME_CASE_TYPE = "case_type"; + @SerializedName(SERIALIZED_NAME_CASE_TYPE) + @javax.annotation.Nonnull + private CaseTypeEnum caseType; + + public static final String SERIALIZED_NAME_NAME = "name"; + @SerializedName(SERIALIZED_NAME_NAME) + @javax.annotation.Nonnull + private String name; + + /** + * PRIVATE is visible only to you, TEAM to your whole team. Only you can modify it either way. + */ + @JsonAdapter(ScopeEnum.Adapter.class) + public enum ScopeEnum { + PRIVATE("PRIVATE"), + + TEAM("TEAM"), + + UNKNOWN_DEFAULT_OPEN_API("unknown_default_open_api"); + + private String value; + + ScopeEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static ScopeEnum fromValue(String value) { + for (ScopeEnum b : ScopeEnum.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 ScopeEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public ScopeEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return ScopeEnum.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + ScopeEnum.fromValue(value); + } + } + + public static final String SERIALIZED_NAME_SCOPE = "scope"; + @SerializedName(SERIALIZED_NAME_SCOPE) + @javax.annotation.Nullable + private ScopeEnum scope = ScopeEnum.PRIVATE; + + /** + * Initial severity. + */ + @JsonAdapter(SeverityEnum.Adapter.class) + public enum SeverityEnum { + CRITICAL("CRITICAL"), + + HIGH("HIGH"), + + MEDIUM("MEDIUM"), + + LOW("LOW"), + + UNKNOWN_DEFAULT_OPEN_API("unknown_default_open_api"); + + private String value; + + SeverityEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static SeverityEnum fromValue(String value) { + for (SeverityEnum b : SeverityEnum.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 SeverityEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public SeverityEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return SeverityEnum.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + SeverityEnum.fromValue(value); + } + } + + public static final String SERIALIZED_NAME_SEVERITY = "severity"; + @SerializedName(SERIALIZED_NAME_SEVERITY) + @javax.annotation.Nonnull + private SeverityEnum severity; + + public CreateInvestigationInputBody() { + } + + public CreateInvestigationInputBody caseType(@javax.annotation.Nonnull CaseTypeEnum caseType) { + this.caseType = caseType; + return this; + } + + /** + * Get caseType + * @return caseType + */ + @javax.annotation.Nonnull + public CaseTypeEnum getCaseType() { + return caseType; + } + + public void setCaseType(@javax.annotation.Nonnull CaseTypeEnum caseType) { + this.caseType = caseType; + } + + + public CreateInvestigationInputBody name(@javax.annotation.Nonnull String name) { + this.name = name; + return this; + } + + /** + * Investigation name. Must contain a non-whitespace character. + * @return name + */ + @javax.annotation.Nonnull + public String getName() { + return name; + } + + public void setName(@javax.annotation.Nonnull String name) { + this.name = name; + } + + + public CreateInvestigationInputBody scope(@javax.annotation.Nullable ScopeEnum scope) { + this.scope = scope; + return this; + } + + /** + * PRIVATE is visible only to you, TEAM to your whole team. Only you can modify it either way. + * @return scope + */ + @javax.annotation.Nullable + public ScopeEnum getScope() { + return scope; + } + + public void setScope(@javax.annotation.Nullable ScopeEnum scope) { + this.scope = scope; + } + + + public CreateInvestigationInputBody severity(@javax.annotation.Nonnull SeverityEnum severity) { + this.severity = severity; + return this; + } + + /** + * Initial severity. + * @return severity + */ + @javax.annotation.Nonnull + public SeverityEnum getSeverity() { + return severity; + } + + public void setSeverity(@javax.annotation.Nonnull SeverityEnum severity) { + this.severity = severity; + } + + /** + * 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 CreateInvestigationInputBody instance itself + */ + public CreateInvestigationInputBody 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; + } + CreateInvestigationInputBody createInvestigationInputBody = (CreateInvestigationInputBody) o; + return Objects.equals(this.caseType, createInvestigationInputBody.caseType) && + Objects.equals(this.name, createInvestigationInputBody.name) && + Objects.equals(this.scope, createInvestigationInputBody.scope) && + Objects.equals(this.severity, createInvestigationInputBody.severity)&& + Objects.equals(this.additionalProperties, createInvestigationInputBody.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(caseType, name, scope, severity, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CreateInvestigationInputBody {\n"); + sb.append(" caseType: ").append(toIndentedString(caseType)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" scope: ").append(toIndentedString(scope)).append("\n"); + sb.append(" severity: ").append(toIndentedString(severity)).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("case_type", "name", "scope", "severity")); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(Arrays.asList("case_type", "name", "severity")); + } + + /** + * 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 CreateInvestigationInputBody + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!CreateInvestigationInputBody.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 CreateInvestigationInputBody is not found in the empty JSON string", CreateInvestigationInputBody.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : CreateInvestigationInputBody.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("case_type").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `case_type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("case_type").toString())); + } + // validate the required field `case_type` + CaseTypeEnum.validateJsonElement(jsonObj.get("case_type")); + 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("scope") != null && !jsonObj.get("scope").isJsonNull()) && !jsonObj.get("scope").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `scope` to be a primitive type in the JSON string but got `%s`", jsonObj.get("scope").toString())); + } + // validate the optional field `scope` + if (jsonObj.get("scope") != null && !jsonObj.get("scope").isJsonNull()) { + ScopeEnum.validateJsonElement(jsonObj.get("scope")); + } + if (!jsonObj.get("severity").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `severity` to be a primitive type in the JSON string but got `%s`", jsonObj.get("severity").toString())); + } + // validate the required field `severity` + SeverityEnum.validateJsonElement(jsonObj.get("severity")); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!CreateInvestigationInputBody.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'CreateInvestigationInputBody' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(CreateInvestigationInputBody.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, CreateInvestigationInputBody 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 CreateInvestigationInputBody read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + CreateInvestigationInputBody 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 CreateInvestigationInputBody given an JSON string + * + * @param jsonString JSON string + * @return An instance of CreateInvestigationInputBody + * @throws IOException if the JSON string is invalid with respect to CreateInvestigationInputBody + */ + public static CreateInvestigationInputBody fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, CreateInvestigationInputBody.class); + } + + /** + * Convert an instance of CreateInvestigationInputBody to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/ai/reveng/model/CreateRequest.java b/src/main/java/ai/reveng/model/CreateRequest.java index b169016a..e5b5cf74 100644 --- a/src/main/java/ai/reveng/model/CreateRequest.java +++ b/src/main/java/ai/reveng/model/CreateRequest.java @@ -13,9 +13,9 @@ package ai.reveng.model; import java.util.Objects; -import ai.reveng.model.AutoRunAgents; import ai.reveng.model.BinaryConfig; import ai.reveng.model.Config; +import ai.reveng.model.RequestedOperation; import ai.reveng.model.Symbols; import com.google.gson.TypeAdapter; import com.google.gson.annotations.JsonAdapter; @@ -122,11 +122,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti @javax.annotation.Nullable private AnalysisScopeEnum analysisScope = AnalysisScopeEnum.PRIVATE; - public static final String SERIALIZED_NAME_AUTO_RUN_AGENTS = "auto_run_agents"; - @SerializedName(SERIALIZED_NAME_AUTO_RUN_AGENTS) - @javax.annotation.Nullable - private AutoRunAgents autoRunAgents; - public static final String SERIALIZED_NAME_BINARY_CONFIG = "binary_config"; @SerializedName(SERIALIZED_NAME_BINARY_CONFIG) @javax.annotation.Nullable @@ -142,6 +137,16 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti @javax.annotation.Nonnull private String filename; + public static final String SERIALIZED_NAME_INVESTIGATION_ID = "investigation_id"; + @SerializedName(SERIALIZED_NAME_INVESTIGATION_ID) + @javax.annotation.Nullable + private Long investigationId; + + public static final String SERIALIZED_NAME_OPERATIONS = "operations"; + @SerializedName(SERIALIZED_NAME_OPERATIONS) + @javax.annotation.Nullable + private List operations = new ArrayList<>(); + public static final String SERIALIZED_NAME_SHA256_HASH = "sha_256_hash"; @SerializedName(SERIALIZED_NAME_SHA256_HASH) @javax.annotation.Nonnull @@ -198,25 +203,6 @@ public void setAnalysisScope(@javax.annotation.Nullable AnalysisScopeEnum analys } - public CreateRequest autoRunAgents(@javax.annotation.Nullable AutoRunAgents autoRunAgents) { - this.autoRunAgents = autoRunAgents; - return this; - } - - /** - * Get autoRunAgents - * @return autoRunAgents - */ - @javax.annotation.Nullable - public AutoRunAgents getAutoRunAgents() { - return autoRunAgents; - } - - public void setAutoRunAgents(@javax.annotation.Nullable AutoRunAgents autoRunAgents) { - this.autoRunAgents = autoRunAgents; - } - - public CreateRequest binaryConfig(@javax.annotation.Nullable BinaryConfig binaryConfig) { this.binaryConfig = binaryConfig; return this; @@ -274,6 +260,53 @@ public void setFilename(@javax.annotation.Nonnull String filename) { } + public CreateRequest investigationId(@javax.annotation.Nullable Long investigationId) { + this.investigationId = investigationId; + return this; + } + + /** + * Adds the new analysis to this investigation, which you must own. + * minimum: 1 + * @return investigationId + */ + @javax.annotation.Nullable + public Long getInvestigationId() { + return investigationId; + } + + public void setInvestigationId(@javax.annotation.Nullable Long investigationId) { + this.investigationId = investigationId; + } + + + public CreateRequest operations(@javax.annotation.Nullable List operations) { + this.operations = operations; + return this; + } + + public CreateRequest addOperationsItem(RequestedOperation operationsItem) { + if (this.operations == null) { + this.operations = new ArrayList<>(); + } + this.operations.add(operationsItem); + return this; + } + + /** + * Operations to run automatically once the analysis completes. Each operation's prerequisites must also be requested. + * @return operations + */ + @javax.annotation.Nullable + public List getOperations() { + return operations; + } + + public void setOperations(@javax.annotation.Nullable List operations) { + this.operations = operations; + } + + public CreateRequest sha256Hash(@javax.annotation.Nonnull String sha256Hash) { this.sha256Hash = sha256Hash; return this; @@ -395,10 +428,11 @@ public boolean equals(Object o) { CreateRequest createRequest = (CreateRequest) o; return Objects.equals(this.analysisConfig, createRequest.analysisConfig) && Objects.equals(this.analysisScope, createRequest.analysisScope) && - Objects.equals(this.autoRunAgents, createRequest.autoRunAgents) && Objects.equals(this.binaryConfig, createRequest.binaryConfig) && Objects.equals(this.debugHash, createRequest.debugHash) && Objects.equals(this.filename, createRequest.filename) && + Objects.equals(this.investigationId, createRequest.investigationId) && + Objects.equals(this.operations, createRequest.operations) && Objects.equals(this.sha256Hash, createRequest.sha256Hash) && Objects.equals(this.symbols, createRequest.symbols) && Objects.equals(this.tags, createRequest.tags)&& @@ -411,7 +445,7 @@ private static boolean equalsNullable(JsonNullable a, JsonNullable b) @Override public int hashCode() { - return Objects.hash(analysisConfig, analysisScope, autoRunAgents, binaryConfig, debugHash, filename, sha256Hash, symbols, tags, additionalProperties); + return Objects.hash(analysisConfig, analysisScope, binaryConfig, debugHash, filename, investigationId, operations, sha256Hash, symbols, tags, additionalProperties); } private static int hashCodeNullable(JsonNullable a) { @@ -427,10 +461,11 @@ public String toString() { sb.append("class CreateRequest {\n"); sb.append(" analysisConfig: ").append(toIndentedString(analysisConfig)).append("\n"); sb.append(" analysisScope: ").append(toIndentedString(analysisScope)).append("\n"); - sb.append(" autoRunAgents: ").append(toIndentedString(autoRunAgents)).append("\n"); sb.append(" binaryConfig: ").append(toIndentedString(binaryConfig)).append("\n"); sb.append(" debugHash: ").append(toIndentedString(debugHash)).append("\n"); sb.append(" filename: ").append(toIndentedString(filename)).append("\n"); + sb.append(" investigationId: ").append(toIndentedString(investigationId)).append("\n"); + sb.append(" operations: ").append(toIndentedString(operations)).append("\n"); sb.append(" sha256Hash: ").append(toIndentedString(sha256Hash)).append("\n"); sb.append(" symbols: ").append(toIndentedString(symbols)).append("\n"); sb.append(" tags: ").append(toIndentedString(tags)).append("\n"); @@ -453,7 +488,7 @@ private String toIndentedString(Object o) { static { // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(Arrays.asList("analysis_config", "analysis_scope", "auto_run_agents", "binary_config", "debug_hash", "filename", "sha_256_hash", "symbols", "tags")); + openapiFields = new HashSet(Arrays.asList("analysis_config", "analysis_scope", "binary_config", "debug_hash", "filename", "investigation_id", "operations", "sha_256_hash", "symbols", "tags")); // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(Arrays.asList("filename", "sha_256_hash")); @@ -492,6 +527,10 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti if (!jsonObj.get("filename").isJsonPrimitive()) { throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `filename` to be a primitive type in the JSON string but got `%s`", jsonObj.get("filename").toString())); } + // ensure the optional json data is an array if present + if (jsonObj.get("operations") != null && !jsonObj.get("operations").isJsonNull() && !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())); + } if (!jsonObj.get("sha_256_hash").isJsonPrimitive()) { throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `sha_256_hash` to be a primitive type in the JSON string but got `%s`", jsonObj.get("sha_256_hash").toString())); } diff --git a/src/main/java/ai/reveng/model/DataTypeFunctionEntry.java b/src/main/java/ai/reveng/model/DataTypeFunctionEntry.java index ecaaf121..ebc051da 100644 --- a/src/main/java/ai/reveng/model/DataTypeFunctionEntry.java +++ b/src/main/java/ai/reveng/model/DataTypeFunctionEntry.java @@ -19,7 +19,9 @@ 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; @@ -59,6 +61,67 @@ public class DataTypeFunctionEntry { @javax.annotation.Nonnull private String functionName; + /** + * Gets or Sets usageKinds + */ + @JsonAdapter(UsageKindsEnum.Adapter.class) + public enum UsageKindsEnum { + SIGNATURE("signature"), + + INLINE("inline"), + + MEMBER("member"), + + UNKNOWN_DEFAULT_OPEN_API("unknown_default_open_api"); + + private String value; + + UsageKindsEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static UsageKindsEnum fromValue(String value) { + for (UsageKindsEnum b : UsageKindsEnum.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 UsageKindsEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public UsageKindsEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return UsageKindsEnum.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + UsageKindsEnum.fromValue(value); + } + } + + public static final String SERIALIZED_NAME_USAGE_KINDS = "usage_kinds"; + @SerializedName(SERIALIZED_NAME_USAGE_KINDS) + @javax.annotation.Nonnull + private List usageKinds = new ArrayList<>(); + public DataTypeFunctionEntry() { } @@ -99,6 +162,33 @@ public void setFunctionName(@javax.annotation.Nonnull String functionName) { this.functionName = functionName; } + + public DataTypeFunctionEntry usageKinds(@javax.annotation.Nonnull List usageKinds) { + this.usageKinds = usageKinds; + return this; + } + + public DataTypeFunctionEntry addUsageKindsItem(UsageKindsEnum usageKindsItem) { + if (this.usageKinds == null) { + this.usageKinds = new ArrayList<>(); + } + this.usageKinds.add(usageKindsItem); + return this; + } + + /** + * How the function uses the type, each listed once, in alphabetical order: signature (its return type or a parameter type), inline (its AI decompilation names the type in its code), member (its AI decompilation reads a struct or union member of this type, or it references a global variable of this type). + * @return usageKinds + */ + @javax.annotation.Nonnull + public List getUsageKinds() { + return usageKinds; + } + + public void setUsageKinds(@javax.annotation.Nonnull List usageKinds) { + this.usageKinds = usageKinds; + } + /** * A container for additional, undeclared properties. * This is a holder for any undeclared properties as specified with @@ -155,13 +245,14 @@ public boolean equals(Object o) { } DataTypeFunctionEntry dataTypeFunctionEntry = (DataTypeFunctionEntry) o; return Objects.equals(this.functionId, dataTypeFunctionEntry.functionId) && - Objects.equals(this.functionName, dataTypeFunctionEntry.functionName)&& + Objects.equals(this.functionName, dataTypeFunctionEntry.functionName) && + Objects.equals(this.usageKinds, dataTypeFunctionEntry.usageKinds)&& Objects.equals(this.additionalProperties, dataTypeFunctionEntry.additionalProperties); } @Override public int hashCode() { - return Objects.hash(functionId, functionName, additionalProperties); + return Objects.hash(functionId, functionName, usageKinds, additionalProperties); } @Override @@ -170,6 +261,7 @@ public String toString() { sb.append("class DataTypeFunctionEntry {\n"); sb.append(" functionId: ").append(toIndentedString(functionId)).append("\n"); sb.append(" functionName: ").append(toIndentedString(functionName)).append("\n"); + sb.append(" usageKinds: ").append(toIndentedString(usageKinds)).append("\n"); sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); sb.append("}"); return sb.toString(); @@ -189,10 +281,10 @@ private String toIndentedString(Object o) { static { // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(Arrays.asList("function_id", "function_name")); + openapiFields = new HashSet(Arrays.asList("function_id", "function_name", "usage_kinds")); // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(Arrays.asList("function_id", "function_name")); + openapiRequiredFields = new HashSet(Arrays.asList("function_id", "function_name", "usage_kinds")); } /** @@ -218,6 +310,12 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti 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())); } + // ensure the required json array is present + if (jsonObj.get("usage_kinds") == null) { + throw new IllegalArgumentException("Expected the field `linkedContent` to be an array in the JSON string but got `null`"); + } else if (!jsonObj.get("usage_kinds").isJsonArray()) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `usage_kinds` to be an array in the JSON string but got `%s`", jsonObj.get("usage_kinds").toString())); + } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { diff --git a/src/main/java/ai/reveng/model/EntityRef.java b/src/main/java/ai/reveng/model/EntityRef.java new file mode 100644 index 00000000..2dac4498 --- /dev/null +++ b/src/main/java/ai/reveng/model/EntityRef.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 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; + +/** + * EntityRef + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class EntityRef { + public static final String SERIALIZED_NAME_ID = "id"; + @SerializedName(SERIALIZED_NAME_ID) + @javax.annotation.Nonnull + private Long id; + + public static final String SERIALIZED_NAME_NAME = "name"; + @SerializedName(SERIALIZED_NAME_NAME) + @javax.annotation.Nullable + private String name; + + public static final String SERIALIZED_NAME_VADDR = "vaddr"; + @SerializedName(SERIALIZED_NAME_VADDR) + @javax.annotation.Nullable + private Long vaddr; + + public EntityRef() { + } + + public EntityRef id(@javax.annotation.Nonnull Long id) { + this.id = id; + return this; + } + + /** + * Get id + * @return id + */ + @javax.annotation.Nonnull + public Long getId() { + return id; + } + + public void setId(@javax.annotation.Nonnull Long id) { + this.id = id; + } + + + public EntityRef name(@javax.annotation.Nullable String name) { + this.name = name; + return this; + } + + /** + * Get name + * @return name + */ + @javax.annotation.Nullable + public String getName() { + return name; + } + + public void setName(@javax.annotation.Nullable String name) { + this.name = name; + } + + + public EntityRef vaddr(@javax.annotation.Nullable Long vaddr) { + this.vaddr = vaddr; + return this; + } + + /** + * Get vaddr + * @return vaddr + */ + @javax.annotation.Nullable + public Long getVaddr() { + return vaddr; + } + + public void setVaddr(@javax.annotation.Nullable Long vaddr) { + this.vaddr = vaddr; + } + + /** + * 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 EntityRef instance itself + */ + public EntityRef 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; + } + EntityRef entityRef = (EntityRef) o; + return Objects.equals(this.id, entityRef.id) && + Objects.equals(this.name, entityRef.name) && + Objects.equals(this.vaddr, entityRef.vaddr)&& + Objects.equals(this.additionalProperties, entityRef.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(id, name, vaddr, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class EntityRef {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" vaddr: ").append(toIndentedString(vaddr)).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("id", "name", "vaddr")); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(Arrays.asList("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 EntityRef + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!EntityRef.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 EntityRef is not found in the empty JSON string", EntityRef.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : EntityRef.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") != 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 (!EntityRef.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'EntityRef' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(EntityRef.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, EntityRef 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 EntityRef read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + EntityRef 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 EntityRef given an JSON string + * + * @param jsonString JSON string + * @return An instance of EntityRef + * @throws IOException if the JSON string is invalid with respect to EntityRef + */ + public static EntityRef fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, EntityRef.class); + } + + /** + * Convert an instance of EntityRef to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/ai/reveng/model/EntityUpdate.java b/src/main/java/ai/reveng/model/EntityUpdate.java new file mode 100644 index 00000000..39bab447 --- /dev/null +++ b/src/main/java/ai/reveng/model/EntityUpdate.java @@ -0,0 +1,373 @@ +/* + * 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.EntityRef; +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; + +/** + * EntityUpdate + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class EntityUpdate { + public static final String SERIALIZED_NAME_IDS = "ids"; + @SerializedName(SERIALIZED_NAME_IDS) + @javax.annotation.Nullable + private List ids; + + public static final String SERIALIZED_NAME_REFS = "refs"; + @SerializedName(SERIALIZED_NAME_REFS) + @javax.annotation.Nullable + private List refs; + + public static final String SERIALIZED_NAME_TYPE = "type"; + @SerializedName(SERIALIZED_NAME_TYPE) + @javax.annotation.Nullable + private String type; + + public EntityUpdate() { + } + + public EntityUpdate ids(@javax.annotation.Nullable List ids) { + this.ids = ids; + return this; + } + + public EntityUpdate addIdsItem(Long idsItem) { + if (this.ids == null) { + this.ids = new ArrayList<>(); + } + this.ids.add(idsItem); + return this; + } + + /** + * Get ids + * @return ids + */ + @javax.annotation.Nullable + public List getIds() { + return ids; + } + + public void setIds(@javax.annotation.Nullable List ids) { + this.ids = ids; + } + + + public EntityUpdate refs(@javax.annotation.Nullable List refs) { + this.refs = refs; + return this; + } + + public EntityUpdate addRefsItem(EntityRef refsItem) { + if (this.refs == null) { + this.refs = new ArrayList<>(); + } + this.refs.add(refsItem); + return this; + } + + /** + * Get refs + * @return refs + */ + @javax.annotation.Nullable + public List getRefs() { + return refs; + } + + public void setRefs(@javax.annotation.Nullable List refs) { + this.refs = refs; + } + + + public EntityUpdate type(@javax.annotation.Nullable String type) { + this.type = type; + return this; + } + + /** + * Get type + * @return type + */ + @javax.annotation.Nullable + public String getType() { + return type; + } + + public void setType(@javax.annotation.Nullable String type) { + this.type = type; + } + + /** + * 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 EntityUpdate instance itself + */ + public EntityUpdate 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; + } + EntityUpdate entityUpdate = (EntityUpdate) o; + return Objects.equals(this.ids, entityUpdate.ids) && + Objects.equals(this.refs, entityUpdate.refs) && + Objects.equals(this.type, entityUpdate.type)&& + Objects.equals(this.additionalProperties, entityUpdate.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(ids, refs, type, 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 EntityUpdate {\n"); + sb.append(" ids: ").append(toIndentedString(ids)).append("\n"); + sb.append(" refs: ").append(toIndentedString(refs)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).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("ids", "refs", "type")); + + // 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 EntityUpdate + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!EntityUpdate.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 EntityUpdate is not found in the empty JSON string", EntityUpdate.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // ensure the optional json data is an array if present + if (jsonObj.get("ids") != null && !jsonObj.get("ids").isJsonNull() && !jsonObj.get("ids").isJsonArray()) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `ids` to be an array in the JSON string but got `%s`", jsonObj.get("ids").toString())); + } + // ensure the optional json data is an array if present + if (jsonObj.get("refs") != null && !jsonObj.get("refs").isJsonNull() && !jsonObj.get("refs").isJsonArray()) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `refs` to be an array in the JSON string but got `%s`", jsonObj.get("refs").toString())); + } + if ((jsonObj.get("type") != null && !jsonObj.get("type").isJsonNull()) && !jsonObj.get("type").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("type").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!EntityUpdate.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'EntityUpdate' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(EntityUpdate.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, EntityUpdate 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 EntityUpdate read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + EntityUpdate 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 EntityUpdate given an JSON string + * + * @param jsonString JSON string + * @return An instance of EntityUpdate + * @throws IOException if the JSON string is invalid with respect to EntityUpdate + */ + public static EntityUpdate fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, EntityUpdate.class); + } + + /** + * Convert an instance of EntityUpdate 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 62dfa9c5..5640bc4d 100644 --- a/src/main/java/ai/reveng/model/ErrorBody.java +++ b/src/main/java/ai/reveng/model/ErrorBody.java @@ -102,6 +102,8 @@ public enum CodeEnum { INVALID_RESET_CODE("INVALID_RESET_CODE"), + INVESTIGATION_BUDGET_SPENT("INVESTIGATION_BUDGET_SPENT"), + LAST_ORG_OWNER("LAST_ORG_OWNER"), LAST_TEAM_ADMIN("LAST_TEAM_ADMIN"), diff --git a/src/main/java/ai/reveng/model/Event.java b/src/main/java/ai/reveng/model/Event.java index 60673828..76a6fc5e 100644 --- a/src/main/java/ai/reveng/model/Event.java +++ b/src/main/java/ai/reveng/model/Event.java @@ -13,6 +13,7 @@ package ai.reveng.model; import java.util.Objects; +import ai.reveng.model.EventData; import com.google.gson.TypeAdapter; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; @@ -62,8 +63,8 @@ public class Event { public static final String SERIALIZED_NAME_DATA = "data"; @SerializedName(SERIALIZED_NAME_DATA) - @javax.annotation.Nullable - private Object data = null; + @javax.annotation.Nonnull + private EventData data; public static final String SERIALIZED_NAME_EVENT_ID = "event_id"; @SerializedName(SERIALIZED_NAME_EVENT_ID) @@ -80,10 +81,96 @@ public class Event { @javax.annotation.Nonnull private Long tokensUsed; + /** + * The event type, which decides the shape of data: 1 RUN_STARTED, 2 RUN_FINISHED, 3 RUN_ERROR, 4 STEP_STARTED, 5 STEP_FINISHED, 6 TEXT_MESSAGE_START, 7 TEXT_MESSAGE_CONTENT, 8 TEXT_MESSAGE_END, 9 TOOL_CALL_START, 10 TOOL_CALL_ARGS_DELTA, 11 TOOL_CALL_END, 12 TOOL_CALL_RESULT, 13 TITLE_UPDATED, 14 RUN_CANCELLED, 15 CONTEXT_COMPACTED, 16 TOOL_CONFIRMATION_REQUIRED, 19 TOOL_CALL_PROGRESS, 20 AGENT_RUN_UPDATE. + */ + @JsonAdapter(TypeEnum.Adapter.class) + public enum TypeEnum { + NUMBER_1(1), + + NUMBER_2(2), + + NUMBER_3(3), + + NUMBER_4(4), + + NUMBER_5(5), + + NUMBER_6(6), + + NUMBER_7(7), + + NUMBER_8(8), + + NUMBER_9(9), + + NUMBER_10(10), + + NUMBER_11(11), + + NUMBER_12(12), + + NUMBER_13(13), + + NUMBER_14(14), + + NUMBER_15(15), + + NUMBER_16(16), + + NUMBER_19(19), + + NUMBER_20(20), + + NUMBER_unknown_default_open_api(11184809); + + private Integer value; + + TypeEnum(Integer value) { + this.value = value; + } + + public Integer getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static TypeEnum fromValue(Integer value) { + for (TypeEnum b : TypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + return NUMBER_unknown_default_open_api; + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final TypeEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public TypeEnum read(final JsonReader jsonReader) throws IOException { + Integer value = jsonReader.nextInt(); + return TypeEnum.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + Integer value = jsonElement.getAsInt(); + TypeEnum.fromValue(value); + } + } + public static final String SERIALIZED_NAME_TYPE = "type"; @SerializedName(SERIALIZED_NAME_TYPE) @javax.annotation.Nonnull - private Integer type; + private TypeEnum type; public Event() { } @@ -126,7 +213,7 @@ public void setCreatedAt(@javax.annotation.Nonnull OffsetDateTime createdAt) { } - public Event data(@javax.annotation.Nullable Object data) { + public Event data(@javax.annotation.Nonnull EventData data) { this.data = data; return this; } @@ -135,12 +222,12 @@ public Event data(@javax.annotation.Nullable Object data) { * Get data * @return data */ - @javax.annotation.Nullable - public Object getData() { + @javax.annotation.Nonnull + public EventData getData() { return data; } - public void setData(@javax.annotation.Nullable Object data) { + public void setData(@javax.annotation.Nonnull EventData data) { this.data = data; } @@ -202,21 +289,21 @@ public void setTokensUsed(@javax.annotation.Nonnull Long tokensUsed) { } - public Event type(@javax.annotation.Nonnull Integer type) { + public Event type(@javax.annotation.Nonnull TypeEnum type) { this.type = type; return this; } /** - * Get type + * The event type, which decides the shape of data: 1 RUN_STARTED, 2 RUN_FINISHED, 3 RUN_ERROR, 4 STEP_STARTED, 5 STEP_FINISHED, 6 TEXT_MESSAGE_START, 7 TEXT_MESSAGE_CONTENT, 8 TEXT_MESSAGE_END, 9 TOOL_CALL_START, 10 TOOL_CALL_ARGS_DELTA, 11 TOOL_CALL_END, 12 TOOL_CALL_RESULT, 13 TITLE_UPDATED, 14 RUN_CANCELLED, 15 CONTEXT_COMPACTED, 16 TOOL_CONFIRMATION_REQUIRED, 19 TOOL_CALL_PROGRESS, 20 AGENT_RUN_UPDATE. * @return type */ @javax.annotation.Nonnull - public Integer getType() { + public TypeEnum getType() { return type; } - public void setType(@javax.annotation.Nonnull Integer type) { + public void setType(@javax.annotation.Nonnull TypeEnum type) { this.type = type; } @@ -349,6 +436,10 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti if (!jsonObj.get("conversation_uuid").isJsonPrimitive()) { throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `conversation_uuid` to be a primitive type in the JSON string but got `%s`", jsonObj.get("conversation_uuid").toString())); } + // validate the required field `data` + EventData.validateJsonElement(jsonObj.get("data")); + // validate the required field `type` + TypeEnum.validateJsonElement(jsonObj.get("type")); } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { diff --git a/src/main/java/ai/reveng/model/EventAGENTRUNUPDATE.java b/src/main/java/ai/reveng/model/EventAGENTRUNUPDATE.java new file mode 100644 index 00000000..a5cb9269 --- /dev/null +++ b/src/main/java/ai/reveng/model/EventAGENTRUNUPDATE.java @@ -0,0 +1,422 @@ +/* + * RevEng.AI API + * RevEng.AI is an AI-powered binary analysis platform for reverse engineering and malware analysis. It provides similarity search across executable binaries and functions, AI-driven decompilation, dynamic execution analysis, firmware unpacking, and integration with external threat intelligence sources like VirusTotal. + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package ai.reveng.model; + +import java.util.Objects; +import ai.reveng.model.SseEventAgentRunUpdateData; +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; + +/** + * EventAGENTRUNUPDATE + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class EventAGENTRUNUPDATE { + public static final String SERIALIZED_NAME_DATA = "data"; + @SerializedName(SERIALIZED_NAME_DATA) + @javax.annotation.Nonnull + private SseEventAgentRunUpdateData data; + + /** + * The event name. + */ + @JsonAdapter(EventEnum.Adapter.class) + public enum EventEnum { + AGENT_RUN_UPDATE("AGENT_RUN_UPDATE"), + + UNKNOWN_DEFAULT_OPEN_API("unknown_default_open_api"); + + private String value; + + EventEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static EventEnum fromValue(String value) { + for (EventEnum b : EventEnum.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 EventEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public EventEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return EventEnum.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + EventEnum.fromValue(value); + } + } + + public static final String SERIALIZED_NAME_EVENT = "event"; + @SerializedName(SERIALIZED_NAME_EVENT) + @javax.annotation.Nonnull + private EventEnum event; + + public static final String SERIALIZED_NAME_ID = "id"; + @SerializedName(SERIALIZED_NAME_ID) + @javax.annotation.Nullable + private Integer id; + + public static final String SERIALIZED_NAME_RETRY = "retry"; + @SerializedName(SERIALIZED_NAME_RETRY) + @javax.annotation.Nullable + private Integer retry; + + public EventAGENTRUNUPDATE() { + } + + public EventAGENTRUNUPDATE data(@javax.annotation.Nonnull SseEventAgentRunUpdateData data) { + this.data = data; + return this; + } + + /** + * Get data + * @return data + */ + @javax.annotation.Nonnull + public SseEventAgentRunUpdateData getData() { + return data; + } + + public void setData(@javax.annotation.Nonnull SseEventAgentRunUpdateData data) { + this.data = data; + } + + + public EventAGENTRUNUPDATE event(@javax.annotation.Nonnull EventEnum event) { + this.event = event; + return this; + } + + /** + * The event name. + * @return event + */ + @javax.annotation.Nonnull + public EventEnum getEvent() { + return event; + } + + public void setEvent(@javax.annotation.Nonnull EventEnum event) { + this.event = event; + } + + + public EventAGENTRUNUPDATE id(@javax.annotation.Nullable Integer id) { + this.id = id; + return this; + } + + /** + * The event ID. + * @return id + */ + @javax.annotation.Nullable + public Integer getId() { + return id; + } + + public void setId(@javax.annotation.Nullable Integer id) { + this.id = id; + } + + + public EventAGENTRUNUPDATE retry(@javax.annotation.Nullable Integer retry) { + this.retry = retry; + return this; + } + + /** + * The retry time in milliseconds. + * @return retry + */ + @javax.annotation.Nullable + public Integer getRetry() { + return retry; + } + + public void setRetry(@javax.annotation.Nullable Integer retry) { + this.retry = retry; + } + + /** + * 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 EventAGENTRUNUPDATE instance itself + */ + public EventAGENTRUNUPDATE 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; + } + EventAGENTRUNUPDATE eventAGENTRUNUPDATE = (EventAGENTRUNUPDATE) o; + return Objects.equals(this.data, eventAGENTRUNUPDATE.data) && + Objects.equals(this.event, eventAGENTRUNUPDATE.event) && + Objects.equals(this.id, eventAGENTRUNUPDATE.id) && + Objects.equals(this.retry, eventAGENTRUNUPDATE.retry)&& + Objects.equals(this.additionalProperties, eventAGENTRUNUPDATE.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, event, id, retry, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class EventAGENTRUNUPDATE {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" event: ").append(toIndentedString(event)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" retry: ").append(toIndentedString(retry)).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", "event", "id", "retry")); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(Arrays.asList("data", "event")); + } + + /** + * 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 EventAGENTRUNUPDATE + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!EventAGENTRUNUPDATE.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 EventAGENTRUNUPDATE is not found in the empty JSON string", EventAGENTRUNUPDATE.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : EventAGENTRUNUPDATE.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("event").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `event` to be a primitive type in the JSON string but got `%s`", jsonObj.get("event").toString())); + } + // validate the required field `event` + EventEnum.validateJsonElement(jsonObj.get("event")); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!EventAGENTRUNUPDATE.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'EventAGENTRUNUPDATE' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(EventAGENTRUNUPDATE.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, EventAGENTRUNUPDATE 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 EventAGENTRUNUPDATE read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + EventAGENTRUNUPDATE 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 EventAGENTRUNUPDATE given an JSON string + * + * @param jsonString JSON string + * @return An instance of EventAGENTRUNUPDATE + * @throws IOException if the JSON string is invalid with respect to EventAGENTRUNUPDATE + */ + public static EventAGENTRUNUPDATE fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, EventAGENTRUNUPDATE.class); + } + + /** + * Convert an instance of EventAGENTRUNUPDATE to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/ai/reveng/model/EventData.java b/src/main/java/ai/reveng/model/EventData.java new file mode 100644 index 00000000..de137fb3 --- /dev/null +++ b/src/main/java/ai/reveng/model/EventData.java @@ -0,0 +1,1008 @@ +/* + * 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.AgentRunUpdateAgent; +import ai.reveng.model.AgentRunUpdateCard; +import ai.reveng.model.AgentRunUpdateData; +import ai.reveng.model.ContextCompactedData; +import ai.reveng.model.EntityUpdate; +import ai.reveng.model.RunCancelledData; +import ai.reveng.model.RunErrorData; +import ai.reveng.model.RunFinishedData; +import ai.reveng.model.RunStartedData; +import ai.reveng.model.StepFinishedData; +import ai.reveng.model.StepStartedData; +import ai.reveng.model.TextMessageContentData; +import ai.reveng.model.TextMessageEndData; +import ai.reveng.model.TextMessageStartData; +import ai.reveng.model.TitleUpdatedData; +import ai.reveng.model.ToolCallArgsDeltaData; +import ai.reveng.model.ToolCallEndData; +import ai.reveng.model.ToolCallProgressData; +import ai.reveng.model.ToolCallResultData; +import ai.reveng.model.ToolCallStartData; +import ai.reveng.model.ToolConfirmationRequiredData; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + + + +import 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 EventData extends AbstractOpenApiSchema { + private static final Logger log = Logger.getLogger(EventData.class.getName()); + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!EventData.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'EventData' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter adapterRunStartedData = gson.getDelegateAdapter(this, TypeToken.get(RunStartedData.class)); + final TypeAdapter adapterRunFinishedData = gson.getDelegateAdapter(this, TypeToken.get(RunFinishedData.class)); + final TypeAdapter adapterRunErrorData = gson.getDelegateAdapter(this, TypeToken.get(RunErrorData.class)); + final TypeAdapter adapterStepStartedData = gson.getDelegateAdapter(this, TypeToken.get(StepStartedData.class)); + final TypeAdapter adapterStepFinishedData = gson.getDelegateAdapter(this, TypeToken.get(StepFinishedData.class)); + final TypeAdapter adapterTextMessageStartData = gson.getDelegateAdapter(this, TypeToken.get(TextMessageStartData.class)); + final TypeAdapter adapterTextMessageContentData = gson.getDelegateAdapter(this, TypeToken.get(TextMessageContentData.class)); + final TypeAdapter adapterTextMessageEndData = gson.getDelegateAdapter(this, TypeToken.get(TextMessageEndData.class)); + final TypeAdapter adapterToolCallStartData = gson.getDelegateAdapter(this, TypeToken.get(ToolCallStartData.class)); + final TypeAdapter adapterToolCallArgsDeltaData = gson.getDelegateAdapter(this, TypeToken.get(ToolCallArgsDeltaData.class)); + final TypeAdapter adapterToolCallEndData = gson.getDelegateAdapter(this, TypeToken.get(ToolCallEndData.class)); + final TypeAdapter adapterToolCallResultData = gson.getDelegateAdapter(this, TypeToken.get(ToolCallResultData.class)); + final TypeAdapter adapterTitleUpdatedData = gson.getDelegateAdapter(this, TypeToken.get(TitleUpdatedData.class)); + final TypeAdapter adapterRunCancelledData = gson.getDelegateAdapter(this, TypeToken.get(RunCancelledData.class)); + final TypeAdapter adapterContextCompactedData = gson.getDelegateAdapter(this, TypeToken.get(ContextCompactedData.class)); + final TypeAdapter adapterToolConfirmationRequiredData = gson.getDelegateAdapter(this, TypeToken.get(ToolConfirmationRequiredData.class)); + final TypeAdapter adapterToolCallProgressData = gson.getDelegateAdapter(this, TypeToken.get(ToolCallProgressData.class)); + final TypeAdapter adapterAgentRunUpdateData = gson.getDelegateAdapter(this, TypeToken.get(AgentRunUpdateData.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, EventData value) throws IOException { + if (value == null || value.getActualInstance() == null) { + elementAdapter.write(out, null); + return; + } + + // check if the actual instance is of the type `RunStartedData` + if (value.getActualInstance() instanceof RunStartedData) { + JsonElement element = adapterRunStartedData.toJsonTree((RunStartedData)value.getActualInstance()); + elementAdapter.write(out, element); + return; + } + // check if the actual instance is of the type `RunFinishedData` + if (value.getActualInstance() instanceof RunFinishedData) { + JsonElement element = adapterRunFinishedData.toJsonTree((RunFinishedData)value.getActualInstance()); + elementAdapter.write(out, element); + return; + } + // check if the actual instance is of the type `RunErrorData` + if (value.getActualInstance() instanceof RunErrorData) { + JsonElement element = adapterRunErrorData.toJsonTree((RunErrorData)value.getActualInstance()); + elementAdapter.write(out, element); + return; + } + // check if the actual instance is of the type `StepStartedData` + if (value.getActualInstance() instanceof StepStartedData) { + JsonElement element = adapterStepStartedData.toJsonTree((StepStartedData)value.getActualInstance()); + elementAdapter.write(out, element); + return; + } + // check if the actual instance is of the type `StepFinishedData` + if (value.getActualInstance() instanceof StepFinishedData) { + JsonElement element = adapterStepFinishedData.toJsonTree((StepFinishedData)value.getActualInstance()); + elementAdapter.write(out, element); + return; + } + // check if the actual instance is of the type `TextMessageStartData` + if (value.getActualInstance() instanceof TextMessageStartData) { + JsonElement element = adapterTextMessageStartData.toJsonTree((TextMessageStartData)value.getActualInstance()); + elementAdapter.write(out, element); + return; + } + // check if the actual instance is of the type `TextMessageContentData` + if (value.getActualInstance() instanceof TextMessageContentData) { + JsonElement element = adapterTextMessageContentData.toJsonTree((TextMessageContentData)value.getActualInstance()); + elementAdapter.write(out, element); + return; + } + // check if the actual instance is of the type `TextMessageEndData` + if (value.getActualInstance() instanceof TextMessageEndData) { + JsonElement element = adapterTextMessageEndData.toJsonTree((TextMessageEndData)value.getActualInstance()); + elementAdapter.write(out, element); + return; + } + // check if the actual instance is of the type `ToolCallStartData` + if (value.getActualInstance() instanceof ToolCallStartData) { + JsonElement element = adapterToolCallStartData.toJsonTree((ToolCallStartData)value.getActualInstance()); + elementAdapter.write(out, element); + return; + } + // check if the actual instance is of the type `ToolCallArgsDeltaData` + if (value.getActualInstance() instanceof ToolCallArgsDeltaData) { + JsonElement element = adapterToolCallArgsDeltaData.toJsonTree((ToolCallArgsDeltaData)value.getActualInstance()); + elementAdapter.write(out, element); + return; + } + // check if the actual instance is of the type `ToolCallEndData` + if (value.getActualInstance() instanceof ToolCallEndData) { + JsonElement element = adapterToolCallEndData.toJsonTree((ToolCallEndData)value.getActualInstance()); + elementAdapter.write(out, element); + return; + } + // check if the actual instance is of the type `ToolCallResultData` + if (value.getActualInstance() instanceof ToolCallResultData) { + JsonElement element = adapterToolCallResultData.toJsonTree((ToolCallResultData)value.getActualInstance()); + elementAdapter.write(out, element); + return; + } + // check if the actual instance is of the type `TitleUpdatedData` + if (value.getActualInstance() instanceof TitleUpdatedData) { + JsonElement element = adapterTitleUpdatedData.toJsonTree((TitleUpdatedData)value.getActualInstance()); + elementAdapter.write(out, element); + return; + } + // check if the actual instance is of the type `RunCancelledData` + if (value.getActualInstance() instanceof RunCancelledData) { + JsonElement element = adapterRunCancelledData.toJsonTree((RunCancelledData)value.getActualInstance()); + elementAdapter.write(out, element); + return; + } + // check if the actual instance is of the type `ContextCompactedData` + if (value.getActualInstance() instanceof ContextCompactedData) { + JsonElement element = adapterContextCompactedData.toJsonTree((ContextCompactedData)value.getActualInstance()); + elementAdapter.write(out, element); + return; + } + // check if the actual instance is of the type `ToolConfirmationRequiredData` + if (value.getActualInstance() instanceof ToolConfirmationRequiredData) { + JsonElement element = adapterToolConfirmationRequiredData.toJsonTree((ToolConfirmationRequiredData)value.getActualInstance()); + elementAdapter.write(out, element); + return; + } + // check if the actual instance is of the type `ToolCallProgressData` + if (value.getActualInstance() instanceof ToolCallProgressData) { + JsonElement element = adapterToolCallProgressData.toJsonTree((ToolCallProgressData)value.getActualInstance()); + elementAdapter.write(out, element); + return; + } + // check if the actual instance is of the type `AgentRunUpdateData` + if (value.getActualInstance() instanceof AgentRunUpdateData) { + JsonElement element = adapterAgentRunUpdateData.toJsonTree((AgentRunUpdateData)value.getActualInstance()); + elementAdapter.write(out, element); + return; + } + throw new IOException("Failed to serialize as the type doesn't match anyOf schemas: AgentRunUpdateData, ContextCompactedData, RunCancelledData, RunErrorData, RunFinishedData, RunStartedData, StepFinishedData, StepStartedData, TextMessageContentData, TextMessageEndData, TextMessageStartData, TitleUpdatedData, ToolCallArgsDeltaData, ToolCallEndData, ToolCallProgressData, ToolCallResultData, ToolCallStartData, ToolConfirmationRequiredData"); + } + + @Override + public EventData read(JsonReader in) throws IOException { + Object deserialized = null; + JsonElement jsonElement = elementAdapter.read(in); + + ArrayList errorMessages = new ArrayList<>(); + TypeAdapter actualAdapter = elementAdapter; + + // deserialize RunStartedData + try { + // validate the JSON object to see if any exception is thrown + RunStartedData.validateJsonElement(jsonElement); + actualAdapter = adapterRunStartedData; + EventData ret = new EventData(); + ret.setActualInstance(actualAdapter.fromJsonTree(jsonElement)); + return ret; + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format(java.util.Locale.ROOT, "Deserialization for RunStartedData failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'RunStartedData'", e); + } + // deserialize RunFinishedData + try { + // validate the JSON object to see if any exception is thrown + RunFinishedData.validateJsonElement(jsonElement); + actualAdapter = adapterRunFinishedData; + EventData ret = new EventData(); + ret.setActualInstance(actualAdapter.fromJsonTree(jsonElement)); + return ret; + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format(java.util.Locale.ROOT, "Deserialization for RunFinishedData failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'RunFinishedData'", e); + } + // deserialize RunErrorData + try { + // validate the JSON object to see if any exception is thrown + RunErrorData.validateJsonElement(jsonElement); + actualAdapter = adapterRunErrorData; + EventData ret = new EventData(); + ret.setActualInstance(actualAdapter.fromJsonTree(jsonElement)); + return ret; + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format(java.util.Locale.ROOT, "Deserialization for RunErrorData failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'RunErrorData'", e); + } + // deserialize StepStartedData + try { + // validate the JSON object to see if any exception is thrown + StepStartedData.validateJsonElement(jsonElement); + actualAdapter = adapterStepStartedData; + EventData ret = new EventData(); + ret.setActualInstance(actualAdapter.fromJsonTree(jsonElement)); + return ret; + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format(java.util.Locale.ROOT, "Deserialization for StepStartedData failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'StepStartedData'", e); + } + // deserialize StepFinishedData + try { + // validate the JSON object to see if any exception is thrown + StepFinishedData.validateJsonElement(jsonElement); + actualAdapter = adapterStepFinishedData; + EventData ret = new EventData(); + ret.setActualInstance(actualAdapter.fromJsonTree(jsonElement)); + return ret; + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format(java.util.Locale.ROOT, "Deserialization for StepFinishedData failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'StepFinishedData'", e); + } + // deserialize TextMessageStartData + try { + // validate the JSON object to see if any exception is thrown + TextMessageStartData.validateJsonElement(jsonElement); + actualAdapter = adapterTextMessageStartData; + EventData ret = new EventData(); + ret.setActualInstance(actualAdapter.fromJsonTree(jsonElement)); + return ret; + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format(java.util.Locale.ROOT, "Deserialization for TextMessageStartData failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'TextMessageStartData'", e); + } + // deserialize TextMessageContentData + try { + // validate the JSON object to see if any exception is thrown + TextMessageContentData.validateJsonElement(jsonElement); + actualAdapter = adapterTextMessageContentData; + EventData ret = new EventData(); + ret.setActualInstance(actualAdapter.fromJsonTree(jsonElement)); + return ret; + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format(java.util.Locale.ROOT, "Deserialization for TextMessageContentData failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'TextMessageContentData'", e); + } + // deserialize TextMessageEndData + try { + // validate the JSON object to see if any exception is thrown + TextMessageEndData.validateJsonElement(jsonElement); + actualAdapter = adapterTextMessageEndData; + EventData ret = new EventData(); + ret.setActualInstance(actualAdapter.fromJsonTree(jsonElement)); + return ret; + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format(java.util.Locale.ROOT, "Deserialization for TextMessageEndData failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'TextMessageEndData'", e); + } + // deserialize ToolCallStartData + try { + // validate the JSON object to see if any exception is thrown + ToolCallStartData.validateJsonElement(jsonElement); + actualAdapter = adapterToolCallStartData; + EventData ret = new EventData(); + ret.setActualInstance(actualAdapter.fromJsonTree(jsonElement)); + return ret; + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format(java.util.Locale.ROOT, "Deserialization for ToolCallStartData failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'ToolCallStartData'", e); + } + // deserialize ToolCallArgsDeltaData + try { + // validate the JSON object to see if any exception is thrown + ToolCallArgsDeltaData.validateJsonElement(jsonElement); + actualAdapter = adapterToolCallArgsDeltaData; + EventData ret = new EventData(); + ret.setActualInstance(actualAdapter.fromJsonTree(jsonElement)); + return ret; + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format(java.util.Locale.ROOT, "Deserialization for ToolCallArgsDeltaData failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'ToolCallArgsDeltaData'", e); + } + // deserialize ToolCallEndData + try { + // validate the JSON object to see if any exception is thrown + ToolCallEndData.validateJsonElement(jsonElement); + actualAdapter = adapterToolCallEndData; + EventData ret = new EventData(); + ret.setActualInstance(actualAdapter.fromJsonTree(jsonElement)); + return ret; + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format(java.util.Locale.ROOT, "Deserialization for ToolCallEndData failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'ToolCallEndData'", e); + } + // deserialize ToolCallResultData + try { + // validate the JSON object to see if any exception is thrown + ToolCallResultData.validateJsonElement(jsonElement); + actualAdapter = adapterToolCallResultData; + EventData ret = new EventData(); + ret.setActualInstance(actualAdapter.fromJsonTree(jsonElement)); + return ret; + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format(java.util.Locale.ROOT, "Deserialization for ToolCallResultData failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'ToolCallResultData'", e); + } + // deserialize TitleUpdatedData + try { + // validate the JSON object to see if any exception is thrown + TitleUpdatedData.validateJsonElement(jsonElement); + actualAdapter = adapterTitleUpdatedData; + EventData ret = new EventData(); + ret.setActualInstance(actualAdapter.fromJsonTree(jsonElement)); + return ret; + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format(java.util.Locale.ROOT, "Deserialization for TitleUpdatedData failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'TitleUpdatedData'", e); + } + // deserialize RunCancelledData + try { + // validate the JSON object to see if any exception is thrown + RunCancelledData.validateJsonElement(jsonElement); + actualAdapter = adapterRunCancelledData; + EventData ret = new EventData(); + ret.setActualInstance(actualAdapter.fromJsonTree(jsonElement)); + return ret; + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format(java.util.Locale.ROOT, "Deserialization for RunCancelledData failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'RunCancelledData'", e); + } + // deserialize ContextCompactedData + try { + // validate the JSON object to see if any exception is thrown + ContextCompactedData.validateJsonElement(jsonElement); + actualAdapter = adapterContextCompactedData; + EventData ret = new EventData(); + ret.setActualInstance(actualAdapter.fromJsonTree(jsonElement)); + return ret; + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format(java.util.Locale.ROOT, "Deserialization for ContextCompactedData failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'ContextCompactedData'", e); + } + // deserialize ToolConfirmationRequiredData + try { + // validate the JSON object to see if any exception is thrown + ToolConfirmationRequiredData.validateJsonElement(jsonElement); + actualAdapter = adapterToolConfirmationRequiredData; + EventData ret = new EventData(); + ret.setActualInstance(actualAdapter.fromJsonTree(jsonElement)); + return ret; + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format(java.util.Locale.ROOT, "Deserialization for ToolConfirmationRequiredData failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'ToolConfirmationRequiredData'", e); + } + // deserialize ToolCallProgressData + try { + // validate the JSON object to see if any exception is thrown + ToolCallProgressData.validateJsonElement(jsonElement); + actualAdapter = adapterToolCallProgressData; + EventData ret = new EventData(); + ret.setActualInstance(actualAdapter.fromJsonTree(jsonElement)); + return ret; + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format(java.util.Locale.ROOT, "Deserialization for ToolCallProgressData failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'ToolCallProgressData'", e); + } + // deserialize AgentRunUpdateData + try { + // validate the JSON object to see if any exception is thrown + AgentRunUpdateData.validateJsonElement(jsonElement); + actualAdapter = adapterAgentRunUpdateData; + EventData ret = new EventData(); + ret.setActualInstance(actualAdapter.fromJsonTree(jsonElement)); + return ret; + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format(java.util.Locale.ROOT, "Deserialization for AgentRunUpdateData failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'AgentRunUpdateData'", e); + } + + throw new IOException(String.format(java.util.Locale.ROOT, "Failed deserialization for EventData: no class matches result, expected at least 1. Detailed failure message for anyOf schemas: %s. JSON: %s", errorMessages, jsonElement.toString())); + } + }.nullSafe(); + } + } + + // store a list of schema names defined in anyOf + public static final Map> schemas = new HashMap>(); + + public EventData() { + super("anyOf", Boolean.FALSE); + } + + public EventData(Object o) { + super("anyOf", Boolean.FALSE); + setActualInstance(o); + } + + static { + schemas.put("RunStartedData", RunStartedData.class); + schemas.put("RunFinishedData", RunFinishedData.class); + schemas.put("RunErrorData", RunErrorData.class); + schemas.put("StepStartedData", StepStartedData.class); + schemas.put("StepFinishedData", StepFinishedData.class); + schemas.put("TextMessageStartData", TextMessageStartData.class); + schemas.put("TextMessageContentData", TextMessageContentData.class); + schemas.put("TextMessageEndData", TextMessageEndData.class); + schemas.put("ToolCallStartData", ToolCallStartData.class); + schemas.put("ToolCallArgsDeltaData", ToolCallArgsDeltaData.class); + schemas.put("ToolCallEndData", ToolCallEndData.class); + schemas.put("ToolCallResultData", ToolCallResultData.class); + schemas.put("TitleUpdatedData", TitleUpdatedData.class); + schemas.put("RunCancelledData", RunCancelledData.class); + schemas.put("ContextCompactedData", ContextCompactedData.class); + schemas.put("ToolConfirmationRequiredData", ToolConfirmationRequiredData.class); + schemas.put("ToolCallProgressData", ToolCallProgressData.class); + schemas.put("AgentRunUpdateData", AgentRunUpdateData.class); + } + + @Override + public Map> getSchemas() { + return EventData.schemas; + } + + /** + * Set the instance that matches the anyOf child schema, check + * the instance parameter is valid against the anyOf child schemas: + * AgentRunUpdateData, ContextCompactedData, RunCancelledData, RunErrorData, RunFinishedData, RunStartedData, StepFinishedData, StepStartedData, TextMessageContentData, TextMessageEndData, TextMessageStartData, TitleUpdatedData, ToolCallArgsDeltaData, ToolCallEndData, ToolCallProgressData, ToolCallResultData, ToolCallStartData, ToolConfirmationRequiredData + * + * It could be an instance of the 'anyOf' schemas. + */ + @Override + public void setActualInstance(Object instance) { + if (instance instanceof RunStartedData) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof RunFinishedData) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof RunErrorData) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof StepStartedData) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof StepFinishedData) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof TextMessageStartData) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof TextMessageContentData) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof TextMessageEndData) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof ToolCallStartData) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof ToolCallArgsDeltaData) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof ToolCallEndData) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof ToolCallResultData) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof TitleUpdatedData) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof RunCancelledData) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof ContextCompactedData) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof ToolConfirmationRequiredData) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof ToolCallProgressData) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof AgentRunUpdateData) { + super.setActualInstance(instance); + return; + } + + throw new RuntimeException("Invalid instance type. Must be AgentRunUpdateData, ContextCompactedData, RunCancelledData, RunErrorData, RunFinishedData, RunStartedData, StepFinishedData, StepStartedData, TextMessageContentData, TextMessageEndData, TextMessageStartData, TitleUpdatedData, ToolCallArgsDeltaData, ToolCallEndData, ToolCallProgressData, ToolCallResultData, ToolCallStartData, ToolConfirmationRequiredData"); + } + + /** + * Get the actual instance, which can be the following: + * AgentRunUpdateData, ContextCompactedData, RunCancelledData, RunErrorData, RunFinishedData, RunStartedData, StepFinishedData, StepStartedData, TextMessageContentData, TextMessageEndData, TextMessageStartData, TitleUpdatedData, ToolCallArgsDeltaData, ToolCallEndData, ToolCallProgressData, ToolCallResultData, ToolCallStartData, ToolConfirmationRequiredData + * + * @return The actual instance (AgentRunUpdateData, ContextCompactedData, RunCancelledData, RunErrorData, RunFinishedData, RunStartedData, StepFinishedData, StepStartedData, TextMessageContentData, TextMessageEndData, TextMessageStartData, TitleUpdatedData, ToolCallArgsDeltaData, ToolCallEndData, ToolCallProgressData, ToolCallResultData, ToolCallStartData, ToolConfirmationRequiredData) + */ + @SuppressWarnings("unchecked") + @Override + public Object getActualInstance() { + return super.getActualInstance(); + } + + /** + * Get the actual instance of `RunStartedData`. If the actual instance is not `RunStartedData`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `RunStartedData` + * @throws ClassCastException if the instance is not `RunStartedData` + */ + public RunStartedData getRunStartedData() throws ClassCastException { + return (RunStartedData)super.getActualInstance(); + } + + /** + * Get the actual instance of `RunFinishedData`. If the actual instance is not `RunFinishedData`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `RunFinishedData` + * @throws ClassCastException if the instance is not `RunFinishedData` + */ + public RunFinishedData getRunFinishedData() throws ClassCastException { + return (RunFinishedData)super.getActualInstance(); + } + + /** + * Get the actual instance of `RunErrorData`. If the actual instance is not `RunErrorData`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `RunErrorData` + * @throws ClassCastException if the instance is not `RunErrorData` + */ + public RunErrorData getRunErrorData() throws ClassCastException { + return (RunErrorData)super.getActualInstance(); + } + + /** + * Get the actual instance of `StepStartedData`. If the actual instance is not `StepStartedData`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `StepStartedData` + * @throws ClassCastException if the instance is not `StepStartedData` + */ + public StepStartedData getStepStartedData() throws ClassCastException { + return (StepStartedData)super.getActualInstance(); + } + + /** + * Get the actual instance of `StepFinishedData`. If the actual instance is not `StepFinishedData`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `StepFinishedData` + * @throws ClassCastException if the instance is not `StepFinishedData` + */ + public StepFinishedData getStepFinishedData() throws ClassCastException { + return (StepFinishedData)super.getActualInstance(); + } + + /** + * Get the actual instance of `TextMessageStartData`. If the actual instance is not `TextMessageStartData`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `TextMessageStartData` + * @throws ClassCastException if the instance is not `TextMessageStartData` + */ + public TextMessageStartData getTextMessageStartData() throws ClassCastException { + return (TextMessageStartData)super.getActualInstance(); + } + + /** + * Get the actual instance of `TextMessageContentData`. If the actual instance is not `TextMessageContentData`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `TextMessageContentData` + * @throws ClassCastException if the instance is not `TextMessageContentData` + */ + public TextMessageContentData getTextMessageContentData() throws ClassCastException { + return (TextMessageContentData)super.getActualInstance(); + } + + /** + * Get the actual instance of `TextMessageEndData`. If the actual instance is not `TextMessageEndData`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `TextMessageEndData` + * @throws ClassCastException if the instance is not `TextMessageEndData` + */ + public TextMessageEndData getTextMessageEndData() throws ClassCastException { + return (TextMessageEndData)super.getActualInstance(); + } + + /** + * Get the actual instance of `ToolCallStartData`. If the actual instance is not `ToolCallStartData`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `ToolCallStartData` + * @throws ClassCastException if the instance is not `ToolCallStartData` + */ + public ToolCallStartData getToolCallStartData() throws ClassCastException { + return (ToolCallStartData)super.getActualInstance(); + } + + /** + * Get the actual instance of `ToolCallArgsDeltaData`. If the actual instance is not `ToolCallArgsDeltaData`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `ToolCallArgsDeltaData` + * @throws ClassCastException if the instance is not `ToolCallArgsDeltaData` + */ + public ToolCallArgsDeltaData getToolCallArgsDeltaData() throws ClassCastException { + return (ToolCallArgsDeltaData)super.getActualInstance(); + } + + /** + * Get the actual instance of `ToolCallEndData`. If the actual instance is not `ToolCallEndData`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `ToolCallEndData` + * @throws ClassCastException if the instance is not `ToolCallEndData` + */ + public ToolCallEndData getToolCallEndData() throws ClassCastException { + return (ToolCallEndData)super.getActualInstance(); + } + + /** + * Get the actual instance of `ToolCallResultData`. If the actual instance is not `ToolCallResultData`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `ToolCallResultData` + * @throws ClassCastException if the instance is not `ToolCallResultData` + */ + public ToolCallResultData getToolCallResultData() throws ClassCastException { + return (ToolCallResultData)super.getActualInstance(); + } + + /** + * Get the actual instance of `TitleUpdatedData`. If the actual instance is not `TitleUpdatedData`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `TitleUpdatedData` + * @throws ClassCastException if the instance is not `TitleUpdatedData` + */ + public TitleUpdatedData getTitleUpdatedData() throws ClassCastException { + return (TitleUpdatedData)super.getActualInstance(); + } + + /** + * Get the actual instance of `RunCancelledData`. If the actual instance is not `RunCancelledData`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `RunCancelledData` + * @throws ClassCastException if the instance is not `RunCancelledData` + */ + public RunCancelledData getRunCancelledData() throws ClassCastException { + return (RunCancelledData)super.getActualInstance(); + } + + /** + * Get the actual instance of `ContextCompactedData`. If the actual instance is not `ContextCompactedData`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `ContextCompactedData` + * @throws ClassCastException if the instance is not `ContextCompactedData` + */ + public ContextCompactedData getContextCompactedData() throws ClassCastException { + return (ContextCompactedData)super.getActualInstance(); + } + + /** + * Get the actual instance of `ToolConfirmationRequiredData`. If the actual instance is not `ToolConfirmationRequiredData`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `ToolConfirmationRequiredData` + * @throws ClassCastException if the instance is not `ToolConfirmationRequiredData` + */ + public ToolConfirmationRequiredData getToolConfirmationRequiredData() throws ClassCastException { + return (ToolConfirmationRequiredData)super.getActualInstance(); + } + + /** + * Get the actual instance of `ToolCallProgressData`. If the actual instance is not `ToolCallProgressData`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `ToolCallProgressData` + * @throws ClassCastException if the instance is not `ToolCallProgressData` + */ + public ToolCallProgressData getToolCallProgressData() throws ClassCastException { + return (ToolCallProgressData)super.getActualInstance(); + } + + /** + * Get the actual instance of `AgentRunUpdateData`. If the actual instance is not `AgentRunUpdateData`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `AgentRunUpdateData` + * @throws ClassCastException if the instance is not `AgentRunUpdateData` + */ + public AgentRunUpdateData getAgentRunUpdateData() throws ClassCastException { + return (AgentRunUpdateData)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 EventData + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + // validate anyOf schemas one by one + ArrayList errorMessages = new ArrayList<>(); + // validate the json string with RunStartedData + try { + RunStartedData.validateJsonElement(jsonElement); + return; + } catch (Exception e) { + errorMessages.add(String.format(java.util.Locale.ROOT, "Deserialization for RunStartedData failed with `%s`.", e.getMessage())); + // continue to the next one + } + // validate the json string with RunFinishedData + try { + RunFinishedData.validateJsonElement(jsonElement); + return; + } catch (Exception e) { + errorMessages.add(String.format(java.util.Locale.ROOT, "Deserialization for RunFinishedData failed with `%s`.", e.getMessage())); + // continue to the next one + } + // validate the json string with RunErrorData + try { + RunErrorData.validateJsonElement(jsonElement); + return; + } catch (Exception e) { + errorMessages.add(String.format(java.util.Locale.ROOT, "Deserialization for RunErrorData failed with `%s`.", e.getMessage())); + // continue to the next one + } + // validate the json string with StepStartedData + try { + StepStartedData.validateJsonElement(jsonElement); + return; + } catch (Exception e) { + errorMessages.add(String.format(java.util.Locale.ROOT, "Deserialization for StepStartedData failed with `%s`.", e.getMessage())); + // continue to the next one + } + // validate the json string with StepFinishedData + try { + StepFinishedData.validateJsonElement(jsonElement); + return; + } catch (Exception e) { + errorMessages.add(String.format(java.util.Locale.ROOT, "Deserialization for StepFinishedData failed with `%s`.", e.getMessage())); + // continue to the next one + } + // validate the json string with TextMessageStartData + try { + TextMessageStartData.validateJsonElement(jsonElement); + return; + } catch (Exception e) { + errorMessages.add(String.format(java.util.Locale.ROOT, "Deserialization for TextMessageStartData failed with `%s`.", e.getMessage())); + // continue to the next one + } + // validate the json string with TextMessageContentData + try { + TextMessageContentData.validateJsonElement(jsonElement); + return; + } catch (Exception e) { + errorMessages.add(String.format(java.util.Locale.ROOT, "Deserialization for TextMessageContentData failed with `%s`.", e.getMessage())); + // continue to the next one + } + // validate the json string with TextMessageEndData + try { + TextMessageEndData.validateJsonElement(jsonElement); + return; + } catch (Exception e) { + errorMessages.add(String.format(java.util.Locale.ROOT, "Deserialization for TextMessageEndData failed with `%s`.", e.getMessage())); + // continue to the next one + } + // validate the json string with ToolCallStartData + try { + ToolCallStartData.validateJsonElement(jsonElement); + return; + } catch (Exception e) { + errorMessages.add(String.format(java.util.Locale.ROOT, "Deserialization for ToolCallStartData failed with `%s`.", e.getMessage())); + // continue to the next one + } + // validate the json string with ToolCallArgsDeltaData + try { + ToolCallArgsDeltaData.validateJsonElement(jsonElement); + return; + } catch (Exception e) { + errorMessages.add(String.format(java.util.Locale.ROOT, "Deserialization for ToolCallArgsDeltaData failed with `%s`.", e.getMessage())); + // continue to the next one + } + // validate the json string with ToolCallEndData + try { + ToolCallEndData.validateJsonElement(jsonElement); + return; + } catch (Exception e) { + errorMessages.add(String.format(java.util.Locale.ROOT, "Deserialization for ToolCallEndData failed with `%s`.", e.getMessage())); + // continue to the next one + } + // validate the json string with ToolCallResultData + try { + ToolCallResultData.validateJsonElement(jsonElement); + return; + } catch (Exception e) { + errorMessages.add(String.format(java.util.Locale.ROOT, "Deserialization for ToolCallResultData failed with `%s`.", e.getMessage())); + // continue to the next one + } + // validate the json string with TitleUpdatedData + try { + TitleUpdatedData.validateJsonElement(jsonElement); + return; + } catch (Exception e) { + errorMessages.add(String.format(java.util.Locale.ROOT, "Deserialization for TitleUpdatedData failed with `%s`.", e.getMessage())); + // continue to the next one + } + // validate the json string with RunCancelledData + try { + RunCancelledData.validateJsonElement(jsonElement); + return; + } catch (Exception e) { + errorMessages.add(String.format(java.util.Locale.ROOT, "Deserialization for RunCancelledData failed with `%s`.", e.getMessage())); + // continue to the next one + } + // validate the json string with ContextCompactedData + try { + ContextCompactedData.validateJsonElement(jsonElement); + return; + } catch (Exception e) { + errorMessages.add(String.format(java.util.Locale.ROOT, "Deserialization for ContextCompactedData failed with `%s`.", e.getMessage())); + // continue to the next one + } + // validate the json string with ToolConfirmationRequiredData + try { + ToolConfirmationRequiredData.validateJsonElement(jsonElement); + return; + } catch (Exception e) { + errorMessages.add(String.format(java.util.Locale.ROOT, "Deserialization for ToolConfirmationRequiredData failed with `%s`.", e.getMessage())); + // continue to the next one + } + // validate the json string with ToolCallProgressData + try { + ToolCallProgressData.validateJsonElement(jsonElement); + return; + } catch (Exception e) { + errorMessages.add(String.format(java.util.Locale.ROOT, "Deserialization for ToolCallProgressData failed with `%s`.", e.getMessage())); + // continue to the next one + } + // validate the json string with AgentRunUpdateData + try { + AgentRunUpdateData.validateJsonElement(jsonElement); + return; + } catch (Exception e) { + errorMessages.add(String.format(java.util.Locale.ROOT, "Deserialization for AgentRunUpdateData failed with `%s`.", e.getMessage())); + // continue to the next one + } + throw new IOException(String.format(java.util.Locale.ROOT, "The JSON string is invalid for EventData with anyOf schemas: AgentRunUpdateData, ContextCompactedData, RunCancelledData, RunErrorData, RunFinishedData, RunStartedData, StepFinishedData, StepStartedData, TextMessageContentData, TextMessageEndData, TextMessageStartData, TitleUpdatedData, ToolCallArgsDeltaData, ToolCallEndData, ToolCallProgressData, ToolCallResultData, ToolCallStartData, ToolConfirmationRequiredData. no class match the result, expected at least 1. Detailed failure message for anyOf schemas: %s. JSON: %s", errorMessages, jsonElement.toString())); + } + + /** + * Create an instance of EventData given an JSON string + * + * @param jsonString JSON string + * @return An instance of EventData + * @throws IOException if the JSON string is invalid with respect to EventData + */ + public static EventData fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, EventData.class); + } + + /** + * Convert an instance of EventData to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/ai/reveng/model/EvidenceInner.java b/src/main/java/ai/reveng/model/EvidenceInner.java index 1d703896..453ed3e2 100644 --- a/src/main/java/ai/reveng/model/EvidenceInner.java +++ b/src/main/java/ai/reveng/model/EvidenceInner.java @@ -13,14 +13,14 @@ package ai.reveng.model; import java.util.Objects; -import ai.reveng.model.ApiCombinationEvidence; +import ai.reveng.model.APICombinationEvidence; import ai.reveng.model.CallChainEvidence; import ai.reveng.model.DecompilerSummaryEvidence; import ai.reveng.model.FunctionSimilarityEvidence; import ai.reveng.model.HardcodedSecretEvidence; +import ai.reveng.model.ImportedAPICallEvidence; import ai.reveng.model.ImportedApi; import ai.reveng.model.ImportedApiCall; -import ai.reveng.model.ImportedApiCallEvidence; import ai.reveng.model.KnownConstantEvidence; import ai.reveng.model.ModelInterpretationEvidence; import ai.reveng.model.ReferencedConstantEvidence; @@ -90,10 +90,10 @@ public TypeAdapter create(Gson gson, TypeToken type) { 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 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 adapterAPICombinationEvidence = gson.getDelegateAdapter(this, TypeToken.get(APICombinationEvidence.class)); final TypeAdapter adapterDecompilerSummaryEvidence = gson.getDelegateAdapter(this, TypeToken.get(DecompilerSummaryEvidence.class)); final TypeAdapter adapterModelInterpretationEvidence = gson.getDelegateAdapter(this, TypeToken.get(ModelInterpretationEvidence.class)); final TypeAdapter adapterKnownConstantEvidence = gson.getDelegateAdapter(this, TypeToken.get(KnownConstantEvidence.class)); @@ -119,9 +119,9 @@ public void write(JsonWriter out, EvidenceInner value) throws IOException { 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()); + // 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; } @@ -137,9 +137,9 @@ public void write(JsonWriter out, EvidenceInner value) throws IOException { 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()); + // 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; } @@ -167,7 +167,7 @@ public void write(JsonWriter out, EvidenceInner value) throws IOException { elementAdapter.write(out, element); return; } - throw new IOException("Failed to serialize as the type doesn't match oneOf schemas: ApiCombinationEvidence, CallChainEvidence, DecompilerSummaryEvidence, FunctionSimilarityEvidence, HardcodedSecretEvidence, ImportedApiCallEvidence, KnownConstantEvidence, ModelInterpretationEvidence, ReferencedConstantEvidence, StringMatchEvidence"); + throw new IOException("Failed to serialize as the type doesn't match oneOf schemas: APICombinationEvidence, CallChainEvidence, DecompilerSummaryEvidence, FunctionSimilarityEvidence, HardcodedSecretEvidence, ImportedAPICallEvidence, KnownConstantEvidence, ModelInterpretationEvidence, ReferencedConstantEvidence, StringMatchEvidence"); } @Override @@ -203,17 +203,17 @@ public EvidenceInner read(JsonReader in) throws IOException { 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 + // deserialize ImportedAPICallEvidence try { // validate the JSON object to see if any exception is thrown - ImportedApiCallEvidence.validateJsonElement(jsonElement); - actualAdapter = adapterImportedApiCallEvidence; + ImportedAPICallEvidence.validateJsonElement(jsonElement); + actualAdapter = adapterImportedAPICallEvidence; match++; - log.log(Level.FINER, "Input data matches schema 'ImportedApiCallEvidence'"); + 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); + 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 { @@ -239,17 +239,17 @@ public EvidenceInner read(JsonReader in) throws IOException { 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 + // deserialize APICombinationEvidence try { // validate the JSON object to see if any exception is thrown - ApiCombinationEvidence.validateJsonElement(jsonElement); - actualAdapter = adapterApiCombinationEvidence; + APICombinationEvidence.validateJsonElement(jsonElement); + actualAdapter = adapterAPICombinationEvidence; match++; - log.log(Level.FINER, "Input data matches schema 'ApiCombinationEvidence'"); + 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); + 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 { @@ -327,10 +327,10 @@ public EvidenceInner(Object o) { static { schemas.put("CallChainEvidence", CallChainEvidence.class); schemas.put("ReferencedConstantEvidence", ReferencedConstantEvidence.class); - schemas.put("ImportedApiCallEvidence", ImportedApiCallEvidence.class); + schemas.put("ImportedAPICallEvidence", ImportedAPICallEvidence.class); schemas.put("StringMatchEvidence", StringMatchEvidence.class); schemas.put("FunctionSimilarityEvidence", FunctionSimilarityEvidence.class); - schemas.put("ApiCombinationEvidence", ApiCombinationEvidence.class); + schemas.put("APICombinationEvidence", APICombinationEvidence.class); schemas.put("DecompilerSummaryEvidence", DecompilerSummaryEvidence.class); schemas.put("ModelInterpretationEvidence", ModelInterpretationEvidence.class); schemas.put("KnownConstantEvidence", KnownConstantEvidence.class); @@ -345,7 +345,7 @@ public Map> getSchemas() { /** * Set the instance that matches the oneOf child schema, check * the instance parameter is valid against the oneOf child schemas: - * ApiCombinationEvidence, CallChainEvidence, DecompilerSummaryEvidence, FunctionSimilarityEvidence, HardcodedSecretEvidence, ImportedApiCallEvidence, KnownConstantEvidence, ModelInterpretationEvidence, ReferencedConstantEvidence, StringMatchEvidence + * APICombinationEvidence, CallChainEvidence, DecompilerSummaryEvidence, FunctionSimilarityEvidence, HardcodedSecretEvidence, ImportedAPICallEvidence, KnownConstantEvidence, ModelInterpretationEvidence, ReferencedConstantEvidence, StringMatchEvidence * * It could be an instance of the 'oneOf' schemas. */ @@ -361,7 +361,7 @@ public void setActualInstance(Object instance) { return; } - if (instance instanceof ImportedApiCallEvidence) { + if (instance instanceof ImportedAPICallEvidence) { super.setActualInstance(instance); return; } @@ -376,7 +376,7 @@ public void setActualInstance(Object instance) { return; } - if (instance instanceof ApiCombinationEvidence) { + if (instance instanceof APICombinationEvidence) { super.setActualInstance(instance); return; } @@ -401,14 +401,14 @@ public void setActualInstance(Object instance) { return; } - throw new RuntimeException("Invalid instance type. Must be ApiCombinationEvidence, CallChainEvidence, DecompilerSummaryEvidence, FunctionSimilarityEvidence, HardcodedSecretEvidence, ImportedApiCallEvidence, KnownConstantEvidence, ModelInterpretationEvidence, ReferencedConstantEvidence, StringMatchEvidence"); + throw new RuntimeException("Invalid instance type. Must be APICombinationEvidence, CallChainEvidence, DecompilerSummaryEvidence, FunctionSimilarityEvidence, HardcodedSecretEvidence, ImportedAPICallEvidence, KnownConstantEvidence, ModelInterpretationEvidence, ReferencedConstantEvidence, StringMatchEvidence"); } /** * Get the actual instance, which can be the following: - * ApiCombinationEvidence, CallChainEvidence, DecompilerSummaryEvidence, FunctionSimilarityEvidence, HardcodedSecretEvidence, ImportedApiCallEvidence, KnownConstantEvidence, ModelInterpretationEvidence, ReferencedConstantEvidence, StringMatchEvidence + * APICombinationEvidence, CallChainEvidence, DecompilerSummaryEvidence, FunctionSimilarityEvidence, HardcodedSecretEvidence, ImportedAPICallEvidence, KnownConstantEvidence, ModelInterpretationEvidence, ReferencedConstantEvidence, StringMatchEvidence * - * @return The actual instance (ApiCombinationEvidence, CallChainEvidence, DecompilerSummaryEvidence, FunctionSimilarityEvidence, HardcodedSecretEvidence, ImportedApiCallEvidence, KnownConstantEvidence, ModelInterpretationEvidence, ReferencedConstantEvidence, StringMatchEvidence) + * @return The actual instance (APICombinationEvidence, CallChainEvidence, DecompilerSummaryEvidence, FunctionSimilarityEvidence, HardcodedSecretEvidence, ImportedAPICallEvidence, KnownConstantEvidence, ModelInterpretationEvidence, ReferencedConstantEvidence, StringMatchEvidence) */ @SuppressWarnings("unchecked") @Override @@ -441,15 +441,15 @@ public ReferencedConstantEvidence getReferencedConstantEvidence() throws ClassCa } /** - * Get the actual instance of `ImportedApiCallEvidence`. If the actual instance is not `ImportedApiCallEvidence`, + * 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` + * @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(); + public ImportedAPICallEvidence getImportedAPICallEvidence() throws ClassCastException { + return (ImportedAPICallEvidence)super.getActualInstance(); } /** @@ -477,15 +477,15 @@ public FunctionSimilarityEvidence getFunctionSimilarityEvidence() throws ClassCa } /** - * Get the actual instance of `ApiCombinationEvidence`. If the actual instance is not `ApiCombinationEvidence`, + * 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` + * @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(); + public APICombinationEvidence getAPICombinationEvidence() throws ClassCastException { + return (APICombinationEvidence)super.getActualInstance(); } /** @@ -562,12 +562,12 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti 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 + // validate the json string with ImportedAPICallEvidence try { - ImportedApiCallEvidence.validateJsonElement(jsonElement); + ImportedAPICallEvidence.validateJsonElement(jsonElement); validCount++; } catch (Exception e) { - errorMessages.add(String.format(java.util.Locale.ROOT, "Deserialization for ImportedApiCallEvidence failed with `%s`.", e.getMessage())); + 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 @@ -586,12 +586,12 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti 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 + // validate the json string with APICombinationEvidence try { - ApiCombinationEvidence.validateJsonElement(jsonElement); + APICombinationEvidence.validateJsonElement(jsonElement); validCount++; } catch (Exception e) { - errorMessages.add(String.format(java.util.Locale.ROOT, "Deserialization for ApiCombinationEvidence failed with `%s`.", e.getMessage())); + 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 @@ -627,7 +627,7 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti // continue to the next one } if (validCount != 1) { - throw new IOException(String.format(java.util.Locale.ROOT, "The JSON string is invalid for EvidenceInner with oneOf schemas: ApiCombinationEvidence, CallChainEvidence, DecompilerSummaryEvidence, FunctionSimilarityEvidence, HardcodedSecretEvidence, ImportedApiCallEvidence, KnownConstantEvidence, ModelInterpretationEvidence, ReferencedConstantEvidence, StringMatchEvidence. %d class(es) match the result, expected 1. Detailed failure message for oneOf schemas: %s. JSON: %s", validCount, errorMessages, jsonElement.toString())); + throw new IOException(String.format(java.util.Locale.ROOT, "The JSON string is invalid for EvidenceInner with oneOf schemas: APICombinationEvidence, CallChainEvidence, DecompilerSummaryEvidence, FunctionSimilarityEvidence, HardcodedSecretEvidence, ImportedAPICallEvidence, KnownConstantEvidence, ModelInterpretationEvidence, ReferencedConstantEvidence, StringMatchEvidence. %d class(es) match the result, expected 1. Detailed failure message for oneOf schemas: %s. JSON: %s", validCount, errorMessages, jsonElement.toString())); } } diff --git a/src/main/java/ai/reveng/model/ExtractedBinary.java b/src/main/java/ai/reveng/model/ExtractedBinary.java index c6ec2065..978cb8e8 100644 --- a/src/main/java/ai/reveng/model/ExtractedBinary.java +++ b/src/main/java/ai/reveng/model/ExtractedBinary.java @@ -92,7 +92,7 @@ public ExtractedBinary sha256Hash(@javax.annotation.Nonnull String sha256Hash) { } /** - * Content hash of the recovered binary + * Content hash of the recovered file * @return sha256Hash */ @javax.annotation.Nonnull diff --git a/src/main/java/ai/reveng/model/FindingBody.java b/src/main/java/ai/reveng/model/FindingBody.java new file mode 100644 index 00000000..35aa6fe0 --- /dev/null +++ b/src/main/java/ai/reveng/model/FindingBody.java @@ -0,0 +1,640 @@ +/* + * 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.time.OffsetDateTime; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import ai.reveng.invoker.JSON; + +/** + * FindingBody + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class FindingBody { + public static final String SERIALIZED_NAME_CREATED_AT = "created_at"; + @SerializedName(SERIALIZED_NAME_CREATED_AT) + @javax.annotation.Nonnull + private OffsetDateTime createdAt; + + public static final String SERIALIZED_NAME_DETAILS = "details"; + @SerializedName(SERIALIZED_NAME_DETAILS) + @javax.annotation.Nonnull + private Map details = new HashMap<>(); + + public static final String SERIALIZED_NAME_FINDING_ID = "finding_id"; + @SerializedName(SERIALIZED_NAME_FINDING_ID) + @javax.annotation.Nonnull + private Long findingId; + + /** + * Gets or Sets findingType + */ + @JsonAdapter(FindingTypeEnum.Adapter.class) + public enum FindingTypeEnum { + IOC("IOC"), + + CAPABILITY("CAPABILITY"), + + VULNERABILITY("VULNERABILITY"), + + CROSS_FILE_FLOW("CROSS_FILE_FLOW"), + + UNKNOWN_DEFAULT_OPEN_API("unknown_default_open_api"); + + private String value; + + FindingTypeEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static FindingTypeEnum fromValue(String value) { + for (FindingTypeEnum b : FindingTypeEnum.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 FindingTypeEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public FindingTypeEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return FindingTypeEnum.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + FindingTypeEnum.fromValue(value); + } + } + + public static final String SERIALIZED_NAME_FINDING_TYPE = "finding_type"; + @SerializedName(SERIALIZED_NAME_FINDING_TYPE) + @javax.annotation.Nonnull + private FindingTypeEnum findingType; + + public static final String SERIALIZED_NAME_INVESTIGATION_ID = "investigation_id"; + @SerializedName(SERIALIZED_NAME_INVESTIGATION_ID) + @javax.annotation.Nonnull + private Long investigationId; + + /** + * Gets or Sets severity + */ + @JsonAdapter(SeverityEnum.Adapter.class) + public enum SeverityEnum { + CRITICAL("CRITICAL"), + + HIGH("HIGH"), + + MEDIUM("MEDIUM"), + + LOW("LOW"), + + UNKNOWN_DEFAULT_OPEN_API("unknown_default_open_api"); + + private String value; + + SeverityEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static SeverityEnum fromValue(String value) { + for (SeverityEnum b : SeverityEnum.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 SeverityEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public SeverityEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return SeverityEnum.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + SeverityEnum.fromValue(value); + } + } + + public static final String SERIALIZED_NAME_SEVERITY = "severity"; + @SerializedName(SERIALIZED_NAME_SEVERITY) + @javax.annotation.Nonnull + private SeverityEnum severity; + + public static final String SERIALIZED_NAME_SOURCE = "source"; + @SerializedName(SERIALIZED_NAME_SOURCE) + @javax.annotation.Nonnull + private String source; + + public static final String SERIALIZED_NAME_SUMMARY = "summary"; + @SerializedName(SERIALIZED_NAME_SUMMARY) + @javax.annotation.Nonnull + private String summary; + + public static final String SERIALIZED_NAME_TITLE = "title"; + @SerializedName(SERIALIZED_NAME_TITLE) + @javax.annotation.Nonnull + private String title; + + public FindingBody() { + } + + public FindingBody createdAt(@javax.annotation.Nonnull OffsetDateTime createdAt) { + this.createdAt = createdAt; + return this; + } + + /** + * Get createdAt + * @return createdAt + */ + @javax.annotation.Nonnull + public OffsetDateTime getCreatedAt() { + return createdAt; + } + + public void setCreatedAt(@javax.annotation.Nonnull OffsetDateTime createdAt) { + this.createdAt = createdAt; + } + + + public FindingBody details(@javax.annotation.Nonnull Map details) { + this.details = details; + return this; + } + + public FindingBody putDetailsItem(String key, Object detailsItem) { + if (this.details == null) { + this.details = new HashMap<>(); + } + this.details.put(key, detailsItem); + return this; + } + + /** + * Fields specific to the finding type. An IOC has kind and value, a capability has name, a vulnerability has optional cve, cwe and location, and a cross-file flow has steps. + * @return details + */ + @javax.annotation.Nonnull + public Map getDetails() { + return details; + } + + public void setDetails(@javax.annotation.Nonnull Map details) { + this.details = details; + } + + + public FindingBody findingId(@javax.annotation.Nonnull Long findingId) { + this.findingId = findingId; + return this; + } + + /** + * Get findingId + * @return findingId + */ + @javax.annotation.Nonnull + public Long getFindingId() { + return findingId; + } + + public void setFindingId(@javax.annotation.Nonnull Long findingId) { + this.findingId = findingId; + } + + + public FindingBody findingType(@javax.annotation.Nonnull FindingTypeEnum findingType) { + this.findingType = findingType; + return this; + } + + /** + * Get findingType + * @return findingType + */ + @javax.annotation.Nonnull + public FindingTypeEnum getFindingType() { + return findingType; + } + + public void setFindingType(@javax.annotation.Nonnull FindingTypeEnum findingType) { + this.findingType = findingType; + } + + + public FindingBody investigationId(@javax.annotation.Nonnull Long investigationId) { + this.investigationId = investigationId; + return this; + } + + /** + * Get investigationId + * @return investigationId + */ + @javax.annotation.Nonnull + public Long getInvestigationId() { + return investigationId; + } + + public void setInvestigationId(@javax.annotation.Nonnull Long investigationId) { + this.investigationId = investigationId; + } + + + public FindingBody severity(@javax.annotation.Nonnull SeverityEnum severity) { + this.severity = severity; + return this; + } + + /** + * Get severity + * @return severity + */ + @javax.annotation.Nonnull + public SeverityEnum getSeverity() { + return severity; + } + + public void setSeverity(@javax.annotation.Nonnull SeverityEnum severity) { + this.severity = severity; + } + + + public FindingBody source(@javax.annotation.Nonnull String source) { + this.source = source; + return this; + } + + /** + * The agent or tool that produced the finding. + * @return source + */ + @javax.annotation.Nonnull + public String getSource() { + return source; + } + + public void setSource(@javax.annotation.Nonnull String source) { + this.source = source; + } + + + public FindingBody summary(@javax.annotation.Nonnull String summary) { + this.summary = summary; + return this; + } + + /** + * Get summary + * @return summary + */ + @javax.annotation.Nonnull + public String getSummary() { + return summary; + } + + public void setSummary(@javax.annotation.Nonnull String summary) { + this.summary = summary; + } + + + public FindingBody title(@javax.annotation.Nonnull String title) { + this.title = title; + return this; + } + + /** + * Get title + * @return title + */ + @javax.annotation.Nonnull + public String getTitle() { + return title; + } + + public void setTitle(@javax.annotation.Nonnull String title) { + this.title = title; + } + + /** + * 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 FindingBody instance itself + */ + public FindingBody 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; + } + FindingBody findingBody = (FindingBody) o; + return Objects.equals(this.createdAt, findingBody.createdAt) && + Objects.equals(this.details, findingBody.details) && + Objects.equals(this.findingId, findingBody.findingId) && + Objects.equals(this.findingType, findingBody.findingType) && + Objects.equals(this.investigationId, findingBody.investigationId) && + Objects.equals(this.severity, findingBody.severity) && + Objects.equals(this.source, findingBody.source) && + Objects.equals(this.summary, findingBody.summary) && + Objects.equals(this.title, findingBody.title)&& + Objects.equals(this.additionalProperties, findingBody.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(createdAt, details, findingId, findingType, investigationId, severity, source, summary, title, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class FindingBody {\n"); + sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); + sb.append(" details: ").append(toIndentedString(details)).append("\n"); + sb.append(" findingId: ").append(toIndentedString(findingId)).append("\n"); + sb.append(" findingType: ").append(toIndentedString(findingType)).append("\n"); + sb.append(" investigationId: ").append(toIndentedString(investigationId)).append("\n"); + sb.append(" severity: ").append(toIndentedString(severity)).append("\n"); + sb.append(" source: ").append(toIndentedString(source)).append("\n"); + sb.append(" summary: ").append(toIndentedString(summary)).append("\n"); + sb.append(" title: ").append(toIndentedString(title)).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("created_at", "details", "finding_id", "finding_type", "investigation_id", "severity", "source", "summary", "title")); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(Arrays.asList("created_at", "details", "finding_id", "finding_type", "investigation_id", "severity", "source", "summary", "title")); + } + + /** + * 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 FindingBody + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!FindingBody.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 FindingBody is not found in the empty JSON string", FindingBody.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : FindingBody.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("finding_type").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `finding_type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("finding_type").toString())); + } + // validate the required field `finding_type` + FindingTypeEnum.validateJsonElement(jsonObj.get("finding_type")); + if (!jsonObj.get("severity").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `severity` to be a primitive type in the JSON string but got `%s`", jsonObj.get("severity").toString())); + } + // validate the required field `severity` + SeverityEnum.validateJsonElement(jsonObj.get("severity")); + if (!jsonObj.get("source").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `source` to be a primitive type in the JSON string but got `%s`", jsonObj.get("source").toString())); + } + 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())); + } + if (!jsonObj.get("title").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `title` to be a primitive type in the JSON string but got `%s`", jsonObj.get("title").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!FindingBody.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'FindingBody' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(FindingBody.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, FindingBody 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 FindingBody read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + FindingBody 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 FindingBody given an JSON string + * + * @param jsonString JSON string + * @return An instance of FindingBody + * @throws IOException if the JSON string is invalid with respect to FindingBody + */ + public static FindingBody fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, FindingBody.class); + } + + /** + * Convert an instance of FindingBody to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/ai/reveng/model/FindingCountsBody.java b/src/main/java/ai/reveng/model/FindingCountsBody.java new file mode 100644 index 00000000..2a51a516 --- /dev/null +++ b/src/main/java/ai/reveng/model/FindingCountsBody.java @@ -0,0 +1,390 @@ +/* + * RevEng.AI API + * RevEng.AI is an AI-powered binary analysis platform for reverse engineering and malware analysis. It provides similarity search across executable binaries and functions, AI-driven decompilation, dynamic execution analysis, firmware unpacking, and integration with external threat intelligence sources like VirusTotal. + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package ai.reveng.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import ai.reveng.invoker.JSON; + +/** + * FindingCountsBody + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class FindingCountsBody { + public static final String SERIALIZED_NAME_CRITICAL = "critical"; + @SerializedName(SERIALIZED_NAME_CRITICAL) + @javax.annotation.Nonnull + private Long critical; + + public static final String SERIALIZED_NAME_HIGH = "high"; + @SerializedName(SERIALIZED_NAME_HIGH) + @javax.annotation.Nonnull + private Long high; + + public static final String SERIALIZED_NAME_LOW = "low"; + @SerializedName(SERIALIZED_NAME_LOW) + @javax.annotation.Nonnull + private Long low; + + public static final String SERIALIZED_NAME_MEDIUM = "medium"; + @SerializedName(SERIALIZED_NAME_MEDIUM) + @javax.annotation.Nonnull + private Long medium; + + public static final String SERIALIZED_NAME_TOTAL = "total"; + @SerializedName(SERIALIZED_NAME_TOTAL) + @javax.annotation.Nonnull + private Long total; + + public FindingCountsBody() { + } + + public FindingCountsBody critical(@javax.annotation.Nonnull Long critical) { + this.critical = critical; + return this; + } + + /** + * Get critical + * @return critical + */ + @javax.annotation.Nonnull + public Long getCritical() { + return critical; + } + + public void setCritical(@javax.annotation.Nonnull Long critical) { + this.critical = critical; + } + + + public FindingCountsBody high(@javax.annotation.Nonnull Long high) { + this.high = high; + return this; + } + + /** + * Get high + * @return high + */ + @javax.annotation.Nonnull + public Long getHigh() { + return high; + } + + public void setHigh(@javax.annotation.Nonnull Long high) { + this.high = high; + } + + + public FindingCountsBody low(@javax.annotation.Nonnull Long low) { + this.low = low; + return this; + } + + /** + * Get low + * @return low + */ + @javax.annotation.Nonnull + public Long getLow() { + return low; + } + + public void setLow(@javax.annotation.Nonnull Long low) { + this.low = low; + } + + + public FindingCountsBody medium(@javax.annotation.Nonnull Long medium) { + this.medium = medium; + return this; + } + + /** + * Get medium + * @return medium + */ + @javax.annotation.Nonnull + public Long getMedium() { + return medium; + } + + public void setMedium(@javax.annotation.Nonnull Long medium) { + this.medium = medium; + } + + + public FindingCountsBody 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; + } + + /** + * 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 FindingCountsBody instance itself + */ + public FindingCountsBody 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; + } + FindingCountsBody findingCountsBody = (FindingCountsBody) o; + return Objects.equals(this.critical, findingCountsBody.critical) && + Objects.equals(this.high, findingCountsBody.high) && + Objects.equals(this.low, findingCountsBody.low) && + Objects.equals(this.medium, findingCountsBody.medium) && + Objects.equals(this.total, findingCountsBody.total)&& + Objects.equals(this.additionalProperties, findingCountsBody.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(critical, high, low, medium, total, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class FindingCountsBody {\n"); + sb.append(" critical: ").append(toIndentedString(critical)).append("\n"); + sb.append(" high: ").append(toIndentedString(high)).append("\n"); + sb.append(" low: ").append(toIndentedString(low)).append("\n"); + sb.append(" medium: ").append(toIndentedString(medium)).append("\n"); + sb.append(" total: ").append(toIndentedString(total)).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("critical", "high", "low", "medium", "total")); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(Arrays.asList("critical", "high", "low", "medium", "total")); + } + + /** + * 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 FindingCountsBody + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!FindingCountsBody.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 FindingCountsBody is not found in the empty JSON string", FindingCountsBody.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : FindingCountsBody.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 (!FindingCountsBody.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'FindingCountsBody' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(FindingCountsBody.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, FindingCountsBody 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 FindingCountsBody read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + FindingCountsBody 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 FindingCountsBody given an JSON string + * + * @param jsonString JSON string + * @return An instance of FindingCountsBody + * @throws IOException if the JSON string is invalid with respect to FindingCountsBody + */ + public static FindingCountsBody fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, FindingCountsBody.class); + } + + /** + * Convert an instance of FindingCountsBody to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/ai/reveng/model/GetFindingOutputBody.java b/src/main/java/ai/reveng/model/GetFindingOutputBody.java new file mode 100644 index 00000000..e39127bb --- /dev/null +++ b/src/main/java/ai/reveng/model/GetFindingOutputBody.java @@ -0,0 +1,682 @@ +/* + * 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.time.OffsetDateTime; +import java.util.ArrayList; +import java.util.Arrays; +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.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; + +/** + * GetFindingOutputBody + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class GetFindingOutputBody { + public static final String SERIALIZED_NAME_ANALYSIS_IDS = "analysis_ids"; + @SerializedName(SERIALIZED_NAME_ANALYSIS_IDS) + @javax.annotation.Nonnull + private List analysisIds = new ArrayList<>(); + + public static final String SERIALIZED_NAME_CREATED_AT = "created_at"; + @SerializedName(SERIALIZED_NAME_CREATED_AT) + @javax.annotation.Nonnull + private OffsetDateTime createdAt; + + public static final String SERIALIZED_NAME_DETAILS = "details"; + @SerializedName(SERIALIZED_NAME_DETAILS) + @javax.annotation.Nonnull + private Map details = new HashMap<>(); + + public static final String SERIALIZED_NAME_FINDING_ID = "finding_id"; + @SerializedName(SERIALIZED_NAME_FINDING_ID) + @javax.annotation.Nonnull + private Long findingId; + + /** + * Gets or Sets findingType + */ + @JsonAdapter(FindingTypeEnum.Adapter.class) + public enum FindingTypeEnum { + IOC("IOC"), + + CAPABILITY("CAPABILITY"), + + VULNERABILITY("VULNERABILITY"), + + CROSS_FILE_FLOW("CROSS_FILE_FLOW"), + + UNKNOWN_DEFAULT_OPEN_API("unknown_default_open_api"); + + private String value; + + FindingTypeEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static FindingTypeEnum fromValue(String value) { + for (FindingTypeEnum b : FindingTypeEnum.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 FindingTypeEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public FindingTypeEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return FindingTypeEnum.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + FindingTypeEnum.fromValue(value); + } + } + + public static final String SERIALIZED_NAME_FINDING_TYPE = "finding_type"; + @SerializedName(SERIALIZED_NAME_FINDING_TYPE) + @javax.annotation.Nonnull + private FindingTypeEnum findingType; + + public static final String SERIALIZED_NAME_INVESTIGATION_ID = "investigation_id"; + @SerializedName(SERIALIZED_NAME_INVESTIGATION_ID) + @javax.annotation.Nonnull + private Long investigationId; + + /** + * Gets or Sets severity + */ + @JsonAdapter(SeverityEnum.Adapter.class) + public enum SeverityEnum { + CRITICAL("CRITICAL"), + + HIGH("HIGH"), + + MEDIUM("MEDIUM"), + + LOW("LOW"), + + UNKNOWN_DEFAULT_OPEN_API("unknown_default_open_api"); + + private String value; + + SeverityEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static SeverityEnum fromValue(String value) { + for (SeverityEnum b : SeverityEnum.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 SeverityEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public SeverityEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return SeverityEnum.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + SeverityEnum.fromValue(value); + } + } + + public static final String SERIALIZED_NAME_SEVERITY = "severity"; + @SerializedName(SERIALIZED_NAME_SEVERITY) + @javax.annotation.Nonnull + private SeverityEnum severity; + + public static final String SERIALIZED_NAME_SOURCE = "source"; + @SerializedName(SERIALIZED_NAME_SOURCE) + @javax.annotation.Nonnull + private String source; + + public static final String SERIALIZED_NAME_SUMMARY = "summary"; + @SerializedName(SERIALIZED_NAME_SUMMARY) + @javax.annotation.Nonnull + private String summary; + + public static final String SERIALIZED_NAME_TITLE = "title"; + @SerializedName(SERIALIZED_NAME_TITLE) + @javax.annotation.Nonnull + private String title; + + public GetFindingOutputBody() { + } + + public GetFindingOutputBody analysisIds(@javax.annotation.Nonnull List analysisIds) { + this.analysisIds = analysisIds; + return this; + } + + public GetFindingOutputBody addAnalysisIdsItem(Long analysisIdsItem) { + if (this.analysisIds == null) { + this.analysisIds = new ArrayList<>(); + } + this.analysisIds.add(analysisIdsItem); + return this; + } + + /** + * Analyses the finding was derived from that you are permitted to see. + * @return analysisIds + */ + @javax.annotation.Nonnull + public List getAnalysisIds() { + return analysisIds; + } + + public void setAnalysisIds(@javax.annotation.Nonnull List analysisIds) { + this.analysisIds = analysisIds; + } + + + public GetFindingOutputBody createdAt(@javax.annotation.Nonnull OffsetDateTime createdAt) { + this.createdAt = createdAt; + return this; + } + + /** + * Get createdAt + * @return createdAt + */ + @javax.annotation.Nonnull + public OffsetDateTime getCreatedAt() { + return createdAt; + } + + public void setCreatedAt(@javax.annotation.Nonnull OffsetDateTime createdAt) { + this.createdAt = createdAt; + } + + + public GetFindingOutputBody details(@javax.annotation.Nonnull Map details) { + this.details = details; + return this; + } + + public GetFindingOutputBody putDetailsItem(String key, Object detailsItem) { + if (this.details == null) { + this.details = new HashMap<>(); + } + this.details.put(key, detailsItem); + return this; + } + + /** + * Fields specific to the finding type. An IOC has kind and value, a capability has name, a vulnerability has optional cve, cwe and location, and a cross-file flow has steps. + * @return details + */ + @javax.annotation.Nonnull + public Map getDetails() { + return details; + } + + public void setDetails(@javax.annotation.Nonnull Map details) { + this.details = details; + } + + + public GetFindingOutputBody findingId(@javax.annotation.Nonnull Long findingId) { + this.findingId = findingId; + return this; + } + + /** + * Get findingId + * @return findingId + */ + @javax.annotation.Nonnull + public Long getFindingId() { + return findingId; + } + + public void setFindingId(@javax.annotation.Nonnull Long findingId) { + this.findingId = findingId; + } + + + public GetFindingOutputBody findingType(@javax.annotation.Nonnull FindingTypeEnum findingType) { + this.findingType = findingType; + return this; + } + + /** + * Get findingType + * @return findingType + */ + @javax.annotation.Nonnull + public FindingTypeEnum getFindingType() { + return findingType; + } + + public void setFindingType(@javax.annotation.Nonnull FindingTypeEnum findingType) { + this.findingType = findingType; + } + + + public GetFindingOutputBody investigationId(@javax.annotation.Nonnull Long investigationId) { + this.investigationId = investigationId; + return this; + } + + /** + * Get investigationId + * @return investigationId + */ + @javax.annotation.Nonnull + public Long getInvestigationId() { + return investigationId; + } + + public void setInvestigationId(@javax.annotation.Nonnull Long investigationId) { + this.investigationId = investigationId; + } + + + public GetFindingOutputBody severity(@javax.annotation.Nonnull SeverityEnum severity) { + this.severity = severity; + return this; + } + + /** + * Get severity + * @return severity + */ + @javax.annotation.Nonnull + public SeverityEnum getSeverity() { + return severity; + } + + public void setSeverity(@javax.annotation.Nonnull SeverityEnum severity) { + this.severity = severity; + } + + + public GetFindingOutputBody source(@javax.annotation.Nonnull String source) { + this.source = source; + return this; + } + + /** + * The agent or tool that produced the finding. + * @return source + */ + @javax.annotation.Nonnull + public String getSource() { + return source; + } + + public void setSource(@javax.annotation.Nonnull String source) { + this.source = source; + } + + + public GetFindingOutputBody summary(@javax.annotation.Nonnull String summary) { + this.summary = summary; + return this; + } + + /** + * Get summary + * @return summary + */ + @javax.annotation.Nonnull + public String getSummary() { + return summary; + } + + public void setSummary(@javax.annotation.Nonnull String summary) { + this.summary = summary; + } + + + public GetFindingOutputBody title(@javax.annotation.Nonnull String title) { + this.title = title; + return this; + } + + /** + * Get title + * @return title + */ + @javax.annotation.Nonnull + public String getTitle() { + return title; + } + + public void setTitle(@javax.annotation.Nonnull String title) { + this.title = title; + } + + /** + * 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 GetFindingOutputBody instance itself + */ + public GetFindingOutputBody 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; + } + GetFindingOutputBody getFindingOutputBody = (GetFindingOutputBody) o; + return Objects.equals(this.analysisIds, getFindingOutputBody.analysisIds) && + Objects.equals(this.createdAt, getFindingOutputBody.createdAt) && + Objects.equals(this.details, getFindingOutputBody.details) && + Objects.equals(this.findingId, getFindingOutputBody.findingId) && + Objects.equals(this.findingType, getFindingOutputBody.findingType) && + Objects.equals(this.investigationId, getFindingOutputBody.investigationId) && + Objects.equals(this.severity, getFindingOutputBody.severity) && + Objects.equals(this.source, getFindingOutputBody.source) && + Objects.equals(this.summary, getFindingOutputBody.summary) && + Objects.equals(this.title, getFindingOutputBody.title)&& + Objects.equals(this.additionalProperties, getFindingOutputBody.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(analysisIds, createdAt, details, findingId, findingType, investigationId, severity, source, summary, title, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetFindingOutputBody {\n"); + sb.append(" analysisIds: ").append(toIndentedString(analysisIds)).append("\n"); + sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); + sb.append(" details: ").append(toIndentedString(details)).append("\n"); + sb.append(" findingId: ").append(toIndentedString(findingId)).append("\n"); + sb.append(" findingType: ").append(toIndentedString(findingType)).append("\n"); + sb.append(" investigationId: ").append(toIndentedString(investigationId)).append("\n"); + sb.append(" severity: ").append(toIndentedString(severity)).append("\n"); + sb.append(" source: ").append(toIndentedString(source)).append("\n"); + sb.append(" summary: ").append(toIndentedString(summary)).append("\n"); + sb.append(" title: ").append(toIndentedString(title)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + return o == null ? "null" : o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(Arrays.asList("analysis_ids", "created_at", "details", "finding_id", "finding_type", "investigation_id", "severity", "source", "summary", "title")); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(Arrays.asList("analysis_ids", "created_at", "details", "finding_id", "finding_type", "investigation_id", "severity", "source", "summary", "title")); + } + + /** + * 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 GetFindingOutputBody + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!GetFindingOutputBody.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 GetFindingOutputBody is not found in the empty JSON string", GetFindingOutputBody.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : GetFindingOutputBody.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // ensure the required json array is present + if (jsonObj.get("analysis_ids") == null) { + throw new IllegalArgumentException("Expected the field `linkedContent` to be an array in the JSON string but got `null`"); + } else if (!jsonObj.get("analysis_ids").isJsonArray()) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `analysis_ids` to be an array in the JSON string but got `%s`", jsonObj.get("analysis_ids").toString())); + } + if (!jsonObj.get("finding_type").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `finding_type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("finding_type").toString())); + } + // validate the required field `finding_type` + FindingTypeEnum.validateJsonElement(jsonObj.get("finding_type")); + if (!jsonObj.get("severity").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `severity` to be a primitive type in the JSON string but got `%s`", jsonObj.get("severity").toString())); + } + // validate the required field `severity` + SeverityEnum.validateJsonElement(jsonObj.get("severity")); + if (!jsonObj.get("source").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `source` to be a primitive type in the JSON string but got `%s`", jsonObj.get("source").toString())); + } + 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())); + } + if (!jsonObj.get("title").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `title` to be a primitive type in the JSON string but got `%s`", jsonObj.get("title").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!GetFindingOutputBody.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'GetFindingOutputBody' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(GetFindingOutputBody.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, GetFindingOutputBody 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 GetFindingOutputBody read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + GetFindingOutputBody 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 GetFindingOutputBody given an JSON string + * + * @param jsonString JSON string + * @return An instance of GetFindingOutputBody + * @throws IOException if the JSON string is invalid with respect to GetFindingOutputBody + */ + public static GetFindingOutputBody fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, GetFindingOutputBody.class); + } + + /** + * Convert an instance of GetFindingOutputBody to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/ai/reveng/model/GetInvestigationOutputBody.java b/src/main/java/ai/reveng/model/GetInvestigationOutputBody.java new file mode 100644 index 00000000..20fb0dfc --- /dev/null +++ b/src/main/java/ai/reveng/model/GetInvestigationOutputBody.java @@ -0,0 +1,895 @@ +/* + * 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.BudgetBody; +import ai.reveng.model.RollupBody; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + +import 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; + +/** + * GetInvestigationOutputBody + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class GetInvestigationOutputBody { + public static final String SERIALIZED_NAME_ANALYSIS_IDS = "analysis_ids"; + @SerializedName(SERIALIZED_NAME_ANALYSIS_IDS) + @javax.annotation.Nonnull + private List analysisIds = new ArrayList<>(); + + public static final String SERIALIZED_NAME_BUDGET = "budget"; + @SerializedName(SERIALIZED_NAME_BUDGET) + @javax.annotation.Nonnull + private BudgetBody budget; + + /** + * Gets or Sets caseType + */ + @JsonAdapter(CaseTypeEnum.Adapter.class) + public enum CaseTypeEnum { + REVERSE_ENGINEERING("REVERSE_ENGINEERING"), + + MALWARE_ANALYSIS("MALWARE_ANALYSIS"), + + VULNERABILITY_DISCOVERY("VULNERABILITY_DISCOVERY"), + + UNKNOWN_DEFAULT_OPEN_API("unknown_default_open_api"); + + private String value; + + CaseTypeEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static CaseTypeEnum fromValue(String value) { + for (CaseTypeEnum b : CaseTypeEnum.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 CaseTypeEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public CaseTypeEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return CaseTypeEnum.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + CaseTypeEnum.fromValue(value); + } + } + + public static final String SERIALIZED_NAME_CASE_TYPE = "case_type"; + @SerializedName(SERIALIZED_NAME_CASE_TYPE) + @javax.annotation.Nonnull + private CaseTypeEnum caseType; + + public static final String SERIALIZED_NAME_CREATED_AT = "created_at"; + @SerializedName(SERIALIZED_NAME_CREATED_AT) + @javax.annotation.Nonnull + private OffsetDateTime createdAt; + + public static final String SERIALIZED_NAME_INVESTIGATION_ID = "investigation_id"; + @SerializedName(SERIALIZED_NAME_INVESTIGATION_ID) + @javax.annotation.Nonnull + private Long investigationId; + + public static final String SERIALIZED_NAME_NAME = "name"; + @SerializedName(SERIALIZED_NAME_NAME) + @javax.annotation.Nonnull + private String name; + + public static final String SERIALIZED_NAME_OWNER_ID = "owner_id"; + @SerializedName(SERIALIZED_NAME_OWNER_ID) + @javax.annotation.Nonnull + private Long ownerId; + + public static final String SERIALIZED_NAME_OWNER_USERNAME = "owner_username"; + @SerializedName(SERIALIZED_NAME_OWNER_USERNAME) + @javax.annotation.Nonnull + private String ownerUsername; + + public static final String SERIALIZED_NAME_ROLLUP = "rollup"; + @SerializedName(SERIALIZED_NAME_ROLLUP) + @javax.annotation.Nonnull + private RollupBody rollup; + + /** + * Gets or Sets scope + */ + @JsonAdapter(ScopeEnum.Adapter.class) + public enum ScopeEnum { + PRIVATE("PRIVATE"), + + TEAM("TEAM"), + + UNKNOWN_DEFAULT_OPEN_API("unknown_default_open_api"); + + private String value; + + ScopeEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static ScopeEnum fromValue(String value) { + for (ScopeEnum b : ScopeEnum.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 ScopeEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public ScopeEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return ScopeEnum.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + ScopeEnum.fromValue(value); + } + } + + public static final String SERIALIZED_NAME_SCOPE = "scope"; + @SerializedName(SERIALIZED_NAME_SCOPE) + @javax.annotation.Nonnull + private ScopeEnum scope; + + /** + * Gets or Sets severity + */ + @JsonAdapter(SeverityEnum.Adapter.class) + public enum SeverityEnum { + CRITICAL("CRITICAL"), + + HIGH("HIGH"), + + MEDIUM("MEDIUM"), + + LOW("LOW"), + + UNKNOWN_DEFAULT_OPEN_API("unknown_default_open_api"); + + private String value; + + SeverityEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static SeverityEnum fromValue(String value) { + for (SeverityEnum b : SeverityEnum.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 SeverityEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public SeverityEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return SeverityEnum.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + SeverityEnum.fromValue(value); + } + } + + public static final String SERIALIZED_NAME_SEVERITY = "severity"; + @SerializedName(SERIALIZED_NAME_SEVERITY) + @javax.annotation.Nonnull + private SeverityEnum severity; + + /** + * Gets or Sets status + */ + @JsonAdapter(StatusEnum.Adapter.class) + public enum StatusEnum { + OPEN("OPEN"), + + IN_PROGRESS("IN_PROGRESS"), + + ON_HOLD("ON_HOLD"), + + CLOSED("CLOSED"), + + 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 static final String SERIALIZED_NAME_TEAM_ID = "team_id"; + @SerializedName(SERIALIZED_NAME_TEAM_ID) + @javax.annotation.Nonnull + private Long teamId; + + public static final String SERIALIZED_NAME_UPDATED_AT = "updated_at"; + @SerializedName(SERIALIZED_NAME_UPDATED_AT) + @javax.annotation.Nonnull + private OffsetDateTime updatedAt; + + public GetInvestigationOutputBody() { + } + + public GetInvestigationOutputBody analysisIds(@javax.annotation.Nonnull List analysisIds) { + this.analysisIds = analysisIds; + return this; + } + + public GetInvestigationOutputBody addAnalysisIdsItem(Long analysisIdsItem) { + if (this.analysisIds == null) { + this.analysisIds = new ArrayList<>(); + } + this.analysisIds.add(analysisIdsItem); + return this; + } + + /** + * Analyses in the investigation that you are permitted to see. + * @return analysisIds + */ + @javax.annotation.Nonnull + public List getAnalysisIds() { + return analysisIds; + } + + public void setAnalysisIds(@javax.annotation.Nonnull List analysisIds) { + this.analysisIds = analysisIds; + } + + + public GetInvestigationOutputBody budget(@javax.annotation.Nonnull BudgetBody budget) { + this.budget = budget; + return this; + } + + /** + * Get budget + * @return budget + */ + @javax.annotation.Nonnull + public BudgetBody getBudget() { + return budget; + } + + public void setBudget(@javax.annotation.Nonnull BudgetBody budget) { + this.budget = budget; + } + + + public GetInvestigationOutputBody caseType(@javax.annotation.Nonnull CaseTypeEnum caseType) { + this.caseType = caseType; + return this; + } + + /** + * Get caseType + * @return caseType + */ + @javax.annotation.Nonnull + public CaseTypeEnum getCaseType() { + return caseType; + } + + public void setCaseType(@javax.annotation.Nonnull CaseTypeEnum caseType) { + this.caseType = caseType; + } + + + public GetInvestigationOutputBody createdAt(@javax.annotation.Nonnull OffsetDateTime createdAt) { + this.createdAt = createdAt; + return this; + } + + /** + * Get createdAt + * @return createdAt + */ + @javax.annotation.Nonnull + public OffsetDateTime getCreatedAt() { + return createdAt; + } + + public void setCreatedAt(@javax.annotation.Nonnull OffsetDateTime createdAt) { + this.createdAt = createdAt; + } + + + public GetInvestigationOutputBody investigationId(@javax.annotation.Nonnull Long investigationId) { + this.investigationId = investigationId; + return this; + } + + /** + * Get investigationId + * @return investigationId + */ + @javax.annotation.Nonnull + public Long getInvestigationId() { + return investigationId; + } + + public void setInvestigationId(@javax.annotation.Nonnull Long investigationId) { + this.investigationId = investigationId; + } + + + public GetInvestigationOutputBody name(@javax.annotation.Nonnull String name) { + this.name = name; + return this; + } + + /** + * Get name + * @return name + */ + @javax.annotation.Nonnull + public String getName() { + return name; + } + + public void setName(@javax.annotation.Nonnull String name) { + this.name = name; + } + + + public GetInvestigationOutputBody ownerId(@javax.annotation.Nonnull Long ownerId) { + this.ownerId = ownerId; + return this; + } + + /** + * Get ownerId + * @return ownerId + */ + @javax.annotation.Nonnull + public Long getOwnerId() { + return ownerId; + } + + public void setOwnerId(@javax.annotation.Nonnull Long ownerId) { + this.ownerId = ownerId; + } + + + public GetInvestigationOutputBody ownerUsername(@javax.annotation.Nonnull String ownerUsername) { + this.ownerUsername = ownerUsername; + return this; + } + + /** + * Get ownerUsername + * @return ownerUsername + */ + @javax.annotation.Nonnull + public String getOwnerUsername() { + return ownerUsername; + } + + public void setOwnerUsername(@javax.annotation.Nonnull String ownerUsername) { + this.ownerUsername = ownerUsername; + } + + + public GetInvestigationOutputBody rollup(@javax.annotation.Nonnull RollupBody rollup) { + this.rollup = rollup; + return this; + } + + /** + * Get rollup + * @return rollup + */ + @javax.annotation.Nonnull + public RollupBody getRollup() { + return rollup; + } + + public void setRollup(@javax.annotation.Nonnull RollupBody rollup) { + this.rollup = rollup; + } + + + public GetInvestigationOutputBody scope(@javax.annotation.Nonnull ScopeEnum scope) { + this.scope = scope; + return this; + } + + /** + * Get scope + * @return scope + */ + @javax.annotation.Nonnull + public ScopeEnum getScope() { + return scope; + } + + public void setScope(@javax.annotation.Nonnull ScopeEnum scope) { + this.scope = scope; + } + + + public GetInvestigationOutputBody severity(@javax.annotation.Nonnull SeverityEnum severity) { + this.severity = severity; + return this; + } + + /** + * Get severity + * @return severity + */ + @javax.annotation.Nonnull + public SeverityEnum getSeverity() { + return severity; + } + + public void setSeverity(@javax.annotation.Nonnull SeverityEnum severity) { + this.severity = severity; + } + + + public GetInvestigationOutputBody status(@javax.annotation.Nonnull StatusEnum status) { + this.status = status; + return this; + } + + /** + * Get status + * @return status + */ + @javax.annotation.Nonnull + public StatusEnum getStatus() { + return status; + } + + public void setStatus(@javax.annotation.Nonnull StatusEnum status) { + this.status = status; + } + + + public GetInvestigationOutputBody teamId(@javax.annotation.Nonnull Long teamId) { + this.teamId = teamId; + return this; + } + + /** + * Team the investigation belongs to; 0 when its owner had no team + * @return teamId + */ + @javax.annotation.Nonnull + public Long getTeamId() { + return teamId; + } + + public void setTeamId(@javax.annotation.Nonnull Long teamId) { + this.teamId = teamId; + } + + + public GetInvestigationOutputBody updatedAt(@javax.annotation.Nonnull OffsetDateTime updatedAt) { + this.updatedAt = updatedAt; + return this; + } + + /** + * Get updatedAt + * @return updatedAt + */ + @javax.annotation.Nonnull + public OffsetDateTime getUpdatedAt() { + return updatedAt; + } + + public void setUpdatedAt(@javax.annotation.Nonnull OffsetDateTime updatedAt) { + this.updatedAt = updatedAt; + } + + /** + * 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 GetInvestigationOutputBody instance itself + */ + public GetInvestigationOutputBody 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; + } + GetInvestigationOutputBody getInvestigationOutputBody = (GetInvestigationOutputBody) o; + return Objects.equals(this.analysisIds, getInvestigationOutputBody.analysisIds) && + Objects.equals(this.budget, getInvestigationOutputBody.budget) && + Objects.equals(this.caseType, getInvestigationOutputBody.caseType) && + Objects.equals(this.createdAt, getInvestigationOutputBody.createdAt) && + Objects.equals(this.investigationId, getInvestigationOutputBody.investigationId) && + Objects.equals(this.name, getInvestigationOutputBody.name) && + Objects.equals(this.ownerId, getInvestigationOutputBody.ownerId) && + Objects.equals(this.ownerUsername, getInvestigationOutputBody.ownerUsername) && + Objects.equals(this.rollup, getInvestigationOutputBody.rollup) && + Objects.equals(this.scope, getInvestigationOutputBody.scope) && + Objects.equals(this.severity, getInvestigationOutputBody.severity) && + Objects.equals(this.status, getInvestigationOutputBody.status) && + Objects.equals(this.teamId, getInvestigationOutputBody.teamId) && + Objects.equals(this.updatedAt, getInvestigationOutputBody.updatedAt)&& + Objects.equals(this.additionalProperties, getInvestigationOutputBody.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(analysisIds, budget, caseType, createdAt, investigationId, name, ownerId, ownerUsername, rollup, scope, severity, status, teamId, updatedAt, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetInvestigationOutputBody {\n"); + sb.append(" analysisIds: ").append(toIndentedString(analysisIds)).append("\n"); + sb.append(" budget: ").append(toIndentedString(budget)).append("\n"); + sb.append(" caseType: ").append(toIndentedString(caseType)).append("\n"); + sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); + sb.append(" investigationId: ").append(toIndentedString(investigationId)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" ownerId: ").append(toIndentedString(ownerId)).append("\n"); + sb.append(" ownerUsername: ").append(toIndentedString(ownerUsername)).append("\n"); + sb.append(" rollup: ").append(toIndentedString(rollup)).append("\n"); + sb.append(" scope: ").append(toIndentedString(scope)).append("\n"); + sb.append(" severity: ").append(toIndentedString(severity)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append(" teamId: ").append(toIndentedString(teamId)).append("\n"); + sb.append(" updatedAt: ").append(toIndentedString(updatedAt)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + return o == null ? "null" : o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(Arrays.asList("analysis_ids", "budget", "case_type", "created_at", "investigation_id", "name", "owner_id", "owner_username", "rollup", "scope", "severity", "status", "team_id", "updated_at")); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(Arrays.asList("analysis_ids", "budget", "case_type", "created_at", "investigation_id", "name", "owner_id", "owner_username", "rollup", "scope", "severity", "status", "team_id", "updated_at")); + } + + /** + * 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 GetInvestigationOutputBody + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!GetInvestigationOutputBody.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 GetInvestigationOutputBody is not found in the empty JSON string", GetInvestigationOutputBody.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : GetInvestigationOutputBody.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // ensure the required json array is present + if (jsonObj.get("analysis_ids") == null) { + throw new IllegalArgumentException("Expected the field `linkedContent` to be an array in the JSON string but got `null`"); + } else if (!jsonObj.get("analysis_ids").isJsonArray()) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `analysis_ids` to be an array in the JSON string but got `%s`", jsonObj.get("analysis_ids").toString())); + } + if (!jsonObj.get("case_type").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `case_type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("case_type").toString())); + } + // validate the required field `case_type` + CaseTypeEnum.validateJsonElement(jsonObj.get("case_type")); + 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("owner_username").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `owner_username` to be a primitive type in the JSON string but got `%s`", jsonObj.get("owner_username").toString())); + } + if (!jsonObj.get("scope").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `scope` to be a primitive type in the JSON string but got `%s`", jsonObj.get("scope").toString())); + } + // validate the required field `scope` + ScopeEnum.validateJsonElement(jsonObj.get("scope")); + if (!jsonObj.get("severity").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `severity` to be a primitive type in the JSON string but got `%s`", jsonObj.get("severity").toString())); + } + // validate the required field `severity` + SeverityEnum.validateJsonElement(jsonObj.get("severity")); + 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 (!GetInvestigationOutputBody.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'GetInvestigationOutputBody' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(GetInvestigationOutputBody.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, GetInvestigationOutputBody 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 GetInvestigationOutputBody read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + GetInvestigationOutputBody 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 GetInvestigationOutputBody given an JSON string + * + * @param jsonString JSON string + * @return An instance of GetInvestigationOutputBody + * @throws IOException if the JSON string is invalid with respect to GetInvestigationOutputBody + */ + public static GetInvestigationOutputBody fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, GetInvestigationOutputBody.class); + } + + /** + * Convert an instance of GetInvestigationOutputBody to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/ai/reveng/model/GetMatchesStatusOutputBody.java b/src/main/java/ai/reveng/model/GetMatchesStatusOutputBody.java index c8fdefa8..bcf7d583 100644 --- a/src/main/java/ai/reveng/model/GetMatchesStatusOutputBody.java +++ b/src/main/java/ai/reveng/model/GetMatchesStatusOutputBody.java @@ -20,6 +20,7 @@ import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import java.io.IOException; +import java.time.OffsetDateTime; import java.util.ArrayList; import java.util.Arrays; import java.util.List; @@ -52,6 +53,11 @@ */ @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class GetMatchesStatusOutputBody { + public static final String SERIALIZED_NAME_COMPLETED_AT = "completed_at"; + @SerializedName(SERIALIZED_NAME_COMPLETED_AT) + @javax.annotation.Nullable + private OffsetDateTime completedAt; + public static final String SERIALIZED_NAME_MESSAGES = "messages"; @SerializedName(SERIALIZED_NAME_MESSAGES) @javax.annotation.Nullable @@ -165,6 +171,25 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti public GetMatchesStatusOutputBody() { } + public GetMatchesStatusOutputBody completedAt(@javax.annotation.Nullable OffsetDateTime completedAt) { + this.completedAt = completedAt; + return this; + } + + /** + * When this run last completed. Absent until status=COMPLETED. + * @return completedAt + */ + @javax.annotation.Nullable + public OffsetDateTime getCompletedAt() { + return completedAt; + } + + public void setCompletedAt(@javax.annotation.Nullable OffsetDateTime completedAt) { + this.completedAt = completedAt; + } + + public GetMatchesStatusOutputBody messages(@javax.annotation.Nullable List messages) { this.messages = messages; return this; @@ -417,7 +442,8 @@ public boolean equals(Object o) { return false; } GetMatchesStatusOutputBody getMatchesStatusOutputBody = (GetMatchesStatusOutputBody) o; - return Objects.equals(this.messages, getMatchesStatusOutputBody.messages) && + return Objects.equals(this.completedAt, getMatchesStatusOutputBody.completedAt) && + Objects.equals(this.messages, getMatchesStatusOutputBody.messages) && Objects.equals(this.percent, getMatchesStatusOutputBody.percent) && Objects.equals(this.status, getMatchesStatusOutputBody.status) && Objects.equals(this.step, getMatchesStatusOutputBody.step) && @@ -432,13 +458,14 @@ public boolean equals(Object o) { @Override public int hashCode() { - return Objects.hash(messages, percent, status, step, stepIndex, stepShare, stepsTotal, subStep, subStepDone, subStepTotal, additionalProperties); + return Objects.hash(completedAt, messages, percent, status, step, stepIndex, stepShare, stepsTotal, subStep, subStepDone, subStepTotal, additionalProperties); } @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class GetMatchesStatusOutputBody {\n"); + sb.append(" completedAt: ").append(toIndentedString(completedAt)).append("\n"); sb.append(" messages: ").append(toIndentedString(messages)).append("\n"); sb.append(" percent: ").append(toIndentedString(percent)).append("\n"); sb.append(" status: ").append(toIndentedString(status)).append("\n"); @@ -468,7 +495,7 @@ private String toIndentedString(Object o) { static { // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(Arrays.asList("messages", "percent", "status", "step", "step_index", "step_share", "steps_total", "sub_step", "sub_step_done", "sub_step_total")); + openapiFields = new HashSet(Arrays.asList("completed_at", "messages", "percent", "status", "step", "step_index", "step_share", "steps_total", "sub_step", "sub_step_done", "sub_step_total")); // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(Arrays.asList("messages", "percent", "status", "step", "step_index", "step_share", "steps_total")); diff --git a/src/main/java/ai/reveng/model/GrantAccessInputBody.java b/src/main/java/ai/reveng/model/GrantAccessInputBody.java new file mode 100644 index 00000000..da9938db --- /dev/null +++ b/src/main/java/ai/reveng/model/GrantAccessInputBody.java @@ -0,0 +1,399 @@ +/* + * 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; + +/** + * GrantAccessInputBody + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class GrantAccessInputBody { + /** + * The level of access to grant + */ + @JsonAdapter(PermissionEnum.Adapter.class) + public enum PermissionEnum { + VIEW("VIEW"), + + EDIT("EDIT"), + + UNKNOWN_DEFAULT_OPEN_API("unknown_default_open_api"); + + private String value; + + PermissionEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static PermissionEnum fromValue(String value) { + for (PermissionEnum b : PermissionEnum.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 PermissionEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public PermissionEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return PermissionEnum.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + PermissionEnum.fromValue(value); + } + } + + public static final String SERIALIZED_NAME_PERMISSION = "permission"; + @SerializedName(SERIALIZED_NAME_PERMISSION) + @javax.annotation.Nonnull + private PermissionEnum permission; + + public static final String SERIALIZED_NAME_TEAM_ID = "team_id"; + @SerializedName(SERIALIZED_NAME_TEAM_ID) + @javax.annotation.Nullable + private Long teamId; + + public static final String SERIALIZED_NAME_USER_ID = "user_id"; + @SerializedName(SERIALIZED_NAME_USER_ID) + @javax.annotation.Nullable + private Long userId; + + public GrantAccessInputBody() { + } + + public GrantAccessInputBody permission(@javax.annotation.Nonnull PermissionEnum permission) { + this.permission = permission; + return this; + } + + /** + * The level of access to grant + * @return permission + */ + @javax.annotation.Nonnull + public PermissionEnum getPermission() { + return permission; + } + + public void setPermission(@javax.annotation.Nonnull PermissionEnum permission) { + this.permission = permission; + } + + + public GrantAccessInputBody teamId(@javax.annotation.Nullable Long teamId) { + this.teamId = teamId; + return this; + } + + /** + * The team to share with. Exactly one of user_id and team_id is required + * minimum: 1 + * @return teamId + */ + @javax.annotation.Nullable + public Long getTeamId() { + return teamId; + } + + public void setTeamId(@javax.annotation.Nullable Long teamId) { + this.teamId = teamId; + } + + + public GrantAccessInputBody userId(@javax.annotation.Nullable Long userId) { + this.userId = userId; + return this; + } + + /** + * The user to share with. Exactly one of user_id and team_id is required + * minimum: 1 + * @return userId + */ + @javax.annotation.Nullable + public Long getUserId() { + return userId; + } + + public void setUserId(@javax.annotation.Nullable Long userId) { + this.userId = userId; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the GrantAccessInputBody instance itself + */ + public GrantAccessInputBody 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; + } + GrantAccessInputBody grantAccessInputBody = (GrantAccessInputBody) o; + return Objects.equals(this.permission, grantAccessInputBody.permission) && + Objects.equals(this.teamId, grantAccessInputBody.teamId) && + Objects.equals(this.userId, grantAccessInputBody.userId)&& + Objects.equals(this.additionalProperties, grantAccessInputBody.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(permission, teamId, userId, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GrantAccessInputBody {\n"); + sb.append(" permission: ").append(toIndentedString(permission)).append("\n"); + sb.append(" teamId: ").append(toIndentedString(teamId)).append("\n"); + sb.append(" userId: ").append(toIndentedString(userId)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + 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("permission", "team_id", "user_id")); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(Arrays.asList("permission")); + } + + /** + * 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 GrantAccessInputBody + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!GrantAccessInputBody.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 GrantAccessInputBody is not found in the empty JSON string", GrantAccessInputBody.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : GrantAccessInputBody.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("permission").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `permission` to be a primitive type in the JSON string but got `%s`", jsonObj.get("permission").toString())); + } + // validate the required field `permission` + PermissionEnum.validateJsonElement(jsonObj.get("permission")); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!GrantAccessInputBody.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'GrantAccessInputBody' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(GrantAccessInputBody.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, GrantAccessInputBody 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 GrantAccessInputBody read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + GrantAccessInputBody 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 GrantAccessInputBody given an JSON string + * + * @param jsonString JSON string + * @return An instance of GrantAccessInputBody + * @throws IOException if the JSON string is invalid with respect to GrantAccessInputBody + */ + public static GrantAccessInputBody fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, GrantAccessInputBody.class); + } + + /** + * Convert an instance of GrantAccessInputBody 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/ImportedAPICallEvidence.java similarity index 89% rename from src/main/java/ai/reveng/model/ImportedApiCallEvidence.java rename to src/main/java/ai/reveng/model/ImportedAPICallEvidence.java index e6dd6191..d799bcb3 100644 --- a/src/main/java/ai/reveng/model/ImportedApiCallEvidence.java +++ b/src/main/java/ai/reveng/model/ImportedAPICallEvidence.java @@ -52,7 +52,7 @@ * Imported API calls observed in the program. */ @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class ImportedApiCallEvidence { +public class ImportedAPICallEvidence { /** * Gets or Sets evidenceKind */ @@ -234,10 +234,10 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti @javax.annotation.Nonnull private List calls = new ArrayList<>(); - public ImportedApiCallEvidence() { + public ImportedAPICallEvidence() { } - public ImportedApiCallEvidence evidenceKind(@javax.annotation.Nullable EvidenceKindEnum evidenceKind) { + public ImportedAPICallEvidence evidenceKind(@javax.annotation.Nullable EvidenceKindEnum evidenceKind) { this.evidenceKind = evidenceKind; return this; } @@ -256,7 +256,7 @@ public void setEvidenceKind(@javax.annotation.Nullable EvidenceKindEnum evidence } - public ImportedApiCallEvidence kind(@javax.annotation.Nullable KindEnum kind) { + public ImportedAPICallEvidence kind(@javax.annotation.Nullable KindEnum kind) { this.kind = kind; return this; } @@ -275,7 +275,7 @@ public void setKind(@javax.annotation.Nullable KindEnum kind) { } - public ImportedApiCallEvidence effect(@javax.annotation.Nonnull EvidenceEffect effect) { + public ImportedAPICallEvidence effect(@javax.annotation.Nonnull EvidenceEffect effect) { this.effect = effect; return this; } @@ -294,7 +294,7 @@ public void setEffect(@javax.annotation.Nonnull EvidenceEffect effect) { } - public ImportedApiCallEvidence strength(@javax.annotation.Nullable StrengthEnum strength) { + public ImportedAPICallEvidence strength(@javax.annotation.Nullable StrengthEnum strength) { this.strength = strength; return this; } @@ -313,12 +313,12 @@ public void setStrength(@javax.annotation.Nullable StrengthEnum strength) { } - public ImportedApiCallEvidence calls(@javax.annotation.Nonnull List calls) { + public ImportedAPICallEvidence calls(@javax.annotation.Nonnull List calls) { this.calls = calls; return this; } - public ImportedApiCallEvidence addCallsItem(ImportedApiCall callsItem) { + public ImportedAPICallEvidence addCallsItem(ImportedApiCall callsItem) { if (this.calls == null) { this.calls = new ArrayList<>(); } @@ -352,9 +352,9 @@ public void setCalls(@javax.annotation.Nonnull List calls) { * * @param key name of the property * @param value value of the property - * @return the ImportedApiCallEvidence instance itself + * @return the ImportedAPICallEvidence instance itself */ - public ImportedApiCallEvidence putAdditionalProperty(String key, Object value) { + public ImportedAPICallEvidence putAdditionalProperty(String key, Object value) { if (this.additionalProperties == null) { this.additionalProperties = new HashMap(); } @@ -393,13 +393,13 @@ public boolean equals(Object o) { if (o == null || getClass() != o.getClass()) { return false; } - ImportedApiCallEvidence importedApiCallEvidence = (ImportedApiCallEvidence) o; - return Objects.equals(this.evidenceKind, importedApiCallEvidence.evidenceKind) && - Objects.equals(this.kind, importedApiCallEvidence.kind) && - Objects.equals(this.effect, importedApiCallEvidence.effect) && - Objects.equals(this.strength, importedApiCallEvidence.strength) && - Objects.equals(this.calls, importedApiCallEvidence.calls)&& - Objects.equals(this.additionalProperties, importedApiCallEvidence.additionalProperties); + ImportedAPICallEvidence importedAPICallEvidence = (ImportedAPICallEvidence) o; + return Objects.equals(this.evidenceKind, importedAPICallEvidence.evidenceKind) && + Objects.equals(this.kind, importedAPICallEvidence.kind) && + Objects.equals(this.effect, importedAPICallEvidence.effect) && + Objects.equals(this.strength, importedAPICallEvidence.strength) && + Objects.equals(this.calls, importedAPICallEvidence.calls)&& + Objects.equals(this.additionalProperties, importedAPICallEvidence.additionalProperties); } @Override @@ -410,7 +410,7 @@ public int hashCode() { @Override public String toString() { StringBuilder sb = new StringBuilder(); - sb.append("class ImportedApiCallEvidence {\n"); + sb.append("class ImportedAPICallEvidence {\n"); sb.append(" evidenceKind: ").append(toIndentedString(evidenceKind)).append("\n"); sb.append(" kind: ").append(toIndentedString(kind)).append("\n"); sb.append(" effect: ").append(toIndentedString(effect)).append("\n"); @@ -445,17 +445,17 @@ private String toIndentedString(Object o) { * Validates the JSON Element and throws an exception if issues found * * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to ImportedApiCallEvidence + * @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())); + 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) { + 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())); } @@ -500,16 +500,16 @@ 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 + 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)); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ImportedAPICallEvidence.class)); - return (TypeAdapter) new TypeAdapter() { + return (TypeAdapter) new TypeAdapter() { @Override - public void write(JsonWriter out, ImportedApiCallEvidence value) throws IOException { + public void write(JsonWriter out, ImportedAPICallEvidence value) throws IOException { JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); obj.remove("additionalProperties"); // serialize additional properties @@ -537,12 +537,12 @@ else if (entry.getValue() instanceof Character) } @Override - public ImportedApiCallEvidence read(JsonReader in) throws IOException { + 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); + ImportedAPICallEvidence instance = thisAdapter.fromJsonTree(jsonObj); for (Map.Entry entry : jsonObj.entrySet()) { if (!openapiFields.contains(entry.getKey())) { if (entry.getValue().isJsonPrimitive()) { // primitive type @@ -569,18 +569,18 @@ else if (entry.getValue().getAsJsonPrimitive().isBoolean()) } /** - * Create an instance of ImportedApiCallEvidence given an JSON string + * 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 + * @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); + public static ImportedAPICallEvidence fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ImportedAPICallEvidence.class); } /** - * Convert an instance of ImportedApiCallEvidence to an JSON string + * Convert an instance of ImportedAPICallEvidence to an JSON string * * @return JSON string */ diff --git a/src/main/java/ai/reveng/model/InvestigationBody.java b/src/main/java/ai/reveng/model/InvestigationBody.java new file mode 100644 index 00000000..6845a70a --- /dev/null +++ b/src/main/java/ai/reveng/model/InvestigationBody.java @@ -0,0 +1,799 @@ +/* + * 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.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; + +/** + * InvestigationBody + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class InvestigationBody { + /** + * Gets or Sets caseType + */ + @JsonAdapter(CaseTypeEnum.Adapter.class) + public enum CaseTypeEnum { + REVERSE_ENGINEERING("REVERSE_ENGINEERING"), + + MALWARE_ANALYSIS("MALWARE_ANALYSIS"), + + VULNERABILITY_DISCOVERY("VULNERABILITY_DISCOVERY"), + + UNKNOWN_DEFAULT_OPEN_API("unknown_default_open_api"); + + private String value; + + CaseTypeEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static CaseTypeEnum fromValue(String value) { + for (CaseTypeEnum b : CaseTypeEnum.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 CaseTypeEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public CaseTypeEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return CaseTypeEnum.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + CaseTypeEnum.fromValue(value); + } + } + + public static final String SERIALIZED_NAME_CASE_TYPE = "case_type"; + @SerializedName(SERIALIZED_NAME_CASE_TYPE) + @javax.annotation.Nonnull + private CaseTypeEnum caseType; + + public static final String SERIALIZED_NAME_CREATED_AT = "created_at"; + @SerializedName(SERIALIZED_NAME_CREATED_AT) + @javax.annotation.Nonnull + private OffsetDateTime createdAt; + + public static final String SERIALIZED_NAME_INVESTIGATION_ID = "investigation_id"; + @SerializedName(SERIALIZED_NAME_INVESTIGATION_ID) + @javax.annotation.Nonnull + private Long investigationId; + + public static final String SERIALIZED_NAME_NAME = "name"; + @SerializedName(SERIALIZED_NAME_NAME) + @javax.annotation.Nonnull + private String name; + + public static final String SERIALIZED_NAME_OWNER_ID = "owner_id"; + @SerializedName(SERIALIZED_NAME_OWNER_ID) + @javax.annotation.Nonnull + private Long ownerId; + + public static final String SERIALIZED_NAME_OWNER_USERNAME = "owner_username"; + @SerializedName(SERIALIZED_NAME_OWNER_USERNAME) + @javax.annotation.Nonnull + private String ownerUsername; + + /** + * Gets or Sets scope + */ + @JsonAdapter(ScopeEnum.Adapter.class) + public enum ScopeEnum { + PRIVATE("PRIVATE"), + + TEAM("TEAM"), + + UNKNOWN_DEFAULT_OPEN_API("unknown_default_open_api"); + + private String value; + + ScopeEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static ScopeEnum fromValue(String value) { + for (ScopeEnum b : ScopeEnum.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 ScopeEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public ScopeEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return ScopeEnum.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + ScopeEnum.fromValue(value); + } + } + + public static final String SERIALIZED_NAME_SCOPE = "scope"; + @SerializedName(SERIALIZED_NAME_SCOPE) + @javax.annotation.Nonnull + private ScopeEnum scope; + + /** + * Gets or Sets severity + */ + @JsonAdapter(SeverityEnum.Adapter.class) + public enum SeverityEnum { + CRITICAL("CRITICAL"), + + HIGH("HIGH"), + + MEDIUM("MEDIUM"), + + LOW("LOW"), + + UNKNOWN_DEFAULT_OPEN_API("unknown_default_open_api"); + + private String value; + + SeverityEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static SeverityEnum fromValue(String value) { + for (SeverityEnum b : SeverityEnum.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 SeverityEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public SeverityEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return SeverityEnum.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + SeverityEnum.fromValue(value); + } + } + + public static final String SERIALIZED_NAME_SEVERITY = "severity"; + @SerializedName(SERIALIZED_NAME_SEVERITY) + @javax.annotation.Nonnull + private SeverityEnum severity; + + /** + * Gets or Sets status + */ + @JsonAdapter(StatusEnum.Adapter.class) + public enum StatusEnum { + OPEN("OPEN"), + + IN_PROGRESS("IN_PROGRESS"), + + ON_HOLD("ON_HOLD"), + + CLOSED("CLOSED"), + + 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 static final String SERIALIZED_NAME_TEAM_ID = "team_id"; + @SerializedName(SERIALIZED_NAME_TEAM_ID) + @javax.annotation.Nonnull + private Long teamId; + + public static final String SERIALIZED_NAME_UPDATED_AT = "updated_at"; + @SerializedName(SERIALIZED_NAME_UPDATED_AT) + @javax.annotation.Nonnull + private OffsetDateTime updatedAt; + + public InvestigationBody() { + } + + public InvestigationBody caseType(@javax.annotation.Nonnull CaseTypeEnum caseType) { + this.caseType = caseType; + return this; + } + + /** + * Get caseType + * @return caseType + */ + @javax.annotation.Nonnull + public CaseTypeEnum getCaseType() { + return caseType; + } + + public void setCaseType(@javax.annotation.Nonnull CaseTypeEnum caseType) { + this.caseType = caseType; + } + + + public InvestigationBody createdAt(@javax.annotation.Nonnull OffsetDateTime createdAt) { + this.createdAt = createdAt; + return this; + } + + /** + * Get createdAt + * @return createdAt + */ + @javax.annotation.Nonnull + public OffsetDateTime getCreatedAt() { + return createdAt; + } + + public void setCreatedAt(@javax.annotation.Nonnull OffsetDateTime createdAt) { + this.createdAt = createdAt; + } + + + public InvestigationBody investigationId(@javax.annotation.Nonnull Long investigationId) { + this.investigationId = investigationId; + return this; + } + + /** + * Get investigationId + * @return investigationId + */ + @javax.annotation.Nonnull + public Long getInvestigationId() { + return investigationId; + } + + public void setInvestigationId(@javax.annotation.Nonnull Long investigationId) { + this.investigationId = investigationId; + } + + + public InvestigationBody name(@javax.annotation.Nonnull String name) { + this.name = name; + return this; + } + + /** + * Get name + * @return name + */ + @javax.annotation.Nonnull + public String getName() { + return name; + } + + public void setName(@javax.annotation.Nonnull String name) { + this.name = name; + } + + + public InvestigationBody ownerId(@javax.annotation.Nonnull Long ownerId) { + this.ownerId = ownerId; + return this; + } + + /** + * Get ownerId + * @return ownerId + */ + @javax.annotation.Nonnull + public Long getOwnerId() { + return ownerId; + } + + public void setOwnerId(@javax.annotation.Nonnull Long ownerId) { + this.ownerId = ownerId; + } + + + public InvestigationBody ownerUsername(@javax.annotation.Nonnull String ownerUsername) { + this.ownerUsername = ownerUsername; + return this; + } + + /** + * Get ownerUsername + * @return ownerUsername + */ + @javax.annotation.Nonnull + public String getOwnerUsername() { + return ownerUsername; + } + + public void setOwnerUsername(@javax.annotation.Nonnull String ownerUsername) { + this.ownerUsername = ownerUsername; + } + + + public InvestigationBody scope(@javax.annotation.Nonnull ScopeEnum scope) { + this.scope = scope; + return this; + } + + /** + * Get scope + * @return scope + */ + @javax.annotation.Nonnull + public ScopeEnum getScope() { + return scope; + } + + public void setScope(@javax.annotation.Nonnull ScopeEnum scope) { + this.scope = scope; + } + + + public InvestigationBody severity(@javax.annotation.Nonnull SeverityEnum severity) { + this.severity = severity; + return this; + } + + /** + * Get severity + * @return severity + */ + @javax.annotation.Nonnull + public SeverityEnum getSeverity() { + return severity; + } + + public void setSeverity(@javax.annotation.Nonnull SeverityEnum severity) { + this.severity = severity; + } + + + public InvestigationBody status(@javax.annotation.Nonnull StatusEnum status) { + this.status = status; + return this; + } + + /** + * Get status + * @return status + */ + @javax.annotation.Nonnull + public StatusEnum getStatus() { + return status; + } + + public void setStatus(@javax.annotation.Nonnull StatusEnum status) { + this.status = status; + } + + + public InvestigationBody teamId(@javax.annotation.Nonnull Long teamId) { + this.teamId = teamId; + return this; + } + + /** + * Team the investigation belongs to; 0 when its owner had no team + * @return teamId + */ + @javax.annotation.Nonnull + public Long getTeamId() { + return teamId; + } + + public void setTeamId(@javax.annotation.Nonnull Long teamId) { + this.teamId = teamId; + } + + + public InvestigationBody updatedAt(@javax.annotation.Nonnull OffsetDateTime updatedAt) { + this.updatedAt = updatedAt; + return this; + } + + /** + * Get updatedAt + * @return updatedAt + */ + @javax.annotation.Nonnull + public OffsetDateTime getUpdatedAt() { + return updatedAt; + } + + public void setUpdatedAt(@javax.annotation.Nonnull OffsetDateTime updatedAt) { + this.updatedAt = updatedAt; + } + + /** + * 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 InvestigationBody instance itself + */ + public InvestigationBody 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; + } + InvestigationBody investigationBody = (InvestigationBody) o; + return Objects.equals(this.caseType, investigationBody.caseType) && + Objects.equals(this.createdAt, investigationBody.createdAt) && + Objects.equals(this.investigationId, investigationBody.investigationId) && + Objects.equals(this.name, investigationBody.name) && + Objects.equals(this.ownerId, investigationBody.ownerId) && + Objects.equals(this.ownerUsername, investigationBody.ownerUsername) && + Objects.equals(this.scope, investigationBody.scope) && + Objects.equals(this.severity, investigationBody.severity) && + Objects.equals(this.status, investigationBody.status) && + Objects.equals(this.teamId, investigationBody.teamId) && + Objects.equals(this.updatedAt, investigationBody.updatedAt)&& + Objects.equals(this.additionalProperties, investigationBody.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(caseType, createdAt, investigationId, name, ownerId, ownerUsername, scope, severity, status, teamId, updatedAt, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class InvestigationBody {\n"); + sb.append(" caseType: ").append(toIndentedString(caseType)).append("\n"); + sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); + sb.append(" investigationId: ").append(toIndentedString(investigationId)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" ownerId: ").append(toIndentedString(ownerId)).append("\n"); + sb.append(" ownerUsername: ").append(toIndentedString(ownerUsername)).append("\n"); + sb.append(" scope: ").append(toIndentedString(scope)).append("\n"); + sb.append(" severity: ").append(toIndentedString(severity)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append(" teamId: ").append(toIndentedString(teamId)).append("\n"); + sb.append(" updatedAt: ").append(toIndentedString(updatedAt)).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("case_type", "created_at", "investigation_id", "name", "owner_id", "owner_username", "scope", "severity", "status", "team_id", "updated_at")); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(Arrays.asList("case_type", "created_at", "investigation_id", "name", "owner_id", "owner_username", "scope", "severity", "status", "team_id", "updated_at")); + } + + /** + * 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 InvestigationBody + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!InvestigationBody.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 InvestigationBody is not found in the empty JSON string", InvestigationBody.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : InvestigationBody.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("case_type").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `case_type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("case_type").toString())); + } + // validate the required field `case_type` + CaseTypeEnum.validateJsonElement(jsonObj.get("case_type")); + 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("owner_username").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `owner_username` to be a primitive type in the JSON string but got `%s`", jsonObj.get("owner_username").toString())); + } + if (!jsonObj.get("scope").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `scope` to be a primitive type in the JSON string but got `%s`", jsonObj.get("scope").toString())); + } + // validate the required field `scope` + ScopeEnum.validateJsonElement(jsonObj.get("scope")); + if (!jsonObj.get("severity").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `severity` to be a primitive type in the JSON string but got `%s`", jsonObj.get("severity").toString())); + } + // validate the required field `severity` + SeverityEnum.validateJsonElement(jsonObj.get("severity")); + 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 (!InvestigationBody.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'InvestigationBody' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(InvestigationBody.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, InvestigationBody 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 InvestigationBody read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + InvestigationBody 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 InvestigationBody given an JSON string + * + * @param jsonString JSON string + * @return An instance of InvestigationBody + * @throws IOException if the JSON string is invalid with respect to InvestigationBody + */ + public static InvestigationBody fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, InvestigationBody.class); + } + + /** + * Convert an instance of InvestigationBody to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/ai/reveng/model/InvestigationListItemBody.java b/src/main/java/ai/reveng/model/InvestigationListItemBody.java new file mode 100644 index 00000000..87386c1f --- /dev/null +++ b/src/main/java/ai/reveng/model/InvestigationListItemBody.java @@ -0,0 +1,853 @@ +/* + * 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.BudgetBody; +import ai.reveng.model.RollupBody; +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; + +/** + * InvestigationListItemBody + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class InvestigationListItemBody { + public static final String SERIALIZED_NAME_BUDGET = "budget"; + @SerializedName(SERIALIZED_NAME_BUDGET) + @javax.annotation.Nonnull + private BudgetBody budget; + + /** + * Gets or Sets caseType + */ + @JsonAdapter(CaseTypeEnum.Adapter.class) + public enum CaseTypeEnum { + REVERSE_ENGINEERING("REVERSE_ENGINEERING"), + + MALWARE_ANALYSIS("MALWARE_ANALYSIS"), + + VULNERABILITY_DISCOVERY("VULNERABILITY_DISCOVERY"), + + UNKNOWN_DEFAULT_OPEN_API("unknown_default_open_api"); + + private String value; + + CaseTypeEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static CaseTypeEnum fromValue(String value) { + for (CaseTypeEnum b : CaseTypeEnum.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 CaseTypeEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public CaseTypeEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return CaseTypeEnum.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + CaseTypeEnum.fromValue(value); + } + } + + public static final String SERIALIZED_NAME_CASE_TYPE = "case_type"; + @SerializedName(SERIALIZED_NAME_CASE_TYPE) + @javax.annotation.Nonnull + private CaseTypeEnum caseType; + + public static final String SERIALIZED_NAME_CREATED_AT = "created_at"; + @SerializedName(SERIALIZED_NAME_CREATED_AT) + @javax.annotation.Nonnull + private OffsetDateTime createdAt; + + public static final String SERIALIZED_NAME_INVESTIGATION_ID = "investigation_id"; + @SerializedName(SERIALIZED_NAME_INVESTIGATION_ID) + @javax.annotation.Nonnull + private Long investigationId; + + public static final String SERIALIZED_NAME_NAME = "name"; + @SerializedName(SERIALIZED_NAME_NAME) + @javax.annotation.Nonnull + private String name; + + public static final String SERIALIZED_NAME_OWNER_ID = "owner_id"; + @SerializedName(SERIALIZED_NAME_OWNER_ID) + @javax.annotation.Nonnull + private Long ownerId; + + public static final String SERIALIZED_NAME_OWNER_USERNAME = "owner_username"; + @SerializedName(SERIALIZED_NAME_OWNER_USERNAME) + @javax.annotation.Nonnull + private String ownerUsername; + + public static final String SERIALIZED_NAME_ROLLUP = "rollup"; + @SerializedName(SERIALIZED_NAME_ROLLUP) + @javax.annotation.Nonnull + private RollupBody rollup; + + /** + * Gets or Sets scope + */ + @JsonAdapter(ScopeEnum.Adapter.class) + public enum ScopeEnum { + PRIVATE("PRIVATE"), + + TEAM("TEAM"), + + UNKNOWN_DEFAULT_OPEN_API("unknown_default_open_api"); + + private String value; + + ScopeEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static ScopeEnum fromValue(String value) { + for (ScopeEnum b : ScopeEnum.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 ScopeEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public ScopeEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return ScopeEnum.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + ScopeEnum.fromValue(value); + } + } + + public static final String SERIALIZED_NAME_SCOPE = "scope"; + @SerializedName(SERIALIZED_NAME_SCOPE) + @javax.annotation.Nonnull + private ScopeEnum scope; + + /** + * Gets or Sets severity + */ + @JsonAdapter(SeverityEnum.Adapter.class) + public enum SeverityEnum { + CRITICAL("CRITICAL"), + + HIGH("HIGH"), + + MEDIUM("MEDIUM"), + + LOW("LOW"), + + UNKNOWN_DEFAULT_OPEN_API("unknown_default_open_api"); + + private String value; + + SeverityEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static SeverityEnum fromValue(String value) { + for (SeverityEnum b : SeverityEnum.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 SeverityEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public SeverityEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return SeverityEnum.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + SeverityEnum.fromValue(value); + } + } + + public static final String SERIALIZED_NAME_SEVERITY = "severity"; + @SerializedName(SERIALIZED_NAME_SEVERITY) + @javax.annotation.Nonnull + private SeverityEnum severity; + + /** + * Gets or Sets status + */ + @JsonAdapter(StatusEnum.Adapter.class) + public enum StatusEnum { + OPEN("OPEN"), + + IN_PROGRESS("IN_PROGRESS"), + + ON_HOLD("ON_HOLD"), + + CLOSED("CLOSED"), + + 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 static final String SERIALIZED_NAME_TEAM_ID = "team_id"; + @SerializedName(SERIALIZED_NAME_TEAM_ID) + @javax.annotation.Nonnull + private Long teamId; + + public static final String SERIALIZED_NAME_UPDATED_AT = "updated_at"; + @SerializedName(SERIALIZED_NAME_UPDATED_AT) + @javax.annotation.Nonnull + private OffsetDateTime updatedAt; + + public InvestigationListItemBody() { + } + + public InvestigationListItemBody budget(@javax.annotation.Nonnull BudgetBody budget) { + this.budget = budget; + return this; + } + + /** + * Get budget + * @return budget + */ + @javax.annotation.Nonnull + public BudgetBody getBudget() { + return budget; + } + + public void setBudget(@javax.annotation.Nonnull BudgetBody budget) { + this.budget = budget; + } + + + public InvestigationListItemBody caseType(@javax.annotation.Nonnull CaseTypeEnum caseType) { + this.caseType = caseType; + return this; + } + + /** + * Get caseType + * @return caseType + */ + @javax.annotation.Nonnull + public CaseTypeEnum getCaseType() { + return caseType; + } + + public void setCaseType(@javax.annotation.Nonnull CaseTypeEnum caseType) { + this.caseType = caseType; + } + + + public InvestigationListItemBody createdAt(@javax.annotation.Nonnull OffsetDateTime createdAt) { + this.createdAt = createdAt; + return this; + } + + /** + * Get createdAt + * @return createdAt + */ + @javax.annotation.Nonnull + public OffsetDateTime getCreatedAt() { + return createdAt; + } + + public void setCreatedAt(@javax.annotation.Nonnull OffsetDateTime createdAt) { + this.createdAt = createdAt; + } + + + public InvestigationListItemBody investigationId(@javax.annotation.Nonnull Long investigationId) { + this.investigationId = investigationId; + return this; + } + + /** + * Get investigationId + * @return investigationId + */ + @javax.annotation.Nonnull + public Long getInvestigationId() { + return investigationId; + } + + public void setInvestigationId(@javax.annotation.Nonnull Long investigationId) { + this.investigationId = investigationId; + } + + + public InvestigationListItemBody name(@javax.annotation.Nonnull String name) { + this.name = name; + return this; + } + + /** + * Get name + * @return name + */ + @javax.annotation.Nonnull + public String getName() { + return name; + } + + public void setName(@javax.annotation.Nonnull String name) { + this.name = name; + } + + + public InvestigationListItemBody ownerId(@javax.annotation.Nonnull Long ownerId) { + this.ownerId = ownerId; + return this; + } + + /** + * Get ownerId + * @return ownerId + */ + @javax.annotation.Nonnull + public Long getOwnerId() { + return ownerId; + } + + public void setOwnerId(@javax.annotation.Nonnull Long ownerId) { + this.ownerId = ownerId; + } + + + public InvestigationListItemBody ownerUsername(@javax.annotation.Nonnull String ownerUsername) { + this.ownerUsername = ownerUsername; + return this; + } + + /** + * Get ownerUsername + * @return ownerUsername + */ + @javax.annotation.Nonnull + public String getOwnerUsername() { + return ownerUsername; + } + + public void setOwnerUsername(@javax.annotation.Nonnull String ownerUsername) { + this.ownerUsername = ownerUsername; + } + + + public InvestigationListItemBody rollup(@javax.annotation.Nonnull RollupBody rollup) { + this.rollup = rollup; + return this; + } + + /** + * Get rollup + * @return rollup + */ + @javax.annotation.Nonnull + public RollupBody getRollup() { + return rollup; + } + + public void setRollup(@javax.annotation.Nonnull RollupBody rollup) { + this.rollup = rollup; + } + + + public InvestigationListItemBody scope(@javax.annotation.Nonnull ScopeEnum scope) { + this.scope = scope; + return this; + } + + /** + * Get scope + * @return scope + */ + @javax.annotation.Nonnull + public ScopeEnum getScope() { + return scope; + } + + public void setScope(@javax.annotation.Nonnull ScopeEnum scope) { + this.scope = scope; + } + + + public InvestigationListItemBody severity(@javax.annotation.Nonnull SeverityEnum severity) { + this.severity = severity; + return this; + } + + /** + * Get severity + * @return severity + */ + @javax.annotation.Nonnull + public SeverityEnum getSeverity() { + return severity; + } + + public void setSeverity(@javax.annotation.Nonnull SeverityEnum severity) { + this.severity = severity; + } + + + public InvestigationListItemBody status(@javax.annotation.Nonnull StatusEnum status) { + this.status = status; + return this; + } + + /** + * Get status + * @return status + */ + @javax.annotation.Nonnull + public StatusEnum getStatus() { + return status; + } + + public void setStatus(@javax.annotation.Nonnull StatusEnum status) { + this.status = status; + } + + + public InvestigationListItemBody teamId(@javax.annotation.Nonnull Long teamId) { + this.teamId = teamId; + return this; + } + + /** + * Team the investigation belongs to; 0 when its owner had no team + * @return teamId + */ + @javax.annotation.Nonnull + public Long getTeamId() { + return teamId; + } + + public void setTeamId(@javax.annotation.Nonnull Long teamId) { + this.teamId = teamId; + } + + + public InvestigationListItemBody updatedAt(@javax.annotation.Nonnull OffsetDateTime updatedAt) { + this.updatedAt = updatedAt; + return this; + } + + /** + * Get updatedAt + * @return updatedAt + */ + @javax.annotation.Nonnull + public OffsetDateTime getUpdatedAt() { + return updatedAt; + } + + public void setUpdatedAt(@javax.annotation.Nonnull OffsetDateTime updatedAt) { + this.updatedAt = updatedAt; + } + + /** + * 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 InvestigationListItemBody instance itself + */ + public InvestigationListItemBody 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; + } + InvestigationListItemBody investigationListItemBody = (InvestigationListItemBody) o; + return Objects.equals(this.budget, investigationListItemBody.budget) && + Objects.equals(this.caseType, investigationListItemBody.caseType) && + Objects.equals(this.createdAt, investigationListItemBody.createdAt) && + Objects.equals(this.investigationId, investigationListItemBody.investigationId) && + Objects.equals(this.name, investigationListItemBody.name) && + Objects.equals(this.ownerId, investigationListItemBody.ownerId) && + Objects.equals(this.ownerUsername, investigationListItemBody.ownerUsername) && + Objects.equals(this.rollup, investigationListItemBody.rollup) && + Objects.equals(this.scope, investigationListItemBody.scope) && + Objects.equals(this.severity, investigationListItemBody.severity) && + Objects.equals(this.status, investigationListItemBody.status) && + Objects.equals(this.teamId, investigationListItemBody.teamId) && + Objects.equals(this.updatedAt, investigationListItemBody.updatedAt)&& + Objects.equals(this.additionalProperties, investigationListItemBody.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(budget, caseType, createdAt, investigationId, name, ownerId, ownerUsername, rollup, scope, severity, status, teamId, updatedAt, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class InvestigationListItemBody {\n"); + sb.append(" budget: ").append(toIndentedString(budget)).append("\n"); + sb.append(" caseType: ").append(toIndentedString(caseType)).append("\n"); + sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); + sb.append(" investigationId: ").append(toIndentedString(investigationId)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" ownerId: ").append(toIndentedString(ownerId)).append("\n"); + sb.append(" ownerUsername: ").append(toIndentedString(ownerUsername)).append("\n"); + sb.append(" rollup: ").append(toIndentedString(rollup)).append("\n"); + sb.append(" scope: ").append(toIndentedString(scope)).append("\n"); + sb.append(" severity: ").append(toIndentedString(severity)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append(" teamId: ").append(toIndentedString(teamId)).append("\n"); + sb.append(" updatedAt: ").append(toIndentedString(updatedAt)).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("budget", "case_type", "created_at", "investigation_id", "name", "owner_id", "owner_username", "rollup", "scope", "severity", "status", "team_id", "updated_at")); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(Arrays.asList("budget", "case_type", "created_at", "investigation_id", "name", "owner_id", "owner_username", "rollup", "scope", "severity", "status", "team_id", "updated_at")); + } + + /** + * 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 InvestigationListItemBody + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!InvestigationListItemBody.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 InvestigationListItemBody is not found in the empty JSON string", InvestigationListItemBody.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : InvestigationListItemBody.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("case_type").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `case_type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("case_type").toString())); + } + // validate the required field `case_type` + CaseTypeEnum.validateJsonElement(jsonObj.get("case_type")); + 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("owner_username").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `owner_username` to be a primitive type in the JSON string but got `%s`", jsonObj.get("owner_username").toString())); + } + if (!jsonObj.get("scope").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `scope` to be a primitive type in the JSON string but got `%s`", jsonObj.get("scope").toString())); + } + // validate the required field `scope` + ScopeEnum.validateJsonElement(jsonObj.get("scope")); + if (!jsonObj.get("severity").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `severity` to be a primitive type in the JSON string but got `%s`", jsonObj.get("severity").toString())); + } + // validate the required field `severity` + SeverityEnum.validateJsonElement(jsonObj.get("severity")); + 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 (!InvestigationListItemBody.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'InvestigationListItemBody' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(InvestigationListItemBody.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, InvestigationListItemBody 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 InvestigationListItemBody read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + InvestigationListItemBody 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 InvestigationListItemBody given an JSON string + * + * @param jsonString JSON string + * @return An instance of InvestigationListItemBody + * @throws IOException if the JSON string is invalid with respect to InvestigationListItemBody + */ + public static InvestigationListItemBody fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, InvestigationListItemBody.class); + } + + /** + * Convert an instance of InvestigationListItemBody to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/ai/reveng/model/ListAccessRulesOutputBody.java b/src/main/java/ai/reveng/model/ListAccessRulesOutputBody.java new file mode 100644 index 00000000..666d44c5 --- /dev/null +++ b/src/main/java/ai/reveng/model/ListAccessRulesOutputBody.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.AccessRuleBody; +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; + +/** + * ListAccessRulesOutputBody + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class ListAccessRulesOutputBody { + public static final String SERIALIZED_NAME_RULES = "rules"; + @SerializedName(SERIALIZED_NAME_RULES) + @javax.annotation.Nonnull + private List rules = new ArrayList<>(); + + public ListAccessRulesOutputBody() { + } + + public ListAccessRulesOutputBody rules(@javax.annotation.Nonnull List rules) { + this.rules = rules; + return this; + } + + public ListAccessRulesOutputBody addRulesItem(AccessRuleBody rulesItem) { + if (this.rules == null) { + this.rules = new ArrayList<>(); + } + this.rules.add(rulesItem); + return this; + } + + /** + * Every user and team the analysis is shared with, oldest first + * @return rules + */ + @javax.annotation.Nonnull + public List getRules() { + return rules; + } + + public void setRules(@javax.annotation.Nonnull List rules) { + this.rules = rules; + } + + /** + * 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 ListAccessRulesOutputBody instance itself + */ + public ListAccessRulesOutputBody 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; + } + ListAccessRulesOutputBody listAccessRulesOutputBody = (ListAccessRulesOutputBody) o; + return Objects.equals(this.rules, listAccessRulesOutputBody.rules)&& + Objects.equals(this.additionalProperties, listAccessRulesOutputBody.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(rules, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ListAccessRulesOutputBody {\n"); + sb.append(" rules: ").append(toIndentedString(rules)).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("rules")); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(Arrays.asList("rules")); + } + + /** + * 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 ListAccessRulesOutputBody + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ListAccessRulesOutputBody.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 ListAccessRulesOutputBody is not found in the empty JSON string", ListAccessRulesOutputBody.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : ListAccessRulesOutputBody.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("rules") == null) { + throw new IllegalArgumentException("Expected the field `linkedContent` to be an array in the JSON string but got `null`"); + } else if (!jsonObj.get("rules").isJsonArray()) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `rules` to be an array in the JSON string but got `%s`", jsonObj.get("rules").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ListAccessRulesOutputBody.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ListAccessRulesOutputBody' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ListAccessRulesOutputBody.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, ListAccessRulesOutputBody 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 ListAccessRulesOutputBody read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + ListAccessRulesOutputBody 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 ListAccessRulesOutputBody given an JSON string + * + * @param jsonString JSON string + * @return An instance of ListAccessRulesOutputBody + * @throws IOException if the JSON string is invalid with respect to ListAccessRulesOutputBody + */ + public static ListAccessRulesOutputBody fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ListAccessRulesOutputBody.class); + } + + /** + * Convert an instance of ListAccessRulesOutputBody to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/ai/reveng/model/ListAgentRunsOutputBody.java b/src/main/java/ai/reveng/model/ListAgentRunsOutputBody.java new file mode 100644 index 00000000..93e5acda --- /dev/null +++ b/src/main/java/ai/reveng/model/ListAgentRunsOutputBody.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.AgentRunBody; +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; + +/** + * ListAgentRunsOutputBody + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class ListAgentRunsOutputBody { + public static final String SERIALIZED_NAME_HAS_NEXT_PAGE = "has_next_page"; + @SerializedName(SERIALIZED_NAME_HAS_NEXT_PAGE) + @javax.annotation.Nonnull + private Boolean hasNextPage; + + public static final String SERIALIZED_NAME_RESULTS = "results"; + @SerializedName(SERIALIZED_NAME_RESULTS) + @javax.annotation.Nonnull + private List results = new ArrayList<>(); + + public static final String SERIALIZED_NAME_TOTAL_COUNT = "total_count"; + @SerializedName(SERIALIZED_NAME_TOTAL_COUNT) + @javax.annotation.Nonnull + private Long totalCount; + + public ListAgentRunsOutputBody() { + } + + public ListAgentRunsOutputBody hasNextPage(@javax.annotation.Nonnull Boolean hasNextPage) { + this.hasNextPage = hasNextPage; + return this; + } + + /** + * Get hasNextPage + * @return hasNextPage + */ + @javax.annotation.Nonnull + public Boolean getHasNextPage() { + return hasNextPage; + } + + public void setHasNextPage(@javax.annotation.Nonnull Boolean hasNextPage) { + this.hasNextPage = hasNextPage; + } + + + public ListAgentRunsOutputBody results(@javax.annotation.Nonnull List results) { + this.results = results; + return this; + } + + public ListAgentRunsOutputBody addResultsItem(AgentRunBody resultsItem) { + if (this.results == null) { + this.results = new ArrayList<>(); + } + this.results.add(resultsItem); + return this; + } + + /** + * Get results + * @return results + */ + @javax.annotation.Nonnull + public List getResults() { + return results; + } + + public void setResults(@javax.annotation.Nonnull List results) { + this.results = results; + } + + + public ListAgentRunsOutputBody totalCount(@javax.annotation.Nonnull Long totalCount) { + this.totalCount = totalCount; + return this; + } + + /** + * Runs matching the filters across all pages. + * @return totalCount + */ + @javax.annotation.Nonnull + public Long getTotalCount() { + return totalCount; + } + + public void setTotalCount(@javax.annotation.Nonnull Long totalCount) { + this.totalCount = totalCount; + } + + /** + * 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 ListAgentRunsOutputBody instance itself + */ + public ListAgentRunsOutputBody 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; + } + ListAgentRunsOutputBody listAgentRunsOutputBody = (ListAgentRunsOutputBody) o; + return Objects.equals(this.hasNextPage, listAgentRunsOutputBody.hasNextPage) && + Objects.equals(this.results, listAgentRunsOutputBody.results) && + Objects.equals(this.totalCount, listAgentRunsOutputBody.totalCount)&& + Objects.equals(this.additionalProperties, listAgentRunsOutputBody.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(hasNextPage, results, totalCount, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ListAgentRunsOutputBody {\n"); + sb.append(" hasNextPage: ").append(toIndentedString(hasNextPage)).append("\n"); + sb.append(" results: ").append(toIndentedString(results)).append("\n"); + sb.append(" totalCount: ").append(toIndentedString(totalCount)).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("has_next_page", "results", "total_count")); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(Arrays.asList("has_next_page", "results", "total_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 ListAgentRunsOutputBody + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ListAgentRunsOutputBody.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 ListAgentRunsOutputBody is not found in the empty JSON string", ListAgentRunsOutputBody.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : ListAgentRunsOutputBody.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()) { + 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 (!ListAgentRunsOutputBody.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ListAgentRunsOutputBody' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ListAgentRunsOutputBody.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, ListAgentRunsOutputBody 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 ListAgentRunsOutputBody read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + ListAgentRunsOutputBody 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 ListAgentRunsOutputBody given an JSON string + * + * @param jsonString JSON string + * @return An instance of ListAgentRunsOutputBody + * @throws IOException if the JSON string is invalid with respect to ListAgentRunsOutputBody + */ + public static ListAgentRunsOutputBody fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ListAgentRunsOutputBody.class); + } + + /** + * Convert an instance of ListAgentRunsOutputBody to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/ai/reveng/model/ListConversationsOutputBody.java b/src/main/java/ai/reveng/model/ListConversationsOutputBody.java new file mode 100644 index 00000000..b638f41f --- /dev/null +++ b/src/main/java/ai/reveng/model/ListConversationsOutputBody.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.ConversationBody; +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; + +/** + * ListConversationsOutputBody + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class ListConversationsOutputBody { + public static final String SERIALIZED_NAME_HAS_NEXT_PAGE = "has_next_page"; + @SerializedName(SERIALIZED_NAME_HAS_NEXT_PAGE) + @javax.annotation.Nonnull + private Boolean hasNextPage; + + public static final String SERIALIZED_NAME_RESULTS = "results"; + @SerializedName(SERIALIZED_NAME_RESULTS) + @javax.annotation.Nonnull + private List results = new ArrayList<>(); + + public static final String SERIALIZED_NAME_TOTAL_COUNT = "total_count"; + @SerializedName(SERIALIZED_NAME_TOTAL_COUNT) + @javax.annotation.Nonnull + private Long totalCount; + + public ListConversationsOutputBody() { + } + + public ListConversationsOutputBody hasNextPage(@javax.annotation.Nonnull Boolean hasNextPage) { + this.hasNextPage = hasNextPage; + return this; + } + + /** + * Get hasNextPage + * @return hasNextPage + */ + @javax.annotation.Nonnull + public Boolean getHasNextPage() { + return hasNextPage; + } + + public void setHasNextPage(@javax.annotation.Nonnull Boolean hasNextPage) { + this.hasNextPage = hasNextPage; + } + + + public ListConversationsOutputBody results(@javax.annotation.Nonnull List results) { + this.results = results; + return this; + } + + public ListConversationsOutputBody addResultsItem(ConversationBody resultsItem) { + if (this.results == null) { + this.results = new ArrayList<>(); + } + this.results.add(resultsItem); + return this; + } + + /** + * Get results + * @return results + */ + @javax.annotation.Nonnull + public List getResults() { + return results; + } + + public void setResults(@javax.annotation.Nonnull List results) { + this.results = results; + } + + + public ListConversationsOutputBody totalCount(@javax.annotation.Nonnull Long totalCount) { + this.totalCount = totalCount; + return this; + } + + /** + * Conversations in the investigation across all pages. + * @return totalCount + */ + @javax.annotation.Nonnull + public Long getTotalCount() { + return totalCount; + } + + public void setTotalCount(@javax.annotation.Nonnull Long totalCount) { + this.totalCount = totalCount; + } + + /** + * 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 ListConversationsOutputBody instance itself + */ + public ListConversationsOutputBody 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; + } + ListConversationsOutputBody listConversationsOutputBody = (ListConversationsOutputBody) o; + return Objects.equals(this.hasNextPage, listConversationsOutputBody.hasNextPage) && + Objects.equals(this.results, listConversationsOutputBody.results) && + Objects.equals(this.totalCount, listConversationsOutputBody.totalCount)&& + Objects.equals(this.additionalProperties, listConversationsOutputBody.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(hasNextPage, results, totalCount, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ListConversationsOutputBody {\n"); + sb.append(" hasNextPage: ").append(toIndentedString(hasNextPage)).append("\n"); + sb.append(" results: ").append(toIndentedString(results)).append("\n"); + sb.append(" totalCount: ").append(toIndentedString(totalCount)).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("has_next_page", "results", "total_count")); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(Arrays.asList("has_next_page", "results", "total_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 ListConversationsOutputBody + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ListConversationsOutputBody.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 ListConversationsOutputBody is not found in the empty JSON string", ListConversationsOutputBody.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : ListConversationsOutputBody.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()) { + 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 (!ListConversationsOutputBody.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ListConversationsOutputBody' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ListConversationsOutputBody.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, ListConversationsOutputBody 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 ListConversationsOutputBody read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + ListConversationsOutputBody 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 ListConversationsOutputBody given an JSON string + * + * @param jsonString JSON string + * @return An instance of ListConversationsOutputBody + * @throws IOException if the JSON string is invalid with respect to ListConversationsOutputBody + */ + public static ListConversationsOutputBody fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ListConversationsOutputBody.class); + } + + /** + * Convert an instance of ListConversationsOutputBody to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/ai/reveng/model/ListFindingsOutputBody.java b/src/main/java/ai/reveng/model/ListFindingsOutputBody.java new file mode 100644 index 00000000..4f295588 --- /dev/null +++ b/src/main/java/ai/reveng/model/ListFindingsOutputBody.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.FindingBody; +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; + +/** + * ListFindingsOutputBody + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class ListFindingsOutputBody { + public static final String SERIALIZED_NAME_HAS_NEXT_PAGE = "has_next_page"; + @SerializedName(SERIALIZED_NAME_HAS_NEXT_PAGE) + @javax.annotation.Nonnull + private Boolean hasNextPage; + + public static final String SERIALIZED_NAME_RESULTS = "results"; + @SerializedName(SERIALIZED_NAME_RESULTS) + @javax.annotation.Nonnull + private List results = new ArrayList<>(); + + public static final String SERIALIZED_NAME_TOTAL_COUNT = "total_count"; + @SerializedName(SERIALIZED_NAME_TOTAL_COUNT) + @javax.annotation.Nonnull + private Long totalCount; + + public ListFindingsOutputBody() { + } + + public ListFindingsOutputBody hasNextPage(@javax.annotation.Nonnull Boolean hasNextPage) { + this.hasNextPage = hasNextPage; + return this; + } + + /** + * Get hasNextPage + * @return hasNextPage + */ + @javax.annotation.Nonnull + public Boolean getHasNextPage() { + return hasNextPage; + } + + public void setHasNextPage(@javax.annotation.Nonnull Boolean hasNextPage) { + this.hasNextPage = hasNextPage; + } + + + public ListFindingsOutputBody results(@javax.annotation.Nonnull List results) { + this.results = results; + return this; + } + + public ListFindingsOutputBody addResultsItem(FindingBody resultsItem) { + if (this.results == null) { + this.results = new ArrayList<>(); + } + this.results.add(resultsItem); + return this; + } + + /** + * Get results + * @return results + */ + @javax.annotation.Nonnull + public List getResults() { + return results; + } + + public void setResults(@javax.annotation.Nonnull List results) { + this.results = results; + } + + + public ListFindingsOutputBody totalCount(@javax.annotation.Nonnull Long totalCount) { + this.totalCount = totalCount; + return this; + } + + /** + * Findings matching the filters across all pages. + * @return totalCount + */ + @javax.annotation.Nonnull + public Long getTotalCount() { + return totalCount; + } + + public void setTotalCount(@javax.annotation.Nonnull Long totalCount) { + this.totalCount = totalCount; + } + + /** + * 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 ListFindingsOutputBody instance itself + */ + public ListFindingsOutputBody 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; + } + ListFindingsOutputBody listFindingsOutputBody = (ListFindingsOutputBody) o; + return Objects.equals(this.hasNextPage, listFindingsOutputBody.hasNextPage) && + Objects.equals(this.results, listFindingsOutputBody.results) && + Objects.equals(this.totalCount, listFindingsOutputBody.totalCount)&& + Objects.equals(this.additionalProperties, listFindingsOutputBody.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(hasNextPage, results, totalCount, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ListFindingsOutputBody {\n"); + sb.append(" hasNextPage: ").append(toIndentedString(hasNextPage)).append("\n"); + sb.append(" results: ").append(toIndentedString(results)).append("\n"); + sb.append(" totalCount: ").append(toIndentedString(totalCount)).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("has_next_page", "results", "total_count")); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(Arrays.asList("has_next_page", "results", "total_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 ListFindingsOutputBody + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ListFindingsOutputBody.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 ListFindingsOutputBody is not found in the empty JSON string", ListFindingsOutputBody.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : ListFindingsOutputBody.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()) { + 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 (!ListFindingsOutputBody.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ListFindingsOutputBody' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ListFindingsOutputBody.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, ListFindingsOutputBody 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 ListFindingsOutputBody read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + ListFindingsOutputBody 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 ListFindingsOutputBody given an JSON string + * + * @param jsonString JSON string + * @return An instance of ListFindingsOutputBody + * @throws IOException if the JSON string is invalid with respect to ListFindingsOutputBody + */ + public static ListFindingsOutputBody fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ListFindingsOutputBody.class); + } + + /** + * Convert an instance of ListFindingsOutputBody to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/ai/reveng/model/ListInvestigationsOutputBody.java b/src/main/java/ai/reveng/model/ListInvestigationsOutputBody.java new file mode 100644 index 00000000..ed5f514f --- /dev/null +++ b/src/main/java/ai/reveng/model/ListInvestigationsOutputBody.java @@ -0,0 +1,382 @@ +/* + * 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.AgentStatusCountsBody; +import ai.reveng.model.InvestigationListItemBody; +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; + +/** + * ListInvestigationsOutputBody + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class ListInvestigationsOutputBody { + public static final String SERIALIZED_NAME_AGENT_STATUS_COUNTS = "agent_status_counts"; + @SerializedName(SERIALIZED_NAME_AGENT_STATUS_COUNTS) + @javax.annotation.Nonnull + private AgentStatusCountsBody agentStatusCounts; + + public static final String SERIALIZED_NAME_HAS_NEXT_PAGE = "has_next_page"; + @SerializedName(SERIALIZED_NAME_HAS_NEXT_PAGE) + @javax.annotation.Nonnull + private Boolean hasNextPage; + + public static final String SERIALIZED_NAME_RESULTS = "results"; + @SerializedName(SERIALIZED_NAME_RESULTS) + @javax.annotation.Nonnull + private List results = new ArrayList<>(); + + public static final String SERIALIZED_NAME_TOTAL_COUNT = "total_count"; + @SerializedName(SERIALIZED_NAME_TOTAL_COUNT) + @javax.annotation.Nonnull + private Long totalCount; + + public ListInvestigationsOutputBody() { + } + + public ListInvestigationsOutputBody agentStatusCounts(@javax.annotation.Nonnull AgentStatusCountsBody agentStatusCounts) { + this.agentStatusCounts = agentStatusCounts; + return this; + } + + /** + * Open investigations you can see at each agent status, whatever the filters and page. + * @return agentStatusCounts + */ + @javax.annotation.Nonnull + public AgentStatusCountsBody getAgentStatusCounts() { + return agentStatusCounts; + } + + public void setAgentStatusCounts(@javax.annotation.Nonnull AgentStatusCountsBody agentStatusCounts) { + this.agentStatusCounts = agentStatusCounts; + } + + + public ListInvestigationsOutputBody hasNextPage(@javax.annotation.Nonnull Boolean hasNextPage) { + this.hasNextPage = hasNextPage; + return this; + } + + /** + * Get hasNextPage + * @return hasNextPage + */ + @javax.annotation.Nonnull + public Boolean getHasNextPage() { + return hasNextPage; + } + + public void setHasNextPage(@javax.annotation.Nonnull Boolean hasNextPage) { + this.hasNextPage = hasNextPage; + } + + + public ListInvestigationsOutputBody results(@javax.annotation.Nonnull List results) { + this.results = results; + return this; + } + + public ListInvestigationsOutputBody addResultsItem(InvestigationListItemBody resultsItem) { + if (this.results == null) { + this.results = new ArrayList<>(); + } + this.results.add(resultsItem); + return this; + } + + /** + * Get results + * @return results + */ + @javax.annotation.Nonnull + public List getResults() { + return results; + } + + public void setResults(@javax.annotation.Nonnull List results) { + this.results = results; + } + + + public ListInvestigationsOutputBody totalCount(@javax.annotation.Nonnull Long totalCount) { + this.totalCount = totalCount; + return this; + } + + /** + * Investigations matching the filters across all pages. + * @return totalCount + */ + @javax.annotation.Nonnull + public Long getTotalCount() { + return totalCount; + } + + public void setTotalCount(@javax.annotation.Nonnull Long totalCount) { + this.totalCount = totalCount; + } + + /** + * 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 ListInvestigationsOutputBody instance itself + */ + public ListInvestigationsOutputBody 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; + } + ListInvestigationsOutputBody listInvestigationsOutputBody = (ListInvestigationsOutputBody) o; + return Objects.equals(this.agentStatusCounts, listInvestigationsOutputBody.agentStatusCounts) && + Objects.equals(this.hasNextPage, listInvestigationsOutputBody.hasNextPage) && + Objects.equals(this.results, listInvestigationsOutputBody.results) && + Objects.equals(this.totalCount, listInvestigationsOutputBody.totalCount)&& + Objects.equals(this.additionalProperties, listInvestigationsOutputBody.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(agentStatusCounts, hasNextPage, results, totalCount, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ListInvestigationsOutputBody {\n"); + sb.append(" agentStatusCounts: ").append(toIndentedString(agentStatusCounts)).append("\n"); + sb.append(" hasNextPage: ").append(toIndentedString(hasNextPage)).append("\n"); + sb.append(" results: ").append(toIndentedString(results)).append("\n"); + sb.append(" totalCount: ").append(toIndentedString(totalCount)).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("agent_status_counts", "has_next_page", "results", "total_count")); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(Arrays.asList("agent_status_counts", "has_next_page", "results", "total_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 ListInvestigationsOutputBody + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ListInvestigationsOutputBody.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 ListInvestigationsOutputBody is not found in the empty JSON string", ListInvestigationsOutputBody.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : ListInvestigationsOutputBody.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()) { + 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 (!ListInvestigationsOutputBody.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ListInvestigationsOutputBody' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ListInvestigationsOutputBody.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, ListInvestigationsOutputBody 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 ListInvestigationsOutputBody read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + ListInvestigationsOutputBody 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 ListInvestigationsOutputBody given an JSON string + * + * @param jsonString JSON string + * @return An instance of ListInvestigationsOutputBody + * @throws IOException if the JSON string is invalid with respect to ListInvestigationsOutputBody + */ + public static ListInvestigationsOutputBody fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ListInvestigationsOutputBody.class); + } + + /** + * Convert an instance of ListInvestigationsOutputBody to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/ai/reveng/model/ListPrincipalsOutputBody.java b/src/main/java/ai/reveng/model/ListPrincipalsOutputBody.java new file mode 100644 index 00000000..d9896ea1 --- /dev/null +++ b/src/main/java/ai/reveng/model/ListPrincipalsOutputBody.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.PrincipalBody; +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; + +/** + * ListPrincipalsOutputBody + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class ListPrincipalsOutputBody { + public static final String SERIALIZED_NAME_RESULTS = "results"; + @SerializedName(SERIALIZED_NAME_RESULTS) + @javax.annotation.Nullable + private List results; + + public ListPrincipalsOutputBody() { + } + + public ListPrincipalsOutputBody results(@javax.annotation.Nullable List results) { + this.results = results; + return this; + } + + public ListPrincipalsOutputBody addResultsItem(PrincipalBody resultsItem) { + if (this.results == null) { + this.results = new ArrayList<>(); + } + this.results.add(resultsItem); + return this; + } + + /** + * Up to 5 matching users followed by up to 5 matching teams, each ordered by name + * @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 ListPrincipalsOutputBody instance itself + */ + public ListPrincipalsOutputBody 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; + } + ListPrincipalsOutputBody listPrincipalsOutputBody = (ListPrincipalsOutputBody) o; + return Objects.equals(this.results, listPrincipalsOutputBody.results)&& + Objects.equals(this.additionalProperties, listPrincipalsOutputBody.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(results, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ListPrincipalsOutputBody {\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 ListPrincipalsOutputBody + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ListPrincipalsOutputBody.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 ListPrincipalsOutputBody is not found in the empty JSON string", ListPrincipalsOutputBody.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : ListPrincipalsOutputBody.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 (!ListPrincipalsOutputBody.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ListPrincipalsOutputBody' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ListPrincipalsOutputBody.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, ListPrincipalsOutputBody 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 ListPrincipalsOutputBody read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + ListPrincipalsOutputBody 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 ListPrincipalsOutputBody given an JSON string + * + * @param jsonString JSON string + * @return An instance of ListPrincipalsOutputBody + * @throws IOException if the JSON string is invalid with respect to ListPrincipalsOutputBody + */ + public static ListPrincipalsOutputBody fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ListPrincipalsOutputBody.class); + } + + /** + * Convert an instance of ListPrincipalsOutputBody to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/ai/reveng/model/ListSpendOutputBody.java b/src/main/java/ai/reveng/model/ListSpendOutputBody.java new file mode 100644 index 00000000..b7138829 --- /dev/null +++ b/src/main/java/ai/reveng/model/ListSpendOutputBody.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.SpendBody; +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; + +/** + * ListSpendOutputBody + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class ListSpendOutputBody { + public static final String SERIALIZED_NAME_HAS_NEXT_PAGE = "has_next_page"; + @SerializedName(SERIALIZED_NAME_HAS_NEXT_PAGE) + @javax.annotation.Nonnull + private Boolean hasNextPage; + + public static final String SERIALIZED_NAME_RESULTS = "results"; + @SerializedName(SERIALIZED_NAME_RESULTS) + @javax.annotation.Nonnull + private List results = new ArrayList<>(); + + public static final String SERIALIZED_NAME_TOTAL_COUNT = "total_count"; + @SerializedName(SERIALIZED_NAME_TOTAL_COUNT) + @javax.annotation.Nonnull + private Long totalCount; + + public ListSpendOutputBody() { + } + + public ListSpendOutputBody hasNextPage(@javax.annotation.Nonnull Boolean hasNextPage) { + this.hasNextPage = hasNextPage; + return this; + } + + /** + * Get hasNextPage + * @return hasNextPage + */ + @javax.annotation.Nonnull + public Boolean getHasNextPage() { + return hasNextPage; + } + + public void setHasNextPage(@javax.annotation.Nonnull Boolean hasNextPage) { + this.hasNextPage = hasNextPage; + } + + + public ListSpendOutputBody results(@javax.annotation.Nonnull List results) { + this.results = results; + return this; + } + + public ListSpendOutputBody addResultsItem(SpendBody resultsItem) { + if (this.results == null) { + this.results = new ArrayList<>(); + } + this.results.add(resultsItem); + return this; + } + + /** + * Get results + * @return results + */ + @javax.annotation.Nonnull + public List getResults() { + return results; + } + + public void setResults(@javax.annotation.Nonnull List results) { + this.results = results; + } + + + public ListSpendOutputBody totalCount(@javax.annotation.Nonnull Long totalCount) { + this.totalCount = totalCount; + return this; + } + + /** + * Spend records across all pages. + * @return totalCount + */ + @javax.annotation.Nonnull + public Long getTotalCount() { + return totalCount; + } + + public void setTotalCount(@javax.annotation.Nonnull Long totalCount) { + this.totalCount = totalCount; + } + + /** + * 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 ListSpendOutputBody instance itself + */ + public ListSpendOutputBody 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; + } + ListSpendOutputBody listSpendOutputBody = (ListSpendOutputBody) o; + return Objects.equals(this.hasNextPage, listSpendOutputBody.hasNextPage) && + Objects.equals(this.results, listSpendOutputBody.results) && + Objects.equals(this.totalCount, listSpendOutputBody.totalCount)&& + Objects.equals(this.additionalProperties, listSpendOutputBody.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(hasNextPage, results, totalCount, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ListSpendOutputBody {\n"); + sb.append(" hasNextPage: ").append(toIndentedString(hasNextPage)).append("\n"); + sb.append(" results: ").append(toIndentedString(results)).append("\n"); + sb.append(" totalCount: ").append(toIndentedString(totalCount)).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("has_next_page", "results", "total_count")); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(Arrays.asList("has_next_page", "results", "total_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 ListSpendOutputBody + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ListSpendOutputBody.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 ListSpendOutputBody is not found in the empty JSON string", ListSpendOutputBody.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : ListSpendOutputBody.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()) { + 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 (!ListSpendOutputBody.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ListSpendOutputBody' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ListSpendOutputBody.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, ListSpendOutputBody 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 ListSpendOutputBody read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + ListSpendOutputBody 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 ListSpendOutputBody given an JSON string + * + * @param jsonString JSON string + * @return An instance of ListSpendOutputBody + * @throws IOException if the JSON string is invalid with respect to ListSpendOutputBody + */ + public static ListSpendOutputBody fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ListSpendOutputBody.class); + } + + /** + * Convert an instance of ListSpendOutputBody to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/ai/reveng/model/ListTeamsOutputBody.java b/src/main/java/ai/reveng/model/ListTeamsOutputBody.java index 0a98a119..438dba6d 100644 --- a/src/main/java/ai/reveng/model/ListTeamsOutputBody.java +++ b/src/main/java/ai/reveng/model/ListTeamsOutputBody.java @@ -13,7 +13,7 @@ package ai.reveng.model; import java.util.Objects; -import ai.reveng.model.Team; +import ai.reveng.model.PublicTeamBody; import com.google.gson.TypeAdapter; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; @@ -52,62 +52,38 @@ */ @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class ListTeamsOutputBody { - public static final String SERIALIZED_NAME_TEAMS = "teams"; - @SerializedName(SERIALIZED_NAME_TEAMS) + public static final String SERIALIZED_NAME_RESULTS = "results"; + @SerializedName(SERIALIZED_NAME_RESULTS) @javax.annotation.Nullable - private List teams; - - public static final String SERIALIZED_NAME_TOTAL = "total"; - @SerializedName(SERIALIZED_NAME_TOTAL) - @javax.annotation.Nonnull - private Long total; + private List results; public ListTeamsOutputBody() { } - public ListTeamsOutputBody teams(@javax.annotation.Nullable List teams) { - this.teams = teams; + public ListTeamsOutputBody results(@javax.annotation.Nullable List results) { + this.results = results; return this; } - public ListTeamsOutputBody addTeamsItem(Team teamsItem) { - if (this.teams == null) { - this.teams = new ArrayList<>(); + public ListTeamsOutputBody addResultsItem(PublicTeamBody resultsItem) { + if (this.results == null) { + this.results = new ArrayList<>(); } - this.teams.add(teamsItem); + this.results.add(resultsItem); return this; } /** - * Get teams - * @return teams + * Up to 5 matching teams, ordered by name + * @return results */ @javax.annotation.Nullable - public List getTeams() { - return teams; - } - - public void setTeams(@javax.annotation.Nullable List teams) { - this.teams = teams; - } - - - public ListTeamsOutputBody total(@javax.annotation.Nonnull Long total) { - this.total = total; - return this; - } - - /** - * Get total - * @return total - */ - @javax.annotation.Nonnull - public Long getTotal() { - return total; + public List getResults() { + return results; } - public void setTotal(@javax.annotation.Nonnull Long total) { - this.total = total; + public void setResults(@javax.annotation.Nullable List results) { + this.results = results; } /** @@ -165,22 +141,20 @@ public boolean equals(Object o) { return false; } ListTeamsOutputBody listTeamsOutputBody = (ListTeamsOutputBody) o; - return Objects.equals(this.teams, listTeamsOutputBody.teams) && - Objects.equals(this.total, listTeamsOutputBody.total)&& + return Objects.equals(this.results, listTeamsOutputBody.results)&& Objects.equals(this.additionalProperties, listTeamsOutputBody.additionalProperties); } @Override public int hashCode() { - return Objects.hash(teams, total, additionalProperties); + return Objects.hash(results, additionalProperties); } @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class ListTeamsOutputBody {\n"); - sb.append(" teams: ").append(toIndentedString(teams)).append("\n"); - sb.append(" total: ").append(toIndentedString(total)).append("\n"); + sb.append(" results: ").append(toIndentedString(results)).append("\n"); sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); sb.append("}"); return sb.toString(); @@ -200,10 +174,10 @@ private String toIndentedString(Object o) { static { // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(Arrays.asList("teams", "total")); + openapiFields = new HashSet(Arrays.asList("results")); // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(Arrays.asList("teams", "total")); + openapiRequiredFields = new HashSet(Arrays.asList("results")); } /** @@ -227,10 +201,10 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti } JsonObject jsonObj = jsonElement.getAsJsonObject(); // ensure the required json array is present - if (jsonObj.get("teams") == null) { + 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("teams").isJsonArray() && !jsonObj.get("teams").isJsonNull()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `teams` to be an array in the JSON string but got `%s`", jsonObj.get("teams").toString())); + } 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())); } } diff --git a/src/main/java/ai/reveng/model/OrganisationIssuer.java b/src/main/java/ai/reveng/model/OrganisationIssuer.java index b531810f..343b170e 100644 --- a/src/main/java/ai/reveng/model/OrganisationIssuer.java +++ b/src/main/java/ai/reveng/model/OrganisationIssuer.java @@ -72,7 +72,7 @@ public class OrganisationIssuer { public static final String SERIALIZED_NAME_JWKS_URI = "jwks_uri"; @SerializedName(SERIALIZED_NAME_JWKS_URI) - @javax.annotation.Nullable + @javax.annotation.Nonnull private String jwksUri; public static final String SERIALIZED_NAME_ORGANISATION_ID = "organisation_id"; @@ -169,7 +169,7 @@ public void setIssuerUrl(@javax.annotation.Nullable String issuerUrl) { } - public OrganisationIssuer jwksUri(@javax.annotation.Nullable String jwksUri) { + public OrganisationIssuer jwksUri(@javax.annotation.Nonnull String jwksUri) { this.jwksUri = jwksUri; return this; } @@ -178,12 +178,12 @@ public OrganisationIssuer jwksUri(@javax.annotation.Nullable String jwksUri) { * JSON Web Key Set URI discovered from the issuer's OIDC configuration. Populated automatically during issuer registration. * @return jwksUri */ - @javax.annotation.Nullable + @javax.annotation.Nonnull public String getJwksUri() { return jwksUri; } - public void setJwksUri(@javax.annotation.Nullable String jwksUri) { + public void setJwksUri(@javax.annotation.Nonnull String jwksUri) { this.jwksUri = jwksUri; } @@ -349,7 +349,7 @@ private String toIndentedString(Object o) { openapiFields = new HashSet(Arrays.asList("client_id", "created_at", "enabled", "issuer_url", "jwks_uri", "organisation_id", "organisation_issuer_id", "updated_at")); // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(Arrays.asList("created_at", "enabled", "issuer_url", "organisation_id", "organisation_issuer_id", "updated_at")); + openapiRequiredFields = new HashSet(Arrays.asList("created_at", "enabled", "issuer_url", "jwks_uri", "organisation_id", "organisation_issuer_id", "updated_at")); } /** @@ -378,7 +378,7 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti if ((jsonObj.get("issuer_url") != null && !jsonObj.get("issuer_url").isJsonNull()) && !jsonObj.get("issuer_url").isJsonPrimitive()) { throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `issuer_url` to be a primitive type in the JSON string but got `%s`", jsonObj.get("issuer_url").toString())); } - if ((jsonObj.get("jwks_uri") != null && !jsonObj.get("jwks_uri").isJsonNull()) && !jsonObj.get("jwks_uri").isJsonPrimitive()) { + if (!jsonObj.get("jwks_uri").isJsonPrimitive()) { throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `jwks_uri` to be a primitive type in the JSON string but got `%s`", jsonObj.get("jwks_uri").toString())); } } diff --git a/src/main/java/ai/reveng/model/PatchInvestigationInputBody.java b/src/main/java/ai/reveng/model/PatchInvestigationInputBody.java new file mode 100644 index 00000000..cafa2a93 --- /dev/null +++ b/src/main/java/ai/reveng/model/PatchInvestigationInputBody.java @@ -0,0 +1,640 @@ +/* + * 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; + +/** + * PatchInvestigationInputBody + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class PatchInvestigationInputBody { + /** + * New case type. Omit to keep the existing one. + */ + @JsonAdapter(CaseTypeEnum.Adapter.class) + public enum CaseTypeEnum { + REVERSE_ENGINEERING("REVERSE_ENGINEERING"), + + MALWARE_ANALYSIS("MALWARE_ANALYSIS"), + + VULNERABILITY_DISCOVERY("VULNERABILITY_DISCOVERY"), + + UNKNOWN_DEFAULT_OPEN_API("unknown_default_open_api"); + + private String value; + + CaseTypeEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static CaseTypeEnum fromValue(String value) { + for (CaseTypeEnum b : CaseTypeEnum.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 CaseTypeEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public CaseTypeEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return CaseTypeEnum.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + CaseTypeEnum.fromValue(value); + } + } + + public static final String SERIALIZED_NAME_CASE_TYPE = "case_type"; + @SerializedName(SERIALIZED_NAME_CASE_TYPE) + @javax.annotation.Nullable + private CaseTypeEnum caseType; + + public static final String SERIALIZED_NAME_NAME = "name"; + @SerializedName(SERIALIZED_NAME_NAME) + @javax.annotation.Nullable + private String name; + + /** + * New scope. Omit to keep the existing one. + */ + @JsonAdapter(ScopeEnum.Adapter.class) + public enum ScopeEnum { + PRIVATE("PRIVATE"), + + TEAM("TEAM"), + + UNKNOWN_DEFAULT_OPEN_API("unknown_default_open_api"); + + private String value; + + ScopeEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static ScopeEnum fromValue(String value) { + for (ScopeEnum b : ScopeEnum.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 ScopeEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public ScopeEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return ScopeEnum.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + ScopeEnum.fromValue(value); + } + } + + public static final String SERIALIZED_NAME_SCOPE = "scope"; + @SerializedName(SERIALIZED_NAME_SCOPE) + @javax.annotation.Nullable + private ScopeEnum scope; + + /** + * New severity. Omit to keep the existing one. + */ + @JsonAdapter(SeverityEnum.Adapter.class) + public enum SeverityEnum { + CRITICAL("CRITICAL"), + + HIGH("HIGH"), + + MEDIUM("MEDIUM"), + + LOW("LOW"), + + UNKNOWN_DEFAULT_OPEN_API("unknown_default_open_api"); + + private String value; + + SeverityEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static SeverityEnum fromValue(String value) { + for (SeverityEnum b : SeverityEnum.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 SeverityEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public SeverityEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return SeverityEnum.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + SeverityEnum.fromValue(value); + } + } + + public static final String SERIALIZED_NAME_SEVERITY = "severity"; + @SerializedName(SERIALIZED_NAME_SEVERITY) + @javax.annotation.Nullable + private SeverityEnum severity; + + /** + * New status. Omit to keep the existing one. + */ + @JsonAdapter(StatusEnum.Adapter.class) + public enum StatusEnum { + OPEN("OPEN"), + + IN_PROGRESS("IN_PROGRESS"), + + ON_HOLD("ON_HOLD"), + + CLOSED("CLOSED"), + + 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.Nullable + private StatusEnum status; + + public PatchInvestigationInputBody() { + } + + public PatchInvestigationInputBody caseType(@javax.annotation.Nullable CaseTypeEnum caseType) { + this.caseType = caseType; + return this; + } + + /** + * New case type. Omit to keep the existing one. + * @return caseType + */ + @javax.annotation.Nullable + public CaseTypeEnum getCaseType() { + return caseType; + } + + public void setCaseType(@javax.annotation.Nullable CaseTypeEnum caseType) { + this.caseType = caseType; + } + + + public PatchInvestigationInputBody name(@javax.annotation.Nullable String name) { + this.name = name; + return this; + } + + /** + * New name. Omit to keep the existing one. + * @return name + */ + @javax.annotation.Nullable + public String getName() { + return name; + } + + public void setName(@javax.annotation.Nullable String name) { + this.name = name; + } + + + public PatchInvestigationInputBody scope(@javax.annotation.Nullable ScopeEnum scope) { + this.scope = scope; + return this; + } + + /** + * New scope. Omit to keep the existing one. + * @return scope + */ + @javax.annotation.Nullable + public ScopeEnum getScope() { + return scope; + } + + public void setScope(@javax.annotation.Nullable ScopeEnum scope) { + this.scope = scope; + } + + + public PatchInvestigationInputBody severity(@javax.annotation.Nullable SeverityEnum severity) { + this.severity = severity; + return this; + } + + /** + * New severity. Omit to keep the existing one. + * @return severity + */ + @javax.annotation.Nullable + public SeverityEnum getSeverity() { + return severity; + } + + public void setSeverity(@javax.annotation.Nullable SeverityEnum severity) { + this.severity = severity; + } + + + public PatchInvestigationInputBody status(@javax.annotation.Nullable StatusEnum status) { + this.status = status; + return this; + } + + /** + * New status. Omit to keep the existing one. + * @return status + */ + @javax.annotation.Nullable + public StatusEnum getStatus() { + return status; + } + + public void setStatus(@javax.annotation.Nullable 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 PatchInvestigationInputBody instance itself + */ + public PatchInvestigationInputBody 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; + } + PatchInvestigationInputBody patchInvestigationInputBody = (PatchInvestigationInputBody) o; + return Objects.equals(this.caseType, patchInvestigationInputBody.caseType) && + Objects.equals(this.name, patchInvestigationInputBody.name) && + Objects.equals(this.scope, patchInvestigationInputBody.scope) && + Objects.equals(this.severity, patchInvestigationInputBody.severity) && + Objects.equals(this.status, patchInvestigationInputBody.status)&& + Objects.equals(this.additionalProperties, patchInvestigationInputBody.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(caseType, name, scope, severity, status, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class PatchInvestigationInputBody {\n"); + sb.append(" caseType: ").append(toIndentedString(caseType)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" scope: ").append(toIndentedString(scope)).append("\n"); + sb.append(" severity: ").append(toIndentedString(severity)).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("case_type", "name", "scope", "severity", "status")); + + // 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 PatchInvestigationInputBody + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!PatchInvestigationInputBody.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 PatchInvestigationInputBody is not found in the empty JSON string", PatchInvestigationInputBody.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("case_type") != null && !jsonObj.get("case_type").isJsonNull()) && !jsonObj.get("case_type").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `case_type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("case_type").toString())); + } + // validate the optional field `case_type` + if (jsonObj.get("case_type") != null && !jsonObj.get("case_type").isJsonNull()) { + CaseTypeEnum.validateJsonElement(jsonObj.get("case_type")); + } + 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("scope") != null && !jsonObj.get("scope").isJsonNull()) && !jsonObj.get("scope").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `scope` to be a primitive type in the JSON string but got `%s`", jsonObj.get("scope").toString())); + } + // validate the optional field `scope` + if (jsonObj.get("scope") != null && !jsonObj.get("scope").isJsonNull()) { + ScopeEnum.validateJsonElement(jsonObj.get("scope")); + } + if ((jsonObj.get("severity") != null && !jsonObj.get("severity").isJsonNull()) && !jsonObj.get("severity").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `severity` to be a primitive type in the JSON string but got `%s`", jsonObj.get("severity").toString())); + } + // validate the optional field `severity` + if (jsonObj.get("severity") != null && !jsonObj.get("severity").isJsonNull()) { + SeverityEnum.validateJsonElement(jsonObj.get("severity")); + } + if ((jsonObj.get("status") != null && !jsonObj.get("status").isJsonNull()) && !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 optional field `status` + if (jsonObj.get("status") != null && !jsonObj.get("status").isJsonNull()) { + StatusEnum.validateJsonElement(jsonObj.get("status")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!PatchInvestigationInputBody.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'PatchInvestigationInputBody' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(PatchInvestigationInputBody.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, PatchInvestigationInputBody 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 PatchInvestigationInputBody read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + PatchInvestigationInputBody 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 PatchInvestigationInputBody given an JSON string + * + * @param jsonString JSON string + * @return An instance of PatchInvestigationInputBody + * @throws IOException if the JSON string is invalid with respect to PatchInvestigationInputBody + */ + public static PatchInvestigationInputBody fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, PatchInvestigationInputBody.class); + } + + /** + * Convert an instance of PatchInvestigationInputBody to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/ai/reveng/model/PrincipalBody.java b/src/main/java/ai/reveng/model/PrincipalBody.java new file mode 100644 index 00000000..20d1af84 --- /dev/null +++ b/src/main/java/ai/reveng/model/PrincipalBody.java @@ -0,0 +1,400 @@ +/* + * 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; + +/** + * PrincipalBody + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class PrincipalBody { + public static final String SERIALIZED_NAME_ID = "id"; + @SerializedName(SERIALIZED_NAME_ID) + @javax.annotation.Nonnull + private Long id; + + public static final String SERIALIZED_NAME_NAME = "name"; + @SerializedName(SERIALIZED_NAME_NAME) + @javax.annotation.Nonnull + private String name; + + /** + * Whether this result is a user or a team + */ + @JsonAdapter(TypeEnum.Adapter.class) + public enum TypeEnum { + USER("USER"), + + TEAM("TEAM"), + + UNKNOWN_DEFAULT_OPEN_API("unknown_default_open_api"); + + private String value; + + TypeEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static TypeEnum fromValue(String value) { + for (TypeEnum b : TypeEnum.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 TypeEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public TypeEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return TypeEnum.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + TypeEnum.fromValue(value); + } + } + + public static final String SERIALIZED_NAME_TYPE = "type"; + @SerializedName(SERIALIZED_NAME_TYPE) + @javax.annotation.Nonnull + private TypeEnum type; + + public PrincipalBody() { + } + + public PrincipalBody id(@javax.annotation.Nonnull Long id) { + this.id = id; + return this; + } + + /** + * The user or team's ID + * @return id + */ + @javax.annotation.Nonnull + public Long getId() { + return id; + } + + public void setId(@javax.annotation.Nonnull Long id) { + this.id = id; + } + + + public PrincipalBody name(@javax.annotation.Nonnull String name) { + this.name = name; + return this; + } + + /** + * The user's username or the team's name + * @return name + */ + @javax.annotation.Nonnull + public String getName() { + return name; + } + + public void setName(@javax.annotation.Nonnull String name) { + this.name = name; + } + + + public PrincipalBody type(@javax.annotation.Nonnull TypeEnum type) { + this.type = type; + return this; + } + + /** + * Whether this result is a user or a team + * @return type + */ + @javax.annotation.Nonnull + public TypeEnum getType() { + return type; + } + + public void setType(@javax.annotation.Nonnull TypeEnum type) { + this.type = type; + } + + /** + * 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 PrincipalBody instance itself + */ + public PrincipalBody 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; + } + PrincipalBody principalBody = (PrincipalBody) o; + return Objects.equals(this.id, principalBody.id) && + Objects.equals(this.name, principalBody.name) && + Objects.equals(this.type, principalBody.type)&& + Objects.equals(this.additionalProperties, principalBody.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(id, name, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class PrincipalBody {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).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("id", "name", "type")); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(Arrays.asList("id", "name", "type")); + } + + /** + * 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 PrincipalBody + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!PrincipalBody.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 PrincipalBody is not found in the empty JSON string", PrincipalBody.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : PrincipalBody.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("type").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("type").toString())); + } + // validate the required field `type` + TypeEnum.validateJsonElement(jsonObj.get("type")); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!PrincipalBody.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'PrincipalBody' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(PrincipalBody.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, PrincipalBody 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 PrincipalBody read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + PrincipalBody 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 PrincipalBody given an JSON string + * + * @param jsonString JSON string + * @return An instance of PrincipalBody + * @throws IOException if the JSON string is invalid with respect to PrincipalBody + */ + public static PrincipalBody fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, PrincipalBody.class); + } + + /** + * Convert an instance of PrincipalBody to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/ai/reveng/model/PublicTeamBody.java b/src/main/java/ai/reveng/model/PublicTeamBody.java new file mode 100644 index 00000000..726f0d18 --- /dev/null +++ b/src/main/java/ai/reveng/model/PublicTeamBody.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; + +/** + * PublicTeamBody + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class PublicTeamBody { + public static final String SERIALIZED_NAME_TEAM_ID = "team_id"; + @SerializedName(SERIALIZED_NAME_TEAM_ID) + @javax.annotation.Nonnull + private Long teamId; + + public static final String SERIALIZED_NAME_TEAM_NAME = "team_name"; + @SerializedName(SERIALIZED_NAME_TEAM_NAME) + @javax.annotation.Nonnull + private String teamName; + + public PublicTeamBody() { + } + + public PublicTeamBody teamId(@javax.annotation.Nonnull Long teamId) { + this.teamId = teamId; + return this; + } + + /** + * The team's ID + * @return teamId + */ + @javax.annotation.Nonnull + public Long getTeamId() { + return teamId; + } + + public void setTeamId(@javax.annotation.Nonnull Long teamId) { + this.teamId = teamId; + } + + + public PublicTeamBody teamName(@javax.annotation.Nonnull String teamName) { + this.teamName = teamName; + return this; + } + + /** + * The team's name + * @return teamName + */ + @javax.annotation.Nonnull + public String getTeamName() { + return teamName; + } + + public void setTeamName(@javax.annotation.Nonnull String teamName) { + this.teamName = teamName; + } + + /** + * 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 PublicTeamBody instance itself + */ + public PublicTeamBody 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; + } + PublicTeamBody publicTeamBody = (PublicTeamBody) o; + return Objects.equals(this.teamId, publicTeamBody.teamId) && + Objects.equals(this.teamName, publicTeamBody.teamName)&& + Objects.equals(this.additionalProperties, publicTeamBody.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(teamId, teamName, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class PublicTeamBody {\n"); + sb.append(" teamId: ").append(toIndentedString(teamId)).append("\n"); + sb.append(" teamName: ").append(toIndentedString(teamName)).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("team_id", "team_name")); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(Arrays.asList("team_id", "team_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 PublicTeamBody + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!PublicTeamBody.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 PublicTeamBody is not found in the empty JSON string", PublicTeamBody.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : PublicTeamBody.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("team_name").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `team_name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("team_name").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!PublicTeamBody.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'PublicTeamBody' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(PublicTeamBody.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, PublicTeamBody 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 PublicTeamBody read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + PublicTeamBody 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 PublicTeamBody given an JSON string + * + * @param jsonString JSON string + * @return An instance of PublicTeamBody + * @throws IOException if the JSON string is invalid with respect to PublicTeamBody + */ + public static PublicTeamBody fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, PublicTeamBody.class); + } + + /** + * Convert an instance of PublicTeamBody to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/ai/reveng/model/RequestedConfigBody.java b/src/main/java/ai/reveng/model/RequestedConfigBody.java index 10cda51e..a531c2d9 100644 --- a/src/main/java/ai/reveng/model/RequestedConfigBody.java +++ b/src/main/java/ai/reveng/model/RequestedConfigBody.java @@ -13,13 +13,16 @@ package ai.reveng.model; import java.util.Objects; +import ai.reveng.model.RequestedOperation; 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; @@ -59,6 +62,11 @@ public class RequestedConfigBody { @javax.annotation.Nonnull private Boolean functions; + public static final String SERIALIZED_NAME_OPERATIONS = "operations"; + @SerializedName(SERIALIZED_NAME_OPERATIONS) + @javax.annotation.Nonnull + private List operations = new ArrayList<>(); + public static final String SERIALIZED_NAME_SANDBOX = "sandbox"; @SerializedName(SERIALIZED_NAME_SANDBOX) @javax.annotation.Nonnull @@ -70,6 +78,7 @@ public class RequestedConfigBody { private Boolean scrape; public static final String SERIALIZED_NAME_TRIAGE = "triage"; + @Deprecated @SerializedName(SERIALIZED_NAME_TRIAGE) @javax.annotation.Nonnull private Boolean triage; @@ -83,7 +92,7 @@ public RequestedConfigBody capabilities(@javax.annotation.Nonnull Boolean capabi } /** - * Whether the capabilities agent was requested + * Whether static capability extraction was requested * @return capabilities */ @javax.annotation.Nonnull @@ -115,6 +124,33 @@ public void setFunctions(@javax.annotation.Nonnull Boolean functions) { } + public RequestedConfigBody operations(@javax.annotation.Nonnull List operations) { + this.operations = operations; + return this; + } + + public RequestedConfigBody addOperationsItem(RequestedOperation operationsItem) { + if (this.operations == null) { + this.operations = new ArrayList<>(); + } + this.operations.add(operationsItem); + return this; + } + + /** + * Operations requested to run automatically once the analysis completes + * @return operations + */ + @javax.annotation.Nonnull + public List getOperations() { + return operations; + } + + public void setOperations(@javax.annotation.Nonnull List operations) { + this.operations = operations; + } + + public RequestedConfigBody sandbox(@javax.annotation.Nonnull Boolean sandbox) { this.sandbox = sandbox; return this; @@ -153,6 +189,7 @@ public void setScrape(@javax.annotation.Nonnull Boolean scrape) { } + @Deprecated public RequestedConfigBody triage(@javax.annotation.Nonnull Boolean triage) { this.triage = triage; return this; @@ -161,12 +198,15 @@ public RequestedConfigBody triage(@javax.annotation.Nonnull Boolean triage) { /** * Whether the triage agent was requested * @return triage + * @deprecated */ + @Deprecated @javax.annotation.Nonnull public Boolean getTriage() { return triage; } + @Deprecated public void setTriage(@javax.annotation.Nonnull Boolean triage) { this.triage = triage; } @@ -228,6 +268,7 @@ public boolean equals(Object o) { RequestedConfigBody requestedConfigBody = (RequestedConfigBody) o; return Objects.equals(this.capabilities, requestedConfigBody.capabilities) && Objects.equals(this.functions, requestedConfigBody.functions) && + Objects.equals(this.operations, requestedConfigBody.operations) && Objects.equals(this.sandbox, requestedConfigBody.sandbox) && Objects.equals(this.scrape, requestedConfigBody.scrape) && Objects.equals(this.triage, requestedConfigBody.triage)&& @@ -236,7 +277,7 @@ public boolean equals(Object o) { @Override public int hashCode() { - return Objects.hash(capabilities, functions, sandbox, scrape, triage, additionalProperties); + return Objects.hash(capabilities, functions, operations, sandbox, scrape, triage, additionalProperties); } @Override @@ -245,6 +286,7 @@ public String toString() { sb.append("class RequestedConfigBody {\n"); sb.append(" capabilities: ").append(toIndentedString(capabilities)).append("\n"); sb.append(" functions: ").append(toIndentedString(functions)).append("\n"); + sb.append(" operations: ").append(toIndentedString(operations)).append("\n"); sb.append(" sandbox: ").append(toIndentedString(sandbox)).append("\n"); sb.append(" scrape: ").append(toIndentedString(scrape)).append("\n"); sb.append(" triage: ").append(toIndentedString(triage)).append("\n"); @@ -267,10 +309,10 @@ private String toIndentedString(Object o) { static { // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(Arrays.asList("capabilities", "functions", "sandbox", "scrape", "triage")); + openapiFields = new HashSet(Arrays.asList("capabilities", "functions", "operations", "sandbox", "scrape", "triage")); // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(Arrays.asList("capabilities", "functions", "sandbox", "scrape", "triage")); + openapiRequiredFields = new HashSet(Arrays.asList("capabilities", "functions", "operations", "sandbox", "scrape", "triage")); } /** @@ -293,6 +335,12 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti } } 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 { diff --git a/src/main/java/ai/reveng/model/RequestedOperation.java b/src/main/java/ai/reveng/model/RequestedOperation.java new file mode 100644 index 00000000..829493a1 --- /dev/null +++ b/src/main/java/ai/reveng/model/RequestedOperation.java @@ -0,0 +1,367 @@ +/* + * 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; + +/** + * RequestedOperation + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class RequestedOperation { + /** + * Gets or Sets operation + */ + @JsonAdapter(OperationEnum.Adapter.class) + public enum OperationEnum { + TRIAGE("triage"), + + CAPABILITIES("capabilities"), + + REPORT_ANALYSIS("report-analysis"), + + REMEDIATION("remediation"), + + PROTOCOLS("protocols"), + + SECRETS("secrets"), + + CRYPTOGRAPHY("cryptography"), + + RENAME_UNNAMED_FUNCTIONS("rename-unnamed-functions"), + + SECURITY_SCAN("security-scan"), + + CRYPTO_SCAN("crypto-scan"), + + NETWORKING_SCAN("networking-scan"), + + FILESYSTEM_SCAN("filesystem-scan"), + + EXECUTION_SCAN("execution-scan"), + + UNKNOWN_DEFAULT_OPEN_API("unknown_default_open_api"); + + private String value; + + OperationEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static OperationEnum fromValue(String value) { + for (OperationEnum b : OperationEnum.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 OperationEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public OperationEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return OperationEnum.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + OperationEnum.fromValue(value); + } + } + + public static final String SERIALIZED_NAME_OPERATION = "operation"; + @SerializedName(SERIALIZED_NAME_OPERATION) + @javax.annotation.Nonnull + private OperationEnum operation; + + public RequestedOperation() { + } + + public RequestedOperation operation(@javax.annotation.Nonnull OperationEnum operation) { + this.operation = operation; + return this; + } + + /** + * Get operation + * @return operation + */ + @javax.annotation.Nonnull + public OperationEnum getOperation() { + return operation; + } + + public void setOperation(@javax.annotation.Nonnull OperationEnum operation) { + this.operation = operation; + } + + /** + * 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 RequestedOperation instance itself + */ + public RequestedOperation 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; + } + RequestedOperation requestedOperation = (RequestedOperation) o; + return Objects.equals(this.operation, requestedOperation.operation)&& + Objects.equals(this.additionalProperties, requestedOperation.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(operation, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class RequestedOperation {\n"); + sb.append(" operation: ").append(toIndentedString(operation)).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")); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(Arrays.asList("operation")); + } + + /** + * 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 RequestedOperation + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!RequestedOperation.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 RequestedOperation is not found in the empty JSON string", RequestedOperation.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : RequestedOperation.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())); + } + // validate the required field `operation` + OperationEnum.validateJsonElement(jsonObj.get("operation")); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!RequestedOperation.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'RequestedOperation' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(RequestedOperation.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, RequestedOperation 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 RequestedOperation read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + RequestedOperation 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 RequestedOperation given an JSON string + * + * @param jsonString JSON string + * @return An instance of RequestedOperation + * @throws IOException if the JSON string is invalid with respect to RequestedOperation + */ + public static RequestedOperation fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, RequestedOperation.class); + } + + /** + * Convert an instance of RequestedOperation to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/ai/reveng/model/ResultBody.java b/src/main/java/ai/reveng/model/ResultBody.java index d4431d85..333ca9af 100644 --- a/src/main/java/ai/reveng/model/ResultBody.java +++ b/src/main/java/ai/reveng/model/ResultBody.java @@ -92,7 +92,7 @@ public ResultBody addBinariesItem(ExtractedBinary binariesItem) { } /** - * Child binaries recovered from the extraction. + * Every file recovered from the extraction, binary or not. * @return binaries */ @javax.annotation.Nullable @@ -157,7 +157,7 @@ public ResultBody skippedFiles(@javax.annotation.Nonnull Long skippedFiles) { } /** - * Files skipped because they were not recognised as binaries. + * Deprecated: always 0, every file is returned. * @return skippedFiles */ @javax.annotation.Nonnull diff --git a/src/main/java/ai/reveng/model/RollupBody.java b/src/main/java/ai/reveng/model/RollupBody.java new file mode 100644 index 00000000..131aa3cf --- /dev/null +++ b/src/main/java/ai/reveng/model/RollupBody.java @@ -0,0 +1,632 @@ +/* + * 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.AgentBody; +import ai.reveng.model.FindingCountsBody; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + +import 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; + +/** + * RollupBody + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class RollupBody { + public static final String SERIALIZED_NAME_ACTIVITY = "activity"; + @SerializedName(SERIALIZED_NAME_ACTIVITY) + @javax.annotation.Nonnull + private List activity = new ArrayList<>(); + + /** + * State of the agents as a whole: queued while every run is pending, running while any is pending or running, complete otherwise. Null when no agent has run. + */ + @JsonAdapter(AgentStatusEnum.Adapter.class) + public enum AgentStatusEnum { + QUEUED("QUEUED"), + + AGENTS_RUNNING("AGENTS_RUNNING"), + + COMPLETE("COMPLETE"), + + UNKNOWN_DEFAULT_OPEN_API("unknown_default_open_api"); + + private String value; + + AgentStatusEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static AgentStatusEnum fromValue(String value) { + for (AgentStatusEnum b : AgentStatusEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + return null; + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final AgentStatusEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public AgentStatusEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return AgentStatusEnum.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + AgentStatusEnum.fromValue(value); + } + } + + public static final String SERIALIZED_NAME_AGENT_STATUS = "agent_status"; + @SerializedName(SERIALIZED_NAME_AGENT_STATUS) + @javax.annotation.Nullable + private AgentStatusEnum agentStatus; + + public static final String SERIALIZED_NAME_AGENTS = "agents"; + @SerializedName(SERIALIZED_NAME_AGENTS) + @javax.annotation.Nonnull + private List agents = new ArrayList<>(); + + public static final String SERIALIZED_NAME_FILE_COUNT = "file_count"; + @SerializedName(SERIALIZED_NAME_FILE_COUNT) + @javax.annotation.Nonnull + private Long fileCount; + + public static final String SERIALIZED_NAME_FINDINGS = "findings"; + @SerializedName(SERIALIZED_NAME_FINDINGS) + @javax.annotation.Nonnull + private FindingCountsBody findings; + + /** + * The highest severity among the findings, independent of the investigation's own severity. Null when there are no findings. + */ + @JsonAdapter(FindingsSeverityEnum.Adapter.class) + public enum FindingsSeverityEnum { + CRITICAL("CRITICAL"), + + HIGH("HIGH"), + + MEDIUM("MEDIUM"), + + LOW("LOW"), + + UNKNOWN_DEFAULT_OPEN_API("unknown_default_open_api"); + + private String value; + + FindingsSeverityEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static FindingsSeverityEnum fromValue(String value) { + for (FindingsSeverityEnum b : FindingsSeverityEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + return null; + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final FindingsSeverityEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public FindingsSeverityEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return FindingsSeverityEnum.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + FindingsSeverityEnum.fromValue(value); + } + } + + public static final String SERIALIZED_NAME_FINDINGS_SEVERITY = "findings_severity"; + @SerializedName(SERIALIZED_NAME_FINDINGS_SEVERITY) + @javax.annotation.Nullable + private FindingsSeverityEnum findingsSeverity; + + public static final String SERIALIZED_NAME_FIRST_FILE_NAME = "first_file_name"; + @SerializedName(SERIALIZED_NAME_FIRST_FILE_NAME) + @javax.annotation.Nullable + private String firstFileName; + + public static final String SERIALIZED_NAME_LAST_ACTIVITY_AT = "last_activity_at"; + @SerializedName(SERIALIZED_NAME_LAST_ACTIVITY_AT) + @javax.annotation.Nonnull + private OffsetDateTime lastActivityAt; + + public RollupBody() { + } + + public RollupBody activity(@javax.annotation.Nonnull List activity) { + this.activity = activity; + return this; + } + + public RollupBody addActivityItem(Long activityItem) { + if (this.activity == null) { + this.activity = new ArrayList<>(); + } + this.activity.add(activityItem); + return this; + } + + /** + * Files added and findings recorded in each of the last 24 hours, oldest first. + * @return activity + */ + @javax.annotation.Nonnull + public List getActivity() { + return activity; + } + + public void setActivity(@javax.annotation.Nonnull List activity) { + this.activity = activity; + } + + + public RollupBody agentStatus(@javax.annotation.Nullable AgentStatusEnum agentStatus) { + this.agentStatus = agentStatus; + return this; + } + + /** + * State of the agents as a whole: queued while every run is pending, running while any is pending or running, complete otherwise. Null when no agent has run. + * @return agentStatus + */ + @javax.annotation.Nullable + public AgentStatusEnum getAgentStatus() { + return agentStatus; + } + + public void setAgentStatus(@javax.annotation.Nullable AgentStatusEnum agentStatus) { + this.agentStatus = agentStatus; + } + + + public RollupBody agents(@javax.annotation.Nonnull List agents) { + this.agents = agents; + return this; + } + + public RollupBody addAgentsItem(AgentBody agentsItem) { + if (this.agents == null) { + this.agents = new ArrayList<>(); + } + this.agents.add(agentsItem); + return this; + } + + /** + * Agents run on the investigation's files that you may see, each with its state across the files. Empty until an agent has run. + * @return agents + */ + @javax.annotation.Nonnull + public List getAgents() { + return agents; + } + + public void setAgents(@javax.annotation.Nonnull List agents) { + this.agents = agents; + } + + + public RollupBody fileCount(@javax.annotation.Nonnull Long fileCount) { + this.fileCount = fileCount; + return this; + } + + /** + * Files in the investigation that you are permitted to see. + * @return fileCount + */ + @javax.annotation.Nonnull + public Long getFileCount() { + return fileCount; + } + + public void setFileCount(@javax.annotation.Nonnull Long fileCount) { + this.fileCount = fileCount; + } + + + public RollupBody findings(@javax.annotation.Nonnull FindingCountsBody findings) { + this.findings = findings; + return this; + } + + /** + * Get findings + * @return findings + */ + @javax.annotation.Nonnull + public FindingCountsBody getFindings() { + return findings; + } + + public void setFindings(@javax.annotation.Nonnull FindingCountsBody findings) { + this.findings = findings; + } + + + public RollupBody findingsSeverity(@javax.annotation.Nullable FindingsSeverityEnum findingsSeverity) { + this.findingsSeverity = findingsSeverity; + return this; + } + + /** + * The highest severity among the findings, independent of the investigation's own severity. Null when there are no findings. + * @return findingsSeverity + */ + @javax.annotation.Nullable + public FindingsSeverityEnum getFindingsSeverity() { + return findingsSeverity; + } + + public void setFindingsSeverity(@javax.annotation.Nullable FindingsSeverityEnum findingsSeverity) { + this.findingsSeverity = findingsSeverity; + } + + + public RollupBody firstFileName(@javax.annotation.Nullable String firstFileName) { + this.firstFileName = firstFileName; + return this; + } + + /** + * Name of the first file added that you are permitted to see. Null when there is none. + * @return firstFileName + */ + @javax.annotation.Nullable + public String getFirstFileName() { + return firstFileName; + } + + public void setFirstFileName(@javax.annotation.Nullable String firstFileName) { + this.firstFileName = firstFileName; + } + + + public RollupBody lastActivityAt(@javax.annotation.Nonnull OffsetDateTime lastActivityAt) { + this.lastActivityAt = lastActivityAt; + return this; + } + + /** + * The latest of an edit to the investigation, a file being added and a finding being recorded. + * @return lastActivityAt + */ + @javax.annotation.Nonnull + public OffsetDateTime getLastActivityAt() { + return lastActivityAt; + } + + public void setLastActivityAt(@javax.annotation.Nonnull OffsetDateTime lastActivityAt) { + this.lastActivityAt = lastActivityAt; + } + + /** + * 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 RollupBody instance itself + */ + public RollupBody 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; + } + RollupBody rollupBody = (RollupBody) o; + return Objects.equals(this.activity, rollupBody.activity) && + Objects.equals(this.agentStatus, rollupBody.agentStatus) && + Objects.equals(this.agents, rollupBody.agents) && + Objects.equals(this.fileCount, rollupBody.fileCount) && + Objects.equals(this.findings, rollupBody.findings) && + Objects.equals(this.findingsSeverity, rollupBody.findingsSeverity) && + Objects.equals(this.firstFileName, rollupBody.firstFileName) && + Objects.equals(this.lastActivityAt, rollupBody.lastActivityAt)&& + Objects.equals(this.additionalProperties, rollupBody.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(activity, agentStatus, agents, fileCount, findings, findingsSeverity, firstFileName, lastActivityAt, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class RollupBody {\n"); + sb.append(" activity: ").append(toIndentedString(activity)).append("\n"); + sb.append(" agentStatus: ").append(toIndentedString(agentStatus)).append("\n"); + sb.append(" agents: ").append(toIndentedString(agents)).append("\n"); + sb.append(" fileCount: ").append(toIndentedString(fileCount)).append("\n"); + sb.append(" findings: ").append(toIndentedString(findings)).append("\n"); + sb.append(" findingsSeverity: ").append(toIndentedString(findingsSeverity)).append("\n"); + sb.append(" firstFileName: ").append(toIndentedString(firstFileName)).append("\n"); + sb.append(" lastActivityAt: ").append(toIndentedString(lastActivityAt)).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("activity", "agent_status", "agents", "file_count", "findings", "findings_severity", "first_file_name", "last_activity_at")); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(Arrays.asList("activity", "agent_status", "agents", "file_count", "findings", "findings_severity", "first_file_name", "last_activity_at")); + } + + /** + * 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 RollupBody + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!RollupBody.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 RollupBody is not found in the empty JSON string", RollupBody.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : RollupBody.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("activity") == null) { + throw new IllegalArgumentException("Expected the field `linkedContent` to be an array in the JSON string but got `null`"); + } else if (!jsonObj.get("activity").isJsonArray()) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `activity` to be an array in the JSON string but got `%s`", jsonObj.get("activity").toString())); + } + if ((jsonObj.get("agent_status") != null && !jsonObj.get("agent_status").isJsonNull()) && !jsonObj.get("agent_status").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `agent_status` to be a primitive type in the JSON string but got `%s`", jsonObj.get("agent_status").toString())); + } + if (jsonObj.get("agent_status") != null && !jsonObj.get("agent_status").isJsonNull()) { + // validate the required field `agent_status` + AgentStatusEnum.validateJsonElement(jsonObj.get("agent_status")); + } + // ensure the required json array is present + if (jsonObj.get("agents") == null) { + throw new IllegalArgumentException("Expected the field `linkedContent` to be an array in the JSON string but got `null`"); + } else if (!jsonObj.get("agents").isJsonArray()) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `agents` to be an array in the JSON string but got `%s`", jsonObj.get("agents").toString())); + } + if ((jsonObj.get("findings_severity") != null && !jsonObj.get("findings_severity").isJsonNull()) && !jsonObj.get("findings_severity").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `findings_severity` to be a primitive type in the JSON string but got `%s`", jsonObj.get("findings_severity").toString())); + } + if (jsonObj.get("findings_severity") != null && !jsonObj.get("findings_severity").isJsonNull()) { + // validate the required field `findings_severity` + FindingsSeverityEnum.validateJsonElement(jsonObj.get("findings_severity")); + } + if ((jsonObj.get("first_file_name") != null && !jsonObj.get("first_file_name").isJsonNull()) && !jsonObj.get("first_file_name").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `first_file_name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("first_file_name").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!RollupBody.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'RollupBody' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(RollupBody.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, RollupBody 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 RollupBody read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + RollupBody 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 RollupBody given an JSON string + * + * @param jsonString JSON string + * @return An instance of RollupBody + * @throws IOException if the JSON string is invalid with respect to RollupBody + */ + public static RollupBody fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, RollupBody.class); + } + + /** + * Convert an instance of RollupBody to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/ai/reveng/model/RunCancelledData.java b/src/main/java/ai/reveng/model/RunCancelledData.java new file mode 100644 index 00000000..ae6e34fb --- /dev/null +++ b/src/main/java/ai/reveng/model/RunCancelledData.java @@ -0,0 +1,282 @@ +/* + * 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; + +/** + * RunCancelledData + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class RunCancelledData { + public static final String SERIALIZED_NAME_CONVERSATION_UUID = "conversation_uuid"; + @SerializedName(SERIALIZED_NAME_CONVERSATION_UUID) + @javax.annotation.Nullable + private String conversationUuid; + + public RunCancelledData() { + } + + public RunCancelledData conversationUuid(@javax.annotation.Nullable String conversationUuid) { + this.conversationUuid = conversationUuid; + return this; + } + + /** + * Get conversationUuid + * @return conversationUuid + */ + @javax.annotation.Nullable + public String getConversationUuid() { + return conversationUuid; + } + + public void setConversationUuid(@javax.annotation.Nullable String conversationUuid) { + this.conversationUuid = conversationUuid; + } + + /** + * 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 RunCancelledData instance itself + */ + public RunCancelledData 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; + } + RunCancelledData runCancelledData = (RunCancelledData) o; + return Objects.equals(this.conversationUuid, runCancelledData.conversationUuid)&& + Objects.equals(this.additionalProperties, runCancelledData.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(conversationUuid, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class RunCancelledData {\n"); + sb.append(" conversationUuid: ").append(toIndentedString(conversationUuid)).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("conversation_uuid")); + + // 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 RunCancelledData + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!RunCancelledData.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 RunCancelledData is not found in the empty JSON string", RunCancelledData.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("conversation_uuid") != null && !jsonObj.get("conversation_uuid").isJsonNull()) && !jsonObj.get("conversation_uuid").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `conversation_uuid` to be a primitive type in the JSON string but got `%s`", jsonObj.get("conversation_uuid").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!RunCancelledData.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'RunCancelledData' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(RunCancelledData.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, RunCancelledData 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 RunCancelledData read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + RunCancelledData 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 RunCancelledData given an JSON string + * + * @param jsonString JSON string + * @return An instance of RunCancelledData + * @throws IOException if the JSON string is invalid with respect to RunCancelledData + */ + public static RunCancelledData fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, RunCancelledData.class); + } + + /** + * Convert an instance of RunCancelledData to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/ai/reveng/model/RunErrorData.java b/src/main/java/ai/reveng/model/RunErrorData.java new file mode 100644 index 00000000..83844d12 --- /dev/null +++ b/src/main/java/ai/reveng/model/RunErrorData.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 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; + +/** + * RunErrorData + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class RunErrorData { + public static final String SERIALIZED_NAME_CONVERSATION_UUID = "conversation_uuid"; + @SerializedName(SERIALIZED_NAME_CONVERSATION_UUID) + @javax.annotation.Nullable + private String conversationUuid; + + public static final String SERIALIZED_NAME_DEFINITION_NAME = "definition_name"; + @SerializedName(SERIALIZED_NAME_DEFINITION_NAME) + @javax.annotation.Nullable + private String definitionName; + + public static final String SERIALIZED_NAME_ERROR = "error"; + @SerializedName(SERIALIZED_NAME_ERROR) + @javax.annotation.Nullable + private String error; + + public RunErrorData() { + } + + public RunErrorData conversationUuid(@javax.annotation.Nullable String conversationUuid) { + this.conversationUuid = conversationUuid; + return this; + } + + /** + * Get conversationUuid + * @return conversationUuid + */ + @javax.annotation.Nullable + public String getConversationUuid() { + return conversationUuid; + } + + public void setConversationUuid(@javax.annotation.Nullable String conversationUuid) { + this.conversationUuid = conversationUuid; + } + + + public RunErrorData definitionName(@javax.annotation.Nullable String definitionName) { + this.definitionName = definitionName; + return this; + } + + /** + * Get definitionName + * @return definitionName + */ + @javax.annotation.Nullable + public String getDefinitionName() { + return definitionName; + } + + public void setDefinitionName(@javax.annotation.Nullable String definitionName) { + this.definitionName = definitionName; + } + + + public RunErrorData error(@javax.annotation.Nullable String error) { + this.error = error; + return this; + } + + /** + * Get error + * @return error + */ + @javax.annotation.Nullable + public String getError() { + return error; + } + + public void setError(@javax.annotation.Nullable String error) { + this.error = error; + } + + /** + * 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 RunErrorData instance itself + */ + public RunErrorData 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; + } + RunErrorData runErrorData = (RunErrorData) o; + return Objects.equals(this.conversationUuid, runErrorData.conversationUuid) && + Objects.equals(this.definitionName, runErrorData.definitionName) && + Objects.equals(this.error, runErrorData.error)&& + Objects.equals(this.additionalProperties, runErrorData.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(conversationUuid, definitionName, error, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class RunErrorData {\n"); + sb.append(" conversationUuid: ").append(toIndentedString(conversationUuid)).append("\n"); + sb.append(" definitionName: ").append(toIndentedString(definitionName)).append("\n"); + sb.append(" error: ").append(toIndentedString(error)).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("conversation_uuid", "definition_name", "error")); + + // 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 RunErrorData + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!RunErrorData.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 RunErrorData is not found in the empty JSON string", RunErrorData.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("conversation_uuid") != null && !jsonObj.get("conversation_uuid").isJsonNull()) && !jsonObj.get("conversation_uuid").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `conversation_uuid` to be a primitive type in the JSON string but got `%s`", jsonObj.get("conversation_uuid").toString())); + } + if ((jsonObj.get("definition_name") != null && !jsonObj.get("definition_name").isJsonNull()) && !jsonObj.get("definition_name").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `definition_name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("definition_name").toString())); + } + if ((jsonObj.get("error") != null && !jsonObj.get("error").isJsonNull()) && !jsonObj.get("error").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `error` to be a primitive type in the JSON string but got `%s`", jsonObj.get("error").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!RunErrorData.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'RunErrorData' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(RunErrorData.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, RunErrorData 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 RunErrorData read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + RunErrorData 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 RunErrorData given an JSON string + * + * @param jsonString JSON string + * @return An instance of RunErrorData + * @throws IOException if the JSON string is invalid with respect to RunErrorData + */ + public static RunErrorData fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, RunErrorData.class); + } + + /** + * Convert an instance of RunErrorData to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/ai/reveng/model/RunFinishedData.java b/src/main/java/ai/reveng/model/RunFinishedData.java new file mode 100644 index 00000000..38c0b7c5 --- /dev/null +++ b/src/main/java/ai/reveng/model/RunFinishedData.java @@ -0,0 +1,389 @@ +/* + * 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; + +/** + * RunFinishedData + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class RunFinishedData { + public static final String SERIALIZED_NAME_CONVERSATION_UUID = "conversation_uuid"; + @SerializedName(SERIALIZED_NAME_CONVERSATION_UUID) + @javax.annotation.Nullable + private String conversationUuid; + + public static final String SERIALIZED_NAME_DEFINITION_NAME = "definition_name"; + @SerializedName(SERIALIZED_NAME_DEFINITION_NAME) + @javax.annotation.Nullable + private String definitionName; + + public static final String SERIALIZED_NAME_INPUT_TOKENS = "input_tokens"; + @SerializedName(SERIALIZED_NAME_INPUT_TOKENS) + @javax.annotation.Nullable + private Integer inputTokens; + + public static final String SERIALIZED_NAME_OUTPUT_TOKENS = "output_tokens"; + @SerializedName(SERIALIZED_NAME_OUTPUT_TOKENS) + @javax.annotation.Nullable + private Integer outputTokens; + + public static final String SERIALIZED_NAME_TOTAL_TOKENS = "total_tokens"; + @SerializedName(SERIALIZED_NAME_TOTAL_TOKENS) + @javax.annotation.Nullable + private Integer totalTokens; + + public RunFinishedData() { + } + + public RunFinishedData conversationUuid(@javax.annotation.Nullable String conversationUuid) { + this.conversationUuid = conversationUuid; + return this; + } + + /** + * Get conversationUuid + * @return conversationUuid + */ + @javax.annotation.Nullable + public String getConversationUuid() { + return conversationUuid; + } + + public void setConversationUuid(@javax.annotation.Nullable String conversationUuid) { + this.conversationUuid = conversationUuid; + } + + + public RunFinishedData definitionName(@javax.annotation.Nullable String definitionName) { + this.definitionName = definitionName; + return this; + } + + /** + * Get definitionName + * @return definitionName + */ + @javax.annotation.Nullable + public String getDefinitionName() { + return definitionName; + } + + public void setDefinitionName(@javax.annotation.Nullable String definitionName) { + this.definitionName = definitionName; + } + + + public RunFinishedData inputTokens(@javax.annotation.Nullable Integer inputTokens) { + this.inputTokens = inputTokens; + return this; + } + + /** + * Get inputTokens + * @return inputTokens + */ + @javax.annotation.Nullable + public Integer getInputTokens() { + return inputTokens; + } + + public void setInputTokens(@javax.annotation.Nullable Integer inputTokens) { + this.inputTokens = inputTokens; + } + + + public RunFinishedData outputTokens(@javax.annotation.Nullable Integer outputTokens) { + this.outputTokens = outputTokens; + return this; + } + + /** + * Get outputTokens + * @return outputTokens + */ + @javax.annotation.Nullable + public Integer getOutputTokens() { + return outputTokens; + } + + public void setOutputTokens(@javax.annotation.Nullable Integer outputTokens) { + this.outputTokens = outputTokens; + } + + + public RunFinishedData totalTokens(@javax.annotation.Nullable Integer totalTokens) { + this.totalTokens = totalTokens; + return this; + } + + /** + * Get totalTokens + * @return totalTokens + */ + @javax.annotation.Nullable + public Integer getTotalTokens() { + return totalTokens; + } + + public void setTotalTokens(@javax.annotation.Nullable Integer totalTokens) { + this.totalTokens = totalTokens; + } + + /** + * 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 RunFinishedData instance itself + */ + public RunFinishedData 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; + } + RunFinishedData runFinishedData = (RunFinishedData) o; + return Objects.equals(this.conversationUuid, runFinishedData.conversationUuid) && + Objects.equals(this.definitionName, runFinishedData.definitionName) && + Objects.equals(this.inputTokens, runFinishedData.inputTokens) && + Objects.equals(this.outputTokens, runFinishedData.outputTokens) && + Objects.equals(this.totalTokens, runFinishedData.totalTokens)&& + Objects.equals(this.additionalProperties, runFinishedData.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(conversationUuid, definitionName, inputTokens, outputTokens, totalTokens, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class RunFinishedData {\n"); + sb.append(" conversationUuid: ").append(toIndentedString(conversationUuid)).append("\n"); + sb.append(" definitionName: ").append(toIndentedString(definitionName)).append("\n"); + sb.append(" inputTokens: ").append(toIndentedString(inputTokens)).append("\n"); + sb.append(" outputTokens: ").append(toIndentedString(outputTokens)).append("\n"); + sb.append(" totalTokens: ").append(toIndentedString(totalTokens)).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("conversation_uuid", "definition_name", "input_tokens", "output_tokens", "total_tokens")); + + // 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 RunFinishedData + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!RunFinishedData.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 RunFinishedData is not found in the empty JSON string", RunFinishedData.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("conversation_uuid") != null && !jsonObj.get("conversation_uuid").isJsonNull()) && !jsonObj.get("conversation_uuid").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `conversation_uuid` to be a primitive type in the JSON string but got `%s`", jsonObj.get("conversation_uuid").toString())); + } + if ((jsonObj.get("definition_name") != null && !jsonObj.get("definition_name").isJsonNull()) && !jsonObj.get("definition_name").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `definition_name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("definition_name").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!RunFinishedData.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'RunFinishedData' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(RunFinishedData.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, RunFinishedData 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 RunFinishedData read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + RunFinishedData 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 RunFinishedData given an JSON string + * + * @param jsonString JSON string + * @return An instance of RunFinishedData + * @throws IOException if the JSON string is invalid with respect to RunFinishedData + */ + public static RunFinishedData fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, RunFinishedData.class); + } + + /** + * Convert an instance of RunFinishedData to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/ai/reveng/model/TaskResponse.java b/src/main/java/ai/reveng/model/RunStartedData.java similarity index 68% rename from src/main/java/ai/reveng/model/TaskResponse.java rename to src/main/java/ai/reveng/model/RunStartedData.java index 932ce9a2..348de5a1 100644 --- a/src/main/java/ai/reveng/model/TaskResponse.java +++ b/src/main/java/ai/reveng/model/RunStartedData.java @@ -13,7 +13,6 @@ package ai.reveng.model; import java.util.Objects; -import ai.reveng.model.TaskStatus; import com.google.gson.TypeAdapter; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; @@ -21,7 +20,6 @@ import com.google.gson.stream.JsonWriter; import java.io.IOException; import java.util.Arrays; -import org.openapitools.jackson.nullable.JsonNullable; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -47,58 +45,58 @@ import ai.reveng.invoker.JSON; /** - * TaskResponse + * RunStartedData */ @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class TaskResponse { - public static final String SERIALIZED_NAME_STATUS = "status"; - @SerializedName(SERIALIZED_NAME_STATUS) +public class RunStartedData { + public static final String SERIALIZED_NAME_CONVERSATION_UUID = "conversation_uuid"; + @SerializedName(SERIALIZED_NAME_CONVERSATION_UUID) @javax.annotation.Nullable - private TaskStatus status = TaskStatus.UNINITIALISED; + private String conversationUuid; - public static final String SERIALIZED_NAME_ERROR_MESSAGE = "error_message"; - @SerializedName(SERIALIZED_NAME_ERROR_MESSAGE) + public static final String SERIALIZED_NAME_DEFINITION_NAME = "definition_name"; + @SerializedName(SERIALIZED_NAME_DEFINITION_NAME) @javax.annotation.Nullable - private String errorMessage; + private String definitionName; - public TaskResponse() { + public RunStartedData() { } - public TaskResponse status(@javax.annotation.Nullable TaskStatus status) { - this.status = status; + public RunStartedData conversationUuid(@javax.annotation.Nullable String conversationUuid) { + this.conversationUuid = conversationUuid; return this; } /** - * Get status - * @return status + * Get conversationUuid + * @return conversationUuid */ @javax.annotation.Nullable - public TaskStatus getStatus() { - return status; + public String getConversationUuid() { + return conversationUuid; } - public void setStatus(@javax.annotation.Nullable TaskStatus status) { - this.status = status; + public void setConversationUuid(@javax.annotation.Nullable String conversationUuid) { + this.conversationUuid = conversationUuid; } - public TaskResponse errorMessage(@javax.annotation.Nullable String errorMessage) { - this.errorMessage = errorMessage; + public RunStartedData definitionName(@javax.annotation.Nullable String definitionName) { + this.definitionName = definitionName; return this; } /** - * Get errorMessage - * @return errorMessage + * Get definitionName + * @return definitionName */ @javax.annotation.Nullable - public String getErrorMessage() { - return errorMessage; + public String getDefinitionName() { + return definitionName; } - public void setErrorMessage(@javax.annotation.Nullable String errorMessage) { - this.errorMessage = errorMessage; + public void setDefinitionName(@javax.annotation.Nullable String definitionName) { + this.definitionName = definitionName; } /** @@ -114,9 +112,9 @@ public void setErrorMessage(@javax.annotation.Nullable String errorMessage) { * * @param key name of the property * @param value value of the property - * @return the TaskResponse instance itself + * @return the RunStartedData instance itself */ - public TaskResponse putAdditionalProperty(String key, Object value) { + public RunStartedData putAdditionalProperty(String key, Object value) { if (this.additionalProperties == null) { this.additionalProperties = new HashMap(); } @@ -155,34 +153,23 @@ public boolean equals(Object o) { if (o == null || getClass() != o.getClass()) { return false; } - TaskResponse taskResponse = (TaskResponse) o; - return Objects.equals(this.status, taskResponse.status) && - Objects.equals(this.errorMessage, taskResponse.errorMessage)&& - Objects.equals(this.additionalProperties, taskResponse.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())); + RunStartedData runStartedData = (RunStartedData) o; + return Objects.equals(this.conversationUuid, runStartedData.conversationUuid) && + Objects.equals(this.definitionName, runStartedData.definitionName)&& + Objects.equals(this.additionalProperties, runStartedData.additionalProperties); } @Override public int hashCode() { - return Objects.hash(status, errorMessage, additionalProperties); - } - - private static int hashCodeNullable(JsonNullable a) { - if (a == null) { - return 1; - } - return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + return Objects.hash(conversationUuid, definitionName, additionalProperties); } @Override public String toString() { StringBuilder sb = new StringBuilder(); - sb.append("class TaskResponse {\n"); - sb.append(" status: ").append(toIndentedString(status)).append("\n"); - sb.append(" errorMessage: ").append(toIndentedString(errorMessage)).append("\n"); + sb.append("class RunStartedData {\n"); + sb.append(" conversationUuid: ").append(toIndentedString(conversationUuid)).append("\n"); + sb.append(" definitionName: ").append(toIndentedString(definitionName)).append("\n"); sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); sb.append("}"); return sb.toString(); @@ -202,7 +189,7 @@ private String toIndentedString(Object o) { static { // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(Arrays.asList("status", "error_message")); + openapiFields = new HashSet(Arrays.asList("conversation_uuid", "definition_name")); // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(0); @@ -212,21 +199,20 @@ private String toIndentedString(Object o) { * Validates the JSON Element and throws an exception if issues found * * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to TaskResponse + * @throws IOException if the JSON Element is invalid with respect to RunStartedData */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (jsonElement == null) { - if (!TaskResponse.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 TaskResponse is not found in the empty JSON string", TaskResponse.openapiRequiredFields.toString())); + if (!RunStartedData.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 RunStartedData is not found in the empty JSON string", RunStartedData.openapiRequiredFields.toString())); } } JsonObject jsonObj = jsonElement.getAsJsonObject(); - // validate the optional field `status` - if (jsonObj.get("status") != null && !jsonObj.get("status").isJsonNull()) { - TaskStatus.validateJsonElement(jsonObj.get("status")); + if ((jsonObj.get("conversation_uuid") != null && !jsonObj.get("conversation_uuid").isJsonNull()) && !jsonObj.get("conversation_uuid").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `conversation_uuid` to be a primitive type in the JSON string but got `%s`", jsonObj.get("conversation_uuid").toString())); } - if ((jsonObj.get("error_message") != null && !jsonObj.get("error_message").isJsonNull()) && !jsonObj.get("error_message").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `error_message` to be a primitive type in the JSON string but got `%s`", jsonObj.get("error_message").toString())); + if ((jsonObj.get("definition_name") != null && !jsonObj.get("definition_name").isJsonNull()) && !jsonObj.get("definition_name").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `definition_name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("definition_name").toString())); } } @@ -234,16 +220,16 @@ public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @SuppressWarnings("unchecked") @Override public TypeAdapter create(Gson gson, TypeToken type) { - if (!TaskResponse.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'TaskResponse' and its subtypes + if (!RunStartedData.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'RunStartedData' and its subtypes } final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(TaskResponse.class)); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(RunStartedData.class)); - return (TypeAdapter) new TypeAdapter() { + return (TypeAdapter) new TypeAdapter() { @Override - public void write(JsonWriter out, TaskResponse value) throws IOException { + public void write(JsonWriter out, RunStartedData value) throws IOException { JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); obj.remove("additionalProperties"); // serialize additional properties @@ -271,12 +257,12 @@ else if (entry.getValue() instanceof Character) } @Override - public TaskResponse read(JsonReader in) throws IOException { + public RunStartedData read(JsonReader in) throws IOException { JsonElement jsonElement = elementAdapter.read(in); validateJsonElement(jsonElement); JsonObject jsonObj = jsonElement.getAsJsonObject(); // store additional fields in the deserialized instance - TaskResponse instance = thisAdapter.fromJsonTree(jsonObj); + RunStartedData instance = thisAdapter.fromJsonTree(jsonObj); for (Map.Entry entry : jsonObj.entrySet()) { if (!openapiFields.contains(entry.getKey())) { if (entry.getValue().isJsonPrimitive()) { // primitive type @@ -303,18 +289,18 @@ else if (entry.getValue().getAsJsonPrimitive().isBoolean()) } /** - * Create an instance of TaskResponse given an JSON string + * Create an instance of RunStartedData given an JSON string * * @param jsonString JSON string - * @return An instance of TaskResponse - * @throws IOException if the JSON string is invalid with respect to TaskResponse + * @return An instance of RunStartedData + * @throws IOException if the JSON string is invalid with respect to RunStartedData */ - public static TaskResponse fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, TaskResponse.class); + public static RunStartedData fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, RunStartedData.class); } /** - * Convert an instance of TaskResponse to an JSON string + * Convert an instance of RunStartedData to an JSON string * * @return JSON string */ diff --git a/src/main/java/ai/reveng/model/ServerSentEventsInner.java b/src/main/java/ai/reveng/model/ServerSentEventsInner.java index e5a4c4d4..870321db 100644 --- a/src/main/java/ai/reveng/model/ServerSentEventsInner.java +++ b/src/main/java/ai/reveng/model/ServerSentEventsInner.java @@ -13,6 +13,7 @@ package ai.reveng.model; import java.util.Objects; +import ai.reveng.model.EventAGENTRUNUPDATE; import ai.reveng.model.EventCONTEXTCOMPACTED; import ai.reveng.model.EventRUNCANCELLED; import ai.reveng.model.EventRUNERROR; @@ -86,6 +87,7 @@ public TypeAdapter create(Gson gson, TypeToken type) { return null; // this class only serializes 'ServerSentEventsInner' and its subtypes } final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter adapterEventAGENTRUNUPDATE = gson.getDelegateAdapter(this, TypeToken.get(EventAGENTRUNUPDATE.class)); final TypeAdapter adapterEventCONTEXTCOMPACTED = gson.getDelegateAdapter(this, TypeToken.get(EventCONTEXTCOMPACTED.class)); final TypeAdapter adapterEventRUNCANCELLED = gson.getDelegateAdapter(this, TypeToken.get(EventRUNCANCELLED.class)); final TypeAdapter adapterEventRUNERROR = gson.getDelegateAdapter(this, TypeToken.get(EventRUNERROR.class)); @@ -112,6 +114,12 @@ public void write(JsonWriter out, ServerSentEventsInner value) throws IOExceptio return; } + // check if the actual instance is of the type `EventAGENTRUNUPDATE` + if (value.getActualInstance() instanceof EventAGENTRUNUPDATE) { + JsonElement element = adapterEventAGENTRUNUPDATE.toJsonTree((EventAGENTRUNUPDATE)value.getActualInstance()); + elementAdapter.write(out, element); + return; + } // check if the actual instance is of the type `EventCONTEXTCOMPACTED` if (value.getActualInstance() instanceof EventCONTEXTCOMPACTED) { JsonElement element = adapterEventCONTEXTCOMPACTED.toJsonTree((EventCONTEXTCOMPACTED)value.getActualInstance()); @@ -214,7 +222,7 @@ public void write(JsonWriter out, ServerSentEventsInner value) throws IOExceptio elementAdapter.write(out, element); return; } - throw new IOException("Failed to serialize as the type doesn't match oneOf schemas: EventCONTEXTCOMPACTED, EventRUNCANCELLED, EventRUNERROR, EventRUNFINISHED, EventRUNSTARTED, EventSTEPFINISHED, EventSTEPSTARTED, EventTEXTMESSAGECONTENT, EventTEXTMESSAGEEND, EventTEXTMESSAGESTART, EventTITLEUPDATED, EventTOOLCALLARGSDELTA, EventTOOLCALLEND, EventTOOLCALLPROGRESS, EventTOOLCALLRESULT, EventTOOLCALLSTART, EventTOOLCONFIRMATIONREQUIRED"); + throw new IOException("Failed to serialize as the type doesn't match oneOf schemas: EventAGENTRUNUPDATE, EventCONTEXTCOMPACTED, EventRUNCANCELLED, EventRUNERROR, EventRUNFINISHED, EventRUNSTARTED, EventSTEPFINISHED, EventSTEPSTARTED, EventTEXTMESSAGECONTENT, EventTEXTMESSAGEEND, EventTEXTMESSAGESTART, EventTITLEUPDATED, EventTOOLCALLARGSDELTA, EventTOOLCALLEND, EventTOOLCALLPROGRESS, EventTOOLCALLRESULT, EventTOOLCALLSTART, EventTOOLCONFIRMATIONREQUIRED"); } @Override @@ -226,6 +234,18 @@ public ServerSentEventsInner read(JsonReader in) throws IOException { ArrayList errorMessages = new ArrayList<>(); TypeAdapter actualAdapter = elementAdapter; + // deserialize EventAGENTRUNUPDATE + try { + // validate the JSON object to see if any exception is thrown + EventAGENTRUNUPDATE.validateJsonElement(jsonElement); + actualAdapter = adapterEventAGENTRUNUPDATE; + match++; + log.log(Level.FINER, "Input data matches schema 'EventAGENTRUNUPDATE'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format(java.util.Locale.ROOT, "Deserialization for EventAGENTRUNUPDATE failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'EventAGENTRUNUPDATE'", e); + } // deserialize EventCONTEXTCOMPACTED try { // validate the JSON object to see if any exception is thrown @@ -456,6 +476,7 @@ public ServerSentEventsInner(Object o) { } static { + schemas.put("EventAGENTRUNUPDATE", EventAGENTRUNUPDATE.class); schemas.put("EventCONTEXTCOMPACTED", EventCONTEXTCOMPACTED.class); schemas.put("EventRUNCANCELLED", EventRUNCANCELLED.class); schemas.put("EventRUNERROR", EventRUNERROR.class); @@ -483,12 +504,17 @@ public Map> getSchemas() { /** * Set the instance that matches the oneOf child schema, check * the instance parameter is valid against the oneOf child schemas: - * EventCONTEXTCOMPACTED, EventRUNCANCELLED, EventRUNERROR, EventRUNFINISHED, EventRUNSTARTED, EventSTEPFINISHED, EventSTEPSTARTED, EventTEXTMESSAGECONTENT, EventTEXTMESSAGEEND, EventTEXTMESSAGESTART, EventTITLEUPDATED, EventTOOLCALLARGSDELTA, EventTOOLCALLEND, EventTOOLCALLPROGRESS, EventTOOLCALLRESULT, EventTOOLCALLSTART, EventTOOLCONFIRMATIONREQUIRED + * EventAGENTRUNUPDATE, EventCONTEXTCOMPACTED, EventRUNCANCELLED, EventRUNERROR, EventRUNFINISHED, EventRUNSTARTED, EventSTEPFINISHED, EventSTEPSTARTED, EventTEXTMESSAGECONTENT, EventTEXTMESSAGEEND, EventTEXTMESSAGESTART, EventTITLEUPDATED, EventTOOLCALLARGSDELTA, EventTOOLCALLEND, EventTOOLCALLPROGRESS, EventTOOLCALLRESULT, EventTOOLCALLSTART, EventTOOLCONFIRMATIONREQUIRED * * It could be an instance of the 'oneOf' schemas. */ @Override public void setActualInstance(Object instance) { + if (instance instanceof EventAGENTRUNUPDATE) { + super.setActualInstance(instance); + return; + } + if (instance instanceof EventCONTEXTCOMPACTED) { super.setActualInstance(instance); return; @@ -574,14 +600,14 @@ public void setActualInstance(Object instance) { return; } - throw new RuntimeException("Invalid instance type. Must be EventCONTEXTCOMPACTED, EventRUNCANCELLED, EventRUNERROR, EventRUNFINISHED, EventRUNSTARTED, EventSTEPFINISHED, EventSTEPSTARTED, EventTEXTMESSAGECONTENT, EventTEXTMESSAGEEND, EventTEXTMESSAGESTART, EventTITLEUPDATED, EventTOOLCALLARGSDELTA, EventTOOLCALLEND, EventTOOLCALLPROGRESS, EventTOOLCALLRESULT, EventTOOLCALLSTART, EventTOOLCONFIRMATIONREQUIRED"); + throw new RuntimeException("Invalid instance type. Must be EventAGENTRUNUPDATE, EventCONTEXTCOMPACTED, EventRUNCANCELLED, EventRUNERROR, EventRUNFINISHED, EventRUNSTARTED, EventSTEPFINISHED, EventSTEPSTARTED, EventTEXTMESSAGECONTENT, EventTEXTMESSAGEEND, EventTEXTMESSAGESTART, EventTITLEUPDATED, EventTOOLCALLARGSDELTA, EventTOOLCALLEND, EventTOOLCALLPROGRESS, EventTOOLCALLRESULT, EventTOOLCALLSTART, EventTOOLCONFIRMATIONREQUIRED"); } /** * Get the actual instance, which can be the following: - * EventCONTEXTCOMPACTED, EventRUNCANCELLED, EventRUNERROR, EventRUNFINISHED, EventRUNSTARTED, EventSTEPFINISHED, EventSTEPSTARTED, EventTEXTMESSAGECONTENT, EventTEXTMESSAGEEND, EventTEXTMESSAGESTART, EventTITLEUPDATED, EventTOOLCALLARGSDELTA, EventTOOLCALLEND, EventTOOLCALLPROGRESS, EventTOOLCALLRESULT, EventTOOLCALLSTART, EventTOOLCONFIRMATIONREQUIRED + * EventAGENTRUNUPDATE, EventCONTEXTCOMPACTED, EventRUNCANCELLED, EventRUNERROR, EventRUNFINISHED, EventRUNSTARTED, EventSTEPFINISHED, EventSTEPSTARTED, EventTEXTMESSAGECONTENT, EventTEXTMESSAGEEND, EventTEXTMESSAGESTART, EventTITLEUPDATED, EventTOOLCALLARGSDELTA, EventTOOLCALLEND, EventTOOLCALLPROGRESS, EventTOOLCALLRESULT, EventTOOLCALLSTART, EventTOOLCONFIRMATIONREQUIRED * - * @return The actual instance (EventCONTEXTCOMPACTED, EventRUNCANCELLED, EventRUNERROR, EventRUNFINISHED, EventRUNSTARTED, EventSTEPFINISHED, EventSTEPSTARTED, EventTEXTMESSAGECONTENT, EventTEXTMESSAGEEND, EventTEXTMESSAGESTART, EventTITLEUPDATED, EventTOOLCALLARGSDELTA, EventTOOLCALLEND, EventTOOLCALLPROGRESS, EventTOOLCALLRESULT, EventTOOLCALLSTART, EventTOOLCONFIRMATIONREQUIRED) + * @return The actual instance (EventAGENTRUNUPDATE, EventCONTEXTCOMPACTED, EventRUNCANCELLED, EventRUNERROR, EventRUNFINISHED, EventRUNSTARTED, EventSTEPFINISHED, EventSTEPSTARTED, EventTEXTMESSAGECONTENT, EventTEXTMESSAGEEND, EventTEXTMESSAGESTART, EventTITLEUPDATED, EventTOOLCALLARGSDELTA, EventTOOLCALLEND, EventTOOLCALLPROGRESS, EventTOOLCALLRESULT, EventTOOLCALLSTART, EventTOOLCONFIRMATIONREQUIRED) */ @SuppressWarnings("unchecked") @Override @@ -589,6 +615,18 @@ public Object getActualInstance() { return super.getActualInstance(); } + /** + * Get the actual instance of `EventAGENTRUNUPDATE`. If the actual instance is not `EventAGENTRUNUPDATE`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `EventAGENTRUNUPDATE` + * @throws ClassCastException if the instance is not `EventAGENTRUNUPDATE` + */ + @SuppressWarnings("unchecked") + public EventAGENTRUNUPDATE getEventAGENTRUNUPDATE() throws ClassCastException { + return (EventAGENTRUNUPDATE)super.getActualInstance(); + } + /** * Get the actual instance of `EventCONTEXTCOMPACTED`. If the actual instance is not `EventCONTEXTCOMPACTED`, * the ClassCastException will be thrown. @@ -803,6 +841,14 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti // validate oneOf schemas one by one int validCount = 0; ArrayList errorMessages = new ArrayList<>(); + // validate the json string with EventAGENTRUNUPDATE + try { + EventAGENTRUNUPDATE.validateJsonElement(jsonElement); + validCount++; + } catch (Exception e) { + errorMessages.add(String.format(java.util.Locale.ROOT, "Deserialization for EventAGENTRUNUPDATE failed with `%s`.", e.getMessage())); + // continue to the next one + } // validate the json string with EventCONTEXTCOMPACTED try { EventCONTEXTCOMPACTED.validateJsonElement(jsonElement); @@ -940,7 +986,7 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti // continue to the next one } if (validCount != 1) { - throw new IOException(String.format(java.util.Locale.ROOT, "The JSON string is invalid for ServerSentEventsInner with oneOf schemas: EventCONTEXTCOMPACTED, EventRUNCANCELLED, EventRUNERROR, EventRUNFINISHED, EventRUNSTARTED, EventSTEPFINISHED, EventSTEPSTARTED, EventTEXTMESSAGECONTENT, EventTEXTMESSAGEEND, EventTEXTMESSAGESTART, EventTITLEUPDATED, EventTOOLCALLARGSDELTA, EventTOOLCALLEND, EventTOOLCALLPROGRESS, EventTOOLCALLRESULT, EventTOOLCALLSTART, EventTOOLCONFIRMATIONREQUIRED. %d class(es) match the result, expected 1. Detailed failure message for oneOf schemas: %s. JSON: %s", validCount, errorMessages, jsonElement.toString())); + throw new IOException(String.format(java.util.Locale.ROOT, "The JSON string is invalid for ServerSentEventsInner with oneOf schemas: EventAGENTRUNUPDATE, EventCONTEXTCOMPACTED, EventRUNCANCELLED, EventRUNERROR, EventRUNFINISHED, EventRUNSTARTED, EventSTEPFINISHED, EventSTEPSTARTED, EventTEXTMESSAGECONTENT, EventTEXTMESSAGEEND, EventTEXTMESSAGESTART, EventTITLEUPDATED, EventTOOLCALLARGSDELTA, EventTOOLCALLEND, EventTOOLCALLPROGRESS, EventTOOLCALLRESULT, EventTOOLCALLSTART, EventTOOLCONFIRMATIONREQUIRED. %d class(es) match the result, expected 1. Detailed failure message for oneOf schemas: %s. JSON: %s", validCount, errorMessages, jsonElement.toString())); } } diff --git a/src/main/java/ai/reveng/model/SetBudgetInputBody.java b/src/main/java/ai/reveng/model/SetBudgetInputBody.java new file mode 100644 index 00000000..fb8d0355 --- /dev/null +++ b/src/main/java/ai/reveng/model/SetBudgetInputBody.java @@ -0,0 +1,288 @@ +/* + * 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; + +/** + * SetBudgetInputBody + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class SetBudgetInputBody { + public static final String SERIALIZED_NAME_CREDIT_BUDGET = "credit_budget"; + @SerializedName(SERIALIZED_NAME_CREDIT_BUDGET) + @javax.annotation.Nullable + private Long creditBudget; + + public SetBudgetInputBody() { + } + + public SetBudgetInputBody creditBudget(@javax.annotation.Nullable Long creditBudget) { + this.creditBudget = creditBudget; + return this; + } + + /** + * The most credits the investigation may spend, up to 1,000,000,000, or null to remove the limit. + * minimum: 0 + * maximum: 1000000000 + * @return creditBudget + */ + @javax.annotation.Nullable + public Long getCreditBudget() { + return creditBudget; + } + + public void setCreditBudget(@javax.annotation.Nullable Long creditBudget) { + this.creditBudget = creditBudget; + } + + /** + * 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 SetBudgetInputBody instance itself + */ + public SetBudgetInputBody 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; + } + SetBudgetInputBody setBudgetInputBody = (SetBudgetInputBody) o; + return Objects.equals(this.creditBudget, setBudgetInputBody.creditBudget)&& + Objects.equals(this.additionalProperties, setBudgetInputBody.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(creditBudget, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SetBudgetInputBody {\n"); + sb.append(" creditBudget: ").append(toIndentedString(creditBudget)).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("credit_budget")); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(Arrays.asList("credit_budget")); + } + + /** + * 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 SetBudgetInputBody + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!SetBudgetInputBody.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 SetBudgetInputBody is not found in the empty JSON string", SetBudgetInputBody.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : SetBudgetInputBody.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 (!SetBudgetInputBody.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'SetBudgetInputBody' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(SetBudgetInputBody.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, SetBudgetInputBody 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 SetBudgetInputBody read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + SetBudgetInputBody 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 SetBudgetInputBody given an JSON string + * + * @param jsonString JSON string + * @return An instance of SetBudgetInputBody + * @throws IOException if the JSON string is invalid with respect to SetBudgetInputBody + */ + public static SetBudgetInputBody fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, SetBudgetInputBody.class); + } + + /** + * Convert an instance of SetBudgetInputBody to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/ai/reveng/model/SpendBody.java b/src/main/java/ai/reveng/model/SpendBody.java new file mode 100644 index 00000000..3887f2a1 --- /dev/null +++ b/src/main/java/ai/reveng/model/SpendBody.java @@ -0,0 +1,537 @@ +/* + * 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.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; + +/** + * SpendBody + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class SpendBody { + public static final String SERIALIZED_NAME_CONVERSATION_UUID = "conversation_uuid"; + @SerializedName(SERIALIZED_NAME_CONVERSATION_UUID) + @javax.annotation.Nullable + private String conversationUuid; + + public static final String SERIALIZED_NAME_CREATED_AT = "created_at"; + @SerializedName(SERIALIZED_NAME_CREATED_AT) + @javax.annotation.Nonnull + private OffsetDateTime createdAt; + + public static final String SERIALIZED_NAME_CREDITS = "credits"; + @SerializedName(SERIALIZED_NAME_CREDITS) + @javax.annotation.Nonnull + private Double credits; + + /** + * What the credits were spent on: a conversation turn or an agent run started from the investigation. + */ + @JsonAdapter(SourceEnum.Adapter.class) + public enum SourceEnum { + CHAT("CHAT"), + + AGENT_RUN("AGENT_RUN"), + + UNKNOWN_DEFAULT_OPEN_API("unknown_default_open_api"); + + private String value; + + SourceEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static SourceEnum fromValue(String value) { + for (SourceEnum b : SourceEnum.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 SourceEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public SourceEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return SourceEnum.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + SourceEnum.fromValue(value); + } + } + + public static final String SERIALIZED_NAME_SOURCE = "source"; + @SerializedName(SERIALIZED_NAME_SOURCE) + @javax.annotation.Nonnull + private SourceEnum source; + + public static final String SERIALIZED_NAME_SPEND_ID = "spend_id"; + @SerializedName(SERIALIZED_NAME_SPEND_ID) + @javax.annotation.Nonnull + private Long spendId; + + public static final String SERIALIZED_NAME_TASK_ID = "task_id"; + @SerializedName(SERIALIZED_NAME_TASK_ID) + @javax.annotation.Nullable + private String taskId; + + 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 SpendBody() { + } + + public SpendBody conversationUuid(@javax.annotation.Nullable String conversationUuid) { + this.conversationUuid = conversationUuid; + return this; + } + + /** + * The conversation of a CHAT spend. + * @return conversationUuid + */ + @javax.annotation.Nullable + public String getConversationUuid() { + return conversationUuid; + } + + public void setConversationUuid(@javax.annotation.Nullable String conversationUuid) { + this.conversationUuid = conversationUuid; + } + + + public SpendBody createdAt(@javax.annotation.Nonnull OffsetDateTime createdAt) { + this.createdAt = createdAt; + return this; + } + + /** + * Get createdAt + * @return createdAt + */ + @javax.annotation.Nonnull + public OffsetDateTime getCreatedAt() { + return createdAt; + } + + public void setCreatedAt(@javax.annotation.Nonnull OffsetDateTime createdAt) { + this.createdAt = createdAt; + } + + + public SpendBody credits(@javax.annotation.Nonnull Double credits) { + this.credits = credits; + return this; + } + + /** + * Get credits + * @return credits + */ + @javax.annotation.Nonnull + public Double getCredits() { + return credits; + } + + public void setCredits(@javax.annotation.Nonnull Double credits) { + this.credits = credits; + } + + + public SpendBody source(@javax.annotation.Nonnull SourceEnum source) { + this.source = source; + return this; + } + + /** + * What the credits were spent on: a conversation turn or an agent run started from the investigation. + * @return source + */ + @javax.annotation.Nonnull + public SourceEnum getSource() { + return source; + } + + public void setSource(@javax.annotation.Nonnull SourceEnum source) { + this.source = source; + } + + + public SpendBody spendId(@javax.annotation.Nonnull Long spendId) { + this.spendId = spendId; + return this; + } + + /** + * Get spendId + * @return spendId + */ + @javax.annotation.Nonnull + public Long getSpendId() { + return spendId; + } + + public void setSpendId(@javax.annotation.Nonnull Long spendId) { + this.spendId = spendId; + } + + + public SpendBody taskId(@javax.annotation.Nullable String taskId) { + this.taskId = taskId; + return this; + } + + /** + * The agent run of an AGENT_RUN spend. + * @return taskId + */ + @javax.annotation.Nullable + public String getTaskId() { + return taskId; + } + + public void setTaskId(@javax.annotation.Nullable String taskId) { + this.taskId = taskId; + } + + + public SpendBody userId(@javax.annotation.Nonnull Long userId) { + this.userId = userId; + return this; + } + + /** + * Who was charged. Zero when that user has been deleted. + * @return userId + */ + @javax.annotation.Nonnull + public Long getUserId() { + return userId; + } + + public void setUserId(@javax.annotation.Nonnull Long userId) { + this.userId = userId; + } + + + public SpendBody username(@javax.annotation.Nonnull String username) { + this.username = username; + return this; + } + + /** + * Get username + * @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 SpendBody instance itself + */ + public SpendBody 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; + } + SpendBody spendBody = (SpendBody) o; + return Objects.equals(this.conversationUuid, spendBody.conversationUuid) && + Objects.equals(this.createdAt, spendBody.createdAt) && + Objects.equals(this.credits, spendBody.credits) && + Objects.equals(this.source, spendBody.source) && + Objects.equals(this.spendId, spendBody.spendId) && + Objects.equals(this.taskId, spendBody.taskId) && + Objects.equals(this.userId, spendBody.userId) && + Objects.equals(this.username, spendBody.username)&& + Objects.equals(this.additionalProperties, spendBody.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(conversationUuid, createdAt, credits, source, spendId, taskId, userId, username, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SpendBody {\n"); + sb.append(" conversationUuid: ").append(toIndentedString(conversationUuid)).append("\n"); + sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); + sb.append(" credits: ").append(toIndentedString(credits)).append("\n"); + sb.append(" source: ").append(toIndentedString(source)).append("\n"); + sb.append(" spendId: ").append(toIndentedString(spendId)).append("\n"); + sb.append(" taskId: ").append(toIndentedString(taskId)).append("\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("conversation_uuid", "created_at", "credits", "source", "spend_id", "task_id", "user_id", "username")); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(Arrays.asList("conversation_uuid", "created_at", "credits", "source", "spend_id", "task_id", "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 SpendBody + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!SpendBody.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 SpendBody is not found in the empty JSON string", SpendBody.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : SpendBody.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("conversation_uuid") != null && !jsonObj.get("conversation_uuid").isJsonNull()) && !jsonObj.get("conversation_uuid").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `conversation_uuid` to be a primitive type in the JSON string but got `%s`", jsonObj.get("conversation_uuid").toString())); + } + if (!jsonObj.get("source").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `source` to be a primitive type in the JSON string but got `%s`", jsonObj.get("source").toString())); + } + // validate the required field `source` + SourceEnum.validateJsonElement(jsonObj.get("source")); + if ((jsonObj.get("task_id") != null && !jsonObj.get("task_id").isJsonNull()) && !jsonObj.get("task_id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `task_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("task_id").toString())); + } + 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 (!SpendBody.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'SpendBody' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(SpendBody.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, SpendBody 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 SpendBody read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + SpendBody 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 SpendBody given an JSON string + * + * @param jsonString JSON string + * @return An instance of SpendBody + * @throws IOException if the JSON string is invalid with respect to SpendBody + */ + public static SpendBody fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, SpendBody.class); + } + + /** + * Convert an instance of SpendBody to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/ai/reveng/model/SseEventAgentRunUpdateData.java b/src/main/java/ai/reveng/model/SseEventAgentRunUpdateData.java new file mode 100644 index 00000000..7218a0d5 --- /dev/null +++ b/src/main/java/ai/reveng/model/SseEventAgentRunUpdateData.java @@ -0,0 +1,371 @@ +/* + * RevEng.AI API + * RevEng.AI is an AI-powered binary analysis platform for reverse engineering and malware analysis. It provides similarity search across executable binaries and functions, AI-driven decompilation, dynamic execution analysis, firmware unpacking, and integration with external threat intelligence sources like VirusTotal. + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package ai.reveng.model; + +import java.util.Objects; +import ai.reveng.model.AgentRunUpdateData; +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; + +/** + * The event envelope, sent as the JSON of the SSE data line. Its type names the event, and its data is that event's payload. + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class SseEventAgentRunUpdateData { + public static final String SERIALIZED_NAME_DATA = "data"; + @SerializedName(SERIALIZED_NAME_DATA) + @javax.annotation.Nonnull + private AgentRunUpdateData data; + + public static final String SERIALIZED_NAME_EVENT_ID = "event_id"; + @SerializedName(SERIALIZED_NAME_EVENT_ID) + @javax.annotation.Nonnull + private Long eventId; + + public static final String SERIALIZED_NAME_SOURCE_RUN_ID = "source_run_id"; + @SerializedName(SERIALIZED_NAME_SOURCE_RUN_ID) + @javax.annotation.Nullable + private String sourceRunId; + + public static final String SERIALIZED_NAME_TYPE = "type"; + @SerializedName(SERIALIZED_NAME_TYPE) + @javax.annotation.Nonnull + private String type; + + public SseEventAgentRunUpdateData() { + } + + public SseEventAgentRunUpdateData data(@javax.annotation.Nonnull AgentRunUpdateData data) { + this.data = data; + return this; + } + + /** + * The payload of the event named in type. + * @return data + */ + @javax.annotation.Nonnull + public AgentRunUpdateData getData() { + return data; + } + + public void setData(@javax.annotation.Nonnull AgentRunUpdateData data) { + this.data = data; + } + + + public SseEventAgentRunUpdateData eventId(@javax.annotation.Nonnull Long eventId) { + this.eventId = eventId; + return this; + } + + /** + * The stored event's ID, the same as the SSE id field. Pass the last one received as last_event_id to resume after a reconnection. + * @return eventId + */ + @javax.annotation.Nonnull + public Long getEventId() { + return eventId; + } + + public void setEventId(@javax.annotation.Nonnull Long eventId) { + this.eventId = eventId; + } + + + public SseEventAgentRunUpdateData sourceRunId(@javax.annotation.Nullable String sourceRunId) { + this.sourceRunId = sourceRunId; + return this; + } + + /** + * Get sourceRunId + * @return sourceRunId + */ + @javax.annotation.Nullable + public String getSourceRunId() { + return sourceRunId; + } + + public void setSourceRunId(@javax.annotation.Nullable String sourceRunId) { + this.sourceRunId = sourceRunId; + } + + + public SseEventAgentRunUpdateData type(@javax.annotation.Nonnull String type) { + this.type = type; + return this; + } + + /** + * The event name, the same as the SSE event field. + * @return type + */ + @javax.annotation.Nonnull + public String getType() { + return type; + } + + public void setType(@javax.annotation.Nonnull String type) { + this.type = type; + } + + /** + * 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 SseEventAgentRunUpdateData instance itself + */ + public SseEventAgentRunUpdateData 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; + } + SseEventAgentRunUpdateData sseEventAgentRunUpdateData = (SseEventAgentRunUpdateData) o; + return Objects.equals(this.data, sseEventAgentRunUpdateData.data) && + Objects.equals(this.eventId, sseEventAgentRunUpdateData.eventId) && + Objects.equals(this.sourceRunId, sseEventAgentRunUpdateData.sourceRunId) && + Objects.equals(this.type, sseEventAgentRunUpdateData.type)&& + Objects.equals(this.additionalProperties, sseEventAgentRunUpdateData.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, eventId, sourceRunId, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SseEventAgentRunUpdateData {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" eventId: ").append(toIndentedString(eventId)).append("\n"); + sb.append(" sourceRunId: ").append(toIndentedString(sourceRunId)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).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", "event_id", "source_run_id", "type")); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(Arrays.asList("data", "event_id", "type")); + } + + /** + * 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 SseEventAgentRunUpdateData + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!SseEventAgentRunUpdateData.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 SseEventAgentRunUpdateData is not found in the empty JSON string", SseEventAgentRunUpdateData.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : SseEventAgentRunUpdateData.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("source_run_id") != null && !jsonObj.get("source_run_id").isJsonNull()) && !jsonObj.get("source_run_id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `source_run_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("source_run_id").toString())); + } + if (!jsonObj.get("type").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("type").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!SseEventAgentRunUpdateData.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'SseEventAgentRunUpdateData' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(SseEventAgentRunUpdateData.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, SseEventAgentRunUpdateData 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 SseEventAgentRunUpdateData read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + SseEventAgentRunUpdateData 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 SseEventAgentRunUpdateData given an JSON string + * + * @param jsonString JSON string + * @return An instance of SseEventAgentRunUpdateData + * @throws IOException if the JSON string is invalid with respect to SseEventAgentRunUpdateData + */ + public static SseEventAgentRunUpdateData fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, SseEventAgentRunUpdateData.class); + } + + /** + * Convert an instance of SseEventAgentRunUpdateData to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/ai/reveng/model/SseEventContextCompactedData.java b/src/main/java/ai/reveng/model/SseEventContextCompactedData.java index f62d7e51..54185e18 100644 --- a/src/main/java/ai/reveng/model/SseEventContextCompactedData.java +++ b/src/main/java/ai/reveng/model/SseEventContextCompactedData.java @@ -13,6 +13,7 @@ package ai.reveng.model; import java.util.Objects; +import ai.reveng.model.ContextCompactedData; import com.google.gson.TypeAdapter; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; @@ -45,14 +46,14 @@ import ai.reveng.invoker.JSON; /** - * SseEventContextCompactedData + * The event envelope, sent as the JSON of the SSE data line. Its type names the event, and its data is that event's payload. */ @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class SseEventContextCompactedData { public static final String SERIALIZED_NAME_DATA = "data"; @SerializedName(SERIALIZED_NAME_DATA) - @javax.annotation.Nullable - private Object data = null; + @javax.annotation.Nonnull + private ContextCompactedData data; public static final String SERIALIZED_NAME_EVENT_ID = "event_id"; @SerializedName(SERIALIZED_NAME_EVENT_ID) @@ -72,21 +73,21 @@ public class SseEventContextCompactedData { public SseEventContextCompactedData() { } - public SseEventContextCompactedData data(@javax.annotation.Nullable Object data) { + public SseEventContextCompactedData data(@javax.annotation.Nonnull ContextCompactedData data) { this.data = data; return this; } /** - * Get data + * The payload of the event named in type. * @return data */ - @javax.annotation.Nullable - public Object getData() { + @javax.annotation.Nonnull + public ContextCompactedData getData() { return data; } - public void setData(@javax.annotation.Nullable Object data) { + public void setData(@javax.annotation.Nonnull ContextCompactedData data) { this.data = data; } @@ -97,7 +98,7 @@ public SseEventContextCompactedData eventId(@javax.annotation.Nonnull Long event } /** - * Get eventId + * The stored event's ID, the same as the SSE id field. Pass the last one received as last_event_id to resume after a reconnection. * @return eventId */ @javax.annotation.Nonnull @@ -135,7 +136,7 @@ public SseEventContextCompactedData type(@javax.annotation.Nonnull String type) } /** - * Get type + * The event name, the same as the SSE event field. * @return type */ @javax.annotation.Nonnull diff --git a/src/main/java/ai/reveng/model/SseEventRunCancelledData.java b/src/main/java/ai/reveng/model/SseEventRunCancelledData.java index 13fdbc15..6d6ad813 100644 --- a/src/main/java/ai/reveng/model/SseEventRunCancelledData.java +++ b/src/main/java/ai/reveng/model/SseEventRunCancelledData.java @@ -13,6 +13,7 @@ package ai.reveng.model; import java.util.Objects; +import ai.reveng.model.RunCancelledData; import com.google.gson.TypeAdapter; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; @@ -45,14 +46,14 @@ import ai.reveng.invoker.JSON; /** - * SseEventRunCancelledData + * The event envelope, sent as the JSON of the SSE data line. Its type names the event, and its data is that event's payload. */ @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class SseEventRunCancelledData { public static final String SERIALIZED_NAME_DATA = "data"; @SerializedName(SERIALIZED_NAME_DATA) - @javax.annotation.Nullable - private Object data = null; + @javax.annotation.Nonnull + private RunCancelledData data; public static final String SERIALIZED_NAME_EVENT_ID = "event_id"; @SerializedName(SERIALIZED_NAME_EVENT_ID) @@ -72,21 +73,21 @@ public class SseEventRunCancelledData { public SseEventRunCancelledData() { } - public SseEventRunCancelledData data(@javax.annotation.Nullable Object data) { + public SseEventRunCancelledData data(@javax.annotation.Nonnull RunCancelledData data) { this.data = data; return this; } /** - * Get data + * The payload of the event named in type. * @return data */ - @javax.annotation.Nullable - public Object getData() { + @javax.annotation.Nonnull + public RunCancelledData getData() { return data; } - public void setData(@javax.annotation.Nullable Object data) { + public void setData(@javax.annotation.Nonnull RunCancelledData data) { this.data = data; } @@ -97,7 +98,7 @@ public SseEventRunCancelledData eventId(@javax.annotation.Nonnull Long eventId) } /** - * Get eventId + * The stored event's ID, the same as the SSE id field. Pass the last one received as last_event_id to resume after a reconnection. * @return eventId */ @javax.annotation.Nonnull @@ -135,7 +136,7 @@ public SseEventRunCancelledData type(@javax.annotation.Nonnull String type) { } /** - * Get type + * The event name, the same as the SSE event field. * @return type */ @javax.annotation.Nonnull diff --git a/src/main/java/ai/reveng/model/SseEventRunErrorData.java b/src/main/java/ai/reveng/model/SseEventRunErrorData.java index dd875d4c..6da9f8f6 100644 --- a/src/main/java/ai/reveng/model/SseEventRunErrorData.java +++ b/src/main/java/ai/reveng/model/SseEventRunErrorData.java @@ -13,6 +13,7 @@ package ai.reveng.model; import java.util.Objects; +import ai.reveng.model.RunErrorData; import com.google.gson.TypeAdapter; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; @@ -45,14 +46,14 @@ import ai.reveng.invoker.JSON; /** - * SseEventRunErrorData + * The event envelope, sent as the JSON of the SSE data line. Its type names the event, and its data is that event's payload. */ @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class SseEventRunErrorData { public static final String SERIALIZED_NAME_DATA = "data"; @SerializedName(SERIALIZED_NAME_DATA) - @javax.annotation.Nullable - private Object data = null; + @javax.annotation.Nonnull + private RunErrorData data; public static final String SERIALIZED_NAME_EVENT_ID = "event_id"; @SerializedName(SERIALIZED_NAME_EVENT_ID) @@ -72,21 +73,21 @@ public class SseEventRunErrorData { public SseEventRunErrorData() { } - public SseEventRunErrorData data(@javax.annotation.Nullable Object data) { + public SseEventRunErrorData data(@javax.annotation.Nonnull RunErrorData data) { this.data = data; return this; } /** - * Get data + * The payload of the event named in type. * @return data */ - @javax.annotation.Nullable - public Object getData() { + @javax.annotation.Nonnull + public RunErrorData getData() { return data; } - public void setData(@javax.annotation.Nullable Object data) { + public void setData(@javax.annotation.Nonnull RunErrorData data) { this.data = data; } @@ -97,7 +98,7 @@ public SseEventRunErrorData eventId(@javax.annotation.Nonnull Long eventId) { } /** - * Get eventId + * The stored event's ID, the same as the SSE id field. Pass the last one received as last_event_id to resume after a reconnection. * @return eventId */ @javax.annotation.Nonnull @@ -135,7 +136,7 @@ public SseEventRunErrorData type(@javax.annotation.Nonnull String type) { } /** - * Get type + * The event name, the same as the SSE event field. * @return type */ @javax.annotation.Nonnull diff --git a/src/main/java/ai/reveng/model/SseEventRunFinishedData.java b/src/main/java/ai/reveng/model/SseEventRunFinishedData.java index 85d100ba..087d4b71 100644 --- a/src/main/java/ai/reveng/model/SseEventRunFinishedData.java +++ b/src/main/java/ai/reveng/model/SseEventRunFinishedData.java @@ -13,6 +13,7 @@ package ai.reveng.model; import java.util.Objects; +import ai.reveng.model.RunFinishedData; import com.google.gson.TypeAdapter; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; @@ -45,14 +46,14 @@ import ai.reveng.invoker.JSON; /** - * SseEventRunFinishedData + * The event envelope, sent as the JSON of the SSE data line. Its type names the event, and its data is that event's payload. */ @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class SseEventRunFinishedData { public static final String SERIALIZED_NAME_DATA = "data"; @SerializedName(SERIALIZED_NAME_DATA) - @javax.annotation.Nullable - private Object data = null; + @javax.annotation.Nonnull + private RunFinishedData data; public static final String SERIALIZED_NAME_EVENT_ID = "event_id"; @SerializedName(SERIALIZED_NAME_EVENT_ID) @@ -72,21 +73,21 @@ public class SseEventRunFinishedData { public SseEventRunFinishedData() { } - public SseEventRunFinishedData data(@javax.annotation.Nullable Object data) { + public SseEventRunFinishedData data(@javax.annotation.Nonnull RunFinishedData data) { this.data = data; return this; } /** - * Get data + * The payload of the event named in type. * @return data */ - @javax.annotation.Nullable - public Object getData() { + @javax.annotation.Nonnull + public RunFinishedData getData() { return data; } - public void setData(@javax.annotation.Nullable Object data) { + public void setData(@javax.annotation.Nonnull RunFinishedData data) { this.data = data; } @@ -97,7 +98,7 @@ public SseEventRunFinishedData eventId(@javax.annotation.Nonnull Long eventId) { } /** - * Get eventId + * The stored event's ID, the same as the SSE id field. Pass the last one received as last_event_id to resume after a reconnection. * @return eventId */ @javax.annotation.Nonnull @@ -135,7 +136,7 @@ public SseEventRunFinishedData type(@javax.annotation.Nonnull String type) { } /** - * Get type + * The event name, the same as the SSE event field. * @return type */ @javax.annotation.Nonnull diff --git a/src/main/java/ai/reveng/model/SseEventRunStartedData.java b/src/main/java/ai/reveng/model/SseEventRunStartedData.java index 1ddbb11e..713843f1 100644 --- a/src/main/java/ai/reveng/model/SseEventRunStartedData.java +++ b/src/main/java/ai/reveng/model/SseEventRunStartedData.java @@ -13,6 +13,7 @@ package ai.reveng.model; import java.util.Objects; +import ai.reveng.model.RunStartedData; import com.google.gson.TypeAdapter; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; @@ -45,14 +46,14 @@ import ai.reveng.invoker.JSON; /** - * SseEventRunStartedData + * The event envelope, sent as the JSON of the SSE data line. Its type names the event, and its data is that event's payload. */ @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class SseEventRunStartedData { public static final String SERIALIZED_NAME_DATA = "data"; @SerializedName(SERIALIZED_NAME_DATA) - @javax.annotation.Nullable - private Object data = null; + @javax.annotation.Nonnull + private RunStartedData data; public static final String SERIALIZED_NAME_EVENT_ID = "event_id"; @SerializedName(SERIALIZED_NAME_EVENT_ID) @@ -72,21 +73,21 @@ public class SseEventRunStartedData { public SseEventRunStartedData() { } - public SseEventRunStartedData data(@javax.annotation.Nullable Object data) { + public SseEventRunStartedData data(@javax.annotation.Nonnull RunStartedData data) { this.data = data; return this; } /** - * Get data + * The payload of the event named in type. * @return data */ - @javax.annotation.Nullable - public Object getData() { + @javax.annotation.Nonnull + public RunStartedData getData() { return data; } - public void setData(@javax.annotation.Nullable Object data) { + public void setData(@javax.annotation.Nonnull RunStartedData data) { this.data = data; } @@ -97,7 +98,7 @@ public SseEventRunStartedData eventId(@javax.annotation.Nonnull Long eventId) { } /** - * Get eventId + * The stored event's ID, the same as the SSE id field. Pass the last one received as last_event_id to resume after a reconnection. * @return eventId */ @javax.annotation.Nonnull @@ -135,7 +136,7 @@ public SseEventRunStartedData type(@javax.annotation.Nonnull String type) { } /** - * Get type + * The event name, the same as the SSE event field. * @return type */ @javax.annotation.Nonnull diff --git a/src/main/java/ai/reveng/model/SseEventStepFinishedData.java b/src/main/java/ai/reveng/model/SseEventStepFinishedData.java index c22667cf..cb29fda9 100644 --- a/src/main/java/ai/reveng/model/SseEventStepFinishedData.java +++ b/src/main/java/ai/reveng/model/SseEventStepFinishedData.java @@ -13,6 +13,7 @@ package ai.reveng.model; import java.util.Objects; +import ai.reveng.model.StepFinishedData; import com.google.gson.TypeAdapter; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; @@ -45,14 +46,14 @@ import ai.reveng.invoker.JSON; /** - * SseEventStepFinishedData + * The event envelope, sent as the JSON of the SSE data line. Its type names the event, and its data is that event's payload. */ @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class SseEventStepFinishedData { public static final String SERIALIZED_NAME_DATA = "data"; @SerializedName(SERIALIZED_NAME_DATA) - @javax.annotation.Nullable - private Object data = null; + @javax.annotation.Nonnull + private StepFinishedData data; public static final String SERIALIZED_NAME_EVENT_ID = "event_id"; @SerializedName(SERIALIZED_NAME_EVENT_ID) @@ -72,21 +73,21 @@ public class SseEventStepFinishedData { public SseEventStepFinishedData() { } - public SseEventStepFinishedData data(@javax.annotation.Nullable Object data) { + public SseEventStepFinishedData data(@javax.annotation.Nonnull StepFinishedData data) { this.data = data; return this; } /** - * Get data + * The payload of the event named in type. * @return data */ - @javax.annotation.Nullable - public Object getData() { + @javax.annotation.Nonnull + public StepFinishedData getData() { return data; } - public void setData(@javax.annotation.Nullable Object data) { + public void setData(@javax.annotation.Nonnull StepFinishedData data) { this.data = data; } @@ -97,7 +98,7 @@ public SseEventStepFinishedData eventId(@javax.annotation.Nonnull Long eventId) } /** - * Get eventId + * The stored event's ID, the same as the SSE id field. Pass the last one received as last_event_id to resume after a reconnection. * @return eventId */ @javax.annotation.Nonnull @@ -135,7 +136,7 @@ public SseEventStepFinishedData type(@javax.annotation.Nonnull String type) { } /** - * Get type + * The event name, the same as the SSE event field. * @return type */ @javax.annotation.Nonnull diff --git a/src/main/java/ai/reveng/model/SseEventStepStartedData.java b/src/main/java/ai/reveng/model/SseEventStepStartedData.java index 7a337479..425cefd9 100644 --- a/src/main/java/ai/reveng/model/SseEventStepStartedData.java +++ b/src/main/java/ai/reveng/model/SseEventStepStartedData.java @@ -13,6 +13,7 @@ package ai.reveng.model; import java.util.Objects; +import ai.reveng.model.StepStartedData; import com.google.gson.TypeAdapter; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; @@ -45,14 +46,14 @@ import ai.reveng.invoker.JSON; /** - * SseEventStepStartedData + * The event envelope, sent as the JSON of the SSE data line. Its type names the event, and its data is that event's payload. */ @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class SseEventStepStartedData { public static final String SERIALIZED_NAME_DATA = "data"; @SerializedName(SERIALIZED_NAME_DATA) - @javax.annotation.Nullable - private Object data = null; + @javax.annotation.Nonnull + private StepStartedData data; public static final String SERIALIZED_NAME_EVENT_ID = "event_id"; @SerializedName(SERIALIZED_NAME_EVENT_ID) @@ -72,21 +73,21 @@ public class SseEventStepStartedData { public SseEventStepStartedData() { } - public SseEventStepStartedData data(@javax.annotation.Nullable Object data) { + public SseEventStepStartedData data(@javax.annotation.Nonnull StepStartedData data) { this.data = data; return this; } /** - * Get data + * The payload of the event named in type. * @return data */ - @javax.annotation.Nullable - public Object getData() { + @javax.annotation.Nonnull + public StepStartedData getData() { return data; } - public void setData(@javax.annotation.Nullable Object data) { + public void setData(@javax.annotation.Nonnull StepStartedData data) { this.data = data; } @@ -97,7 +98,7 @@ public SseEventStepStartedData eventId(@javax.annotation.Nonnull Long eventId) { } /** - * Get eventId + * The stored event's ID, the same as the SSE id field. Pass the last one received as last_event_id to resume after a reconnection. * @return eventId */ @javax.annotation.Nonnull @@ -135,7 +136,7 @@ public SseEventStepStartedData type(@javax.annotation.Nonnull String type) { } /** - * Get type + * The event name, the same as the SSE event field. * @return type */ @javax.annotation.Nonnull diff --git a/src/main/java/ai/reveng/model/SseEventTextMessageContentData.java b/src/main/java/ai/reveng/model/SseEventTextMessageContentData.java index 70ede3b7..8f057490 100644 --- a/src/main/java/ai/reveng/model/SseEventTextMessageContentData.java +++ b/src/main/java/ai/reveng/model/SseEventTextMessageContentData.java @@ -13,6 +13,7 @@ package ai.reveng.model; import java.util.Objects; +import ai.reveng.model.TextMessageContentData; import com.google.gson.TypeAdapter; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; @@ -45,14 +46,14 @@ import ai.reveng.invoker.JSON; /** - * SseEventTextMessageContentData + * The event envelope, sent as the JSON of the SSE data line. Its type names the event, and its data is that event's payload. */ @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class SseEventTextMessageContentData { public static final String SERIALIZED_NAME_DATA = "data"; @SerializedName(SERIALIZED_NAME_DATA) - @javax.annotation.Nullable - private Object data = null; + @javax.annotation.Nonnull + private TextMessageContentData data; public static final String SERIALIZED_NAME_EVENT_ID = "event_id"; @SerializedName(SERIALIZED_NAME_EVENT_ID) @@ -72,21 +73,21 @@ public class SseEventTextMessageContentData { public SseEventTextMessageContentData() { } - public SseEventTextMessageContentData data(@javax.annotation.Nullable Object data) { + public SseEventTextMessageContentData data(@javax.annotation.Nonnull TextMessageContentData data) { this.data = data; return this; } /** - * Get data + * The payload of the event named in type. * @return data */ - @javax.annotation.Nullable - public Object getData() { + @javax.annotation.Nonnull + public TextMessageContentData getData() { return data; } - public void setData(@javax.annotation.Nullable Object data) { + public void setData(@javax.annotation.Nonnull TextMessageContentData data) { this.data = data; } @@ -97,7 +98,7 @@ public SseEventTextMessageContentData eventId(@javax.annotation.Nonnull Long eve } /** - * Get eventId + * The stored event's ID, the same as the SSE id field. Pass the last one received as last_event_id to resume after a reconnection. * @return eventId */ @javax.annotation.Nonnull @@ -135,7 +136,7 @@ public SseEventTextMessageContentData type(@javax.annotation.Nonnull String type } /** - * Get type + * The event name, the same as the SSE event field. * @return type */ @javax.annotation.Nonnull diff --git a/src/main/java/ai/reveng/model/SseEventTextMessageEndData.java b/src/main/java/ai/reveng/model/SseEventTextMessageEndData.java index 84f01920..b3e4636e 100644 --- a/src/main/java/ai/reveng/model/SseEventTextMessageEndData.java +++ b/src/main/java/ai/reveng/model/SseEventTextMessageEndData.java @@ -13,6 +13,7 @@ package ai.reveng.model; import java.util.Objects; +import ai.reveng.model.TextMessageEndData; import com.google.gson.TypeAdapter; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; @@ -45,14 +46,14 @@ import ai.reveng.invoker.JSON; /** - * SseEventTextMessageEndData + * The event envelope, sent as the JSON of the SSE data line. Its type names the event, and its data is that event's payload. */ @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class SseEventTextMessageEndData { public static final String SERIALIZED_NAME_DATA = "data"; @SerializedName(SERIALIZED_NAME_DATA) - @javax.annotation.Nullable - private Object data = null; + @javax.annotation.Nonnull + private TextMessageEndData data; public static final String SERIALIZED_NAME_EVENT_ID = "event_id"; @SerializedName(SERIALIZED_NAME_EVENT_ID) @@ -72,21 +73,21 @@ public class SseEventTextMessageEndData { public SseEventTextMessageEndData() { } - public SseEventTextMessageEndData data(@javax.annotation.Nullable Object data) { + public SseEventTextMessageEndData data(@javax.annotation.Nonnull TextMessageEndData data) { this.data = data; return this; } /** - * Get data + * The payload of the event named in type. * @return data */ - @javax.annotation.Nullable - public Object getData() { + @javax.annotation.Nonnull + public TextMessageEndData getData() { return data; } - public void setData(@javax.annotation.Nullable Object data) { + public void setData(@javax.annotation.Nonnull TextMessageEndData data) { this.data = data; } @@ -97,7 +98,7 @@ public SseEventTextMessageEndData eventId(@javax.annotation.Nonnull Long eventId } /** - * Get eventId + * The stored event's ID, the same as the SSE id field. Pass the last one received as last_event_id to resume after a reconnection. * @return eventId */ @javax.annotation.Nonnull @@ -135,7 +136,7 @@ public SseEventTextMessageEndData type(@javax.annotation.Nonnull String type) { } /** - * Get type + * The event name, the same as the SSE event field. * @return type */ @javax.annotation.Nonnull diff --git a/src/main/java/ai/reveng/model/SseEventTextMessageStartData.java b/src/main/java/ai/reveng/model/SseEventTextMessageStartData.java index 0326d8d5..268c19a6 100644 --- a/src/main/java/ai/reveng/model/SseEventTextMessageStartData.java +++ b/src/main/java/ai/reveng/model/SseEventTextMessageStartData.java @@ -13,6 +13,7 @@ package ai.reveng.model; import java.util.Objects; +import ai.reveng.model.TextMessageStartData; import com.google.gson.TypeAdapter; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; @@ -45,14 +46,14 @@ import ai.reveng.invoker.JSON; /** - * SseEventTextMessageStartData + * The event envelope, sent as the JSON of the SSE data line. Its type names the event, and its data is that event's payload. */ @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class SseEventTextMessageStartData { public static final String SERIALIZED_NAME_DATA = "data"; @SerializedName(SERIALIZED_NAME_DATA) - @javax.annotation.Nullable - private Object data = null; + @javax.annotation.Nonnull + private TextMessageStartData data; public static final String SERIALIZED_NAME_EVENT_ID = "event_id"; @SerializedName(SERIALIZED_NAME_EVENT_ID) @@ -72,21 +73,21 @@ public class SseEventTextMessageStartData { public SseEventTextMessageStartData() { } - public SseEventTextMessageStartData data(@javax.annotation.Nullable Object data) { + public SseEventTextMessageStartData data(@javax.annotation.Nonnull TextMessageStartData data) { this.data = data; return this; } /** - * Get data + * The payload of the event named in type. * @return data */ - @javax.annotation.Nullable - public Object getData() { + @javax.annotation.Nonnull + public TextMessageStartData getData() { return data; } - public void setData(@javax.annotation.Nullable Object data) { + public void setData(@javax.annotation.Nonnull TextMessageStartData data) { this.data = data; } @@ -97,7 +98,7 @@ public SseEventTextMessageStartData eventId(@javax.annotation.Nonnull Long event } /** - * Get eventId + * The stored event's ID, the same as the SSE id field. Pass the last one received as last_event_id to resume after a reconnection. * @return eventId */ @javax.annotation.Nonnull @@ -135,7 +136,7 @@ public SseEventTextMessageStartData type(@javax.annotation.Nonnull String type) } /** - * Get type + * The event name, the same as the SSE event field. * @return type */ @javax.annotation.Nonnull diff --git a/src/main/java/ai/reveng/model/SseEventTitleUpdatedData.java b/src/main/java/ai/reveng/model/SseEventTitleUpdatedData.java index 9cadd2c2..4e13dac5 100644 --- a/src/main/java/ai/reveng/model/SseEventTitleUpdatedData.java +++ b/src/main/java/ai/reveng/model/SseEventTitleUpdatedData.java @@ -13,6 +13,7 @@ package ai.reveng.model; import java.util.Objects; +import ai.reveng.model.TitleUpdatedData; import com.google.gson.TypeAdapter; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; @@ -45,14 +46,14 @@ import ai.reveng.invoker.JSON; /** - * SseEventTitleUpdatedData + * The event envelope, sent as the JSON of the SSE data line. Its type names the event, and its data is that event's payload. */ @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class SseEventTitleUpdatedData { public static final String SERIALIZED_NAME_DATA = "data"; @SerializedName(SERIALIZED_NAME_DATA) - @javax.annotation.Nullable - private Object data = null; + @javax.annotation.Nonnull + private TitleUpdatedData data; public static final String SERIALIZED_NAME_EVENT_ID = "event_id"; @SerializedName(SERIALIZED_NAME_EVENT_ID) @@ -72,21 +73,21 @@ public class SseEventTitleUpdatedData { public SseEventTitleUpdatedData() { } - public SseEventTitleUpdatedData data(@javax.annotation.Nullable Object data) { + public SseEventTitleUpdatedData data(@javax.annotation.Nonnull TitleUpdatedData data) { this.data = data; return this; } /** - * Get data + * The payload of the event named in type. * @return data */ - @javax.annotation.Nullable - public Object getData() { + @javax.annotation.Nonnull + public TitleUpdatedData getData() { return data; } - public void setData(@javax.annotation.Nullable Object data) { + public void setData(@javax.annotation.Nonnull TitleUpdatedData data) { this.data = data; } @@ -97,7 +98,7 @@ public SseEventTitleUpdatedData eventId(@javax.annotation.Nonnull Long eventId) } /** - * Get eventId + * The stored event's ID, the same as the SSE id field. Pass the last one received as last_event_id to resume after a reconnection. * @return eventId */ @javax.annotation.Nonnull @@ -135,7 +136,7 @@ public SseEventTitleUpdatedData type(@javax.annotation.Nonnull String type) { } /** - * Get type + * The event name, the same as the SSE event field. * @return type */ @javax.annotation.Nonnull diff --git a/src/main/java/ai/reveng/model/SseEventToolCallArgsDeltaData.java b/src/main/java/ai/reveng/model/SseEventToolCallArgsDeltaData.java index 49116e1c..509848c6 100644 --- a/src/main/java/ai/reveng/model/SseEventToolCallArgsDeltaData.java +++ b/src/main/java/ai/reveng/model/SseEventToolCallArgsDeltaData.java @@ -13,6 +13,7 @@ package ai.reveng.model; import java.util.Objects; +import ai.reveng.model.ToolCallArgsDeltaData; import com.google.gson.TypeAdapter; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; @@ -45,14 +46,14 @@ import ai.reveng.invoker.JSON; /** - * SseEventToolCallArgsDeltaData + * The event envelope, sent as the JSON of the SSE data line. Its type names the event, and its data is that event's payload. */ @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class SseEventToolCallArgsDeltaData { public static final String SERIALIZED_NAME_DATA = "data"; @SerializedName(SERIALIZED_NAME_DATA) - @javax.annotation.Nullable - private Object data = null; + @javax.annotation.Nonnull + private ToolCallArgsDeltaData data; public static final String SERIALIZED_NAME_EVENT_ID = "event_id"; @SerializedName(SERIALIZED_NAME_EVENT_ID) @@ -72,21 +73,21 @@ public class SseEventToolCallArgsDeltaData { public SseEventToolCallArgsDeltaData() { } - public SseEventToolCallArgsDeltaData data(@javax.annotation.Nullable Object data) { + public SseEventToolCallArgsDeltaData data(@javax.annotation.Nonnull ToolCallArgsDeltaData data) { this.data = data; return this; } /** - * Get data + * The payload of the event named in type. * @return data */ - @javax.annotation.Nullable - public Object getData() { + @javax.annotation.Nonnull + public ToolCallArgsDeltaData getData() { return data; } - public void setData(@javax.annotation.Nullable Object data) { + public void setData(@javax.annotation.Nonnull ToolCallArgsDeltaData data) { this.data = data; } @@ -97,7 +98,7 @@ public SseEventToolCallArgsDeltaData eventId(@javax.annotation.Nonnull Long even } /** - * Get eventId + * The stored event's ID, the same as the SSE id field. Pass the last one received as last_event_id to resume after a reconnection. * @return eventId */ @javax.annotation.Nonnull @@ -135,7 +136,7 @@ public SseEventToolCallArgsDeltaData type(@javax.annotation.Nonnull String type) } /** - * Get type + * The event name, the same as the SSE event field. * @return type */ @javax.annotation.Nonnull diff --git a/src/main/java/ai/reveng/model/SseEventToolCallEndData.java b/src/main/java/ai/reveng/model/SseEventToolCallEndData.java index 953ada71..1babda9e 100644 --- a/src/main/java/ai/reveng/model/SseEventToolCallEndData.java +++ b/src/main/java/ai/reveng/model/SseEventToolCallEndData.java @@ -13,6 +13,7 @@ package ai.reveng.model; import java.util.Objects; +import ai.reveng.model.ToolCallEndData; import com.google.gson.TypeAdapter; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; @@ -45,14 +46,14 @@ import ai.reveng.invoker.JSON; /** - * SseEventToolCallEndData + * The event envelope, sent as the JSON of the SSE data line. Its type names the event, and its data is that event's payload. */ @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class SseEventToolCallEndData { public static final String SERIALIZED_NAME_DATA = "data"; @SerializedName(SERIALIZED_NAME_DATA) - @javax.annotation.Nullable - private Object data = null; + @javax.annotation.Nonnull + private ToolCallEndData data; public static final String SERIALIZED_NAME_EVENT_ID = "event_id"; @SerializedName(SERIALIZED_NAME_EVENT_ID) @@ -72,21 +73,21 @@ public class SseEventToolCallEndData { public SseEventToolCallEndData() { } - public SseEventToolCallEndData data(@javax.annotation.Nullable Object data) { + public SseEventToolCallEndData data(@javax.annotation.Nonnull ToolCallEndData data) { this.data = data; return this; } /** - * Get data + * The payload of the event named in type. * @return data */ - @javax.annotation.Nullable - public Object getData() { + @javax.annotation.Nonnull + public ToolCallEndData getData() { return data; } - public void setData(@javax.annotation.Nullable Object data) { + public void setData(@javax.annotation.Nonnull ToolCallEndData data) { this.data = data; } @@ -97,7 +98,7 @@ public SseEventToolCallEndData eventId(@javax.annotation.Nonnull Long eventId) { } /** - * Get eventId + * The stored event's ID, the same as the SSE id field. Pass the last one received as last_event_id to resume after a reconnection. * @return eventId */ @javax.annotation.Nonnull @@ -135,7 +136,7 @@ public SseEventToolCallEndData type(@javax.annotation.Nonnull String type) { } /** - * Get type + * The event name, the same as the SSE event field. * @return type */ @javax.annotation.Nonnull diff --git a/src/main/java/ai/reveng/model/SseEventToolCallProgressData.java b/src/main/java/ai/reveng/model/SseEventToolCallProgressData.java index b1d4576e..2cbec54b 100644 --- a/src/main/java/ai/reveng/model/SseEventToolCallProgressData.java +++ b/src/main/java/ai/reveng/model/SseEventToolCallProgressData.java @@ -13,6 +13,7 @@ package ai.reveng.model; import java.util.Objects; +import ai.reveng.model.ToolCallProgressData; import com.google.gson.TypeAdapter; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; @@ -45,14 +46,14 @@ import ai.reveng.invoker.JSON; /** - * SseEventToolCallProgressData + * The event envelope, sent as the JSON of the SSE data line. Its type names the event, and its data is that event's payload. */ @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class SseEventToolCallProgressData { public static final String SERIALIZED_NAME_DATA = "data"; @SerializedName(SERIALIZED_NAME_DATA) - @javax.annotation.Nullable - private Object data = null; + @javax.annotation.Nonnull + private ToolCallProgressData data; public static final String SERIALIZED_NAME_EVENT_ID = "event_id"; @SerializedName(SERIALIZED_NAME_EVENT_ID) @@ -72,21 +73,21 @@ public class SseEventToolCallProgressData { public SseEventToolCallProgressData() { } - public SseEventToolCallProgressData data(@javax.annotation.Nullable Object data) { + public SseEventToolCallProgressData data(@javax.annotation.Nonnull ToolCallProgressData data) { this.data = data; return this; } /** - * Get data + * The payload of the event named in type. * @return data */ - @javax.annotation.Nullable - public Object getData() { + @javax.annotation.Nonnull + public ToolCallProgressData getData() { return data; } - public void setData(@javax.annotation.Nullable Object data) { + public void setData(@javax.annotation.Nonnull ToolCallProgressData data) { this.data = data; } @@ -97,7 +98,7 @@ public SseEventToolCallProgressData eventId(@javax.annotation.Nonnull Long event } /** - * Get eventId + * The stored event's ID, the same as the SSE id field. Pass the last one received as last_event_id to resume after a reconnection. * @return eventId */ @javax.annotation.Nonnull @@ -135,7 +136,7 @@ public SseEventToolCallProgressData type(@javax.annotation.Nonnull String type) } /** - * Get type + * The event name, the same as the SSE event field. * @return type */ @javax.annotation.Nonnull diff --git a/src/main/java/ai/reveng/model/SseEventToolCallResultData.java b/src/main/java/ai/reveng/model/SseEventToolCallResultData.java index eb64c266..b49a09cd 100644 --- a/src/main/java/ai/reveng/model/SseEventToolCallResultData.java +++ b/src/main/java/ai/reveng/model/SseEventToolCallResultData.java @@ -13,6 +13,7 @@ package ai.reveng.model; import java.util.Objects; +import ai.reveng.model.ToolCallResultData; import com.google.gson.TypeAdapter; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; @@ -45,14 +46,14 @@ import ai.reveng.invoker.JSON; /** - * SseEventToolCallResultData + * The event envelope, sent as the JSON of the SSE data line. Its type names the event, and its data is that event's payload. */ @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class SseEventToolCallResultData { public static final String SERIALIZED_NAME_DATA = "data"; @SerializedName(SERIALIZED_NAME_DATA) - @javax.annotation.Nullable - private Object data = null; + @javax.annotation.Nonnull + private ToolCallResultData data; public static final String SERIALIZED_NAME_EVENT_ID = "event_id"; @SerializedName(SERIALIZED_NAME_EVENT_ID) @@ -72,21 +73,21 @@ public class SseEventToolCallResultData { public SseEventToolCallResultData() { } - public SseEventToolCallResultData data(@javax.annotation.Nullable Object data) { + public SseEventToolCallResultData data(@javax.annotation.Nonnull ToolCallResultData data) { this.data = data; return this; } /** - * Get data + * The payload of the event named in type. * @return data */ - @javax.annotation.Nullable - public Object getData() { + @javax.annotation.Nonnull + public ToolCallResultData getData() { return data; } - public void setData(@javax.annotation.Nullable Object data) { + public void setData(@javax.annotation.Nonnull ToolCallResultData data) { this.data = data; } @@ -97,7 +98,7 @@ public SseEventToolCallResultData eventId(@javax.annotation.Nonnull Long eventId } /** - * Get eventId + * The stored event's ID, the same as the SSE id field. Pass the last one received as last_event_id to resume after a reconnection. * @return eventId */ @javax.annotation.Nonnull @@ -135,7 +136,7 @@ public SseEventToolCallResultData type(@javax.annotation.Nonnull String type) { } /** - * Get type + * The event name, the same as the SSE event field. * @return type */ @javax.annotation.Nonnull diff --git a/src/main/java/ai/reveng/model/SseEventToolCallStartData.java b/src/main/java/ai/reveng/model/SseEventToolCallStartData.java index 58c977e2..72bfa73f 100644 --- a/src/main/java/ai/reveng/model/SseEventToolCallStartData.java +++ b/src/main/java/ai/reveng/model/SseEventToolCallStartData.java @@ -13,6 +13,7 @@ package ai.reveng.model; import java.util.Objects; +import ai.reveng.model.ToolCallStartData; import com.google.gson.TypeAdapter; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; @@ -45,14 +46,14 @@ import ai.reveng.invoker.JSON; /** - * SseEventToolCallStartData + * The event envelope, sent as the JSON of the SSE data line. Its type names the event, and its data is that event's payload. */ @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class SseEventToolCallStartData { public static final String SERIALIZED_NAME_DATA = "data"; @SerializedName(SERIALIZED_NAME_DATA) - @javax.annotation.Nullable - private Object data = null; + @javax.annotation.Nonnull + private ToolCallStartData data; public static final String SERIALIZED_NAME_EVENT_ID = "event_id"; @SerializedName(SERIALIZED_NAME_EVENT_ID) @@ -72,21 +73,21 @@ public class SseEventToolCallStartData { public SseEventToolCallStartData() { } - public SseEventToolCallStartData data(@javax.annotation.Nullable Object data) { + public SseEventToolCallStartData data(@javax.annotation.Nonnull ToolCallStartData data) { this.data = data; return this; } /** - * Get data + * The payload of the event named in type. * @return data */ - @javax.annotation.Nullable - public Object getData() { + @javax.annotation.Nonnull + public ToolCallStartData getData() { return data; } - public void setData(@javax.annotation.Nullable Object data) { + public void setData(@javax.annotation.Nonnull ToolCallStartData data) { this.data = data; } @@ -97,7 +98,7 @@ public SseEventToolCallStartData eventId(@javax.annotation.Nonnull Long eventId) } /** - * Get eventId + * The stored event's ID, the same as the SSE id field. Pass the last one received as last_event_id to resume after a reconnection. * @return eventId */ @javax.annotation.Nonnull @@ -135,7 +136,7 @@ public SseEventToolCallStartData type(@javax.annotation.Nonnull String type) { } /** - * Get type + * The event name, the same as the SSE event field. * @return type */ @javax.annotation.Nonnull diff --git a/src/main/java/ai/reveng/model/SseEventToolConfirmationRequiredData.java b/src/main/java/ai/reveng/model/SseEventToolConfirmationRequiredData.java index 83c5b468..01c93385 100644 --- a/src/main/java/ai/reveng/model/SseEventToolConfirmationRequiredData.java +++ b/src/main/java/ai/reveng/model/SseEventToolConfirmationRequiredData.java @@ -13,6 +13,7 @@ package ai.reveng.model; import java.util.Objects; +import ai.reveng.model.ToolConfirmationRequiredData; import com.google.gson.TypeAdapter; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; @@ -45,14 +46,14 @@ import ai.reveng.invoker.JSON; /** - * SseEventToolConfirmationRequiredData + * The event envelope, sent as the JSON of the SSE data line. Its type names the event, and its data is that event's payload. */ @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class SseEventToolConfirmationRequiredData { public static final String SERIALIZED_NAME_DATA = "data"; @SerializedName(SERIALIZED_NAME_DATA) - @javax.annotation.Nullable - private Object data = null; + @javax.annotation.Nonnull + private ToolConfirmationRequiredData data; public static final String SERIALIZED_NAME_EVENT_ID = "event_id"; @SerializedName(SERIALIZED_NAME_EVENT_ID) @@ -72,21 +73,21 @@ public class SseEventToolConfirmationRequiredData { public SseEventToolConfirmationRequiredData() { } - public SseEventToolConfirmationRequiredData data(@javax.annotation.Nullable Object data) { + public SseEventToolConfirmationRequiredData data(@javax.annotation.Nonnull ToolConfirmationRequiredData data) { this.data = data; return this; } /** - * Get data + * The payload of the event named in type. * @return data */ - @javax.annotation.Nullable - public Object getData() { + @javax.annotation.Nonnull + public ToolConfirmationRequiredData getData() { return data; } - public void setData(@javax.annotation.Nullable Object data) { + public void setData(@javax.annotation.Nonnull ToolConfirmationRequiredData data) { this.data = data; } @@ -97,7 +98,7 @@ public SseEventToolConfirmationRequiredData eventId(@javax.annotation.Nonnull Lo } /** - * Get eventId + * The stored event's ID, the same as the SSE id field. Pass the last one received as last_event_id to resume after a reconnection. * @return eventId */ @javax.annotation.Nonnull @@ -135,7 +136,7 @@ public SseEventToolConfirmationRequiredData type(@javax.annotation.Nonnull Strin } /** - * Get type + * The event name, the same as the SSE event field. * @return type */ @javax.annotation.Nonnull diff --git a/src/main/java/ai/reveng/model/Status.java b/src/main/java/ai/reveng/model/Status.java index 2f4bb484..b6ece2d1 100644 --- a/src/main/java/ai/reveng/model/Status.java +++ b/src/main/java/ai/reveng/model/Status.java @@ -102,6 +102,8 @@ public enum CodeEnum { INVALID_RESET_CODE("INVALID_RESET_CODE"), + INVESTIGATION_BUDGET_SPENT("INVESTIGATION_BUDGET_SPENT"), + LAST_ORG_OWNER("LAST_ORG_OWNER"), LAST_TEAM_ADMIN("LAST_TEAM_ADMIN"), diff --git a/src/main/java/ai/reveng/model/StepFinishedData.java b/src/main/java/ai/reveng/model/StepFinishedData.java new file mode 100644 index 00000000..77e6ff87 --- /dev/null +++ b/src/main/java/ai/reveng/model/StepFinishedData.java @@ -0,0 +1,308 @@ +/* + * RevEng.AI API + * RevEng.AI is an AI-powered binary analysis platform for reverse engineering and malware analysis. It provides similarity search across executable binaries and functions, AI-driven decompilation, dynamic execution analysis, firmware unpacking, and integration with external threat intelligence sources like VirusTotal. + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package ai.reveng.model; + +import java.util.Objects; +import 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; + +/** + * StepFinishedData + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class StepFinishedData { + public static final String SERIALIZED_NAME_FINISH_REASON = "finish_reason"; + @SerializedName(SERIALIZED_NAME_FINISH_REASON) + @javax.annotation.Nullable + private String finishReason; + + public static final String SERIALIZED_NAME_STEP_INDEX = "step_index"; + @SerializedName(SERIALIZED_NAME_STEP_INDEX) + @javax.annotation.Nullable + private Integer stepIndex; + + public StepFinishedData() { + } + + public StepFinishedData finishReason(@javax.annotation.Nullable String finishReason) { + this.finishReason = finishReason; + return this; + } + + /** + * Get finishReason + * @return finishReason + */ + @javax.annotation.Nullable + public String getFinishReason() { + return finishReason; + } + + public void setFinishReason(@javax.annotation.Nullable String finishReason) { + this.finishReason = finishReason; + } + + + public StepFinishedData stepIndex(@javax.annotation.Nullable Integer stepIndex) { + this.stepIndex = stepIndex; + return this; + } + + /** + * Get stepIndex + * @return stepIndex + */ + @javax.annotation.Nullable + public Integer getStepIndex() { + return stepIndex; + } + + public void setStepIndex(@javax.annotation.Nullable Integer stepIndex) { + this.stepIndex = stepIndex; + } + + /** + * 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 StepFinishedData instance itself + */ + public StepFinishedData 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; + } + StepFinishedData stepFinishedData = (StepFinishedData) o; + return Objects.equals(this.finishReason, stepFinishedData.finishReason) && + Objects.equals(this.stepIndex, stepFinishedData.stepIndex)&& + Objects.equals(this.additionalProperties, stepFinishedData.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(finishReason, stepIndex, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class StepFinishedData {\n"); + sb.append(" finishReason: ").append(toIndentedString(finishReason)).append("\n"); + sb.append(" stepIndex: ").append(toIndentedString(stepIndex)).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("finish_reason", "step_index")); + + // 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 StepFinishedData + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!StepFinishedData.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 StepFinishedData is not found in the empty JSON string", StepFinishedData.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("finish_reason") != null && !jsonObj.get("finish_reason").isJsonNull()) && !jsonObj.get("finish_reason").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `finish_reason` to be a primitive type in the JSON string but got `%s`", jsonObj.get("finish_reason").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!StepFinishedData.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'StepFinishedData' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(StepFinishedData.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, StepFinishedData 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 StepFinishedData read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + StepFinishedData 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 StepFinishedData given an JSON string + * + * @param jsonString JSON string + * @return An instance of StepFinishedData + * @throws IOException if the JSON string is invalid with respect to StepFinishedData + */ + public static StepFinishedData fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, StepFinishedData.class); + } + + /** + * Convert an instance of StepFinishedData to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/ai/reveng/model/StepStartedData.java b/src/main/java/ai/reveng/model/StepStartedData.java new file mode 100644 index 00000000..bed2940c --- /dev/null +++ b/src/main/java/ai/reveng/model/StepStartedData.java @@ -0,0 +1,279 @@ +/* + * 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; + +/** + * StepStartedData + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class StepStartedData { + public static final String SERIALIZED_NAME_STEP_INDEX = "step_index"; + @SerializedName(SERIALIZED_NAME_STEP_INDEX) + @javax.annotation.Nullable + private Integer stepIndex; + + public StepStartedData() { + } + + public StepStartedData stepIndex(@javax.annotation.Nullable Integer stepIndex) { + this.stepIndex = stepIndex; + return this; + } + + /** + * Get stepIndex + * @return stepIndex + */ + @javax.annotation.Nullable + public Integer getStepIndex() { + return stepIndex; + } + + public void setStepIndex(@javax.annotation.Nullable Integer stepIndex) { + this.stepIndex = stepIndex; + } + + /** + * 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 StepStartedData instance itself + */ + public StepStartedData 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; + } + StepStartedData stepStartedData = (StepStartedData) o; + return Objects.equals(this.stepIndex, stepStartedData.stepIndex)&& + Objects.equals(this.additionalProperties, stepStartedData.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(stepIndex, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class StepStartedData {\n"); + sb.append(" stepIndex: ").append(toIndentedString(stepIndex)).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("step_index")); + + // 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 StepStartedData + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!StepStartedData.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 StepStartedData is not found in the empty JSON string", StepStartedData.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!StepStartedData.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'StepStartedData' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(StepStartedData.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, StepStartedData 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 StepStartedData read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + StepStartedData 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 StepStartedData given an JSON string + * + * @param jsonString JSON string + * @return An instance of StepStartedData + * @throws IOException if the JSON string is invalid with respect to StepStartedData + */ + public static StepStartedData fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, StepStartedData.class); + } + + /** + * Convert an instance of StepStartedData to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/ai/reveng/model/TaskStatus.java b/src/main/java/ai/reveng/model/TaskStatus.java deleted file mode 100644 index b5b0b21b..00000000 --- a/src/main/java/ai/reveng/model/TaskStatus.java +++ /dev/null @@ -1,85 +0,0 @@ -/* - * RevEng.AI API - * RevEng.AI is an AI-powered binary analysis platform for reverse engineering and malware analysis. It provides similarity search across executable binaries and functions, AI-driven decompilation, dynamic execution analysis, firmware unpacking, and integration with external threat intelligence sources like VirusTotal. - * - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package ai.reveng.model; - -import java.util.Objects; -import com.google.gson.annotations.SerializedName; - -import java.io.IOException; -import com.google.gson.TypeAdapter; -import com.google.gson.JsonElement; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; - -/** - * Gets or Sets TaskStatus - */ -@JsonAdapter(TaskStatus.Adapter.class) -public enum TaskStatus { - - UNINITIALISED("UNINITIALISED"), - - PENDING("PENDING"), - - RUNNING("RUNNING"), - - COMPLETED("COMPLETED"), - - FAILED("FAILED"), - - UNKNOWN_DEFAULT_OPEN_API("unknown_default_open_api"); - - private String value; - - TaskStatus(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - public static TaskStatus fromValue(String value) { - for (TaskStatus b : TaskStatus.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 TaskStatus enumeration) throws IOException { - jsonWriter.value(enumeration.getValue()); - } - - @Override - public TaskStatus read(final JsonReader jsonReader) throws IOException { - String value = jsonReader.nextString(); - return TaskStatus.fromValue(value); - } - } - - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - String value = jsonElement.getAsString(); - TaskStatus.fromValue(value); - } -} - diff --git a/src/main/java/ai/reveng/model/Team.java b/src/main/java/ai/reveng/model/Team.java index c0396790..3462a914 100644 --- a/src/main/java/ai/reveng/model/Team.java +++ b/src/main/java/ai/reveng/model/Team.java @@ -124,7 +124,7 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti public static final String SERIALIZED_NAME_TEAM_NAME = "team_name"; @SerializedName(SERIALIZED_NAME_TEAM_NAME) - @javax.annotation.Nonnull + @javax.annotation.Nullable private String teamName; public Team() { @@ -187,21 +187,21 @@ public void setTeamId(@javax.annotation.Nonnull Long teamId) { } - public Team teamName(@javax.annotation.Nonnull String teamName) { + public Team teamName(@javax.annotation.Nullable String teamName) { this.teamName = teamName; return this; } /** - * Get teamName + * Search is applied to string value * @return teamName */ - @javax.annotation.Nonnull + @javax.annotation.Nullable public String getTeamName() { return teamName; } - public void setTeamName(@javax.annotation.Nonnull String teamName) { + public void setTeamName(@javax.annotation.Nullable String teamName) { this.teamName = teamName; } @@ -330,7 +330,7 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti } // validate the required field `plan` PlanEnum.validateJsonElement(jsonObj.get("plan")); - if (!jsonObj.get("team_name").isJsonPrimitive()) { + if ((jsonObj.get("team_name") != null && !jsonObj.get("team_name").isJsonNull()) && !jsonObj.get("team_name").isJsonPrimitive()) { throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `team_name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("team_name").toString())); } } diff --git a/src/main/java/ai/reveng/model/TextMessageContentData.java b/src/main/java/ai/reveng/model/TextMessageContentData.java new file mode 100644 index 00000000..56fb9987 --- /dev/null +++ b/src/main/java/ai/reveng/model/TextMessageContentData.java @@ -0,0 +1,311 @@ +/* + * 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; + +/** + * TextMessageContentData + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class TextMessageContentData { + public static final String SERIALIZED_NAME_DELTA = "delta"; + @SerializedName(SERIALIZED_NAME_DELTA) + @javax.annotation.Nullable + private String delta; + + public static final String SERIALIZED_NAME_MESSAGE_ID = "message_id"; + @SerializedName(SERIALIZED_NAME_MESSAGE_ID) + @javax.annotation.Nullable + private String messageId; + + public TextMessageContentData() { + } + + public TextMessageContentData delta(@javax.annotation.Nullable String delta) { + this.delta = delta; + return this; + } + + /** + * Get delta + * @return delta + */ + @javax.annotation.Nullable + public String getDelta() { + return delta; + } + + public void setDelta(@javax.annotation.Nullable String delta) { + this.delta = delta; + } + + + public TextMessageContentData messageId(@javax.annotation.Nullable String messageId) { + this.messageId = messageId; + return this; + } + + /** + * Get messageId + * @return messageId + */ + @javax.annotation.Nullable + public String getMessageId() { + return messageId; + } + + public void setMessageId(@javax.annotation.Nullable String messageId) { + this.messageId = messageId; + } + + /** + * 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 TextMessageContentData instance itself + */ + public TextMessageContentData 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; + } + TextMessageContentData textMessageContentData = (TextMessageContentData) o; + return Objects.equals(this.delta, textMessageContentData.delta) && + Objects.equals(this.messageId, textMessageContentData.messageId)&& + Objects.equals(this.additionalProperties, textMessageContentData.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(delta, messageId, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TextMessageContentData {\n"); + sb.append(" delta: ").append(toIndentedString(delta)).append("\n"); + sb.append(" messageId: ").append(toIndentedString(messageId)).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("delta", "message_id")); + + // 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 TextMessageContentData + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!TextMessageContentData.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 TextMessageContentData is not found in the empty JSON string", TextMessageContentData.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("delta") != null && !jsonObj.get("delta").isJsonNull()) && !jsonObj.get("delta").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `delta` to be a primitive type in the JSON string but got `%s`", jsonObj.get("delta").toString())); + } + if ((jsonObj.get("message_id") != null && !jsonObj.get("message_id").isJsonNull()) && !jsonObj.get("message_id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `message_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("message_id").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!TextMessageContentData.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'TextMessageContentData' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(TextMessageContentData.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, TextMessageContentData 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 TextMessageContentData read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + TextMessageContentData 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 TextMessageContentData given an JSON string + * + * @param jsonString JSON string + * @return An instance of TextMessageContentData + * @throws IOException if the JSON string is invalid with respect to TextMessageContentData + */ + public static TextMessageContentData fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, TextMessageContentData.class); + } + + /** + * Convert an instance of TextMessageContentData to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/ai/reveng/model/TextMessageEndData.java b/src/main/java/ai/reveng/model/TextMessageEndData.java new file mode 100644 index 00000000..841f509d --- /dev/null +++ b/src/main/java/ai/reveng/model/TextMessageEndData.java @@ -0,0 +1,282 @@ +/* + * 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; + +/** + * TextMessageEndData + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class TextMessageEndData { + public static final String SERIALIZED_NAME_MESSAGE_ID = "message_id"; + @SerializedName(SERIALIZED_NAME_MESSAGE_ID) + @javax.annotation.Nullable + private String messageId; + + public TextMessageEndData() { + } + + public TextMessageEndData messageId(@javax.annotation.Nullable String messageId) { + this.messageId = messageId; + return this; + } + + /** + * Get messageId + * @return messageId + */ + @javax.annotation.Nullable + public String getMessageId() { + return messageId; + } + + public void setMessageId(@javax.annotation.Nullable String messageId) { + this.messageId = messageId; + } + + /** + * 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 TextMessageEndData instance itself + */ + public TextMessageEndData 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; + } + TextMessageEndData textMessageEndData = (TextMessageEndData) o; + return Objects.equals(this.messageId, textMessageEndData.messageId)&& + Objects.equals(this.additionalProperties, textMessageEndData.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(messageId, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TextMessageEndData {\n"); + sb.append(" messageId: ").append(toIndentedString(messageId)).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("message_id")); + + // 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 TextMessageEndData + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!TextMessageEndData.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 TextMessageEndData is not found in the empty JSON string", TextMessageEndData.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("message_id") != null && !jsonObj.get("message_id").isJsonNull()) && !jsonObj.get("message_id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `message_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("message_id").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!TextMessageEndData.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'TextMessageEndData' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(TextMessageEndData.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, TextMessageEndData 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 TextMessageEndData read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + TextMessageEndData 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 TextMessageEndData given an JSON string + * + * @param jsonString JSON string + * @return An instance of TextMessageEndData + * @throws IOException if the JSON string is invalid with respect to TextMessageEndData + */ + public static TextMessageEndData fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, TextMessageEndData.class); + } + + /** + * Convert an instance of TextMessageEndData to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/ai/reveng/model/TextMessageStartData.java b/src/main/java/ai/reveng/model/TextMessageStartData.java new file mode 100644 index 00000000..2aed071a --- /dev/null +++ b/src/main/java/ai/reveng/model/TextMessageStartData.java @@ -0,0 +1,282 @@ +/* + * 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; + +/** + * TextMessageStartData + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class TextMessageStartData { + public static final String SERIALIZED_NAME_MESSAGE_ID = "message_id"; + @SerializedName(SERIALIZED_NAME_MESSAGE_ID) + @javax.annotation.Nullable + private String messageId; + + public TextMessageStartData() { + } + + public TextMessageStartData messageId(@javax.annotation.Nullable String messageId) { + this.messageId = messageId; + return this; + } + + /** + * Get messageId + * @return messageId + */ + @javax.annotation.Nullable + public String getMessageId() { + return messageId; + } + + public void setMessageId(@javax.annotation.Nullable String messageId) { + this.messageId = messageId; + } + + /** + * 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 TextMessageStartData instance itself + */ + public TextMessageStartData 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; + } + TextMessageStartData textMessageStartData = (TextMessageStartData) o; + return Objects.equals(this.messageId, textMessageStartData.messageId)&& + Objects.equals(this.additionalProperties, textMessageStartData.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(messageId, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TextMessageStartData {\n"); + sb.append(" messageId: ").append(toIndentedString(messageId)).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("message_id")); + + // 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 TextMessageStartData + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!TextMessageStartData.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 TextMessageStartData is not found in the empty JSON string", TextMessageStartData.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("message_id") != null && !jsonObj.get("message_id").isJsonNull()) && !jsonObj.get("message_id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `message_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("message_id").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!TextMessageStartData.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'TextMessageStartData' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(TextMessageStartData.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, TextMessageStartData 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 TextMessageStartData read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + TextMessageStartData 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 TextMessageStartData given an JSON string + * + * @param jsonString JSON string + * @return An instance of TextMessageStartData + * @throws IOException if the JSON string is invalid with respect to TextMessageStartData + */ + public static TextMessageStartData fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, TextMessageStartData.class); + } + + /** + * Convert an instance of TextMessageStartData to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/ai/reveng/model/TitleUpdatedData.java b/src/main/java/ai/reveng/model/TitleUpdatedData.java new file mode 100644 index 00000000..8055e4ec --- /dev/null +++ b/src/main/java/ai/reveng/model/TitleUpdatedData.java @@ -0,0 +1,282 @@ +/* + * 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; + +/** + * TitleUpdatedData + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class TitleUpdatedData { + public static final String SERIALIZED_NAME_TITLE = "title"; + @SerializedName(SERIALIZED_NAME_TITLE) + @javax.annotation.Nullable + private String title; + + public TitleUpdatedData() { + } + + public TitleUpdatedData title(@javax.annotation.Nullable String title) { + this.title = title; + return this; + } + + /** + * Get title + * @return title + */ + @javax.annotation.Nullable + public String getTitle() { + return title; + } + + public void setTitle(@javax.annotation.Nullable String title) { + this.title = title; + } + + /** + * 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 TitleUpdatedData instance itself + */ + public TitleUpdatedData 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; + } + TitleUpdatedData titleUpdatedData = (TitleUpdatedData) o; + return Objects.equals(this.title, titleUpdatedData.title)&& + Objects.equals(this.additionalProperties, titleUpdatedData.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(title, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TitleUpdatedData {\n"); + sb.append(" title: ").append(toIndentedString(title)).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("title")); + + // 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 TitleUpdatedData + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!TitleUpdatedData.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 TitleUpdatedData is not found in the empty JSON string", TitleUpdatedData.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("title") != null && !jsonObj.get("title").isJsonNull()) && !jsonObj.get("title").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `title` to be a primitive type in the JSON string but got `%s`", jsonObj.get("title").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!TitleUpdatedData.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'TitleUpdatedData' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(TitleUpdatedData.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, TitleUpdatedData 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 TitleUpdatedData read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + TitleUpdatedData 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 TitleUpdatedData given an JSON string + * + * @param jsonString JSON string + * @return An instance of TitleUpdatedData + * @throws IOException if the JSON string is invalid with respect to TitleUpdatedData + */ + public static TitleUpdatedData fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, TitleUpdatedData.class); + } + + /** + * Convert an instance of TitleUpdatedData to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/ai/reveng/model/ToolCallArgsDeltaData.java b/src/main/java/ai/reveng/model/ToolCallArgsDeltaData.java new file mode 100644 index 00000000..ffd6753a --- /dev/null +++ b/src/main/java/ai/reveng/model/ToolCallArgsDeltaData.java @@ -0,0 +1,311 @@ +/* + * 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; + +/** + * ToolCallArgsDeltaData + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class ToolCallArgsDeltaData { + public static final String SERIALIZED_NAME_DELTA = "delta"; + @SerializedName(SERIALIZED_NAME_DELTA) + @javax.annotation.Nullable + private String delta; + + public static final String SERIALIZED_NAME_TOOL_CALL_ID = "tool_call_id"; + @SerializedName(SERIALIZED_NAME_TOOL_CALL_ID) + @javax.annotation.Nullable + private String toolCallId; + + public ToolCallArgsDeltaData() { + } + + public ToolCallArgsDeltaData delta(@javax.annotation.Nullable String delta) { + this.delta = delta; + return this; + } + + /** + * Get delta + * @return delta + */ + @javax.annotation.Nullable + public String getDelta() { + return delta; + } + + public void setDelta(@javax.annotation.Nullable String delta) { + this.delta = delta; + } + + + public ToolCallArgsDeltaData toolCallId(@javax.annotation.Nullable String toolCallId) { + this.toolCallId = toolCallId; + return this; + } + + /** + * Get toolCallId + * @return toolCallId + */ + @javax.annotation.Nullable + public String getToolCallId() { + return toolCallId; + } + + public void setToolCallId(@javax.annotation.Nullable String toolCallId) { + this.toolCallId = toolCallId; + } + + /** + * 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 ToolCallArgsDeltaData instance itself + */ + public ToolCallArgsDeltaData 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; + } + ToolCallArgsDeltaData toolCallArgsDeltaData = (ToolCallArgsDeltaData) o; + return Objects.equals(this.delta, toolCallArgsDeltaData.delta) && + Objects.equals(this.toolCallId, toolCallArgsDeltaData.toolCallId)&& + Objects.equals(this.additionalProperties, toolCallArgsDeltaData.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(delta, toolCallId, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ToolCallArgsDeltaData {\n"); + sb.append(" delta: ").append(toIndentedString(delta)).append("\n"); + sb.append(" toolCallId: ").append(toIndentedString(toolCallId)).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("delta", "tool_call_id")); + + // 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 ToolCallArgsDeltaData + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ToolCallArgsDeltaData.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 ToolCallArgsDeltaData is not found in the empty JSON string", ToolCallArgsDeltaData.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("delta") != null && !jsonObj.get("delta").isJsonNull()) && !jsonObj.get("delta").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `delta` to be a primitive type in the JSON string but got `%s`", jsonObj.get("delta").toString())); + } + if ((jsonObj.get("tool_call_id") != null && !jsonObj.get("tool_call_id").isJsonNull()) && !jsonObj.get("tool_call_id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `tool_call_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("tool_call_id").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ToolCallArgsDeltaData.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ToolCallArgsDeltaData' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ToolCallArgsDeltaData.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, ToolCallArgsDeltaData 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 ToolCallArgsDeltaData read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + ToolCallArgsDeltaData 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 ToolCallArgsDeltaData given an JSON string + * + * @param jsonString JSON string + * @return An instance of ToolCallArgsDeltaData + * @throws IOException if the JSON string is invalid with respect to ToolCallArgsDeltaData + */ + public static ToolCallArgsDeltaData fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ToolCallArgsDeltaData.class); + } + + /** + * Convert an instance of ToolCallArgsDeltaData to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/ai/reveng/model/ToolCallEndData.java b/src/main/java/ai/reveng/model/ToolCallEndData.java new file mode 100644 index 00000000..7a1f271a --- /dev/null +++ b/src/main/java/ai/reveng/model/ToolCallEndData.java @@ -0,0 +1,282 @@ +/* + * 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; + +/** + * ToolCallEndData + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class ToolCallEndData { + public static final String SERIALIZED_NAME_TOOL_CALL_ID = "tool_call_id"; + @SerializedName(SERIALIZED_NAME_TOOL_CALL_ID) + @javax.annotation.Nullable + private String toolCallId; + + public ToolCallEndData() { + } + + public ToolCallEndData toolCallId(@javax.annotation.Nullable String toolCallId) { + this.toolCallId = toolCallId; + return this; + } + + /** + * Get toolCallId + * @return toolCallId + */ + @javax.annotation.Nullable + public String getToolCallId() { + return toolCallId; + } + + public void setToolCallId(@javax.annotation.Nullable String toolCallId) { + this.toolCallId = toolCallId; + } + + /** + * 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 ToolCallEndData instance itself + */ + public ToolCallEndData 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; + } + ToolCallEndData toolCallEndData = (ToolCallEndData) o; + return Objects.equals(this.toolCallId, toolCallEndData.toolCallId)&& + Objects.equals(this.additionalProperties, toolCallEndData.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(toolCallId, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ToolCallEndData {\n"); + sb.append(" toolCallId: ").append(toIndentedString(toolCallId)).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("tool_call_id")); + + // 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 ToolCallEndData + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ToolCallEndData.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 ToolCallEndData is not found in the empty JSON string", ToolCallEndData.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("tool_call_id") != null && !jsonObj.get("tool_call_id").isJsonNull()) && !jsonObj.get("tool_call_id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `tool_call_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("tool_call_id").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ToolCallEndData.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ToolCallEndData' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ToolCallEndData.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, ToolCallEndData 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 ToolCallEndData read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + ToolCallEndData 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 ToolCallEndData given an JSON string + * + * @param jsonString JSON string + * @return An instance of ToolCallEndData + * @throws IOException if the JSON string is invalid with respect to ToolCallEndData + */ + public static ToolCallEndData fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ToolCallEndData.class); + } + + /** + * Convert an instance of ToolCallEndData to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/ai/reveng/model/ToolCallProgressData.java b/src/main/java/ai/reveng/model/ToolCallProgressData.java new file mode 100644 index 00000000..31fdbf09 --- /dev/null +++ b/src/main/java/ai/reveng/model/ToolCallProgressData.java @@ -0,0 +1,311 @@ +/* + * 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; + +/** + * ToolCallProgressData + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class ToolCallProgressData { + public static final String SERIALIZED_NAME_MESSAGE = "message"; + @SerializedName(SERIALIZED_NAME_MESSAGE) + @javax.annotation.Nullable + private String message; + + public static final String SERIALIZED_NAME_TOOL_CALL_ID = "tool_call_id"; + @SerializedName(SERIALIZED_NAME_TOOL_CALL_ID) + @javax.annotation.Nullable + private String toolCallId; + + public ToolCallProgressData() { + } + + public ToolCallProgressData message(@javax.annotation.Nullable String message) { + this.message = message; + return this; + } + + /** + * Get message + * @return message + */ + @javax.annotation.Nullable + public String getMessage() { + return message; + } + + public void setMessage(@javax.annotation.Nullable String message) { + this.message = message; + } + + + public ToolCallProgressData toolCallId(@javax.annotation.Nullable String toolCallId) { + this.toolCallId = toolCallId; + return this; + } + + /** + * Get toolCallId + * @return toolCallId + */ + @javax.annotation.Nullable + public String getToolCallId() { + return toolCallId; + } + + public void setToolCallId(@javax.annotation.Nullable String toolCallId) { + this.toolCallId = toolCallId; + } + + /** + * 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 ToolCallProgressData instance itself + */ + public ToolCallProgressData 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; + } + ToolCallProgressData toolCallProgressData = (ToolCallProgressData) o; + return Objects.equals(this.message, toolCallProgressData.message) && + Objects.equals(this.toolCallId, toolCallProgressData.toolCallId)&& + Objects.equals(this.additionalProperties, toolCallProgressData.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(message, toolCallId, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ToolCallProgressData {\n"); + sb.append(" message: ").append(toIndentedString(message)).append("\n"); + sb.append(" toolCallId: ").append(toIndentedString(toolCallId)).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("message", "tool_call_id")); + + // 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 ToolCallProgressData + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ToolCallProgressData.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 ToolCallProgressData is not found in the empty JSON string", ToolCallProgressData.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("message") != null && !jsonObj.get("message").isJsonNull()) && !jsonObj.get("message").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `message` to be a primitive type in the JSON string but got `%s`", jsonObj.get("message").toString())); + } + if ((jsonObj.get("tool_call_id") != null && !jsonObj.get("tool_call_id").isJsonNull()) && !jsonObj.get("tool_call_id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `tool_call_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("tool_call_id").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ToolCallProgressData.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ToolCallProgressData' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ToolCallProgressData.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, ToolCallProgressData 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 ToolCallProgressData read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + ToolCallProgressData 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 ToolCallProgressData given an JSON string + * + * @param jsonString JSON string + * @return An instance of ToolCallProgressData + * @throws IOException if the JSON string is invalid with respect to ToolCallProgressData + */ + public static ToolCallProgressData fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ToolCallProgressData.class); + } + + /** + * Convert an instance of ToolCallProgressData to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/ai/reveng/model/BaseResponseTaskResponse.java b/src/main/java/ai/reveng/model/ToolCallResultData.java similarity index 58% rename from src/main/java/ai/reveng/model/BaseResponseTaskResponse.java rename to src/main/java/ai/reveng/model/ToolCallResultData.java index 5902e87d..5ec4f38b 100644 --- a/src/main/java/ai/reveng/model/BaseResponseTaskResponse.java +++ b/src/main/java/ai/reveng/model/ToolCallResultData.java @@ -13,9 +13,7 @@ package ai.reveng.model; import java.util.Objects; -import ai.reveng.model.ErrorModel; -import ai.reveng.model.MetaModel; -import ai.reveng.model.TaskResponse; +import ai.reveng.model.EntityUpdate; import com.google.gson.TypeAdapter; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; @@ -51,138 +49,138 @@ import ai.reveng.invoker.JSON; /** - * BaseResponseTaskResponse + * ToolCallResultData */ @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class BaseResponseTaskResponse { - public static final String SERIALIZED_NAME_STATUS = "status"; - @SerializedName(SERIALIZED_NAME_STATUS) +public class ToolCallResultData { + public static final String SERIALIZED_NAME_IS_ERROR = "is_error"; + @SerializedName(SERIALIZED_NAME_IS_ERROR) @javax.annotation.Nullable - private Boolean status = true; + private Boolean isError; - public static final String SERIALIZED_NAME_DATA = "data"; - @SerializedName(SERIALIZED_NAME_DATA) + public static final String SERIALIZED_NAME_RESULT = "result"; + @SerializedName(SERIALIZED_NAME_RESULT) @javax.annotation.Nullable - private TaskResponse data; + private String result; - public static final String SERIALIZED_NAME_MESSAGE = "message"; - @SerializedName(SERIALIZED_NAME_MESSAGE) + public static final String SERIALIZED_NAME_TOOL_CALL_ID = "tool_call_id"; + @SerializedName(SERIALIZED_NAME_TOOL_CALL_ID) @javax.annotation.Nullable - private String message; + private String toolCallId; - public static final String SERIALIZED_NAME_ERRORS = "errors"; - @SerializedName(SERIALIZED_NAME_ERRORS) + public static final String SERIALIZED_NAME_TOOL_NAME = "tool_name"; + @SerializedName(SERIALIZED_NAME_TOOL_NAME) @javax.annotation.Nullable - private List errors; + private String toolName; - public static final String SERIALIZED_NAME_META = "meta"; - @SerializedName(SERIALIZED_NAME_META) + public static final String SERIALIZED_NAME_UPDATED = "updated"; + @SerializedName(SERIALIZED_NAME_UPDATED) @javax.annotation.Nullable - private MetaModel meta; + private List updated; - public BaseResponseTaskResponse() { + public ToolCallResultData() { } - public BaseResponseTaskResponse status(@javax.annotation.Nullable Boolean status) { - this.status = status; + public ToolCallResultData isError(@javax.annotation.Nullable Boolean isError) { + this.isError = isError; return this; } /** - * Response status on whether the request succeeded - * @return status + * Get isError + * @return isError */ @javax.annotation.Nullable - public Boolean getStatus() { - return status; + public Boolean getIsError() { + return isError; } - public void setStatus(@javax.annotation.Nullable Boolean status) { - this.status = status; + public void setIsError(@javax.annotation.Nullable Boolean isError) { + this.isError = isError; } - public BaseResponseTaskResponse data(@javax.annotation.Nullable TaskResponse data) { - this.data = data; + public ToolCallResultData result(@javax.annotation.Nullable String result) { + this.result = result; return this; } /** - * Response data - * @return data + * Get result + * @return result */ @javax.annotation.Nullable - public TaskResponse getData() { - return data; + public String getResult() { + return result; } - public void setData(@javax.annotation.Nullable TaskResponse data) { - this.data = data; + public void setResult(@javax.annotation.Nullable String result) { + this.result = result; } - public BaseResponseTaskResponse message(@javax.annotation.Nullable String message) { - this.message = message; + public ToolCallResultData toolCallId(@javax.annotation.Nullable String toolCallId) { + this.toolCallId = toolCallId; return this; } /** - * Response message - * @return message + * Get toolCallId + * @return toolCallId */ @javax.annotation.Nullable - public String getMessage() { - return message; + public String getToolCallId() { + return toolCallId; } - public void setMessage(@javax.annotation.Nullable String message) { - this.message = message; + public void setToolCallId(@javax.annotation.Nullable String toolCallId) { + this.toolCallId = toolCallId; } - public BaseResponseTaskResponse errors(@javax.annotation.Nullable List errors) { - this.errors = errors; - return this; - } - - public BaseResponseTaskResponse addErrorsItem(ErrorModel errorsItem) { - if (this.errors == null) { - this.errors = new ArrayList<>(); - } - this.errors.add(errorsItem); + public ToolCallResultData toolName(@javax.annotation.Nullable String toolName) { + this.toolName = toolName; return this; } /** - * List of errors - * @return errors + * Get toolName + * @return toolName */ @javax.annotation.Nullable - public List getErrors() { - return errors; + public String getToolName() { + return toolName; } - public void setErrors(@javax.annotation.Nullable List errors) { - this.errors = errors; + public void setToolName(@javax.annotation.Nullable String toolName) { + this.toolName = toolName; } - public BaseResponseTaskResponse meta(@javax.annotation.Nullable MetaModel meta) { - this.meta = meta; + public ToolCallResultData updated(@javax.annotation.Nullable List updated) { + this.updated = updated; + return this; + } + + public ToolCallResultData addUpdatedItem(EntityUpdate updatedItem) { + if (this.updated == null) { + this.updated = new ArrayList<>(); + } + this.updated.add(updatedItem); return this; } /** - * Metadata - * @return meta + * Get updated + * @return updated */ @javax.annotation.Nullable - public MetaModel getMeta() { - return meta; + public List getUpdated() { + return updated; } - public void setMeta(@javax.annotation.Nullable MetaModel meta) { - this.meta = meta; + public void setUpdated(@javax.annotation.Nullable List updated) { + this.updated = updated; } /** @@ -198,9 +196,9 @@ public void setMeta(@javax.annotation.Nullable MetaModel meta) { * * @param key name of the property * @param value value of the property - * @return the BaseResponseTaskResponse instance itself + * @return the ToolCallResultData instance itself */ - public BaseResponseTaskResponse putAdditionalProperty(String key, Object value) { + public ToolCallResultData putAdditionalProperty(String key, Object value) { if (this.additionalProperties == null) { this.additionalProperties = new HashMap(); } @@ -239,13 +237,13 @@ public boolean equals(Object o) { if (o == null || getClass() != o.getClass()) { return false; } - BaseResponseTaskResponse baseResponseTaskResponse = (BaseResponseTaskResponse) o; - return Objects.equals(this.status, baseResponseTaskResponse.status) && - Objects.equals(this.data, baseResponseTaskResponse.data) && - Objects.equals(this.message, baseResponseTaskResponse.message) && - Objects.equals(this.errors, baseResponseTaskResponse.errors) && - Objects.equals(this.meta, baseResponseTaskResponse.meta)&& - Objects.equals(this.additionalProperties, baseResponseTaskResponse.additionalProperties); + ToolCallResultData toolCallResultData = (ToolCallResultData) o; + return Objects.equals(this.isError, toolCallResultData.isError) && + Objects.equals(this.result, toolCallResultData.result) && + Objects.equals(this.toolCallId, toolCallResultData.toolCallId) && + Objects.equals(this.toolName, toolCallResultData.toolName) && + Objects.equals(this.updated, toolCallResultData.updated)&& + Objects.equals(this.additionalProperties, toolCallResultData.additionalProperties); } private static boolean equalsNullable(JsonNullable a, JsonNullable b) { @@ -254,7 +252,7 @@ private static boolean equalsNullable(JsonNullable a, JsonNullable b) @Override public int hashCode() { - return Objects.hash(status, data, message, errors, meta, additionalProperties); + return Objects.hash(isError, result, toolCallId, toolName, updated, additionalProperties); } private static int hashCodeNullable(JsonNullable a) { @@ -267,12 +265,12 @@ private static int hashCodeNullable(JsonNullable a) { @Override public String toString() { StringBuilder sb = new StringBuilder(); - sb.append("class BaseResponseTaskResponse {\n"); - sb.append(" status: ").append(toIndentedString(status)).append("\n"); - sb.append(" data: ").append(toIndentedString(data)).append("\n"); - sb.append(" message: ").append(toIndentedString(message)).append("\n"); - sb.append(" errors: ").append(toIndentedString(errors)).append("\n"); - sb.append(" meta: ").append(toIndentedString(meta)).append("\n"); + sb.append("class ToolCallResultData {\n"); + sb.append(" isError: ").append(toIndentedString(isError)).append("\n"); + sb.append(" result: ").append(toIndentedString(result)).append("\n"); + sb.append(" toolCallId: ").append(toIndentedString(toolCallId)).append("\n"); + sb.append(" toolName: ").append(toIndentedString(toolName)).append("\n"); + sb.append(" updated: ").append(toIndentedString(updated)).append("\n"); sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); sb.append("}"); return sb.toString(); @@ -292,7 +290,7 @@ private String toIndentedString(Object o) { static { // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(Arrays.asList("status", "data", "message", "errors", "meta")); + openapiFields = new HashSet(Arrays.asList("is_error", "result", "tool_call_id", "tool_name", "updated")); // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(0); @@ -302,39 +300,27 @@ private String toIndentedString(Object o) { * Validates the JSON Element and throws an exception if issues found * * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to BaseResponseTaskResponse + * @throws IOException if the JSON Element is invalid with respect to ToolCallResultData */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (jsonElement == null) { - if (!BaseResponseTaskResponse.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 BaseResponseTaskResponse is not found in the empty JSON string", BaseResponseTaskResponse.openapiRequiredFields.toString())); + if (!ToolCallResultData.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 ToolCallResultData is not found in the empty JSON string", ToolCallResultData.openapiRequiredFields.toString())); } } JsonObject jsonObj = jsonElement.getAsJsonObject(); - // validate the optional field `data` - if (jsonObj.get("data") != null && !jsonObj.get("data").isJsonNull()) { - TaskResponse.validateJsonElement(jsonObj.get("data")); + if ((jsonObj.get("result") != null && !jsonObj.get("result").isJsonNull()) && !jsonObj.get("result").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `result` to be a primitive type in the JSON string but got `%s`", jsonObj.get("result").toString())); } - if ((jsonObj.get("message") != null && !jsonObj.get("message").isJsonNull()) && !jsonObj.get("message").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `message` to be a primitive type in the JSON string but got `%s`", jsonObj.get("message").toString())); + if ((jsonObj.get("tool_call_id") != null && !jsonObj.get("tool_call_id").isJsonNull()) && !jsonObj.get("tool_call_id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `tool_call_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("tool_call_id").toString())); } - if (jsonObj.get("errors") != null && !jsonObj.get("errors").isJsonNull()) { - JsonArray jsonArrayerrors = jsonObj.getAsJsonArray("errors"); - if (jsonArrayerrors != null) { - // ensure the json data is an array - if (!jsonObj.get("errors").isJsonArray()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `errors` to be an array in the JSON string but got `%s`", jsonObj.get("errors").toString())); - } - - // validate the optional field `errors` (array) - for (int i = 0; i < jsonArrayerrors.size(); i++) { - ErrorModel.validateJsonElement(jsonArrayerrors.get(i)); - }; - } + if ((jsonObj.get("tool_name") != null && !jsonObj.get("tool_name").isJsonNull()) && !jsonObj.get("tool_name").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `tool_name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("tool_name").toString())); } - // validate the optional field `meta` - if (jsonObj.get("meta") != null && !jsonObj.get("meta").isJsonNull()) { - MetaModel.validateJsonElement(jsonObj.get("meta")); + // ensure the optional json data is an array if present + if (jsonObj.get("updated") != null && !jsonObj.get("updated").isJsonNull() && !jsonObj.get("updated").isJsonArray()) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `updated` to be an array in the JSON string but got `%s`", jsonObj.get("updated").toString())); } } @@ -342,16 +328,16 @@ public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @SuppressWarnings("unchecked") @Override public TypeAdapter create(Gson gson, TypeToken type) { - if (!BaseResponseTaskResponse.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'BaseResponseTaskResponse' and its subtypes + if (!ToolCallResultData.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ToolCallResultData' and its subtypes } final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(BaseResponseTaskResponse.class)); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ToolCallResultData.class)); - return (TypeAdapter) new TypeAdapter() { + return (TypeAdapter) new TypeAdapter() { @Override - public void write(JsonWriter out, BaseResponseTaskResponse value) throws IOException { + public void write(JsonWriter out, ToolCallResultData value) throws IOException { JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); obj.remove("additionalProperties"); // serialize additional properties @@ -379,12 +365,12 @@ else if (entry.getValue() instanceof Character) } @Override - public BaseResponseTaskResponse read(JsonReader in) throws IOException { + public ToolCallResultData read(JsonReader in) throws IOException { JsonElement jsonElement = elementAdapter.read(in); validateJsonElement(jsonElement); JsonObject jsonObj = jsonElement.getAsJsonObject(); // store additional fields in the deserialized instance - BaseResponseTaskResponse instance = thisAdapter.fromJsonTree(jsonObj); + ToolCallResultData instance = thisAdapter.fromJsonTree(jsonObj); for (Map.Entry entry : jsonObj.entrySet()) { if (!openapiFields.contains(entry.getKey())) { if (entry.getValue().isJsonPrimitive()) { // primitive type @@ -411,18 +397,18 @@ else if (entry.getValue().getAsJsonPrimitive().isBoolean()) } /** - * Create an instance of BaseResponseTaskResponse given an JSON string + * Create an instance of ToolCallResultData given an JSON string * * @param jsonString JSON string - * @return An instance of BaseResponseTaskResponse - * @throws IOException if the JSON string is invalid with respect to BaseResponseTaskResponse + * @return An instance of ToolCallResultData + * @throws IOException if the JSON string is invalid with respect to ToolCallResultData */ - public static BaseResponseTaskResponse fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, BaseResponseTaskResponse.class); + public static ToolCallResultData fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ToolCallResultData.class); } /** - * Convert an instance of BaseResponseTaskResponse to an JSON string + * Convert an instance of ToolCallResultData to an JSON string * * @return JSON string */ diff --git a/src/main/java/ai/reveng/model/ToolCallStartData.java b/src/main/java/ai/reveng/model/ToolCallStartData.java new file mode 100644 index 00000000..b6e51d43 --- /dev/null +++ b/src/main/java/ai/reveng/model/ToolCallStartData.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 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; + +/** + * ToolCallStartData + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class ToolCallStartData { + public static final String SERIALIZED_NAME_TOOL_ARGS = "tool_args"; + @SerializedName(SERIALIZED_NAME_TOOL_ARGS) + @javax.annotation.Nullable + private String toolArgs; + + public static final String SERIALIZED_NAME_TOOL_CALL_ID = "tool_call_id"; + @SerializedName(SERIALIZED_NAME_TOOL_CALL_ID) + @javax.annotation.Nullable + private String toolCallId; + + public static final String SERIALIZED_NAME_TOOL_NAME = "tool_name"; + @SerializedName(SERIALIZED_NAME_TOOL_NAME) + @javax.annotation.Nullable + private String toolName; + + public ToolCallStartData() { + } + + public ToolCallStartData toolArgs(@javax.annotation.Nullable String toolArgs) { + this.toolArgs = toolArgs; + return this; + } + + /** + * Get toolArgs + * @return toolArgs + */ + @javax.annotation.Nullable + public String getToolArgs() { + return toolArgs; + } + + public void setToolArgs(@javax.annotation.Nullable String toolArgs) { + this.toolArgs = toolArgs; + } + + + public ToolCallStartData toolCallId(@javax.annotation.Nullable String toolCallId) { + this.toolCallId = toolCallId; + return this; + } + + /** + * Get toolCallId + * @return toolCallId + */ + @javax.annotation.Nullable + public String getToolCallId() { + return toolCallId; + } + + public void setToolCallId(@javax.annotation.Nullable String toolCallId) { + this.toolCallId = toolCallId; + } + + + public ToolCallStartData toolName(@javax.annotation.Nullable String toolName) { + this.toolName = toolName; + return this; + } + + /** + * Get toolName + * @return toolName + */ + @javax.annotation.Nullable + public String getToolName() { + return toolName; + } + + public void setToolName(@javax.annotation.Nullable String toolName) { + this.toolName = toolName; + } + + /** + * 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 ToolCallStartData instance itself + */ + public ToolCallStartData 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; + } + ToolCallStartData toolCallStartData = (ToolCallStartData) o; + return Objects.equals(this.toolArgs, toolCallStartData.toolArgs) && + Objects.equals(this.toolCallId, toolCallStartData.toolCallId) && + Objects.equals(this.toolName, toolCallStartData.toolName)&& + Objects.equals(this.additionalProperties, toolCallStartData.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(toolArgs, toolCallId, toolName, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ToolCallStartData {\n"); + sb.append(" toolArgs: ").append(toIndentedString(toolArgs)).append("\n"); + sb.append(" toolCallId: ").append(toIndentedString(toolCallId)).append("\n"); + sb.append(" toolName: ").append(toIndentedString(toolName)).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("tool_args", "tool_call_id", "tool_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 ToolCallStartData + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ToolCallStartData.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 ToolCallStartData is not found in the empty JSON string", ToolCallStartData.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("tool_args") != null && !jsonObj.get("tool_args").isJsonNull()) && !jsonObj.get("tool_args").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `tool_args` to be a primitive type in the JSON string but got `%s`", jsonObj.get("tool_args").toString())); + } + if ((jsonObj.get("tool_call_id") != null && !jsonObj.get("tool_call_id").isJsonNull()) && !jsonObj.get("tool_call_id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `tool_call_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("tool_call_id").toString())); + } + if ((jsonObj.get("tool_name") != null && !jsonObj.get("tool_name").isJsonNull()) && !jsonObj.get("tool_name").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `tool_name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("tool_name").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ToolCallStartData.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ToolCallStartData' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ToolCallStartData.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, ToolCallStartData 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 ToolCallStartData read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + ToolCallStartData 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 ToolCallStartData given an JSON string + * + * @param jsonString JSON string + * @return An instance of ToolCallStartData + * @throws IOException if the JSON string is invalid with respect to ToolCallStartData + */ + public static ToolCallStartData fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ToolCallStartData.class); + } + + /** + * Convert an instance of ToolCallStartData to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/ai/reveng/model/BaseResponseStr.java b/src/main/java/ai/reveng/model/ToolConfirmationRequiredData.java similarity index 59% rename from src/main/java/ai/reveng/model/BaseResponseStr.java rename to src/main/java/ai/reveng/model/ToolConfirmationRequiredData.java index e708e56b..4645f12b 100644 --- a/src/main/java/ai/reveng/model/BaseResponseStr.java +++ b/src/main/java/ai/reveng/model/ToolConfirmationRequiredData.java @@ -13,18 +13,13 @@ package ai.reveng.model; import java.util.Objects; -import ai.reveng.model.ErrorModel; -import ai.reveng.model.MetaModel; 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; @@ -50,138 +45,106 @@ import ai.reveng.invoker.JSON; /** - * BaseResponseStr + * ToolConfirmationRequiredData */ @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class BaseResponseStr { - public static final String SERIALIZED_NAME_STATUS = "status"; - @SerializedName(SERIALIZED_NAME_STATUS) - @javax.annotation.Nullable - private Boolean status = true; - - public static final String SERIALIZED_NAME_DATA = "data"; - @SerializedName(SERIALIZED_NAME_DATA) - @javax.annotation.Nullable - private String data; - +public class ToolConfirmationRequiredData { public static final String SERIALIZED_NAME_MESSAGE = "message"; @SerializedName(SERIALIZED_NAME_MESSAGE) @javax.annotation.Nullable private String message; - public static final String SERIALIZED_NAME_ERRORS = "errors"; - @SerializedName(SERIALIZED_NAME_ERRORS) + public static final String SERIALIZED_NAME_TOOL_ARGS = "tool_args"; + @SerializedName(SERIALIZED_NAME_TOOL_ARGS) @javax.annotation.Nullable - private List errors; + private String toolArgs; - public static final String SERIALIZED_NAME_META = "meta"; - @SerializedName(SERIALIZED_NAME_META) + public static final String SERIALIZED_NAME_TOOL_CALL_ID = "tool_call_id"; + @SerializedName(SERIALIZED_NAME_TOOL_CALL_ID) @javax.annotation.Nullable - private MetaModel meta; - - public BaseResponseStr() { - } - - public BaseResponseStr status(@javax.annotation.Nullable Boolean status) { - this.status = status; - return this; - } + private String toolCallId; - /** - * Response status on whether the request succeeded - * @return status - */ + public static final String SERIALIZED_NAME_TOOL_NAME = "tool_name"; + @SerializedName(SERIALIZED_NAME_TOOL_NAME) @javax.annotation.Nullable - public Boolean getStatus() { - return status; - } + private String toolName; - public void setStatus(@javax.annotation.Nullable Boolean status) { - this.status = status; + public ToolConfirmationRequiredData() { } - - public BaseResponseStr data(@javax.annotation.Nullable String data) { - this.data = data; + public ToolConfirmationRequiredData message(@javax.annotation.Nullable String message) { + this.message = message; return this; } /** - * Response data - * @return data + * Get message + * @return message */ @javax.annotation.Nullable - public String getData() { - return data; + public String getMessage() { + return message; } - public void setData(@javax.annotation.Nullable String data) { - this.data = data; + public void setMessage(@javax.annotation.Nullable String message) { + this.message = message; } - public BaseResponseStr message(@javax.annotation.Nullable String message) { - this.message = message; + public ToolConfirmationRequiredData toolArgs(@javax.annotation.Nullable String toolArgs) { + this.toolArgs = toolArgs; return this; } /** - * Response message - * @return message + * Get toolArgs + * @return toolArgs */ @javax.annotation.Nullable - public String getMessage() { - return message; + public String getToolArgs() { + return toolArgs; } - public void setMessage(@javax.annotation.Nullable String message) { - this.message = message; + public void setToolArgs(@javax.annotation.Nullable String toolArgs) { + this.toolArgs = toolArgs; } - public BaseResponseStr errors(@javax.annotation.Nullable List errors) { - this.errors = errors; - return this; - } - - public BaseResponseStr addErrorsItem(ErrorModel errorsItem) { - if (this.errors == null) { - this.errors = new ArrayList<>(); - } - this.errors.add(errorsItem); + public ToolConfirmationRequiredData toolCallId(@javax.annotation.Nullable String toolCallId) { + this.toolCallId = toolCallId; return this; } /** - * List of errors - * @return errors + * Get toolCallId + * @return toolCallId */ @javax.annotation.Nullable - public List getErrors() { - return errors; + public String getToolCallId() { + return toolCallId; } - public void setErrors(@javax.annotation.Nullable List errors) { - this.errors = errors; + public void setToolCallId(@javax.annotation.Nullable String toolCallId) { + this.toolCallId = toolCallId; } - public BaseResponseStr meta(@javax.annotation.Nullable MetaModel meta) { - this.meta = meta; + public ToolConfirmationRequiredData toolName(@javax.annotation.Nullable String toolName) { + this.toolName = toolName; return this; } /** - * Metadata - * @return meta + * Get toolName + * @return toolName */ @javax.annotation.Nullable - public MetaModel getMeta() { - return meta; + public String getToolName() { + return toolName; } - public void setMeta(@javax.annotation.Nullable MetaModel meta) { - this.meta = meta; + public void setToolName(@javax.annotation.Nullable String toolName) { + this.toolName = toolName; } /** @@ -197,9 +160,9 @@ public void setMeta(@javax.annotation.Nullable MetaModel meta) { * * @param key name of the property * @param value value of the property - * @return the BaseResponseStr instance itself + * @return the ToolConfirmationRequiredData instance itself */ - public BaseResponseStr putAdditionalProperty(String key, Object value) { + public ToolConfirmationRequiredData putAdditionalProperty(String key, Object value) { if (this.additionalProperties == null) { this.additionalProperties = new HashMap(); } @@ -238,40 +201,27 @@ public boolean equals(Object o) { if (o == null || getClass() != o.getClass()) { return false; } - BaseResponseStr baseResponseStr = (BaseResponseStr) o; - return Objects.equals(this.status, baseResponseStr.status) && - Objects.equals(this.data, baseResponseStr.data) && - Objects.equals(this.message, baseResponseStr.message) && - Objects.equals(this.errors, baseResponseStr.errors) && - Objects.equals(this.meta, baseResponseStr.meta)&& - Objects.equals(this.additionalProperties, baseResponseStr.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())); + ToolConfirmationRequiredData toolConfirmationRequiredData = (ToolConfirmationRequiredData) o; + return Objects.equals(this.message, toolConfirmationRequiredData.message) && + Objects.equals(this.toolArgs, toolConfirmationRequiredData.toolArgs) && + Objects.equals(this.toolCallId, toolConfirmationRequiredData.toolCallId) && + Objects.equals(this.toolName, toolConfirmationRequiredData.toolName)&& + Objects.equals(this.additionalProperties, toolConfirmationRequiredData.additionalProperties); } @Override public int hashCode() { - return Objects.hash(status, data, message, errors, meta, additionalProperties); - } - - private static int hashCodeNullable(JsonNullable a) { - if (a == null) { - return 1; - } - return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + return Objects.hash(message, toolArgs, toolCallId, toolName, additionalProperties); } @Override public String toString() { StringBuilder sb = new StringBuilder(); - sb.append("class BaseResponseStr {\n"); - sb.append(" status: ").append(toIndentedString(status)).append("\n"); - sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append("class ToolConfirmationRequiredData {\n"); sb.append(" message: ").append(toIndentedString(message)).append("\n"); - sb.append(" errors: ").append(toIndentedString(errors)).append("\n"); - sb.append(" meta: ").append(toIndentedString(meta)).append("\n"); + sb.append(" toolArgs: ").append(toIndentedString(toolArgs)).append("\n"); + sb.append(" toolCallId: ").append(toIndentedString(toolCallId)).append("\n"); + sb.append(" toolName: ").append(toIndentedString(toolName)).append("\n"); sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); sb.append("}"); return sb.toString(); @@ -291,7 +241,7 @@ private String toIndentedString(Object o) { static { // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(Arrays.asList("status", "data", "message", "errors", "meta")); + openapiFields = new HashSet(Arrays.asList("message", "tool_args", "tool_call_id", "tool_name")); // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(0); @@ -301,38 +251,26 @@ private String toIndentedString(Object o) { * Validates the JSON Element and throws an exception if issues found * * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to BaseResponseStr + * @throws IOException if the JSON Element is invalid with respect to ToolConfirmationRequiredData */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (jsonElement == null) { - if (!BaseResponseStr.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 BaseResponseStr is not found in the empty JSON string", BaseResponseStr.openapiRequiredFields.toString())); + if (!ToolConfirmationRequiredData.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 ToolConfirmationRequiredData is not found in the empty JSON string", ToolConfirmationRequiredData.openapiRequiredFields.toString())); } } JsonObject jsonObj = jsonElement.getAsJsonObject(); - if ((jsonObj.get("data") != null && !jsonObj.get("data").isJsonNull()) && !jsonObj.get("data").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `data` to be a primitive type in the JSON string but got `%s`", jsonObj.get("data").toString())); - } if ((jsonObj.get("message") != null && !jsonObj.get("message").isJsonNull()) && !jsonObj.get("message").isJsonPrimitive()) { throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `message` to be a primitive type in the JSON string but got `%s`", jsonObj.get("message").toString())); } - if (jsonObj.get("errors") != null && !jsonObj.get("errors").isJsonNull()) { - JsonArray jsonArrayerrors = jsonObj.getAsJsonArray("errors"); - if (jsonArrayerrors != null) { - // ensure the json data is an array - if (!jsonObj.get("errors").isJsonArray()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `errors` to be an array in the JSON string but got `%s`", jsonObj.get("errors").toString())); - } - - // validate the optional field `errors` (array) - for (int i = 0; i < jsonArrayerrors.size(); i++) { - ErrorModel.validateJsonElement(jsonArrayerrors.get(i)); - }; - } + if ((jsonObj.get("tool_args") != null && !jsonObj.get("tool_args").isJsonNull()) && !jsonObj.get("tool_args").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `tool_args` to be a primitive type in the JSON string but got `%s`", jsonObj.get("tool_args").toString())); + } + if ((jsonObj.get("tool_call_id") != null && !jsonObj.get("tool_call_id").isJsonNull()) && !jsonObj.get("tool_call_id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `tool_call_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("tool_call_id").toString())); } - // validate the optional field `meta` - if (jsonObj.get("meta") != null && !jsonObj.get("meta").isJsonNull()) { - MetaModel.validateJsonElement(jsonObj.get("meta")); + if ((jsonObj.get("tool_name") != null && !jsonObj.get("tool_name").isJsonNull()) && !jsonObj.get("tool_name").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `tool_name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("tool_name").toString())); } } @@ -340,16 +278,16 @@ public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @SuppressWarnings("unchecked") @Override public TypeAdapter create(Gson gson, TypeToken type) { - if (!BaseResponseStr.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'BaseResponseStr' and its subtypes + if (!ToolConfirmationRequiredData.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ToolConfirmationRequiredData' and its subtypes } final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(BaseResponseStr.class)); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ToolConfirmationRequiredData.class)); - return (TypeAdapter) new TypeAdapter() { + return (TypeAdapter) new TypeAdapter() { @Override - public void write(JsonWriter out, BaseResponseStr value) throws IOException { + public void write(JsonWriter out, ToolConfirmationRequiredData value) throws IOException { JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); obj.remove("additionalProperties"); // serialize additional properties @@ -377,12 +315,12 @@ else if (entry.getValue() instanceof Character) } @Override - public BaseResponseStr read(JsonReader in) throws IOException { + public ToolConfirmationRequiredData read(JsonReader in) throws IOException { JsonElement jsonElement = elementAdapter.read(in); validateJsonElement(jsonElement); JsonObject jsonObj = jsonElement.getAsJsonObject(); // store additional fields in the deserialized instance - BaseResponseStr instance = thisAdapter.fromJsonTree(jsonObj); + ToolConfirmationRequiredData instance = thisAdapter.fromJsonTree(jsonObj); for (Map.Entry entry : jsonObj.entrySet()) { if (!openapiFields.contains(entry.getKey())) { if (entry.getValue().isJsonPrimitive()) { // primitive type @@ -409,18 +347,18 @@ else if (entry.getValue().getAsJsonPrimitive().isBoolean()) } /** - * Create an instance of BaseResponseStr given an JSON string + * Create an instance of ToolConfirmationRequiredData given an JSON string * * @param jsonString JSON string - * @return An instance of BaseResponseStr - * @throws IOException if the JSON string is invalid with respect to BaseResponseStr + * @return An instance of ToolConfirmationRequiredData + * @throws IOException if the JSON string is invalid with respect to ToolConfirmationRequiredData */ - public static BaseResponseStr fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, BaseResponseStr.class); + public static ToolConfirmationRequiredData fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ToolConfirmationRequiredData.class); } /** - * Convert an instance of BaseResponseStr to an JSON string + * Convert an instance of ToolConfirmationRequiredData to an JSON string * * @return JSON string */ diff --git a/src/main/java/ai/reveng/model/TriggerDynamicExecutionInputBody.java b/src/main/java/ai/reveng/model/TriggerDynamicExecutionInputBody.java deleted file mode 100644 index 798bd5de..00000000 --- a/src/main/java/ai/reveng/model/TriggerDynamicExecutionInputBody.java +++ /dev/null @@ -1,544 +0,0 @@ -/* - * RevEng.AI API - * RevEng.AI is an AI-powered binary analysis platform for reverse engineering and malware analysis. It provides similarity search across executable binaries and functions, AI-driven decompilation, dynamic execution analysis, firmware unpacking, and integration with external threat intelligence sources like VirusTotal. - * - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package ai.reveng.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; - -/** - * TriggerDynamicExecutionInputBody - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class TriggerDynamicExecutionInputBody { - public static final String SERIALIZED_NAME_ARCHIVE_ENTRY_PATH = "archive_entry_path"; - @SerializedName(SERIALIZED_NAME_ARCHIVE_ENTRY_PATH) - @javax.annotation.Nullable - private String archiveEntryPath; - - public static final String SERIALIZED_NAME_ARCHIVE_PASSWORD = "archive_password"; - @SerializedName(SERIALIZED_NAME_ARCHIVE_PASSWORD) - @javax.annotation.Nullable - private String archivePassword; - - public static final String SERIALIZED_NAME_ARCHIVE_SHA256_HASH = "archive_sha_256_hash"; - @SerializedName(SERIALIZED_NAME_ARCHIVE_SHA256_HASH) - @javax.annotation.Nullable - private String archiveSha256Hash; - - public static final String SERIALIZED_NAME_COMMAND_LINE_ARGS = "command_line_args"; - @SerializedName(SERIALIZED_NAME_COMMAND_LINE_ARGS) - @javax.annotation.Nullable - private String commandLineArgs; - - /** - * How the sandbox launches the sample. Defaults to the sandbox's standard behaviour when omitted. - */ - @JsonAdapter(StartMethodEnum.Adapter.class) - public enum StartMethodEnum { - STANDARD_USER_PROCESS("standard_user_process"), - - ADMINISTRATOR_PROCESS("administrator_process"), - - UNKNOWN_DEFAULT_OPEN_API("unknown_default_open_api"); - - private String value; - - StartMethodEnum(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - public static StartMethodEnum fromValue(String value) { - for (StartMethodEnum b : StartMethodEnum.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 StartMethodEnum enumeration) throws IOException { - jsonWriter.value(enumeration.getValue()); - } - - @Override - public StartMethodEnum read(final JsonReader jsonReader) throws IOException { - String value = jsonReader.nextString(); - return StartMethodEnum.fromValue(value); - } - } - - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - String value = jsonElement.getAsString(); - StartMethodEnum.fromValue(value); - } - } - - public static final String SERIALIZED_NAME_START_METHOD = "start_method"; - @SerializedName(SERIALIZED_NAME_START_METHOD) - @javax.annotation.Nullable - private StartMethodEnum startMethod; - - /** - * Maximum sandbox execution time in seconds - */ - @JsonAdapter(TimeoutEnum.Adapter.class) - public enum TimeoutEnum { - NUMBER_120(120l), - - NUMBER_180(180l), - - NUMBER_300(300l), - - NUMBER_600(600l), - - NUMBER_unknown_default_open_api(11184809l); - - private Long value; - - TimeoutEnum(Long value) { - this.value = value; - } - - public Long getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - public static TimeoutEnum fromValue(Long value) { - for (TimeoutEnum b : TimeoutEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - return NUMBER_unknown_default_open_api; - } - - public static class Adapter extends TypeAdapter { - @Override - public void write(final JsonWriter jsonWriter, final TimeoutEnum enumeration) throws IOException { - jsonWriter.value(enumeration.getValue()); - } - - @Override - public TimeoutEnum read(final JsonReader jsonReader) throws IOException { - Long value = jsonReader.nextLong(); - return TimeoutEnum.fromValue(value); - } - } - - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - Long value = jsonElement.getAsLong(); - TimeoutEnum.fromValue(value); - } - } - - public static final String SERIALIZED_NAME_TIMEOUT = "timeout"; - @SerializedName(SERIALIZED_NAME_TIMEOUT) - @javax.annotation.Nullable - private TimeoutEnum timeout = TimeoutEnum.NUMBER_120; - - public TriggerDynamicExecutionInputBody() { - } - - public TriggerDynamicExecutionInputBody archiveEntryPath(@javax.annotation.Nullable String archiveEntryPath) { - this.archiveEntryPath = archiveEntryPath; - return this; - } - - /** - * Relative path of the entry inside the archive to execute - * @return archiveEntryPath - */ - @javax.annotation.Nullable - public String getArchiveEntryPath() { - return archiveEntryPath; - } - - public void setArchiveEntryPath(@javax.annotation.Nullable String archiveEntryPath) { - this.archiveEntryPath = archiveEntryPath; - } - - - public TriggerDynamicExecutionInputBody archivePassword(@javax.annotation.Nullable String archivePassword) { - this.archivePassword = archivePassword; - return this; - } - - /** - * Password for an encrypted archive - * @return archivePassword - */ - @javax.annotation.Nullable - public String getArchivePassword() { - return archivePassword; - } - - public void setArchivePassword(@javax.annotation.Nullable String archivePassword) { - this.archivePassword = archivePassword; - } - - - public TriggerDynamicExecutionInputBody archiveSha256Hash(@javax.annotation.Nullable String archiveSha256Hash) { - this.archiveSha256Hash = archiveSha256Hash; - return this; - } - - /** - * SHA-256 of the archive object to send to the sandbox instead of the analysed binary - * @return archiveSha256Hash - */ - @javax.annotation.Nullable - public String getArchiveSha256Hash() { - return archiveSha256Hash; - } - - public void setArchiveSha256Hash(@javax.annotation.Nullable String archiveSha256Hash) { - this.archiveSha256Hash = archiveSha256Hash; - } - - - public TriggerDynamicExecutionInputBody commandLineArgs(@javax.annotation.Nullable String commandLineArgs) { - this.commandLineArgs = commandLineArgs; - return this; - } - - /** - * Command-line arguments passed to the sample when the sandbox launches it - * @return commandLineArgs - */ - @javax.annotation.Nullable - public String getCommandLineArgs() { - return commandLineArgs; - } - - public void setCommandLineArgs(@javax.annotation.Nullable String commandLineArgs) { - this.commandLineArgs = commandLineArgs; - } - - - public TriggerDynamicExecutionInputBody startMethod(@javax.annotation.Nullable StartMethodEnum startMethod) { - this.startMethod = startMethod; - return this; - } - - /** - * How the sandbox launches the sample. Defaults to the sandbox's standard behaviour when omitted. - * @return startMethod - */ - @javax.annotation.Nullable - public StartMethodEnum getStartMethod() { - return startMethod; - } - - public void setStartMethod(@javax.annotation.Nullable StartMethodEnum startMethod) { - this.startMethod = startMethod; - } - - - public TriggerDynamicExecutionInputBody timeout(@javax.annotation.Nullable TimeoutEnum timeout) { - this.timeout = timeout; - return this; - } - - /** - * Maximum sandbox execution time in seconds - * @return timeout - */ - @javax.annotation.Nullable - public TimeoutEnum getTimeout() { - return timeout; - } - - public void setTimeout(@javax.annotation.Nullable TimeoutEnum timeout) { - this.timeout = timeout; - } - - /** - * 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 TriggerDynamicExecutionInputBody instance itself - */ - public TriggerDynamicExecutionInputBody 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; - } - TriggerDynamicExecutionInputBody triggerDynamicExecutionInputBody = (TriggerDynamicExecutionInputBody) o; - return Objects.equals(this.archiveEntryPath, triggerDynamicExecutionInputBody.archiveEntryPath) && - Objects.equals(this.archivePassword, triggerDynamicExecutionInputBody.archivePassword) && - Objects.equals(this.archiveSha256Hash, triggerDynamicExecutionInputBody.archiveSha256Hash) && - Objects.equals(this.commandLineArgs, triggerDynamicExecutionInputBody.commandLineArgs) && - Objects.equals(this.startMethod, triggerDynamicExecutionInputBody.startMethod) && - Objects.equals(this.timeout, triggerDynamicExecutionInputBody.timeout)&& - Objects.equals(this.additionalProperties, triggerDynamicExecutionInputBody.additionalProperties); - } - - @Override - public int hashCode() { - return Objects.hash(archiveEntryPath, archivePassword, archiveSha256Hash, commandLineArgs, startMethod, timeout, additionalProperties); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class TriggerDynamicExecutionInputBody {\n"); - sb.append(" archiveEntryPath: ").append(toIndentedString(archiveEntryPath)).append("\n"); - sb.append(" archivePassword: ").append(toIndentedString(archivePassword)).append("\n"); - sb.append(" archiveSha256Hash: ").append(toIndentedString(archiveSha256Hash)).append("\n"); - sb.append(" commandLineArgs: ").append(toIndentedString(commandLineArgs)).append("\n"); - sb.append(" startMethod: ").append(toIndentedString(startMethod)).append("\n"); - sb.append(" timeout: ").append(toIndentedString(timeout)).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("archive_entry_path", "archive_password", "archive_sha_256_hash", "command_line_args", "start_method", "timeout")); - - // 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 TriggerDynamicExecutionInputBody - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!TriggerDynamicExecutionInputBody.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 TriggerDynamicExecutionInputBody is not found in the empty JSON string", TriggerDynamicExecutionInputBody.openapiRequiredFields.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if ((jsonObj.get("archive_entry_path") != null && !jsonObj.get("archive_entry_path").isJsonNull()) && !jsonObj.get("archive_entry_path").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `archive_entry_path` to be a primitive type in the JSON string but got `%s`", jsonObj.get("archive_entry_path").toString())); - } - if ((jsonObj.get("archive_password") != null && !jsonObj.get("archive_password").isJsonNull()) && !jsonObj.get("archive_password").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `archive_password` to be a primitive type in the JSON string but got `%s`", jsonObj.get("archive_password").toString())); - } - if ((jsonObj.get("archive_sha_256_hash") != null && !jsonObj.get("archive_sha_256_hash").isJsonNull()) && !jsonObj.get("archive_sha_256_hash").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `archive_sha_256_hash` to be a primitive type in the JSON string but got `%s`", jsonObj.get("archive_sha_256_hash").toString())); - } - 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())); - } - if ((jsonObj.get("start_method") != null && !jsonObj.get("start_method").isJsonNull()) && !jsonObj.get("start_method").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `start_method` to be a primitive type in the JSON string but got `%s`", jsonObj.get("start_method").toString())); - } - // validate the optional field `start_method` - if (jsonObj.get("start_method") != null && !jsonObj.get("start_method").isJsonNull()) { - StartMethodEnum.validateJsonElement(jsonObj.get("start_method")); - } - // validate the optional field `timeout` - if (jsonObj.get("timeout") != null && !jsonObj.get("timeout").isJsonNull()) { - TimeoutEnum.validateJsonElement(jsonObj.get("timeout")); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!TriggerDynamicExecutionInputBody.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'TriggerDynamicExecutionInputBody' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(TriggerDynamicExecutionInputBody.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, TriggerDynamicExecutionInputBody 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 TriggerDynamicExecutionInputBody read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // store additional fields in the deserialized instance - TriggerDynamicExecutionInputBody 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 TriggerDynamicExecutionInputBody given an JSON string - * - * @param jsonString JSON string - * @return An instance of TriggerDynamicExecutionInputBody - * @throws IOException if the JSON string is invalid with respect to TriggerDynamicExecutionInputBody - */ - public static TriggerDynamicExecutionInputBody fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, TriggerDynamicExecutionInputBody.class); - } - - /** - * Convert an instance of TriggerDynamicExecutionInputBody to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/ai/reveng/model/UpdateProfileInputBody.java b/src/main/java/ai/reveng/model/UpdateProfileInputBody.java index f691e14d..6cb6cbd4 100644 --- a/src/main/java/ai/reveng/model/UpdateProfileInputBody.java +++ b/src/main/java/ai/reveng/model/UpdateProfileInputBody.java @@ -59,6 +59,11 @@ public class UpdateProfileInputBody { @javax.annotation.Nullable private String firstName; + public static final String SERIALIZED_NAME_HIDE_AI_DECOMPILATION_COMMENTS = "hide_ai_decompilation_comments"; + @SerializedName(SERIALIZED_NAME_HIDE_AI_DECOMPILATION_COMMENTS) + @javax.annotation.Nullable + private Boolean hideAiDecompilationComments; + public static final String SERIALIZED_NAME_HIDE_EXAMPLE_BINARIES = "hide_example_binaries"; @SerializedName(SERIALIZED_NAME_HIDE_EXAMPLE_BINARIES) @javax.annotation.Nullable @@ -121,6 +126,25 @@ public void setFirstName(@javax.annotation.Nullable String firstName) { } + public UpdateProfileInputBody hideAiDecompilationComments(@javax.annotation.Nullable Boolean hideAiDecompilationComments) { + this.hideAiDecompilationComments = hideAiDecompilationComments; + return this; + } + + /** + * Hide AI decompilation comments across the platform + * @return hideAiDecompilationComments + */ + @javax.annotation.Nullable + public Boolean getHideAiDecompilationComments() { + return hideAiDecompilationComments; + } + + public void setHideAiDecompilationComments(@javax.annotation.Nullable Boolean hideAiDecompilationComments) { + this.hideAiDecompilationComments = hideAiDecompilationComments; + } + + public UpdateProfileInputBody hideExampleBinaries(@javax.annotation.Nullable Boolean hideExampleBinaries) { this.hideExampleBinaries = hideExampleBinaries; return this; @@ -253,6 +277,7 @@ public boolean equals(Object o) { UpdateProfileInputBody updateProfileInputBody = (UpdateProfileInputBody) o; return Objects.equals(this.defaultTeamId, updateProfileInputBody.defaultTeamId) && Objects.equals(this.firstName, updateProfileInputBody.firstName) && + Objects.equals(this.hideAiDecompilationComments, updateProfileInputBody.hideAiDecompilationComments) && Objects.equals(this.hideExampleBinaries, updateProfileInputBody.hideExampleBinaries) && Objects.equals(this.lastName, updateProfileInputBody.lastName) && Objects.equals(this.timeZone, updateProfileInputBody.timeZone) && @@ -262,7 +287,7 @@ public boolean equals(Object o) { @Override public int hashCode() { - return Objects.hash(defaultTeamId, firstName, hideExampleBinaries, lastName, timeZone, username, additionalProperties); + return Objects.hash(defaultTeamId, firstName, hideAiDecompilationComments, hideExampleBinaries, lastName, timeZone, username, additionalProperties); } @Override @@ -271,6 +296,7 @@ public String toString() { sb.append("class UpdateProfileInputBody {\n"); sb.append(" defaultTeamId: ").append(toIndentedString(defaultTeamId)).append("\n"); sb.append(" firstName: ").append(toIndentedString(firstName)).append("\n"); + sb.append(" hideAiDecompilationComments: ").append(toIndentedString(hideAiDecompilationComments)).append("\n"); sb.append(" hideExampleBinaries: ").append(toIndentedString(hideExampleBinaries)).append("\n"); sb.append(" lastName: ").append(toIndentedString(lastName)).append("\n"); sb.append(" timeZone: ").append(toIndentedString(timeZone)).append("\n"); @@ -294,7 +320,7 @@ private String toIndentedString(Object o) { static { // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(Arrays.asList("default_team_id", "first_name", "hide_example_binaries", "last_name", "time_zone", "username")); + openapiFields = new HashSet(Arrays.asList("default_team_id", "first_name", "hide_ai_decompilation_comments", "hide_example_binaries", "last_name", "time_zone", "username")); // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(0); diff --git a/src/main/java/ai/reveng/model/UpdateUserInputBody.java b/src/main/java/ai/reveng/model/UpdateUserInputBody.java index fbcfbf36..a72032ec 100644 --- a/src/main/java/ai/reveng/model/UpdateUserInputBody.java +++ b/src/main/java/ai/reveng/model/UpdateUserInputBody.java @@ -59,6 +59,11 @@ public class UpdateUserInputBody { @javax.annotation.Nullable private String firstName; + public static final String SERIALIZED_NAME_IS_ACTIVE = "is_active"; + @SerializedName(SERIALIZED_NAME_IS_ACTIVE) + @javax.annotation.Nullable + private Boolean isActive; + public static final String SERIALIZED_NAME_LAST_NAME = "last_name"; @SerializedName(SERIALIZED_NAME_LAST_NAME) @javax.annotation.Nullable @@ -241,6 +246,25 @@ public void setFirstName(@javax.annotation.Nullable String firstName) { } + public UpdateUserInputBody isActive(@javax.annotation.Nullable Boolean isActive) { + this.isActive = isActive; + return this; + } + + /** + * Whether the user can authenticate (SUPERADMIN only) + * @return isActive + */ + @javax.annotation.Nullable + public Boolean getIsActive() { + return isActive; + } + + public void setIsActive(@javax.annotation.Nullable Boolean isActive) { + this.isActive = isActive; + } + + public UpdateUserInputBody lastName(@javax.annotation.Nullable String lastName) { this.lastName = lastName; return this; @@ -392,6 +416,7 @@ public boolean equals(Object o) { UpdateUserInputBody updateUserInputBody = (UpdateUserInputBody) o; return Objects.equals(this.email, updateUserInputBody.email) && Objects.equals(this.firstName, updateUserInputBody.firstName) && + Objects.equals(this.isActive, updateUserInputBody.isActive) && Objects.equals(this.lastName, updateUserInputBody.lastName) && Objects.equals(this.role, updateUserInputBody.role) && Objects.equals(this.tier, updateUserInputBody.tier) && @@ -402,7 +427,7 @@ public boolean equals(Object o) { @Override public int hashCode() { - return Objects.hash(email, firstName, lastName, role, tier, timeZone, username, additionalProperties); + return Objects.hash(email, firstName, isActive, lastName, role, tier, timeZone, username, additionalProperties); } @Override @@ -411,6 +436,7 @@ public String toString() { sb.append("class UpdateUserInputBody {\n"); sb.append(" email: ").append(toIndentedString(email)).append("\n"); sb.append(" firstName: ").append(toIndentedString(firstName)).append("\n"); + sb.append(" isActive: ").append(toIndentedString(isActive)).append("\n"); sb.append(" lastName: ").append(toIndentedString(lastName)).append("\n"); sb.append(" role: ").append(toIndentedString(role)).append("\n"); sb.append(" tier: ").append(toIndentedString(tier)).append("\n"); @@ -435,7 +461,7 @@ private String toIndentedString(Object o) { static { // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(Arrays.asList("email", "first_name", "last_name", "role", "tier", "time_zone", "username")); + openapiFields = new HashSet(Arrays.asList("email", "first_name", "is_active", "last_name", "role", "tier", "time_zone", "username")); // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(0); diff --git a/src/main/java/ai/reveng/model/User.java b/src/main/java/ai/reveng/model/User.java index 48db7593..de73e01e 100644 --- a/src/main/java/ai/reveng/model/User.java +++ b/src/main/java/ai/reveng/model/User.java @@ -61,6 +61,11 @@ public class User { @javax.annotation.Nonnull private String email; + public static final String SERIALIZED_NAME_IS_ACTIVE = "is_active"; + @SerializedName(SERIALIZED_NAME_IS_ACTIVE) + @javax.annotation.Nonnull + private Boolean isActive; + public static final String SERIALIZED_NAME_PROFILE = "profile"; @SerializedName(SERIALIZED_NAME_PROFILE) @javax.annotation.Nonnull @@ -240,6 +245,25 @@ public void setEmail(@javax.annotation.Nonnull String email) { } + public User isActive(@javax.annotation.Nonnull Boolean isActive) { + this.isActive = isActive; + return this; + } + + /** + * Inactive users cannot authenticate + * @return isActive + */ + @javax.annotation.Nonnull + public Boolean getIsActive() { + return isActive; + } + + public void setIsActive(@javax.annotation.Nonnull Boolean isActive) { + this.isActive = isActive; + } + + public User profile(@javax.annotation.Nonnull UserProfile profile) { this.profile = profile; return this; @@ -372,6 +396,7 @@ public boolean equals(Object o) { User user = (User) o; return Objects.equals(this.createdAt, user.createdAt) && Objects.equals(this.email, user.email) && + Objects.equals(this.isActive, user.isActive) && Objects.equals(this.profile, user.profile) && Objects.equals(this.role, user.role) && Objects.equals(this.tier, user.tier) && @@ -381,7 +406,7 @@ public boolean equals(Object o) { @Override public int hashCode() { - return Objects.hash(createdAt, email, profile, role, tier, userId, additionalProperties); + return Objects.hash(createdAt, email, isActive, profile, role, tier, userId, additionalProperties); } @Override @@ -390,6 +415,7 @@ public String toString() { sb.append("class User {\n"); sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); sb.append(" email: ").append(toIndentedString(email)).append("\n"); + sb.append(" isActive: ").append(toIndentedString(isActive)).append("\n"); sb.append(" profile: ").append(toIndentedString(profile)).append("\n"); sb.append(" role: ").append(toIndentedString(role)).append("\n"); sb.append(" tier: ").append(toIndentedString(tier)).append("\n"); @@ -413,10 +439,10 @@ private String toIndentedString(Object o) { static { // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(Arrays.asList("created_at", "email", "profile", "role", "tier", "user_id")); + openapiFields = new HashSet(Arrays.asList("created_at", "email", "is_active", "profile", "role", "tier", "user_id")); // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(Arrays.asList("created_at", "email", "profile", "role", "user_id")); + openapiRequiredFields = new HashSet(Arrays.asList("created_at", "email", "is_active", "profile", "role", "user_id")); } /** diff --git a/src/main/java/ai/reveng/model/UserProfile.java b/src/main/java/ai/reveng/model/UserProfile.java index bba0045e..5b18e6ef 100644 --- a/src/main/java/ai/reveng/model/UserProfile.java +++ b/src/main/java/ai/reveng/model/UserProfile.java @@ -59,6 +59,11 @@ public class UserProfile { @javax.annotation.Nonnull private String firstName; + public static final String SERIALIZED_NAME_HIDE_AI_DECOMPILATION_COMMENTS = "hide_ai_decompilation_comments"; + @SerializedName(SERIALIZED_NAME_HIDE_AI_DECOMPILATION_COMMENTS) + @javax.annotation.Nonnull + private Boolean hideAiDecompilationComments; + public static final String SERIALIZED_NAME_HIDE_EXAMPLE_BINARIES = "hide_example_binaries"; @SerializedName(SERIALIZED_NAME_HIDE_EXAMPLE_BINARIES) @javax.annotation.Nonnull @@ -120,6 +125,25 @@ public void setFirstName(@javax.annotation.Nonnull String firstName) { } + public UserProfile hideAiDecompilationComments(@javax.annotation.Nonnull Boolean hideAiDecompilationComments) { + this.hideAiDecompilationComments = hideAiDecompilationComments; + return this; + } + + /** + * Get hideAiDecompilationComments + * @return hideAiDecompilationComments + */ + @javax.annotation.Nonnull + public Boolean getHideAiDecompilationComments() { + return hideAiDecompilationComments; + } + + public void setHideAiDecompilationComments(@javax.annotation.Nonnull Boolean hideAiDecompilationComments) { + this.hideAiDecompilationComments = hideAiDecompilationComments; + } + + public UserProfile hideExampleBinaries(@javax.annotation.Nonnull Boolean hideExampleBinaries) { this.hideExampleBinaries = hideExampleBinaries; return this; @@ -252,6 +276,7 @@ public boolean equals(Object o) { UserProfile userProfile = (UserProfile) o; return Objects.equals(this.defaultTeamId, userProfile.defaultTeamId) && Objects.equals(this.firstName, userProfile.firstName) && + Objects.equals(this.hideAiDecompilationComments, userProfile.hideAiDecompilationComments) && Objects.equals(this.hideExampleBinaries, userProfile.hideExampleBinaries) && Objects.equals(this.lastName, userProfile.lastName) && Objects.equals(this.timeZone, userProfile.timeZone) && @@ -261,7 +286,7 @@ public boolean equals(Object o) { @Override public int hashCode() { - return Objects.hash(defaultTeamId, firstName, hideExampleBinaries, lastName, timeZone, username, additionalProperties); + return Objects.hash(defaultTeamId, firstName, hideAiDecompilationComments, hideExampleBinaries, lastName, timeZone, username, additionalProperties); } @Override @@ -270,6 +295,7 @@ public String toString() { sb.append("class UserProfile {\n"); sb.append(" defaultTeamId: ").append(toIndentedString(defaultTeamId)).append("\n"); sb.append(" firstName: ").append(toIndentedString(firstName)).append("\n"); + sb.append(" hideAiDecompilationComments: ").append(toIndentedString(hideAiDecompilationComments)).append("\n"); sb.append(" hideExampleBinaries: ").append(toIndentedString(hideExampleBinaries)).append("\n"); sb.append(" lastName: ").append(toIndentedString(lastName)).append("\n"); sb.append(" timeZone: ").append(toIndentedString(timeZone)).append("\n"); @@ -293,10 +319,10 @@ private String toIndentedString(Object o) { static { // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(Arrays.asList("default_team_id", "first_name", "hide_example_binaries", "last_name", "time_zone", "username")); + openapiFields = new HashSet(Arrays.asList("default_team_id", "first_name", "hide_ai_decompilation_comments", "hide_example_binaries", "last_name", "time_zone", "username")); // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(Arrays.asList("first_name", "hide_example_binaries", "last_name", "time_zone", "username")); + openapiRequiredFields = new HashSet(Arrays.asList("first_name", "hide_ai_decompilation_comments", "hide_example_binaries", "last_name", "time_zone", "username")); } /** diff --git a/src/main/java/ai/reveng/model/WorkflowDayBody.java b/src/main/java/ai/reveng/model/WorkflowDayBody.java index 067f891b..f2644f04 100644 --- a/src/main/java/ai/reveng/model/WorkflowDayBody.java +++ b/src/main/java/ai/reveng/model/WorkflowDayBody.java @@ -13,7 +13,7 @@ package ai.reveng.model; import java.util.Objects; -import ai.reveng.model.AnalyseCapabilitiesBody; +import ai.reveng.model.AgentCompletedBody; import ai.reveng.model.ReportAnalysisBody; import com.google.gson.TypeAdapter; import com.google.gson.annotations.JsonAdapter; @@ -54,22 +54,77 @@ public class WorkflowDayBody { public static final String SERIALIZED_NAME_ANALYSE_CAPABILITIES = "analyse_capabilities"; @SerializedName(SERIALIZED_NAME_ANALYSE_CAPABILITIES) @javax.annotation.Nonnull - private AnalyseCapabilitiesBody analyseCapabilities; + private AgentCompletedBody analyseCapabilities; + + public static final String SERIALIZED_NAME_CRYPTO_SCAN = "crypto_scan"; + @SerializedName(SERIALIZED_NAME_CRYPTO_SCAN) + @javax.annotation.Nonnull + private AgentCompletedBody cryptoScan; + + public static final String SERIALIZED_NAME_CRYPTOGRAPHY_BINARY = "cryptography_binary"; + @SerializedName(SERIALIZED_NAME_CRYPTOGRAPHY_BINARY) + @javax.annotation.Nonnull + private AgentCompletedBody cryptographyBinary; public static final String SERIALIZED_NAME_DATE = "date"; @SerializedName(SERIALIZED_NAME_DATE) @javax.annotation.Nonnull private String date; + public static final String SERIALIZED_NAME_EXECUTION_SCAN = "execution_scan"; + @SerializedName(SERIALIZED_NAME_EXECUTION_SCAN) + @javax.annotation.Nonnull + private AgentCompletedBody executionScan; + + public static final String SERIALIZED_NAME_FILESYSTEM_SCAN = "filesystem_scan"; + @SerializedName(SERIALIZED_NAME_FILESYSTEM_SCAN) + @javax.annotation.Nonnull + private AgentCompletedBody filesystemScan; + + public static final String SERIALIZED_NAME_NETWORKING_SCAN = "networking_scan"; + @SerializedName(SERIALIZED_NAME_NETWORKING_SCAN) + @javax.annotation.Nonnull + private AgentCompletedBody networkingScan; + + public static final String SERIALIZED_NAME_PROTOCOLS = "protocols"; + @SerializedName(SERIALIZED_NAME_PROTOCOLS) + @javax.annotation.Nonnull + private AgentCompletedBody protocols; + + public static final String SERIALIZED_NAME_REMEDIATION = "remediation"; + @SerializedName(SERIALIZED_NAME_REMEDIATION) + @javax.annotation.Nonnull + private AgentCompletedBody remediation; + + public static final String SERIALIZED_NAME_RENAME_UNNAMED_FUNCTIONS = "rename_unnamed_functions"; + @SerializedName(SERIALIZED_NAME_RENAME_UNNAMED_FUNCTIONS) + @javax.annotation.Nonnull + private AgentCompletedBody renameUnnamedFunctions; + public static final String SERIALIZED_NAME_REPORT_ANALYSIS = "report_analysis"; @SerializedName(SERIALIZED_NAME_REPORT_ANALYSIS) @javax.annotation.Nonnull private ReportAnalysisBody reportAnalysis; + public static final String SERIALIZED_NAME_SECRETS = "secrets"; + @SerializedName(SERIALIZED_NAME_SECRETS) + @javax.annotation.Nonnull + private AgentCompletedBody secrets; + + public static final String SERIALIZED_NAME_SECURITY_SCAN = "security_scan"; + @SerializedName(SERIALIZED_NAME_SECURITY_SCAN) + @javax.annotation.Nonnull + private AgentCompletedBody securityScan; + + public static final String SERIALIZED_NAME_TRIAGE = "triage"; + @SerializedName(SERIALIZED_NAME_TRIAGE) + @javax.annotation.Nonnull + private AgentCompletedBody triage; + public WorkflowDayBody() { } - public WorkflowDayBody analyseCapabilities(@javax.annotation.Nonnull AnalyseCapabilitiesBody analyseCapabilities) { + public WorkflowDayBody analyseCapabilities(@javax.annotation.Nonnull AgentCompletedBody analyseCapabilities) { this.analyseCapabilities = analyseCapabilities; return this; } @@ -79,15 +134,53 @@ public WorkflowDayBody analyseCapabilities(@javax.annotation.Nonnull AnalyseCapa * @return analyseCapabilities */ @javax.annotation.Nonnull - public AnalyseCapabilitiesBody getAnalyseCapabilities() { + public AgentCompletedBody getAnalyseCapabilities() { return analyseCapabilities; } - public void setAnalyseCapabilities(@javax.annotation.Nonnull AnalyseCapabilitiesBody analyseCapabilities) { + public void setAnalyseCapabilities(@javax.annotation.Nonnull AgentCompletedBody analyseCapabilities) { this.analyseCapabilities = analyseCapabilities; } + public WorkflowDayBody cryptoScan(@javax.annotation.Nonnull AgentCompletedBody cryptoScan) { + this.cryptoScan = cryptoScan; + return this; + } + + /** + * CRYPTOGRAPHY agent-task stats for the day + * @return cryptoScan + */ + @javax.annotation.Nonnull + public AgentCompletedBody getCryptoScan() { + return cryptoScan; + } + + public void setCryptoScan(@javax.annotation.Nonnull AgentCompletedBody cryptoScan) { + this.cryptoScan = cryptoScan; + } + + + public WorkflowDayBody cryptographyBinary(@javax.annotation.Nonnull AgentCompletedBody cryptographyBinary) { + this.cryptographyBinary = cryptographyBinary; + return this; + } + + /** + * CRYPTOGRAPHY_BINARY agent-task stats for the day + * @return cryptographyBinary + */ + @javax.annotation.Nonnull + public AgentCompletedBody getCryptographyBinary() { + return cryptographyBinary; + } + + public void setCryptographyBinary(@javax.annotation.Nonnull AgentCompletedBody cryptographyBinary) { + this.cryptographyBinary = cryptographyBinary; + } + + public WorkflowDayBody date(@javax.annotation.Nonnull String date) { this.date = date; return this; @@ -107,6 +200,120 @@ public void setDate(@javax.annotation.Nonnull String date) { } + public WorkflowDayBody executionScan(@javax.annotation.Nonnull AgentCompletedBody executionScan) { + this.executionScan = executionScan; + return this; + } + + /** + * EXECUTION agent-task stats for the day + * @return executionScan + */ + @javax.annotation.Nonnull + public AgentCompletedBody getExecutionScan() { + return executionScan; + } + + public void setExecutionScan(@javax.annotation.Nonnull AgentCompletedBody executionScan) { + this.executionScan = executionScan; + } + + + public WorkflowDayBody filesystemScan(@javax.annotation.Nonnull AgentCompletedBody filesystemScan) { + this.filesystemScan = filesystemScan; + return this; + } + + /** + * FILESYSTEM agent-task stats for the day + * @return filesystemScan + */ + @javax.annotation.Nonnull + public AgentCompletedBody getFilesystemScan() { + return filesystemScan; + } + + public void setFilesystemScan(@javax.annotation.Nonnull AgentCompletedBody filesystemScan) { + this.filesystemScan = filesystemScan; + } + + + public WorkflowDayBody networkingScan(@javax.annotation.Nonnull AgentCompletedBody networkingScan) { + this.networkingScan = networkingScan; + return this; + } + + /** + * NETWORKING agent-task stats for the day + * @return networkingScan + */ + @javax.annotation.Nonnull + public AgentCompletedBody getNetworkingScan() { + return networkingScan; + } + + public void setNetworkingScan(@javax.annotation.Nonnull AgentCompletedBody networkingScan) { + this.networkingScan = networkingScan; + } + + + public WorkflowDayBody protocols(@javax.annotation.Nonnull AgentCompletedBody protocols) { + this.protocols = protocols; + return this; + } + + /** + * PROTOCOLS agent-task stats for the day + * @return protocols + */ + @javax.annotation.Nonnull + public AgentCompletedBody getProtocols() { + return protocols; + } + + public void setProtocols(@javax.annotation.Nonnull AgentCompletedBody protocols) { + this.protocols = protocols; + } + + + public WorkflowDayBody remediation(@javax.annotation.Nonnull AgentCompletedBody remediation) { + this.remediation = remediation; + return this; + } + + /** + * REMEDIATION agent-task stats for the day + * @return remediation + */ + @javax.annotation.Nonnull + public AgentCompletedBody getRemediation() { + return remediation; + } + + public void setRemediation(@javax.annotation.Nonnull AgentCompletedBody remediation) { + this.remediation = remediation; + } + + + public WorkflowDayBody renameUnnamedFunctions(@javax.annotation.Nonnull AgentCompletedBody renameUnnamedFunctions) { + this.renameUnnamedFunctions = renameUnnamedFunctions; + return this; + } + + /** + * RENAME_UNNAMED_FUNCTIONS agent-task stats for the day + * @return renameUnnamedFunctions + */ + @javax.annotation.Nonnull + public AgentCompletedBody getRenameUnnamedFunctions() { + return renameUnnamedFunctions; + } + + public void setRenameUnnamedFunctions(@javax.annotation.Nonnull AgentCompletedBody renameUnnamedFunctions) { + this.renameUnnamedFunctions = renameUnnamedFunctions; + } + + public WorkflowDayBody reportAnalysis(@javax.annotation.Nonnull ReportAnalysisBody reportAnalysis) { this.reportAnalysis = reportAnalysis; return this; @@ -125,6 +332,63 @@ public void setReportAnalysis(@javax.annotation.Nonnull ReportAnalysisBody repor this.reportAnalysis = reportAnalysis; } + + public WorkflowDayBody secrets(@javax.annotation.Nonnull AgentCompletedBody secrets) { + this.secrets = secrets; + return this; + } + + /** + * SECRETS agent-task stats for the day + * @return secrets + */ + @javax.annotation.Nonnull + public AgentCompletedBody getSecrets() { + return secrets; + } + + public void setSecrets(@javax.annotation.Nonnull AgentCompletedBody secrets) { + this.secrets = secrets; + } + + + public WorkflowDayBody securityScan(@javax.annotation.Nonnull AgentCompletedBody securityScan) { + this.securityScan = securityScan; + return this; + } + + /** + * SECURITY_SCAN agent-task stats for the day + * @return securityScan + */ + @javax.annotation.Nonnull + public AgentCompletedBody getSecurityScan() { + return securityScan; + } + + public void setSecurityScan(@javax.annotation.Nonnull AgentCompletedBody securityScan) { + this.securityScan = securityScan; + } + + + public WorkflowDayBody triage(@javax.annotation.Nonnull AgentCompletedBody triage) { + this.triage = triage; + return this; + } + + /** + * TRIAGE agent-task stats for the day + * @return triage + */ + @javax.annotation.Nonnull + public AgentCompletedBody getTriage() { + return triage; + } + + public void setTriage(@javax.annotation.Nonnull AgentCompletedBody triage) { + this.triage = triage; + } + /** * A container for additional, undeclared properties. * This is a holder for any undeclared properties as specified with @@ -181,14 +445,25 @@ public boolean equals(Object o) { } WorkflowDayBody workflowDayBody = (WorkflowDayBody) o; return Objects.equals(this.analyseCapabilities, workflowDayBody.analyseCapabilities) && + Objects.equals(this.cryptoScan, workflowDayBody.cryptoScan) && + Objects.equals(this.cryptographyBinary, workflowDayBody.cryptographyBinary) && Objects.equals(this.date, workflowDayBody.date) && - Objects.equals(this.reportAnalysis, workflowDayBody.reportAnalysis)&& + Objects.equals(this.executionScan, workflowDayBody.executionScan) && + Objects.equals(this.filesystemScan, workflowDayBody.filesystemScan) && + Objects.equals(this.networkingScan, workflowDayBody.networkingScan) && + Objects.equals(this.protocols, workflowDayBody.protocols) && + Objects.equals(this.remediation, workflowDayBody.remediation) && + Objects.equals(this.renameUnnamedFunctions, workflowDayBody.renameUnnamedFunctions) && + Objects.equals(this.reportAnalysis, workflowDayBody.reportAnalysis) && + Objects.equals(this.secrets, workflowDayBody.secrets) && + Objects.equals(this.securityScan, workflowDayBody.securityScan) && + Objects.equals(this.triage, workflowDayBody.triage)&& Objects.equals(this.additionalProperties, workflowDayBody.additionalProperties); } @Override public int hashCode() { - return Objects.hash(analyseCapabilities, date, reportAnalysis, additionalProperties); + return Objects.hash(analyseCapabilities, cryptoScan, cryptographyBinary, date, executionScan, filesystemScan, networkingScan, protocols, remediation, renameUnnamedFunctions, reportAnalysis, secrets, securityScan, triage, additionalProperties); } @Override @@ -196,8 +471,19 @@ public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class WorkflowDayBody {\n"); sb.append(" analyseCapabilities: ").append(toIndentedString(analyseCapabilities)).append("\n"); + sb.append(" cryptoScan: ").append(toIndentedString(cryptoScan)).append("\n"); + sb.append(" cryptographyBinary: ").append(toIndentedString(cryptographyBinary)).append("\n"); sb.append(" date: ").append(toIndentedString(date)).append("\n"); + sb.append(" executionScan: ").append(toIndentedString(executionScan)).append("\n"); + sb.append(" filesystemScan: ").append(toIndentedString(filesystemScan)).append("\n"); + sb.append(" networkingScan: ").append(toIndentedString(networkingScan)).append("\n"); + sb.append(" protocols: ").append(toIndentedString(protocols)).append("\n"); + sb.append(" remediation: ").append(toIndentedString(remediation)).append("\n"); + sb.append(" renameUnnamedFunctions: ").append(toIndentedString(renameUnnamedFunctions)).append("\n"); sb.append(" reportAnalysis: ").append(toIndentedString(reportAnalysis)).append("\n"); + sb.append(" secrets: ").append(toIndentedString(secrets)).append("\n"); + sb.append(" securityScan: ").append(toIndentedString(securityScan)).append("\n"); + sb.append(" triage: ").append(toIndentedString(triage)).append("\n"); sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); sb.append("}"); return sb.toString(); @@ -217,10 +503,10 @@ private String toIndentedString(Object o) { static { // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(Arrays.asList("analyse_capabilities", "date", "report_analysis")); + openapiFields = new HashSet(Arrays.asList("analyse_capabilities", "crypto_scan", "cryptography_binary", "date", "execution_scan", "filesystem_scan", "networking_scan", "protocols", "remediation", "rename_unnamed_functions", "report_analysis", "secrets", "security_scan", "triage")); // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(Arrays.asList("analyse_capabilities", "date", "report_analysis")); + openapiRequiredFields = new HashSet(Arrays.asList("analyse_capabilities", "crypto_scan", "cryptography_binary", "date", "execution_scan", "filesystem_scan", "networking_scan", "protocols", "remediation", "rename_unnamed_functions", "report_analysis", "secrets", "security_scan", "triage")); } /**