From 1fdaec1052d476ec25451d180e9ddbc1b03ae3cb Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Thu, 30 Apr 2026 07:44:10 +0000 Subject: [PATCH] Update SDK to version v3.79.0 - Generated from OpenAPI spec version v3.79.0 - Auto-generated by GitHub Actions --- .sdk-version | 2 +- README.md | 101 +- build.gradle | 4 +- build.sbt | 2 +- docs/APIError.md | 14 + docs/AnalysesApi.md | 82 ++ docs/AnalysesCoreApi.md | 4 +- docs/AnalysisRecord.md | 2 +- docs/AnalysisStage.md | 15 - docs/AnalysisStageStatus.md | 17 - docs/AnalysisStagesApi.md | 150 --- ...stV2AnalysesEnumsDynamicExecutionStatus.md | 17 - docs/BaseResponseAnalysisStagesResponse.md | 17 - docs/BaseResponseDynamicExecutionStatus.md | 17 - docs/BaseResponseNetworkOverviewResponse.md | 17 - docs/BaseResponsePipelineStatusResponse.md | 17 - docs/BaseResponseProcessDumps.md | 17 - docs/BaseResponseProcessRegistry.md | 17 - docs/BaseResponseProcessTree.md | 17 - docs/BaseResponseTTPS.md | 17 - docs/ConfirmToolInputBody.md | 14 + docs/Conversation.md | 19 + ...agesResponse.md => ConversationContext.md} | 5 +- docs/ConversationWithEvents.md | 20 + ...micExecutionApi.md => ConversationsApi.md} | 247 ++-- docs/CreateConversationRequest.md | 15 + ...atusInput.md => DynamicExecutionStatus.md} | 2 +- docs/ErrorBody.md | 64 + docs/Event.md | 19 + docs/EventCONTEXTCOMPACTED.md | 24 + docs/EventRUNCANCELLED.md | 24 + docs/EventRUNERROR.md | 24 + docs/EventRUNFINISHED.md | 24 + docs/EventRUNSTARTED.md | 24 + docs/EventSTEPFINISHED.md | 24 + docs/EventSTEPSTARTED.md | 24 + docs/EventTEXTMESSAGECONTENT.md | 24 + docs/EventTEXTMESSAGEEND.md | 24 + docs/EventTEXTMESSAGESTART.md | 24 + docs/EventTITLEUPDATED.md | 24 + docs/EventTOOLCALLARGSDELTA.md | 24 + docs/EventTOOLCALLEND.md | 24 + docs/EventTOOLCALLRESULT.md | 24 + docs/EventTOOLCALLSTART.md | 24 + docs/EventTOOLCONFIRMATIONREQUIRED.md | 24 + docs/NetworkOverviewMetadata.md | 24 - docs/NetworkOverviewResponse.md | 14 - docs/PipelineStageStatus.md | 19 - docs/PipelineStatusResponse.md | 13 - docs/Process.md | 19 - docs/ProcessDump.md | 16 - docs/ProcessDumps.md | 14 - docs/ProcessDumpsData.md | 14 - docs/ProcessRegistry.md | 14 - docs/ProcessTree.md | 14 - docs/QueuePositionResponse.md | 14 + docs/Registry.md | 16 - docs/SendMessageRequest.md | 15 + ...Dns.md => SseEventContextCompactedData.md} | 6 +- docs/SseEventRunCancelledData.md | 15 + ...ewDnsAnswer.md => SseEventRunErrorData.md} | 5 +- ...onStatus.md => SseEventRunFinishedData.md} | 6 +- ...pMetadata.md => SseEventRunStartedData.md} | 6 +- docs/SseEventStepFinishedData.md | 15 + docs/SseEventStepStartedData.md | 15 + docs/SseEventTextMessageContentData.md | 15 + docs/SseEventTextMessageEndData.md | 15 + docs/SseEventTextMessageStartData.md | 15 + docs/SseEventTitleUpdatedData.md | 15 + docs/SseEventToolCallArgsDeltaData.md | 15 + docs/SseEventToolCallEndData.md | 15 + docs/SseEventToolCallResultData.md | 15 + docs/SseEventToolCallStartData.md | 15 + docs/SseEventToolConfirmationRequiredData.md | 15 + docs/StageEvent.md | 15 - docs/StageStatus.md | 15 - docs/StatusResponse.md | 16 + docs/StreamEvents200ResponseInner.md | 24 + docs/TTPS.md | 14 - docs/TTPSAttack.md | 14 - docs/TTPSData.md | 14 - docs/TTPSElement.md | 16 - docs/TTPSOccurance.md | 14 - pom.xml | 2 +- src/main/java/ai/reveng/api/AnalysesApi.java | 218 ++++ .../java/ai/reveng/api/AnalysesCoreApi.java | 12 +- .../api/AnalysesDynamicExecutionApi.java | 1007 --------------- .../java/ai/reveng/api/AnalysisStagesApi.java | 338 ----- .../java/ai/reveng/api/ConversationsApi.java | 1086 +++++++++++++++++ .../java/ai/reveng/invoker/ApiClient.java | 2 +- .../java/ai/reveng/invoker/Configuration.java | 2 +- src/main/java/ai/reveng/invoker/JSON.java | 74 +- .../reveng/model/{TTPS.java => APIError.java} | 127 +- .../java/ai/reveng/model/AnalysisRecord.java | 12 +- .../java/ai/reveng/model/AnalysisStage.java | 81 -- .../ai/reveng/model/AnalysisStageStatus.java | 83 -- ...V2AnalysesEnumsDynamicExecutionStatus.java | 83 -- .../BaseResponseAnalysisStagesResponse.java | 438 ------- .../BaseResponseDynamicExecutionStatus.java | 438 ------- .../BaseResponseNetworkOverviewResponse.java | 438 ------- .../BaseResponsePipelineStatusResponse.java | 438 ------- .../model/BaseResponseProcessDumps.java | 438 ------- .../model/BaseResponseProcessRegistry.java | 438 ------- .../reveng/model/BaseResponseProcessTree.java | 438 ------- .../ai/reveng/model/BaseResponseTTPS.java | 438 ------- ...SAttack.java => ConfirmToolInputBody.java} | 127 +- .../model/{Process.java => Conversation.java} | 309 +++-- ...ccurance.java => ConversationContext.java} | 127 +- ...ponse.java => ConversationWithEvents.java} | 290 ++++- .../model/CreateConversationRequest.java | 343 ++++++ ...Input.java => DynamicExecutionStatus.java} | 20 +- src/main/java/ai/reveng/model/ErrorBody.java | 540 ++++++++ src/main/java/ai/reveng/model/Event.java | 451 +++++++ .../reveng/model/EventCONTEXTCOMPACTED.java | 425 +++++++ .../ai/reveng/model/EventRUNCANCELLED.java | 425 +++++++ .../{Registry.java => EventRUNERROR.java} | 228 ++-- .../ai/reveng/model/EventRUNFINISHED.java | 425 +++++++ .../java/ai/reveng/model/EventRUNSTARTED.java | 425 +++++++ .../ai/reveng/model/EventSTEPFINISHED.java | 425 +++++++ .../ai/reveng/model/EventSTEPSTARTED.java | 425 +++++++ ...data.java => EventTEXTMESSAGECONTENT.java} | 216 ++-- .../ai/reveng/model/EventTEXTMESSAGEEND.java | 425 +++++++ .../reveng/model/EventTEXTMESSAGESTART.java | 425 +++++++ .../ai/reveng/model/EventTITLEUPDATED.java | 425 +++++++ .../reveng/model/EventTOOLCALLARGSDELTA.java | 425 +++++++ .../ai/reveng/model/EventTOOLCALLEND.java | 425 +++++++ .../ai/reveng/model/EventTOOLCALLRESULT.java | 425 +++++++ ...erviewDns.java => EventTOOLCALLSTART.java} | 241 ++-- .../model/EventTOOLCONFIRMATIONREQUIRED.java | 425 +++++++ .../reveng/model/NetworkOverviewResponse.java | 357 ------ .../ai/reveng/model/PipelineStageStatus.java | 85 -- .../reveng/model/PipelineStatusResponse.java | 312 ----- .../java/ai/reveng/model/ProcessDump.java | 378 ------ ...PSData.java => QueuePositionResponse.java} | 142 +-- ...DumpsData.java => SendMessageRequest.java} | 166 +-- .../model/SseEventContextCompactedData.java | 346 ++++++ ...wer.java => SseEventRunCancelledData.java} | 133 +- ...essTree.java => SseEventRunErrorData.java} | 152 +-- .../reveng/model/SseEventRunFinishedData.java | 346 ++++++ ...istry.java => SseEventRunStartedData.java} | 145 ++- ...ata.java => SseEventStepFinishedData.java} | 137 +-- .../reveng/model/SseEventStepStartedData.java | 346 ++++++ .../model/SseEventTextMessageContentData.java | 346 ++++++ ...s.java => SseEventTextMessageEndData.java} | 140 ++- .../model/SseEventTextMessageStartData.java | 346 ++++++ .../model/SseEventTitleUpdatedData.java | 346 ++++++ .../model/SseEventToolCallArgsDeltaData.java | 346 ++++++ .../reveng/model/SseEventToolCallEndData.java | 346 ++++++ .../model/SseEventToolCallResultData.java | 346 ++++++ .../model/SseEventToolCallStartData.java | 346 ++++++ .../SseEventToolConfirmationRequiredData.java | 346 ++++++ src/main/java/ai/reveng/model/StageEvent.java | 352 ------ .../java/ai/reveng/model/StageStatus.java | 349 ------ ...ecutionStatus.java => StatusResponse.java} | 150 ++- .../model/StreamEvents200ResponseInner.java | 907 ++++++++++++++ .../java/ai/reveng/model/TTPSElement.java | 412 ------- 156 files changed, 15668 insertions(+), 9389 deletions(-) create mode 100644 docs/APIError.md create mode 100644 docs/AnalysesApi.md delete mode 100644 docs/AnalysisStage.md delete mode 100644 docs/AnalysisStageStatus.md delete mode 100644 docs/AnalysisStagesApi.md delete mode 100644 docs/AppApiRestV2AnalysesEnumsDynamicExecutionStatus.md delete mode 100644 docs/BaseResponseAnalysisStagesResponse.md delete mode 100644 docs/BaseResponseDynamicExecutionStatus.md delete mode 100644 docs/BaseResponseNetworkOverviewResponse.md delete mode 100644 docs/BaseResponsePipelineStatusResponse.md delete mode 100644 docs/BaseResponseProcessDumps.md delete mode 100644 docs/BaseResponseProcessRegistry.md delete mode 100644 docs/BaseResponseProcessTree.md delete mode 100644 docs/BaseResponseTTPS.md create mode 100644 docs/ConfirmToolInputBody.md create mode 100644 docs/Conversation.md rename docs/{AnalysisStagesResponse.md => ConversationContext.md} (51%) create mode 100644 docs/ConversationWithEvents.md rename docs/{AnalysesDynamicExecutionApi.md => ConversationsApi.md} (51%) create mode 100644 docs/CreateConversationRequest.md rename docs/{DynamicExecutionStatusInput.md => DynamicExecutionStatus.md} (82%) create mode 100644 docs/ErrorBody.md create mode 100644 docs/Event.md create mode 100644 docs/EventCONTEXTCOMPACTED.md create mode 100644 docs/EventRUNCANCELLED.md create mode 100644 docs/EventRUNERROR.md create mode 100644 docs/EventRUNFINISHED.md create mode 100644 docs/EventRUNSTARTED.md create mode 100644 docs/EventSTEPFINISHED.md create mode 100644 docs/EventSTEPSTARTED.md create mode 100644 docs/EventTEXTMESSAGECONTENT.md create mode 100644 docs/EventTEXTMESSAGEEND.md create mode 100644 docs/EventTEXTMESSAGESTART.md create mode 100644 docs/EventTITLEUPDATED.md create mode 100644 docs/EventTOOLCALLARGSDELTA.md create mode 100644 docs/EventTOOLCALLEND.md create mode 100644 docs/EventTOOLCALLRESULT.md create mode 100644 docs/EventTOOLCALLSTART.md create mode 100644 docs/EventTOOLCONFIRMATIONREQUIRED.md delete mode 100644 docs/NetworkOverviewMetadata.md delete mode 100644 docs/NetworkOverviewResponse.md delete mode 100644 docs/PipelineStageStatus.md delete mode 100644 docs/PipelineStatusResponse.md delete mode 100644 docs/Process.md delete mode 100644 docs/ProcessDump.md delete mode 100644 docs/ProcessDumps.md delete mode 100644 docs/ProcessDumpsData.md delete mode 100644 docs/ProcessRegistry.md delete mode 100644 docs/ProcessTree.md create mode 100644 docs/QueuePositionResponse.md delete mode 100644 docs/Registry.md create mode 100644 docs/SendMessageRequest.md rename docs/{NetworkOverviewDns.md => SseEventContextCompactedData.md} (51%) create mode 100644 docs/SseEventRunCancelledData.md rename docs/{NetworkOverviewDnsAnswer.md => SseEventRunErrorData.md} (64%) rename docs/{AppServicesDynamicExecutionSchemasDynamicExecutionStatus.md => SseEventRunFinishedData.md} (50%) rename docs/{ProcessDumpMetadata.md => SseEventRunStartedData.md} (63%) create mode 100644 docs/SseEventStepFinishedData.md create mode 100644 docs/SseEventStepStartedData.md create mode 100644 docs/SseEventTextMessageContentData.md create mode 100644 docs/SseEventTextMessageEndData.md create mode 100644 docs/SseEventTextMessageStartData.md create mode 100644 docs/SseEventTitleUpdatedData.md create mode 100644 docs/SseEventToolCallArgsDeltaData.md create mode 100644 docs/SseEventToolCallEndData.md create mode 100644 docs/SseEventToolCallResultData.md create mode 100644 docs/SseEventToolCallStartData.md create mode 100644 docs/SseEventToolConfirmationRequiredData.md delete mode 100644 docs/StageEvent.md delete mode 100644 docs/StageStatus.md create mode 100644 docs/StatusResponse.md create mode 100644 docs/StreamEvents200ResponseInner.md delete mode 100644 docs/TTPS.md delete mode 100644 docs/TTPSAttack.md delete mode 100644 docs/TTPSData.md delete mode 100644 docs/TTPSElement.md delete mode 100644 docs/TTPSOccurance.md create mode 100644 src/main/java/ai/reveng/api/AnalysesApi.java delete mode 100644 src/main/java/ai/reveng/api/AnalysesDynamicExecutionApi.java delete mode 100644 src/main/java/ai/reveng/api/AnalysisStagesApi.java create mode 100644 src/main/java/ai/reveng/api/ConversationsApi.java rename src/main/java/ai/reveng/model/{TTPS.java => APIError.java} (73%) delete mode 100644 src/main/java/ai/reveng/model/AnalysisStage.java delete mode 100644 src/main/java/ai/reveng/model/AnalysisStageStatus.java delete mode 100644 src/main/java/ai/reveng/model/AppApiRestV2AnalysesEnumsDynamicExecutionStatus.java delete mode 100644 src/main/java/ai/reveng/model/BaseResponseAnalysisStagesResponse.java delete mode 100644 src/main/java/ai/reveng/model/BaseResponseDynamicExecutionStatus.java delete mode 100644 src/main/java/ai/reveng/model/BaseResponseNetworkOverviewResponse.java delete mode 100644 src/main/java/ai/reveng/model/BaseResponsePipelineStatusResponse.java delete mode 100644 src/main/java/ai/reveng/model/BaseResponseProcessDumps.java delete mode 100644 src/main/java/ai/reveng/model/BaseResponseProcessRegistry.java delete mode 100644 src/main/java/ai/reveng/model/BaseResponseProcessTree.java delete mode 100644 src/main/java/ai/reveng/model/BaseResponseTTPS.java rename src/main/java/ai/reveng/model/{TTPSAttack.java => ConfirmToolInputBody.java} (71%) rename src/main/java/ai/reveng/model/{Process.java => Conversation.java} (55%) rename src/main/java/ai/reveng/model/{TTPSOccurance.java => ConversationContext.java} (71%) rename src/main/java/ai/reveng/model/{AnalysisStagesResponse.java => ConversationWithEvents.java} (50%) create mode 100644 src/main/java/ai/reveng/model/CreateConversationRequest.java rename src/main/java/ai/reveng/model/{DynamicExecutionStatusInput.java => DynamicExecutionStatus.java} (75%) create mode 100644 src/main/java/ai/reveng/model/ErrorBody.java create mode 100644 src/main/java/ai/reveng/model/Event.java create mode 100644 src/main/java/ai/reveng/model/EventCONTEXTCOMPACTED.java create mode 100644 src/main/java/ai/reveng/model/EventRUNCANCELLED.java rename src/main/java/ai/reveng/model/{Registry.java => EventRUNERROR.java} (61%) create mode 100644 src/main/java/ai/reveng/model/EventRUNFINISHED.java create mode 100644 src/main/java/ai/reveng/model/EventRUNSTARTED.java create mode 100644 src/main/java/ai/reveng/model/EventSTEPFINISHED.java create mode 100644 src/main/java/ai/reveng/model/EventSTEPSTARTED.java rename src/main/java/ai/reveng/model/{NetworkOverviewMetadata.java => EventTEXTMESSAGECONTENT.java} (62%) create mode 100644 src/main/java/ai/reveng/model/EventTEXTMESSAGEEND.java create mode 100644 src/main/java/ai/reveng/model/EventTEXTMESSAGESTART.java create mode 100644 src/main/java/ai/reveng/model/EventTITLEUPDATED.java create mode 100644 src/main/java/ai/reveng/model/EventTOOLCALLARGSDELTA.java create mode 100644 src/main/java/ai/reveng/model/EventTOOLCALLEND.java create mode 100644 src/main/java/ai/reveng/model/EventTOOLCALLRESULT.java rename src/main/java/ai/reveng/model/{NetworkOverviewDns.java => EventTOOLCALLSTART.java} (61%) create mode 100644 src/main/java/ai/reveng/model/EventTOOLCONFIRMATIONREQUIRED.java delete mode 100644 src/main/java/ai/reveng/model/NetworkOverviewResponse.java delete mode 100644 src/main/java/ai/reveng/model/PipelineStageStatus.java delete mode 100644 src/main/java/ai/reveng/model/PipelineStatusResponse.java delete mode 100644 src/main/java/ai/reveng/model/ProcessDump.java rename src/main/java/ai/reveng/model/{TTPSData.java => QueuePositionResponse.java} (69%) rename src/main/java/ai/reveng/model/{ProcessDumpsData.java => SendMessageRequest.java} (66%) create mode 100644 src/main/java/ai/reveng/model/SseEventContextCompactedData.java rename src/main/java/ai/reveng/model/{NetworkOverviewDnsAnswer.java => SseEventRunCancelledData.java} (76%) rename src/main/java/ai/reveng/model/{ProcessTree.java => SseEventRunErrorData.java} (71%) create mode 100644 src/main/java/ai/reveng/model/SseEventRunFinishedData.java rename src/main/java/ai/reveng/model/{ProcessRegistry.java => SseEventRunStartedData.java} (70%) rename src/main/java/ai/reveng/model/{ProcessDumpMetadata.java => SseEventStepFinishedData.java} (72%) create mode 100644 src/main/java/ai/reveng/model/SseEventStepStartedData.java create mode 100644 src/main/java/ai/reveng/model/SseEventTextMessageContentData.java rename src/main/java/ai/reveng/model/{ProcessDumps.java => SseEventTextMessageEndData.java} (69%) create mode 100644 src/main/java/ai/reveng/model/SseEventTextMessageStartData.java create mode 100644 src/main/java/ai/reveng/model/SseEventTitleUpdatedData.java create mode 100644 src/main/java/ai/reveng/model/SseEventToolCallArgsDeltaData.java create mode 100644 src/main/java/ai/reveng/model/SseEventToolCallEndData.java create mode 100644 src/main/java/ai/reveng/model/SseEventToolCallResultData.java create mode 100644 src/main/java/ai/reveng/model/SseEventToolCallStartData.java create mode 100644 src/main/java/ai/reveng/model/SseEventToolConfirmationRequiredData.java delete mode 100644 src/main/java/ai/reveng/model/StageEvent.java delete mode 100644 src/main/java/ai/reveng/model/StageStatus.java rename src/main/java/ai/reveng/model/{AppServicesDynamicExecutionSchemasDynamicExecutionStatus.java => StatusResponse.java} (63%) create mode 100644 src/main/java/ai/reveng/model/StreamEvents200ResponseInner.java delete mode 100644 src/main/java/ai/reveng/model/TTPSElement.java diff --git a/.sdk-version b/.sdk-version index 44b3480..905878c 100644 --- a/.sdk-version +++ b/.sdk-version @@ -1 +1 @@ -v3.74.4 +v3.79.0 diff --git a/README.md b/README.md index a6eaa4e..9a60b63 100644 --- a/README.md +++ b/README.md @@ -16,7 +16,7 @@ Add this dependency to your project's POM: ai.reveng sdk - 3.74.4 + 3.79.0 compile ``` @@ -31,7 +31,7 @@ repositories { } dependencies { - implementation "ai.reveng:sdk:3.74.4" + implementation "ai.reveng:sdk:3.79.0" } ``` @@ -85,6 +85,7 @@ Class | Method | HTTP request | Description *AgentApi* | [**getCapabilitiesResultV2AnalysesAnalysisIdAgentCapabilitiesGet**](docs/AgentApi.md#getCapabilitiesResultV2AnalysesAnalysisIdAgentCapabilitiesGet) | **GET** /v2/analyses/{analysis_id}/agent/capabilities | Get Capabilities Result *AgentApi* | [**getReportAnalysisResultV2AnalysesAnalysisIdAgentReportAnalysisGet**](docs/AgentApi.md#getReportAnalysisResultV2AnalysesAnalysisIdAgentReportAnalysisGet) | **GET** /v2/analyses/{analysis_id}/agent/report-analysis | Get Report Analysis Result *AgentApi* | [**getTriageResultV2AnalysesAnalysisIdAgentTriageGet**](docs/AgentApi.md#getTriageResultV2AnalysesAnalysisIdAgentTriageGet) | **GET** /v2/analyses/{analysis_id}/agent/triage | Get Triage Result +*AnalysesApi* | [**getAnalysisQueuePosition**](docs/AnalysesApi.md#getAnalysisQueuePosition) | **GET** /v2/analyses/{analysis_id}/queue-position | Get the queue position of an analysis *AnalysesBulkActionsApi* | [**bulkAddAnalysisTags**](docs/AnalysesBulkActionsApi.md#bulkAddAnalysisTags) | **PATCH** /v2/analyses/tags/add | Bulk Add Analysis Tags *AnalysesBulkActionsApi* | [**bulkDeleteAnalyses**](docs/AnalysesBulkActionsApi.md#bulkDeleteAnalyses) | **PATCH** /v2/analyses/delete | Bulk Delete Analyses *AnalysesCommentsApi* | [**createAnalysisComment**](docs/AnalysesCommentsApi.md#createAnalysisComment) | **POST** /v2/analyses/{analysis_id}/comments | Create a comment for this analysis @@ -106,13 +107,6 @@ 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 -*AnalysesDynamicExecutionApi* | [**getDynamicExecutionStatus**](docs/AnalysesDynamicExecutionApi.md#getDynamicExecutionStatus) | **GET** /v2/analyses/{analysis_id}/dynamic-execution/status | Get the status of a dynamic execution task -*AnalysesDynamicExecutionApi* | [**getNetworkOverview**](docs/AnalysesDynamicExecutionApi.md#getNetworkOverview) | **GET** /v2/analyses/{analysis_id}/dynamic-execution/network-overview | Get the dynamic execution results for network overview -*AnalysesDynamicExecutionApi* | [**getProcessDump**](docs/AnalysesDynamicExecutionApi.md#getProcessDump) | **GET** /v2/analyses/{analysis_id}/dynamic-execution/process-dumps/{dump_name} | Get the dynamic execution results for a specific process dump -*AnalysesDynamicExecutionApi* | [**getProcessDumps**](docs/AnalysesDynamicExecutionApi.md#getProcessDumps) | **GET** /v2/analyses/{analysis_id}/dynamic-execution/process-dumps | Get the dynamic execution results for process dumps -*AnalysesDynamicExecutionApi* | [**getProcessRegistry**](docs/AnalysesDynamicExecutionApi.md#getProcessRegistry) | **GET** /v2/analyses/{analysis_id}/dynamic-execution/process-registry | Get the dynamic execution results for process registry -*AnalysesDynamicExecutionApi* | [**getProcessTree**](docs/AnalysesDynamicExecutionApi.md#getProcessTree) | **GET** /v2/analyses/{analysis_id}/dynamic-execution/process-tree | Get the dynamic execution results for process tree -*AnalysesDynamicExecutionApi* | [**getTtps**](docs/AnalysesDynamicExecutionApi.md#getTtps) | **GET** /v2/analyses/{analysis_id}/dynamic-execution/ttps | Get the dynamic execution results for ttps *AnalysesResultsMetadataApi* | [**getAnalysisFunctionsPaginated**](docs/AnalysesResultsMetadataApi.md#getAnalysisFunctionsPaginated) | **GET** /v2/analyses/{analysis_id}/functions | Get functions from analysis *AnalysesResultsMetadataApi* | [**getCapabilities**](docs/AnalysesResultsMetadataApi.md#getCapabilities) | **GET** /v2/analyses/{analysis_id}/capabilities | Gets the capabilities from the analysis *AnalysesResultsMetadataApi* | [**getFunctionsList**](docs/AnalysesResultsMetadataApi.md#getFunctionsList) | **GET** /v2/analyses/{analysis_id}/functions/list | Gets functions from analysis @@ -121,8 +115,6 @@ Class | Method | HTTP request | Description *AnalysesResultsMetadataApi* | [**getTags**](docs/AnalysesResultsMetadataApi.md#getTags) | **GET** /v2/analyses/{analysis_id}/tags | Get function tags with maliciousness score *AnalysesResultsMetadataApi* | [**getVulnerabilities**](docs/AnalysesResultsMetadataApi.md#getVulnerabilities) | **GET** /v2/analyses/{analysis_id}/vulnerabilities | Gets the vulnerabilities found in the analysis *AnalysesXRefsApi* | [**getXrefByVaddr**](docs/AnalysesXRefsApi.md#getXrefByVaddr) | **GET** /v2/analyses/{analysis_id}/xrefs/{vaddr} | [Beta] Look up xrefs by virtual address -*AnalysisStagesApi* | [**getAnalysisStages**](docs/AnalysisStagesApi.md#getAnalysisStages) | **GET** /v2/analysis-stages/{analysis_id} | Get Analysis Stages -*AnalysisStagesApi* | [**getPipelineStatus**](docs/AnalysisStagesApi.md#getPipelineStatus) | **GET** /v2/analysis-stages/{analysis_id}/pipeline-status | Get Pipeline Status *AuthenticationUsersApi* | [**getRequesterUserInfo**](docs/AuthenticationUsersApi.md#getRequesterUserInfo) | **GET** /v2/users/me | Get the requesters user information *AuthenticationUsersApi* | [**getUser**](docs/AuthenticationUsersApi.md#getUser) | **GET** /v2/users/{user_id} | Get a user's public information *AuthenticationUsersApi* | [**getUserActivity**](docs/AuthenticationUsersApi.md#getUserActivity) | **GET** /v2/users/activity | Get auth user activity @@ -144,6 +136,13 @@ Class | Method | HTTP request | Description *CollectionsApi* | [**updateCollectionBinaries**](docs/CollectionsApi.md#updateCollectionBinaries) | **PATCH** /v2/collections/{collection_id}/binaries | Updates a collection binaries *CollectionsApi* | [**updateCollectionTags**](docs/CollectionsApi.md#updateCollectionTags) | **PATCH** /v2/collections/{collection_id}/tags | Updates a collection tags *ConfigApi* | [**getConfig**](docs/ConfigApi.md#getConfig) | **GET** /v2/config | Get Config +*ConversationsApi* | [**cancelRun**](docs/ConversationsApi.md#cancelRun) | **POST** /v2/conversations/{id}/cancel | Cancel an active run +*ConversationsApi* | [**confirmTool**](docs/ConversationsApi.md#confirmTool) | **POST** /v2/conversations/{id}/confirm | Approve or reject a pending tool confirmation +*ConversationsApi* | [**createConversation**](docs/ConversationsApi.md#createConversation) | **POST** /v2/conversations | Create a new conversation +*ConversationsApi* | [**getConversation**](docs/ConversationsApi.md#getConversation) | **GET** /v2/conversations/{id} | Get a conversation with its events +*ConversationsApi* | [**listConversations**](docs/ConversationsApi.md#listConversations) | **GET** /v2/conversations | List conversations for the authenticated user +*ConversationsApi* | [**sendMessage**](docs/ConversationsApi.md#sendMessage) | **POST** /v2/conversations/{id}/messages | Send a message and start an agentic run +*ConversationsApi* | [**streamEvents**](docs/ConversationsApi.md#streamEvents) | **GET** /v2/conversations/{id}/events | Stream conversation events (SSE) *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 @@ -191,6 +190,7 @@ Class | Method | HTTP request | Description ## Documentation for Models + - [APIError](docs/APIError.md) - [AdditionalDetailsStatusResponse](docs/AdditionalDetailsStatusResponse.md) - [Addr](docs/Addr.md) - [AiDecompilationRating](docs/AiDecompilationRating.md) @@ -210,9 +210,6 @@ Class | Method | HTTP request | Description - [AnalysisFunctionsList](docs/AnalysisFunctionsList.md) - [AnalysisRecord](docs/AnalysisRecord.md) - [AnalysisScope](docs/AnalysisScope.md) - - [AnalysisStage](docs/AnalysisStage.md) - - [AnalysisStageStatus](docs/AnalysisStageStatus.md) - - [AnalysisStagesResponse](docs/AnalysisStagesResponse.md) - [AnalysisStringInput](docs/AnalysisStringInput.md) - [AnalysisStringsResponse](docs/AnalysisStringsResponse.md) - [AnalysisStringsStatusResponse](docs/AnalysisStringsStatusResponse.md) @@ -221,13 +218,11 @@ Class | Method | HTTP request | Description - [AnalysisUpdateTagsRequest](docs/AnalysisUpdateTagsRequest.md) - [AnalysisUpdateTagsResponse](docs/AnalysisUpdateTagsResponse.md) - [AppApiRestV2AgentSchemaCapability](docs/AppApiRestV2AgentSchemaCapability.md) - - [AppApiRestV2AnalysesEnumsDynamicExecutionStatus](docs/AppApiRestV2AnalysesEnumsDynamicExecutionStatus.md) - [AppApiRestV2AnalysesEnumsOrderBy](docs/AppApiRestV2AnalysesEnumsOrderBy.md) - [AppApiRestV2CollectionsEnumsOrderBy](docs/AppApiRestV2CollectionsEnumsOrderBy.md) - [AppApiRestV2FunctionsResponsesFunction](docs/AppApiRestV2FunctionsResponsesFunction.md) - [AppApiRestV2FunctionsTypesFunction](docs/AppApiRestV2FunctionsTypesFunction.md) - [AppApiRestV2InfoTypesCapability](docs/AppApiRestV2InfoTypesCapability.md) - - [AppServicesDynamicExecutionSchemasDynamicExecutionStatus](docs/AppServicesDynamicExecutionSchemasDynamicExecutionStatus.md) - [Argument](docs/Argument.md) - [AutoRunAgents](docs/AutoRunAgents.md) - [AutoUnstripRequest](docs/AutoUnstripRequest.md) @@ -240,7 +235,6 @@ Class | Method | HTTP request | Description - [BaseResponseAnalysisFunctionMapping](docs/BaseResponseAnalysisFunctionMapping.md) - [BaseResponseAnalysisFunctions](docs/BaseResponseAnalysisFunctions.md) - [BaseResponseAnalysisFunctionsList](docs/BaseResponseAnalysisFunctionsList.md) - - [BaseResponseAnalysisStagesResponse](docs/BaseResponseAnalysisStagesResponse.md) - [BaseResponseAnalysisStringsResponse](docs/BaseResponseAnalysisStringsResponse.md) - [BaseResponseAnalysisStringsStatusResponse](docs/BaseResponseAnalysisStringsStatusResponse.md) - [BaseResponseAnalysisTags](docs/BaseResponseAnalysisTags.md) @@ -264,7 +258,6 @@ Class | Method | HTTP request | Description - [BaseResponseConfigResponse](docs/BaseResponseConfigResponse.md) - [BaseResponseCreated](docs/BaseResponseCreated.md) - [BaseResponseDict](docs/BaseResponseDict.md) - - [BaseResponseDynamicExecutionStatus](docs/BaseResponseDynamicExecutionStatus.md) - [BaseResponseExternalResponse](docs/BaseResponseExternalResponse.md) - [BaseResponseFunctionBlocksResponse](docs/BaseResponseFunctionBlocksResponse.md) - [BaseResponseFunctionCapabilityResponse](docs/BaseResponseFunctionCapabilityResponse.md) @@ -288,18 +281,12 @@ Class | Method | HTTP request | Description - [BaseResponseListUserActivityResponse](docs/BaseResponseListUserActivityResponse.md) - [BaseResponseLogs](docs/BaseResponseLogs.md) - [BaseResponseModelsResponse](docs/BaseResponseModelsResponse.md) - - [BaseResponseNetworkOverviewResponse](docs/BaseResponseNetworkOverviewResponse.md) - [BaseResponseParams](docs/BaseResponseParams.md) - - [BaseResponsePipelineStatusResponse](docs/BaseResponsePipelineStatusResponse.md) - - [BaseResponseProcessDumps](docs/BaseResponseProcessDumps.md) - - [BaseResponseProcessRegistry](docs/BaseResponseProcessRegistry.md) - - [BaseResponseProcessTree](docs/BaseResponseProcessTree.md) - [BaseResponseQueuedWorkflowTaskResponse](docs/BaseResponseQueuedWorkflowTaskResponse.md) - [BaseResponseRecent](docs/BaseResponseRecent.md) - [BaseResponseReportAnalysisResponse](docs/BaseResponseReportAnalysisResponse.md) - [BaseResponseStatus](docs/BaseResponseStatus.md) - [BaseResponseStr](docs/BaseResponseStr.md) - - [BaseResponseTTPS](docs/BaseResponseTTPS.md) - [BaseResponseTagSearchResponse](docs/BaseResponseTagSearchResponse.md) - [BaseResponseTaskResponse](docs/BaseResponseTaskResponse.md) - [BaseResponseTaskStatusResponse](docs/BaseResponseTaskStatusResponse.md) @@ -344,11 +331,16 @@ Class | Method | HTTP request | Description - [CommentResponse](docs/CommentResponse.md) - [CommentUpdateRequest](docs/CommentUpdateRequest.md) - [ConfigResponse](docs/ConfigResponse.md) + - [ConfirmToolInputBody](docs/ConfirmToolInputBody.md) - [Context](docs/Context.md) + - [Conversation](docs/Conversation.md) + - [ConversationContext](docs/ConversationContext.md) + - [ConversationWithEvents](docs/ConversationWithEvents.md) + - [CreateConversationRequest](docs/CreateConversationRequest.md) - [Created](docs/Created.md) - [DecompilationCommentContext](docs/DecompilationCommentContext.md) - [DieMatch](docs/DieMatch.md) - - [DynamicExecutionStatusInput](docs/DynamicExecutionStatusInput.md) + - [DynamicExecutionStatus](docs/DynamicExecutionStatus.md) - [ELFImportModel](docs/ELFImportModel.md) - [ELFModel](docs/ELFModel.md) - [ELFRelocation](docs/ELFRelocation.md) @@ -359,7 +351,25 @@ Class | Method | HTTP request | Description - [ElfDynamicEntry](docs/ElfDynamicEntry.md) - [EntrypointModel](docs/EntrypointModel.md) - [Enumeration](docs/Enumeration.md) + - [ErrorBody](docs/ErrorBody.md) - [ErrorModel](docs/ErrorModel.md) + - [Event](docs/Event.md) + - [EventCONTEXTCOMPACTED](docs/EventCONTEXTCOMPACTED.md) + - [EventRUNCANCELLED](docs/EventRUNCANCELLED.md) + - [EventRUNERROR](docs/EventRUNERROR.md) + - [EventRUNFINISHED](docs/EventRUNFINISHED.md) + - [EventRUNSTARTED](docs/EventRUNSTARTED.md) + - [EventSTEPFINISHED](docs/EventSTEPFINISHED.md) + - [EventSTEPSTARTED](docs/EventSTEPSTARTED.md) + - [EventTEXTMESSAGECONTENT](docs/EventTEXTMESSAGECONTENT.md) + - [EventTEXTMESSAGEEND](docs/EventTEXTMESSAGEEND.md) + - [EventTEXTMESSAGESTART](docs/EventTEXTMESSAGESTART.md) + - [EventTITLEUPDATED](docs/EventTITLEUPDATED.md) + - [EventTOOLCALLARGSDELTA](docs/EventTOOLCALLARGSDELTA.md) + - [EventTOOLCALLEND](docs/EventTOOLCALLEND.md) + - [EventTOOLCALLRESULT](docs/EventTOOLCALLRESULT.md) + - [EventTOOLCALLSTART](docs/EventTOOLCALLSTART.md) + - [EventTOOLCONFIRMATIONREQUIRED](docs/EventTOOLCONFIRMATIONREQUIRED.md) - [ExportModel](docs/ExportModel.md) - [ExternalResponse](docs/ExternalResponse.md) - [FileFormat](docs/FileFormat.md) @@ -429,31 +439,18 @@ Class | Method | HTTP request | Description - [ModelsResponse](docs/ModelsResponse.md) - [NameConfidence](docs/NameConfidence.md) - [NameSourceType](docs/NameSourceType.md) - - [NetworkOverviewDns](docs/NetworkOverviewDns.md) - - [NetworkOverviewDnsAnswer](docs/NetworkOverviewDnsAnswer.md) - - [NetworkOverviewMetadata](docs/NetworkOverviewMetadata.md) - - [NetworkOverviewResponse](docs/NetworkOverviewResponse.md) - [Order](docs/Order.md) - [PDBDebugModel](docs/PDBDebugModel.md) - [PEModel](docs/PEModel.md) - [PaginationModel](docs/PaginationModel.md) - [Params](docs/Params.md) - - [PipelineStageStatus](docs/PipelineStageStatus.md) - - [PipelineStatusResponse](docs/PipelineStatusResponse.md) - [Platform](docs/Platform.md) - - [Process](docs/Process.md) - - [ProcessDump](docs/ProcessDump.md) - - [ProcessDumpMetadata](docs/ProcessDumpMetadata.md) - - [ProcessDumps](docs/ProcessDumps.md) - - [ProcessDumpsData](docs/ProcessDumpsData.md) - - [ProcessRegistry](docs/ProcessRegistry.md) - - [ProcessTree](docs/ProcessTree.md) - [PutAnalysisStringsRequest](docs/PutAnalysisStringsRequest.md) + - [QueuePositionResponse](docs/QueuePositionResponse.md) - [QueuedWorkflowTaskResponse](docs/QueuedWorkflowTaskResponse.md) - [ReAnalysisForm](docs/ReAnalysisForm.md) - [Recent](docs/Recent.md) - [RegenerateTarget](docs/RegenerateTarget.md) - - [Registry](docs/Registry.md) - [RelativeBinaryResponse](docs/RelativeBinaryResponse.md) - [ReportAnalysisResponse](docs/ReportAnalysisResponse.md) - [SBOM](docs/SBOM.md) @@ -463,26 +460,38 @@ Class | Method | HTTP request | Description - [SectionModel](docs/SectionModel.md) - [SecurityModel](docs/SecurityModel.md) - [SegmentInfo](docs/SegmentInfo.md) + - [SendMessageRequest](docs/SendMessageRequest.md) - [SingleCodeCertificateModel](docs/SingleCodeCertificateModel.md) - [SingleCodeSignatureModel](docs/SingleCodeSignatureModel.md) - [SinglePDBEntryModel](docs/SinglePDBEntryModel.md) - [SingleSectionModel](docs/SingleSectionModel.md) + - [SseEventContextCompactedData](docs/SseEventContextCompactedData.md) + - [SseEventRunCancelledData](docs/SseEventRunCancelledData.md) + - [SseEventRunErrorData](docs/SseEventRunErrorData.md) + - [SseEventRunFinishedData](docs/SseEventRunFinishedData.md) + - [SseEventRunStartedData](docs/SseEventRunStartedData.md) + - [SseEventStepFinishedData](docs/SseEventStepFinishedData.md) + - [SseEventStepStartedData](docs/SseEventStepStartedData.md) + - [SseEventTextMessageContentData](docs/SseEventTextMessageContentData.md) + - [SseEventTextMessageEndData](docs/SseEventTextMessageEndData.md) + - [SseEventTextMessageStartData](docs/SseEventTextMessageStartData.md) + - [SseEventTitleUpdatedData](docs/SseEventTitleUpdatedData.md) + - [SseEventToolCallArgsDeltaData](docs/SseEventToolCallArgsDeltaData.md) + - [SseEventToolCallEndData](docs/SseEventToolCallEndData.md) + - [SseEventToolCallResultData](docs/SseEventToolCallResultData.md) + - [SseEventToolCallStartData](docs/SseEventToolCallStartData.md) + - [SseEventToolConfirmationRequiredData](docs/SseEventToolConfirmationRequiredData.md) - [StackVariable](docs/StackVariable.md) - - [StageEvent](docs/StageEvent.md) - - [StageStatus](docs/StageStatus.md) - [StatusInput](docs/StatusInput.md) - [StatusOutput](docs/StatusOutput.md) + - [StatusResponse](docs/StatusResponse.md) + - [StreamEvents200ResponseInner](docs/StreamEvents200ResponseInner.md) - [StringFunctions](docs/StringFunctions.md) - [StringSource](docs/StringSource.md) - [Structure](docs/Structure.md) - [StructureMember](docs/StructureMember.md) - [SubmitUserFeedbackRequest](docs/SubmitUserFeedbackRequest.md) - [Symbols](docs/Symbols.md) - - [TTPS](docs/TTPS.md) - - [TTPSAttack](docs/TTPSAttack.md) - - [TTPSData](docs/TTPSData.md) - - [TTPSElement](docs/TTPSElement.md) - - [TTPSOccurance](docs/TTPSOccurance.md) - [Tag](docs/Tag.md) - [TagItem](docs/TagItem.md) - [TagResponse](docs/TagResponse.md) diff --git a/build.gradle b/build.gradle index 7cdd532..8b4106e 100644 --- a/build.gradle +++ b/build.gradle @@ -19,7 +19,7 @@ apply plugin: 'java' apply plugin: 'com.diffplug.spotless' group = 'ai.reveng' -version = '3.74.4' +version = '3.79.0' @@ -171,7 +171,7 @@ mavenPublishing { publishToMavenCentral(true) signAllPublications() - coordinates("ai.reveng", "sdk", "3.74.4") + coordinates("ai.reveng", "sdk", "3.79.0") pom { name = "sdk" diff --git a/build.sbt b/build.sbt index 79b87a4..58be0b0 100644 --- a/build.sbt +++ b/build.sbt @@ -2,7 +2,7 @@ lazy val root = (project in file(".")). settings( organization := "ai.reveng", name := "sdk", - version := "3.74.4", + version := "3.79.0", scalaVersion := "2.11.12", scalacOptions ++= Seq("-feature"), compile / javacOptions ++= Seq("-Xlint:deprecation"), diff --git a/docs/APIError.md b/docs/APIError.md new file mode 100644 index 0000000..c331f8b --- /dev/null +++ b/docs/APIError.md @@ -0,0 +1,14 @@ + + +# APIError + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**$schema** | **URI** | A URL to the JSON Schema for this object. | [optional] [readonly] | +|**error** | **ErrorBody** | | | + + + diff --git a/docs/AnalysesApi.md b/docs/AnalysesApi.md new file mode 100644 index 0000000..425d98d --- /dev/null +++ b/docs/AnalysesApi.md @@ -0,0 +1,82 @@ +# AnalysesApi + +All URIs are relative to *https://api.reveng.ai* + +| Method | HTTP request | Description | +|------------- | ------------- | -------------| +| [**getAnalysisQueuePosition**](AnalysesApi.md#getAnalysisQueuePosition) | **GET** /v2/analyses/{analysis_id}/queue-position | Get the queue position of an analysis | + + + +# **getAnalysisQueuePosition** +> QueuePositionResponse getAnalysisQueuePosition(analysisId) + +Get the queue position of an analysis + +Returns the number of Processing analyses with a lower analysis_id than the given one. Useful for showing the user where they sit in the processing queue while waiting for their analysis to start. **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.AnalysesApi; + +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"); + + AnalysesApi apiInstance = new AnalysesApi(defaultClient); + Long analysisId = 56L; // Long | Analysis ID + try { + QueuePositionResponse result = apiInstance.getAnalysisQueuePosition(analysisId); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling AnalysesApi#getAnalysisQueuePosition"); + 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 + +[**QueuePositionResponse**](QueuePositionResponse.md) + +### Authorization + +[APIKey](../README.md#APIKey) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | OK | - | +| **403** | Forbidden | - | +| **404** | Not Found | - | +| **422** | Unprocessable Entity | - | +| **500** | Internal Server Error | - | + diff --git a/docs/AnalysesCoreApi.md b/docs/AnalysesCoreApi.md index 77c6bf3..30c9104 100644 --- a/docs/AnalysesCoreApi.md +++ b/docs/AnalysesCoreApi.md @@ -695,7 +695,7 @@ public class Example { List workspace = Arrays.asList(); // List | The workspace to be viewed List status = Arrays.asList(); // List | The status of the analysis List modelName = Arrays.asList(); // List | Show analysis belonging to the model - DynamicExecutionStatusInput dynamicExecutionStatus = DynamicExecutionStatusInput.fromValue("PENDING"); // DynamicExecutionStatusInput | Show analysis that have a dynamic execution with the given status + DynamicExecutionStatus dynamicExecutionStatus = DynamicExecutionStatus.fromValue("PENDING"); // DynamicExecutionStatus | Show analysis that have a dynamic execution with the given status List usernames = Arrays.asList(); // List | Show analysis belonging to the user String sha256Hash = "sha256Hash_example"; // String | Integer limit = 20; // Integer | @@ -724,7 +724,7 @@ public class Example { | **workspace** | [**List<Workspace>**](Workspace.md)| The workspace to be viewed | [optional] | | **status** | [**List<StatusInput>**](StatusInput.md)| The status of the analysis | [optional] | | **modelName** | [**List<ModelName>**](ModelName.md)| Show analysis belonging to the model | [optional] | -| **dynamicExecutionStatus** | [**DynamicExecutionStatusInput**](.md)| Show analysis that have a dynamic execution with the given status | [optional] [enum: PENDING, ERROR, SUCCESS, ALL] | +| **dynamicExecutionStatus** | [**DynamicExecutionStatus**](.md)| Show analysis that have a dynamic execution with the given status | [optional] [enum: PENDING, ERROR, SUCCESS, ALL] | | **usernames** | [**List<String>**](String.md)| Show analysis belonging to the user | [optional] | | **sha256Hash** | **String**| | [optional] | | **limit** | **Integer**| | [optional] [default to 20] | diff --git a/docs/AnalysisRecord.md b/docs/AnalysisRecord.md index 54905ed..a79033d 100644 --- a/docs/AnalysisRecord.md +++ b/docs/AnalysisRecord.md @@ -20,7 +20,7 @@ |**functionBoundariesHash** | **String** | The hash of the function boundaries | | |**binarySize** | **Integer** | The size of the binary | | |**username** | **String** | The username of the analysis owner | | -|**dynamicExecutionStatus** | **AppApiRestV2AnalysesEnumsDynamicExecutionStatus** | | [optional] | +|**dynamicExecutionStatus** | **DynamicExecutionStatus** | | [optional] | |**dynamicExecutionTaskId** | **Integer** | | [optional] | |**baseAddress** | **BigInteger** | The base address of the binary | | |**tags** | [**List<TagItem>**](TagItem.md) | List of tags associated with the analysis | [optional] | diff --git a/docs/AnalysisStage.md b/docs/AnalysisStage.md deleted file mode 100644 index 2ad31b6..0000000 --- a/docs/AnalysisStage.md +++ /dev/null @@ -1,15 +0,0 @@ - - -# AnalysisStage - -## Enum - - -* `ANALYSIS` (value: `"ANALYSIS"`) - -* `POST_PROCESSING` (value: `"POST_PROCESSING"`) - -* `INFERENCE` (value: `"INFERENCE"`) - - - diff --git a/docs/AnalysisStageStatus.md b/docs/AnalysisStageStatus.md deleted file mode 100644 index 1ccee69..0000000 --- a/docs/AnalysisStageStatus.md +++ /dev/null @@ -1,17 +0,0 @@ - - -# AnalysisStageStatus - -## Enum - - -* `QUEUED` (value: `"QUEUED"`) - -* `STARTED` (value: `"STARTED"`) - -* `FINISHED` (value: `"FINISHED"`) - -* `ERROR` (value: `"ERROR"`) - - - diff --git a/docs/AnalysisStagesApi.md b/docs/AnalysisStagesApi.md deleted file mode 100644 index a64ea12..0000000 --- a/docs/AnalysisStagesApi.md +++ /dev/null @@ -1,150 +0,0 @@ -# AnalysisStagesApi - -All URIs are relative to *https://api.reveng.ai* - -| Method | HTTP request | Description | -|------------- | ------------- | -------------| -| [**getAnalysisStages**](AnalysisStagesApi.md#getAnalysisStages) | **GET** /v2/analysis-stages/{analysis_id} | Get Analysis Stages | -| [**getPipelineStatus**](AnalysisStagesApi.md#getPipelineStatus) | **GET** /v2/analysis-stages/{analysis_id}/pipeline-status | Get Pipeline Status | - - - -# **getAnalysisStages** -> BaseResponseAnalysisStagesResponse getAnalysisStages(analysisId) - -Get Analysis Stages - -Returns all stage events for an analysis ordered by timestamp. - -### 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.AnalysisStagesApi; - -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"); - - AnalysisStagesApi apiInstance = new AnalysisStagesApi(defaultClient); - Integer analysisId = 56; // Integer | - try { - BaseResponseAnalysisStagesResponse result = apiInstance.getAnalysisStages(analysisId); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling AnalysisStagesApi#getAnalysisStages"); - 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 - -[**BaseResponseAnalysisStagesResponse**](BaseResponseAnalysisStagesResponse.md) - -### Authorization - -[APIKey](../README.md#APIKey) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/json - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -| **200** | Successful Response | - | -| **422** | Invalid request parameters | - | - - -# **getPipelineStatus** -> BaseResponsePipelineStatusResponse getPipelineStatus(analysisId) - -Get Pipeline Status - -Returns the latest status for each core pipeline stage with the number of analyses ahead in the queue. - -### 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.AnalysisStagesApi; - -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"); - - AnalysisStagesApi apiInstance = new AnalysisStagesApi(defaultClient); - Integer analysisId = 56; // Integer | - try { - BaseResponsePipelineStatusResponse result = apiInstance.getPipelineStatus(analysisId); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling AnalysisStagesApi#getPipelineStatus"); - 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 - -[**BaseResponsePipelineStatusResponse**](BaseResponsePipelineStatusResponse.md) - -### Authorization - -[APIKey](../README.md#APIKey) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/json - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -| **200** | Successful Response | - | -| **422** | Invalid request parameters | - | - diff --git a/docs/AppApiRestV2AnalysesEnumsDynamicExecutionStatus.md b/docs/AppApiRestV2AnalysesEnumsDynamicExecutionStatus.md deleted file mode 100644 index 2be4037..0000000 --- a/docs/AppApiRestV2AnalysesEnumsDynamicExecutionStatus.md +++ /dev/null @@ -1,17 +0,0 @@ - - -# AppApiRestV2AnalysesEnumsDynamicExecutionStatus - -## Enum - - -* `PENDING` (value: `"PENDING"`) - -* `ERROR` (value: `"ERROR"`) - -* `SUCCESS` (value: `"SUCCESS"`) - -* `ALL` (value: `"ALL"`) - - - diff --git a/docs/BaseResponseAnalysisStagesResponse.md b/docs/BaseResponseAnalysisStagesResponse.md deleted file mode 100644 index 31e644a..0000000 --- a/docs/BaseResponseAnalysisStagesResponse.md +++ /dev/null @@ -1,17 +0,0 @@ - - -# BaseResponseAnalysisStagesResponse - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**status** | **Boolean** | Response status on whether the request succeeded | [optional] | -|**data** | [**AnalysisStagesResponse**](AnalysisStagesResponse.md) | | [optional] | -|**message** | **String** | | [optional] | -|**errors** | [**List<ErrorModel>**](ErrorModel.md) | | [optional] | -|**meta** | [**MetaModel**](MetaModel.md) | Metadata | [optional] | - - - diff --git a/docs/BaseResponseDynamicExecutionStatus.md b/docs/BaseResponseDynamicExecutionStatus.md deleted file mode 100644 index 8e2a0b7..0000000 --- a/docs/BaseResponseDynamicExecutionStatus.md +++ /dev/null @@ -1,17 +0,0 @@ - - -# BaseResponseDynamicExecutionStatus - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**status** | **Boolean** | Response status on whether the request succeeded | [optional] | -|**data** | [**AppServicesDynamicExecutionSchemasDynamicExecutionStatus**](AppServicesDynamicExecutionSchemasDynamicExecutionStatus.md) | | [optional] | -|**message** | **String** | | [optional] | -|**errors** | [**List<ErrorModel>**](ErrorModel.md) | | [optional] | -|**meta** | [**MetaModel**](MetaModel.md) | Metadata | [optional] | - - - diff --git a/docs/BaseResponseNetworkOverviewResponse.md b/docs/BaseResponseNetworkOverviewResponse.md deleted file mode 100644 index 3202052..0000000 --- a/docs/BaseResponseNetworkOverviewResponse.md +++ /dev/null @@ -1,17 +0,0 @@ - - -# BaseResponseNetworkOverviewResponse - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**status** | **Boolean** | Response status on whether the request succeeded | [optional] | -|**data** | [**NetworkOverviewResponse**](NetworkOverviewResponse.md) | | [optional] | -|**message** | **String** | | [optional] | -|**errors** | [**List<ErrorModel>**](ErrorModel.md) | | [optional] | -|**meta** | [**MetaModel**](MetaModel.md) | Metadata | [optional] | - - - diff --git a/docs/BaseResponsePipelineStatusResponse.md b/docs/BaseResponsePipelineStatusResponse.md deleted file mode 100644 index b63d3e9..0000000 --- a/docs/BaseResponsePipelineStatusResponse.md +++ /dev/null @@ -1,17 +0,0 @@ - - -# BaseResponsePipelineStatusResponse - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**status** | **Boolean** | Response status on whether the request succeeded | [optional] | -|**data** | [**PipelineStatusResponse**](PipelineStatusResponse.md) | | [optional] | -|**message** | **String** | | [optional] | -|**errors** | [**List<ErrorModel>**](ErrorModel.md) | | [optional] | -|**meta** | [**MetaModel**](MetaModel.md) | Metadata | [optional] | - - - diff --git a/docs/BaseResponseProcessDumps.md b/docs/BaseResponseProcessDumps.md deleted file mode 100644 index 73f6364..0000000 --- a/docs/BaseResponseProcessDumps.md +++ /dev/null @@ -1,17 +0,0 @@ - - -# BaseResponseProcessDumps - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**status** | **Boolean** | Response status on whether the request succeeded | [optional] | -|**data** | [**ProcessDumps**](ProcessDumps.md) | | [optional] | -|**message** | **String** | | [optional] | -|**errors** | [**List<ErrorModel>**](ErrorModel.md) | | [optional] | -|**meta** | [**MetaModel**](MetaModel.md) | Metadata | [optional] | - - - diff --git a/docs/BaseResponseProcessRegistry.md b/docs/BaseResponseProcessRegistry.md deleted file mode 100644 index 5676c71..0000000 --- a/docs/BaseResponseProcessRegistry.md +++ /dev/null @@ -1,17 +0,0 @@ - - -# BaseResponseProcessRegistry - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**status** | **Boolean** | Response status on whether the request succeeded | [optional] | -|**data** | [**ProcessRegistry**](ProcessRegistry.md) | | [optional] | -|**message** | **String** | | [optional] | -|**errors** | [**List<ErrorModel>**](ErrorModel.md) | | [optional] | -|**meta** | [**MetaModel**](MetaModel.md) | Metadata | [optional] | - - - diff --git a/docs/BaseResponseProcessTree.md b/docs/BaseResponseProcessTree.md deleted file mode 100644 index 616943a..0000000 --- a/docs/BaseResponseProcessTree.md +++ /dev/null @@ -1,17 +0,0 @@ - - -# BaseResponseProcessTree - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**status** | **Boolean** | Response status on whether the request succeeded | [optional] | -|**data** | [**ProcessTree**](ProcessTree.md) | | [optional] | -|**message** | **String** | | [optional] | -|**errors** | [**List<ErrorModel>**](ErrorModel.md) | | [optional] | -|**meta** | [**MetaModel**](MetaModel.md) | Metadata | [optional] | - - - diff --git a/docs/BaseResponseTTPS.md b/docs/BaseResponseTTPS.md deleted file mode 100644 index 7cc12dc..0000000 --- a/docs/BaseResponseTTPS.md +++ /dev/null @@ -1,17 +0,0 @@ - - -# BaseResponseTTPS - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**status** | **Boolean** | Response status on whether the request succeeded | [optional] | -|**data** | [**TTPS**](TTPS.md) | | [optional] | -|**message** | **String** | | [optional] | -|**errors** | [**List<ErrorModel>**](ErrorModel.md) | | [optional] | -|**meta** | [**MetaModel**](MetaModel.md) | Metadata | [optional] | - - - diff --git a/docs/ConfirmToolInputBody.md b/docs/ConfirmToolInputBody.md new file mode 100644 index 0000000..799662d --- /dev/null +++ b/docs/ConfirmToolInputBody.md @@ -0,0 +1,14 @@ + + +# ConfirmToolInputBody + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**$schema** | **URI** | A URL to the JSON Schema for this object. | [optional] [readonly] | +|**approved** | **Boolean** | Whether the user approves the pending tool call. | | + + + diff --git a/docs/Conversation.md b/docs/Conversation.md new file mode 100644 index 0000000..7d47f96 --- /dev/null +++ b/docs/Conversation.md @@ -0,0 +1,19 @@ + + +# Conversation + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**$schema** | **URI** | A URL to the JSON Schema for this object. | [optional] [readonly] | +|**context** | **Object** | | [optional] | +|**conversationUuid** | **String** | | | +|**createdAt** | **OffsetDateTime** | | | +|**title** | **String** | | | +|**updatedAt** | **OffsetDateTime** | | | +|**userId** | **Long** | | | + + + diff --git a/docs/AnalysisStagesResponse.md b/docs/ConversationContext.md similarity index 51% rename from docs/AnalysisStagesResponse.md rename to docs/ConversationContext.md index a1acf5a..ce29e3f 100644 --- a/docs/AnalysisStagesResponse.md +++ b/docs/ConversationContext.md @@ -1,13 +1,14 @@ -# AnalysisStagesResponse +# ConversationContext ## Properties | Name | Type | Description | Notes | |------------ | ------------- | ------------- | -------------| -|**events** | [**List<StageEvent>**](StageEvent.md) | | | +|**analysisId** | **Long** | | [optional] | +|**functionId** | **Long** | | [optional] | diff --git a/docs/ConversationWithEvents.md b/docs/ConversationWithEvents.md new file mode 100644 index 0000000..00802fa --- /dev/null +++ b/docs/ConversationWithEvents.md @@ -0,0 +1,20 @@ + + +# ConversationWithEvents + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**$schema** | **URI** | A URL to the JSON Schema for this object. | [optional] [readonly] | +|**context** | **Object** | | [optional] | +|**conversationUuid** | **String** | | | +|**createdAt** | **OffsetDateTime** | | | +|**events** | **List<Event>** | | | +|**title** | **String** | | | +|**updatedAt** | **OffsetDateTime** | | | +|**userId** | **Long** | | | + + + diff --git a/docs/AnalysesDynamicExecutionApi.md b/docs/ConversationsApi.md similarity index 51% rename from docs/AnalysesDynamicExecutionApi.md rename to docs/ConversationsApi.md index cf57922..abad273 100644 --- a/docs/AnalysesDynamicExecutionApi.md +++ b/docs/ConversationsApi.md @@ -1,23 +1,25 @@ -# AnalysesDynamicExecutionApi +# ConversationsApi All URIs are relative to *https://api.reveng.ai* | Method | HTTP request | Description | |------------- | ------------- | -------------| -| [**getDynamicExecutionStatus**](AnalysesDynamicExecutionApi.md#getDynamicExecutionStatus) | **GET** /v2/analyses/{analysis_id}/dynamic-execution/status | Get the status of a dynamic execution task | -| [**getNetworkOverview**](AnalysesDynamicExecutionApi.md#getNetworkOverview) | **GET** /v2/analyses/{analysis_id}/dynamic-execution/network-overview | Get the dynamic execution results for network overview | -| [**getProcessDump**](AnalysesDynamicExecutionApi.md#getProcessDump) | **GET** /v2/analyses/{analysis_id}/dynamic-execution/process-dumps/{dump_name} | Get the dynamic execution results for a specific process dump | -| [**getProcessDumps**](AnalysesDynamicExecutionApi.md#getProcessDumps) | **GET** /v2/analyses/{analysis_id}/dynamic-execution/process-dumps | Get the dynamic execution results for process dumps | -| [**getProcessRegistry**](AnalysesDynamicExecutionApi.md#getProcessRegistry) | **GET** /v2/analyses/{analysis_id}/dynamic-execution/process-registry | Get the dynamic execution results for process registry | -| [**getProcessTree**](AnalysesDynamicExecutionApi.md#getProcessTree) | **GET** /v2/analyses/{analysis_id}/dynamic-execution/process-tree | Get the dynamic execution results for process tree | -| [**getTtps**](AnalysesDynamicExecutionApi.md#getTtps) | **GET** /v2/analyses/{analysis_id}/dynamic-execution/ttps | Get the dynamic execution results for ttps | +| [**cancelRun**](ConversationsApi.md#cancelRun) | **POST** /v2/conversations/{id}/cancel | Cancel an active run | +| [**confirmTool**](ConversationsApi.md#confirmTool) | **POST** /v2/conversations/{id}/confirm | Approve or reject a pending tool confirmation | +| [**createConversation**](ConversationsApi.md#createConversation) | **POST** /v2/conversations | Create a new conversation | +| [**getConversation**](ConversationsApi.md#getConversation) | **GET** /v2/conversations/{id} | Get a conversation with its events | +| [**listConversations**](ConversationsApi.md#listConversations) | **GET** /v2/conversations | List conversations for the authenticated user | +| [**sendMessage**](ConversationsApi.md#sendMessage) | **POST** /v2/conversations/{id}/messages | Send a message and start an agentic run | +| [**streamEvents**](ConversationsApi.md#streamEvents) | **GET** /v2/conversations/{id}/events | Stream conversation events (SSE) | - -# **getDynamicExecutionStatus** -> BaseResponseDynamicExecutionStatus getDynamicExecutionStatus(analysisId) + +# **cancelRun** +> StatusResponse cancelRun(id) -Get the status of a dynamic execution task +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 ### Example ```java @@ -27,7 +29,7 @@ import ai.reveng.invoker.ApiException; import ai.reveng.invoker.Configuration; import ai.reveng.invoker.auth.*; import ai.reveng.invoker.models.*; -import ai.reveng.api.AnalysesDynamicExecutionApi; +import ai.reveng.api.ConversationsApi; public class Example { public static void main(String[] args) { @@ -40,13 +42,13 @@ public class Example { // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) //APIKey.setApiKeyPrefix("Token"); - AnalysesDynamicExecutionApi apiInstance = new AnalysesDynamicExecutionApi(defaultClient); - Integer analysisId = 56; // Integer | + ConversationsApi apiInstance = new ConversationsApi(defaultClient); + UUID id = UUID.randomUUID(); // UUID | Conversation UUID try { - BaseResponseDynamicExecutionStatus result = apiInstance.getDynamicExecutionStatus(analysisId); + StatusResponse result = apiInstance.cancelRun(id); System.out.println(result); } catch (ApiException e) { - System.err.println("Exception when calling AnalysesDynamicExecutionApi#getDynamicExecutionStatus"); + System.err.println("Exception when calling ConversationsApi#cancelRun"); System.err.println("Status code: " + e.getCode()); System.err.println("Reason: " + e.getResponseBody()); System.err.println("Response headers: " + e.getResponseHeaders()); @@ -60,11 +62,11 @@ public class Example { | Name | Type | Description | Notes | |------------- | ------------- | ------------- | -------------| -| **analysisId** | **Integer**| | | +| **id** | **UUID**| Conversation UUID | | ### Return type -[**BaseResponseDynamicExecutionStatus**](BaseResponseDynamicExecutionStatus.md) +[**StatusResponse**](StatusResponse.md) ### Authorization @@ -78,14 +80,19 @@ public class Example { ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -| **200** | Successful Response | - | -| **422** | Invalid request parameters | - | +| **200** | OK | - | +| **400** | Bad Request | - | +| **404** | Not Found | - | +| **422** | Unprocessable Entity | - | +| **500** | Internal Server Error | - | + + +# **confirmTool** +> StatusResponse confirmTool(id, confirmToolInputBody) - -# **getNetworkOverview** -> BaseResponseNetworkOverviewResponse getNetworkOverview(analysisId) +Approve or reject a pending tool confirmation -Get the dynamic execution results for network overview +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 ### Example ```java @@ -95,7 +102,7 @@ import ai.reveng.invoker.ApiException; import ai.reveng.invoker.Configuration; import ai.reveng.invoker.auth.*; import ai.reveng.invoker.models.*; -import ai.reveng.api.AnalysesDynamicExecutionApi; +import ai.reveng.api.ConversationsApi; public class Example { public static void main(String[] args) { @@ -108,13 +115,14 @@ public class Example { // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) //APIKey.setApiKeyPrefix("Token"); - AnalysesDynamicExecutionApi apiInstance = new AnalysesDynamicExecutionApi(defaultClient); - Integer analysisId = 56; // Integer | + ConversationsApi apiInstance = new ConversationsApi(defaultClient); + UUID id = UUID.randomUUID(); // UUID | Conversation UUID + ConfirmToolInputBody confirmToolInputBody = new ConfirmToolInputBody(); // ConfirmToolInputBody | try { - BaseResponseNetworkOverviewResponse result = apiInstance.getNetworkOverview(analysisId); + StatusResponse result = apiInstance.confirmTool(id, confirmToolInputBody); System.out.println(result); } catch (ApiException e) { - System.err.println("Exception when calling AnalysesDynamicExecutionApi#getNetworkOverview"); + System.err.println("Exception when calling ConversationsApi#confirmTool"); System.err.println("Status code: " + e.getCode()); System.err.println("Reason: " + e.getResponseBody()); System.err.println("Response headers: " + e.getResponseHeaders()); @@ -128,11 +136,12 @@ public class Example { | Name | Type | Description | Notes | |------------- | ------------- | ------------- | -------------| -| **analysisId** | **Integer**| | | +| **id** | **UUID**| Conversation UUID | | +| **confirmToolInputBody** | [**ConfirmToolInputBody**](ConfirmToolInputBody.md)| | | ### Return type -[**BaseResponseNetworkOverviewResponse**](BaseResponseNetworkOverviewResponse.md) +[**StatusResponse**](StatusResponse.md) ### Authorization @@ -140,20 +149,25 @@ public class Example { ### HTTP request headers - - **Content-Type**: Not defined + - **Content-Type**: application/json - **Accept**: application/json ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -| **200** | Successful Response | - | -| **422** | Invalid request parameters | - | +| **200** | OK | - | +| **400** | Bad Request | - | +| **404** | Not Found | - | +| **422** | Unprocessable Entity | - | +| **500** | Internal Server Error | - | + + +# **createConversation** +> Conversation createConversation(createConversationRequest) - -# **getProcessDump** -> Object getProcessDump(analysisId, dumpName) +Create a new conversation -Get the dynamic execution results for a specific process dump +Creates a new conversation for the authenticated user. Optionally include a binary analysis context to scope the assistant to a specific analysis. **Error codes:** - `400` [`BAD_REQUEST`](/errors/BAD_REQUEST) — Bad Request ### Example ```java @@ -163,7 +177,7 @@ import ai.reveng.invoker.ApiException; import ai.reveng.invoker.Configuration; import ai.reveng.invoker.auth.*; import ai.reveng.invoker.models.*; -import ai.reveng.api.AnalysesDynamicExecutionApi; +import ai.reveng.api.ConversationsApi; public class Example { public static void main(String[] args) { @@ -176,14 +190,13 @@ public class Example { // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) //APIKey.setApiKeyPrefix("Token"); - AnalysesDynamicExecutionApi apiInstance = new AnalysesDynamicExecutionApi(defaultClient); - Integer analysisId = 56; // Integer | - String dumpName = "dumpName_example"; // String | + ConversationsApi apiInstance = new ConversationsApi(defaultClient); + CreateConversationRequest createConversationRequest = new CreateConversationRequest(); // CreateConversationRequest | try { - Object result = apiInstance.getProcessDump(analysisId, dumpName); + Conversation result = apiInstance.createConversation(createConversationRequest); System.out.println(result); } catch (ApiException e) { - System.err.println("Exception when calling AnalysesDynamicExecutionApi#getProcessDump"); + System.err.println("Exception when calling ConversationsApi#createConversation"); System.err.println("Status code: " + e.getCode()); System.err.println("Reason: " + e.getResponseBody()); System.err.println("Response headers: " + e.getResponseHeaders()); @@ -197,12 +210,11 @@ public class Example { | Name | Type | Description | Notes | |------------- | ------------- | ------------- | -------------| -| **analysisId** | **Integer**| | | -| **dumpName** | **String**| | | +| **createConversationRequest** | [**CreateConversationRequest**](CreateConversationRequest.md)| | | ### Return type -**Object** +[**Conversation**](Conversation.md) ### Authorization @@ -210,20 +222,24 @@ public class Example { ### HTTP request headers - - **Content-Type**: Not defined + - **Content-Type**: application/json - **Accept**: application/json ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -| **200** | Successful Response | - | -| **422** | Invalid request parameters | - | +| **201** | Created | - | +| **400** | Bad Request | - | +| **422** | Unprocessable Entity | - | +| **500** | Internal Server Error | - | + + +# **getConversation** +> ConversationWithEvents getConversation(id) - -# **getProcessDumps** -> BaseResponseProcessDumps getProcessDumps(analysisId) +Get a conversation with its events -Get the dynamic execution results for process dumps +Returns the conversation metadata along with all persisted events. Useful for reconstructing the full conversation history on page load. **Error codes:** - `400` [`INVALID_CONVERSATION_ID`](/errors/INVALID_CONVERSATION_ID) — Invalid Conversation ID - `404` [`CONVERSATION_NOT_FOUND`](/errors/CONVERSATION_NOT_FOUND) — Conversation Not Found ### Example ```java @@ -233,7 +249,7 @@ import ai.reveng.invoker.ApiException; import ai.reveng.invoker.Configuration; import ai.reveng.invoker.auth.*; import ai.reveng.invoker.models.*; -import ai.reveng.api.AnalysesDynamicExecutionApi; +import ai.reveng.api.ConversationsApi; public class Example { public static void main(String[] args) { @@ -246,13 +262,13 @@ public class Example { // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) //APIKey.setApiKeyPrefix("Token"); - AnalysesDynamicExecutionApi apiInstance = new AnalysesDynamicExecutionApi(defaultClient); - Integer analysisId = 56; // Integer | + ConversationsApi apiInstance = new ConversationsApi(defaultClient); + UUID id = UUID.randomUUID(); // UUID | Conversation UUID try { - BaseResponseProcessDumps result = apiInstance.getProcessDumps(analysisId); + ConversationWithEvents result = apiInstance.getConversation(id); System.out.println(result); } catch (ApiException e) { - System.err.println("Exception when calling AnalysesDynamicExecutionApi#getProcessDumps"); + System.err.println("Exception when calling ConversationsApi#getConversation"); System.err.println("Status code: " + e.getCode()); System.err.println("Reason: " + e.getResponseBody()); System.err.println("Response headers: " + e.getResponseHeaders()); @@ -266,11 +282,11 @@ public class Example { | Name | Type | Description | Notes | |------------- | ------------- | ------------- | -------------| -| **analysisId** | **Integer**| | | +| **id** | **UUID**| Conversation UUID | | ### Return type -[**BaseResponseProcessDumps**](BaseResponseProcessDumps.md) +[**ConversationWithEvents**](ConversationWithEvents.md) ### Authorization @@ -284,14 +300,19 @@ public class Example { ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -| **200** | Successful Response | - | -| **422** | Invalid request parameters | - | +| **200** | OK | - | +| **400** | Bad Request | - | +| **404** | Not Found | - | +| **422** | Unprocessable Entity | - | +| **500** | Internal Server Error | - | + + +# **listConversations** +> List<Conversation> listConversations() - -# **getProcessRegistry** -> BaseResponseProcessRegistry getProcessRegistry(analysisId) +List conversations for the authenticated user -Get the dynamic execution results for process registry +Returns all conversations owned by the authenticated user, ordered by most recently updated. ### Example ```java @@ -301,7 +322,7 @@ import ai.reveng.invoker.ApiException; import ai.reveng.invoker.Configuration; import ai.reveng.invoker.auth.*; import ai.reveng.invoker.models.*; -import ai.reveng.api.AnalysesDynamicExecutionApi; +import ai.reveng.api.ConversationsApi; public class Example { public static void main(String[] args) { @@ -314,13 +335,12 @@ public class Example { // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) //APIKey.setApiKeyPrefix("Token"); - AnalysesDynamicExecutionApi apiInstance = new AnalysesDynamicExecutionApi(defaultClient); - Integer analysisId = 56; // Integer | + ConversationsApi apiInstance = new ConversationsApi(defaultClient); try { - BaseResponseProcessRegistry result = apiInstance.getProcessRegistry(analysisId); + List result = apiInstance.listConversations(); System.out.println(result); } catch (ApiException e) { - System.err.println("Exception when calling AnalysesDynamicExecutionApi#getProcessRegistry"); + System.err.println("Exception when calling ConversationsApi#listConversations"); System.err.println("Status code: " + e.getCode()); System.err.println("Reason: " + e.getResponseBody()); System.err.println("Response headers: " + e.getResponseHeaders()); @@ -331,14 +351,11 @@ public class Example { ``` ### Parameters - -| Name | Type | Description | Notes | -|------------- | ------------- | ------------- | -------------| -| **analysisId** | **Integer**| | | +This endpoint does not need any parameter. ### Return type -[**BaseResponseProcessRegistry**](BaseResponseProcessRegistry.md) +[**List<Conversation>**](Conversation.md) ### Authorization @@ -352,14 +369,16 @@ public class Example { ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -| **200** | Successful Response | - | -| **422** | Invalid request parameters | - | +| **200** | OK | - | +| **0** | Error | - | + + +# **sendMessage** +> StatusResponse sendMessage(id, sendMessageRequest) - -# **getProcessTree** -> BaseResponseProcessTree getProcessTree(analysisId) +Send a message and start an agentic run -Get the dynamic execution results for process tree +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 ### Example ```java @@ -369,7 +388,7 @@ import ai.reveng.invoker.ApiException; import ai.reveng.invoker.Configuration; import ai.reveng.invoker.auth.*; import ai.reveng.invoker.models.*; -import ai.reveng.api.AnalysesDynamicExecutionApi; +import ai.reveng.api.ConversationsApi; public class Example { public static void main(String[] args) { @@ -382,13 +401,14 @@ public class Example { // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) //APIKey.setApiKeyPrefix("Token"); - AnalysesDynamicExecutionApi apiInstance = new AnalysesDynamicExecutionApi(defaultClient); - Integer analysisId = 56; // Integer | + ConversationsApi apiInstance = new ConversationsApi(defaultClient); + UUID id = UUID.randomUUID(); // UUID | Conversation UUID + SendMessageRequest sendMessageRequest = new SendMessageRequest(); // SendMessageRequest | try { - BaseResponseProcessTree result = apiInstance.getProcessTree(analysisId); + StatusResponse result = apiInstance.sendMessage(id, sendMessageRequest); System.out.println(result); } catch (ApiException e) { - System.err.println("Exception when calling AnalysesDynamicExecutionApi#getProcessTree"); + System.err.println("Exception when calling ConversationsApi#sendMessage"); System.err.println("Status code: " + e.getCode()); System.err.println("Reason: " + e.getResponseBody()); System.err.println("Response headers: " + e.getResponseHeaders()); @@ -402,11 +422,12 @@ public class Example { | Name | Type | Description | Notes | |------------- | ------------- | ------------- | -------------| -| **analysisId** | **Integer**| | | +| **id** | **UUID**| Conversation UUID | | +| **sendMessageRequest** | [**SendMessageRequest**](SendMessageRequest.md)| | | ### Return type -[**BaseResponseProcessTree**](BaseResponseProcessTree.md) +[**StatusResponse**](StatusResponse.md) ### Authorization @@ -414,20 +435,28 @@ public class Example { ### HTTP request headers - - **Content-Type**: Not defined + - **Content-Type**: application/json - **Accept**: application/json ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -| **200** | Successful Response | - | -| **422** | Invalid request parameters | - | +| **202** | Accepted | - | +| **400** | Bad Request | - | +| **402** | Payment Required | - | +| **403** | Forbidden | - | +| **404** | Not Found | - | +| **409** | Conflict | - | +| **422** | Unprocessable Entity | - | +| **500** | Internal Server Error | - | + + +# **streamEvents** +> List<StreamEvents200ResponseInner> streamEvents(id, lastEventId) - -# **getTtps** -> BaseResponseTTPS getTtps(analysisId) +Stream conversation events (SSE) -Get the dynamic execution results for ttps +Opens a Server-Sent Events stream for the given conversation. Events include run lifecycle updates, streaming text deltas, tool call progress, and more. Use the `last_event_id` query parameter to replay missed events after a reconnection. ### Example ```java @@ -437,7 +466,7 @@ import ai.reveng.invoker.ApiException; import ai.reveng.invoker.Configuration; import ai.reveng.invoker.auth.*; import ai.reveng.invoker.models.*; -import ai.reveng.api.AnalysesDynamicExecutionApi; +import ai.reveng.api.ConversationsApi; public class Example { public static void main(String[] args) { @@ -450,13 +479,14 @@ public class Example { // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) //APIKey.setApiKeyPrefix("Token"); - AnalysesDynamicExecutionApi apiInstance = new AnalysesDynamicExecutionApi(defaultClient); - Integer analysisId = 56; // Integer | + ConversationsApi apiInstance = new ConversationsApi(defaultClient); + UUID id = UUID.randomUUID(); // UUID | Conversation UUID + Long lastEventId = 56L; // Long | Replay events after this ID try { - BaseResponseTTPS result = apiInstance.getTtps(analysisId); + List result = apiInstance.streamEvents(id, lastEventId); System.out.println(result); } catch (ApiException e) { - System.err.println("Exception when calling AnalysesDynamicExecutionApi#getTtps"); + System.err.println("Exception when calling ConversationsApi#streamEvents"); System.err.println("Status code: " + e.getCode()); System.err.println("Reason: " + e.getResponseBody()); System.err.println("Response headers: " + e.getResponseHeaders()); @@ -470,11 +500,12 @@ public class Example { | Name | Type | Description | Notes | |------------- | ------------- | ------------- | -------------| -| **analysisId** | **Integer**| | | +| **id** | **UUID**| Conversation UUID | | +| **lastEventId** | **Long**| Replay events after this ID | [optional] | ### Return type -[**BaseResponseTTPS**](BaseResponseTTPS.md) +[**List<StreamEvents200ResponseInner>**](StreamEvents200ResponseInner.md) ### Authorization @@ -483,11 +514,11 @@ public class Example { ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json + - **Accept**: text/event-stream, application/json ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -| **200** | Successful Response | - | -| **422** | Invalid request parameters | - | +| **200** | OK | - | +| **0** | Error | - | diff --git a/docs/CreateConversationRequest.md b/docs/CreateConversationRequest.md new file mode 100644 index 0000000..8a5f844 --- /dev/null +++ b/docs/CreateConversationRequest.md @@ -0,0 +1,15 @@ + + +# CreateConversationRequest + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**$schema** | **URI** | A URL to the JSON Schema for this object. | [optional] [readonly] | +|**context** | **ConversationContext** | | [optional] | +|**title** | **String** | | [optional] | + + + diff --git a/docs/DynamicExecutionStatusInput.md b/docs/DynamicExecutionStatus.md similarity index 82% rename from docs/DynamicExecutionStatusInput.md rename to docs/DynamicExecutionStatus.md index 002e61c..797e7d0 100644 --- a/docs/DynamicExecutionStatusInput.md +++ b/docs/DynamicExecutionStatus.md @@ -1,6 +1,6 @@ -# DynamicExecutionStatusInput +# DynamicExecutionStatus ## Enum diff --git a/docs/ErrorBody.md b/docs/ErrorBody.md new file mode 100644 index 0000000..95db66a --- /dev/null +++ b/docs/ErrorBody.md @@ -0,0 +1,64 @@ + + +# ErrorBody + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**code** | [**CodeEnum**](#CodeEnum) | Stable, machine-readable error code. Versioned and documented. | | +|**detail** | **String** | Additional context where helpful (quota numbers, validation specifics, etc.). | [optional] | +|**docUrl** | **String** | Link to documentation explaining this error and resolution steps. | [optional] | +|**message** | **String** | Human-readable summary. Never contains internals. Suitable for direct display. | | +|**traceId** | **String** | Correlation ID from the request. Quote this in support requests. | | + + + +## Enum: CodeEnum + +| Name | Value | +|---- | -----| +| ACCESS_DENIED | "ACCESS_DENIED" | +| ALREADY_EXISTS | "ALREADY_EXISTS" | +| ANALYSIS_NOT_READY | "ANALYSIS_NOT_READY" | +| BAD_REQUEST | "BAD_REQUEST" | +| CONFLICT | "CONFLICT" | +| CONVERSATION_NOT_FOUND | "CONVERSATION_NOT_FOUND" | +| DOMAIN_ALREADY_CLAIMED | "DOMAIN_ALREADY_CLAIMED" | +| DOMAIN_VERIFICATION_PENDING | "DOMAIN_VERIFICATION_PENDING" | +| EMAIL_NOT_VERIFIED | "EMAIL_NOT_VERIFIED" | +| EXTERNAL_USER | "EXTERNAL_USER" | +| FORBIDDEN | "FORBIDDEN" | +| GATEWAY_TIMEOUT | "GATEWAY_TIMEOUT" | +| INSUFFICIENT_CREDITS | "INSUFFICIENT_CREDITS" | +| INTERNAL_ERROR | "INTERNAL_ERROR" | +| INTERNAL_ISSUER | "INTERNAL_ISSUER" | +| INVALID_CONVERSATION_ID | "INVALID_CONVERSATION_ID" | +| INVALID_CREDENTIALS | "INVALID_CREDENTIALS" | +| INVALID_RESET_CODE | "INVALID_RESET_CODE" | +| LAST_ORG_OWNER | "LAST_ORG_OWNER" | +| LINKED_TO_ORG | "LINKED_TO_ORG" | +| METHOD_NOT_ALLOWED | "METHOD_NOT_ALLOWED" | +| NOT_ACCEPTABLE | "NOT_ACCEPTABLE" | +| NOT_FOUND | "NOT_FOUND" | +| NO_ACTIVE_RUN | "NO_ACTIVE_RUN" | +| NO_PENDING_CONFIRMATION | "NO_PENDING_CONFIRMATION" | +| OIDC_DISCOVERY_FAILED | "OIDC_DISCOVERY_FAILED" | +| PASSWORD_RESET_REQUIRED | "PASSWORD_RESET_REQUIRED" | +| PAYMENT_REQUIRED | "PAYMENT_REQUIRED" | +| REQUEST_ENTITY_TOO_LARGE | "REQUEST_ENTITY_TOO_LARGE" | +| RUN_ALREADY_ACTIVE | "RUN_ALREADY_ACTIVE" | +| SELF_DELETION_NOT_ALLOWED | "SELF_DELETION_NOT_ALLOWED" | +| SERVICE_UNAVAILABLE | "SERVICE_UNAVAILABLE" | +| TOKEN_EXPIRED | "TOKEN_EXPIRED" | +| TOKEN_REUSED | "TOKEN_REUSED" | +| TOO_MANY_REQUESTS | "TOO_MANY_REQUESTS" | +| UNAUTHORIZED | "UNAUTHORIZED" | +| UNSUPPORTED_MEDIA_TYPE | "UNSUPPORTED_MEDIA_TYPE" | +| VALIDATION_FAILED | "VALIDATION_FAILED" | +| VERIFICATION_EXPIRED | "VERIFICATION_EXPIRED" | +| VERIFICATION_NOT_FOUND | "VERIFICATION_NOT_FOUND" | + + + diff --git a/docs/Event.md b/docs/Event.md new file mode 100644 index 0000000..85620c7 --- /dev/null +++ b/docs/Event.md @@ -0,0 +1,19 @@ + + +# Event + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**conversationUuid** | **String** | | | +|**createdAt** | **OffsetDateTime** | | | +|**data** | **Object** | | | +|**eventId** | **Long** | | | +|**role** | **Integer** | | | +|**tokensUsed** | **Long** | | | +|**type** | **Integer** | | | + + + diff --git a/docs/EventCONTEXTCOMPACTED.md b/docs/EventCONTEXTCOMPACTED.md new file mode 100644 index 0000000..82b1c74 --- /dev/null +++ b/docs/EventCONTEXTCOMPACTED.md @@ -0,0 +1,24 @@ + + +# EventCONTEXTCOMPACTED + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**data** | **SseEventContextCompactedData** | | | +|**event** | [**EventEnum**](#EventEnum) | The event name. | | +|**id** | **Integer** | The event ID. | [optional] | +|**retry** | **Integer** | The retry time in milliseconds. | [optional] | + + + +## Enum: EventEnum + +| Name | Value | +|---- | -----| +| CONTEXT_COMPACTED | "CONTEXT_COMPACTED" | + + + diff --git a/docs/EventRUNCANCELLED.md b/docs/EventRUNCANCELLED.md new file mode 100644 index 0000000..a00d8d8 --- /dev/null +++ b/docs/EventRUNCANCELLED.md @@ -0,0 +1,24 @@ + + +# EventRUNCANCELLED + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**data** | **SseEventRunCancelledData** | | | +|**event** | [**EventEnum**](#EventEnum) | The event name. | | +|**id** | **Integer** | The event ID. | [optional] | +|**retry** | **Integer** | The retry time in milliseconds. | [optional] | + + + +## Enum: EventEnum + +| Name | Value | +|---- | -----| +| RUN_CANCELLED | "RUN_CANCELLED" | + + + diff --git a/docs/EventRUNERROR.md b/docs/EventRUNERROR.md new file mode 100644 index 0000000..ed5d813 --- /dev/null +++ b/docs/EventRUNERROR.md @@ -0,0 +1,24 @@ + + +# EventRUNERROR + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**data** | **SseEventRunErrorData** | | | +|**event** | [**EventEnum**](#EventEnum) | The event name. | | +|**id** | **Integer** | The event ID. | [optional] | +|**retry** | **Integer** | The retry time in milliseconds. | [optional] | + + + +## Enum: EventEnum + +| Name | Value | +|---- | -----| +| RUN_ERROR | "RUN_ERROR" | + + + diff --git a/docs/EventRUNFINISHED.md b/docs/EventRUNFINISHED.md new file mode 100644 index 0000000..ecaba6a --- /dev/null +++ b/docs/EventRUNFINISHED.md @@ -0,0 +1,24 @@ + + +# EventRUNFINISHED + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**data** | **SseEventRunFinishedData** | | | +|**event** | [**EventEnum**](#EventEnum) | The event name. | | +|**id** | **Integer** | The event ID. | [optional] | +|**retry** | **Integer** | The retry time in milliseconds. | [optional] | + + + +## Enum: EventEnum + +| Name | Value | +|---- | -----| +| RUN_FINISHED | "RUN_FINISHED" | + + + diff --git a/docs/EventRUNSTARTED.md b/docs/EventRUNSTARTED.md new file mode 100644 index 0000000..8f51d81 --- /dev/null +++ b/docs/EventRUNSTARTED.md @@ -0,0 +1,24 @@ + + +# EventRUNSTARTED + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**data** | **SseEventRunStartedData** | | | +|**event** | [**EventEnum**](#EventEnum) | The event name. | | +|**id** | **Integer** | The event ID. | [optional] | +|**retry** | **Integer** | The retry time in milliseconds. | [optional] | + + + +## Enum: EventEnum + +| Name | Value | +|---- | -----| +| RUN_STARTED | "RUN_STARTED" | + + + diff --git a/docs/EventSTEPFINISHED.md b/docs/EventSTEPFINISHED.md new file mode 100644 index 0000000..947c4cd --- /dev/null +++ b/docs/EventSTEPFINISHED.md @@ -0,0 +1,24 @@ + + +# EventSTEPFINISHED + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**data** | **SseEventStepFinishedData** | | | +|**event** | [**EventEnum**](#EventEnum) | The event name. | | +|**id** | **Integer** | The event ID. | [optional] | +|**retry** | **Integer** | The retry time in milliseconds. | [optional] | + + + +## Enum: EventEnum + +| Name | Value | +|---- | -----| +| STEP_FINISHED | "STEP_FINISHED" | + + + diff --git a/docs/EventSTEPSTARTED.md b/docs/EventSTEPSTARTED.md new file mode 100644 index 0000000..55f2086 --- /dev/null +++ b/docs/EventSTEPSTARTED.md @@ -0,0 +1,24 @@ + + +# EventSTEPSTARTED + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**data** | **SseEventStepStartedData** | | | +|**event** | [**EventEnum**](#EventEnum) | The event name. | | +|**id** | **Integer** | The event ID. | [optional] | +|**retry** | **Integer** | The retry time in milliseconds. | [optional] | + + + +## Enum: EventEnum + +| Name | Value | +|---- | -----| +| STEP_STARTED | "STEP_STARTED" | + + + diff --git a/docs/EventTEXTMESSAGECONTENT.md b/docs/EventTEXTMESSAGECONTENT.md new file mode 100644 index 0000000..53a5db5 --- /dev/null +++ b/docs/EventTEXTMESSAGECONTENT.md @@ -0,0 +1,24 @@ + + +# EventTEXTMESSAGECONTENT + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**data** | **SseEventTextMessageContentData** | | | +|**event** | [**EventEnum**](#EventEnum) | The event name. | | +|**id** | **Integer** | The event ID. | [optional] | +|**retry** | **Integer** | The retry time in milliseconds. | [optional] | + + + +## Enum: EventEnum + +| Name | Value | +|---- | -----| +| TEXT_MESSAGE_CONTENT | "TEXT_MESSAGE_CONTENT" | + + + diff --git a/docs/EventTEXTMESSAGEEND.md b/docs/EventTEXTMESSAGEEND.md new file mode 100644 index 0000000..f46c14a --- /dev/null +++ b/docs/EventTEXTMESSAGEEND.md @@ -0,0 +1,24 @@ + + +# EventTEXTMESSAGEEND + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**data** | **SseEventTextMessageEndData** | | | +|**event** | [**EventEnum**](#EventEnum) | The event name. | | +|**id** | **Integer** | The event ID. | [optional] | +|**retry** | **Integer** | The retry time in milliseconds. | [optional] | + + + +## Enum: EventEnum + +| Name | Value | +|---- | -----| +| TEXT_MESSAGE_END | "TEXT_MESSAGE_END" | + + + diff --git a/docs/EventTEXTMESSAGESTART.md b/docs/EventTEXTMESSAGESTART.md new file mode 100644 index 0000000..0da1e19 --- /dev/null +++ b/docs/EventTEXTMESSAGESTART.md @@ -0,0 +1,24 @@ + + +# EventTEXTMESSAGESTART + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**data** | **SseEventTextMessageStartData** | | | +|**event** | [**EventEnum**](#EventEnum) | The event name. | | +|**id** | **Integer** | The event ID. | [optional] | +|**retry** | **Integer** | The retry time in milliseconds. | [optional] | + + + +## Enum: EventEnum + +| Name | Value | +|---- | -----| +| TEXT_MESSAGE_START | "TEXT_MESSAGE_START" | + + + diff --git a/docs/EventTITLEUPDATED.md b/docs/EventTITLEUPDATED.md new file mode 100644 index 0000000..6d689c9 --- /dev/null +++ b/docs/EventTITLEUPDATED.md @@ -0,0 +1,24 @@ + + +# EventTITLEUPDATED + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**data** | **SseEventTitleUpdatedData** | | | +|**event** | [**EventEnum**](#EventEnum) | The event name. | | +|**id** | **Integer** | The event ID. | [optional] | +|**retry** | **Integer** | The retry time in milliseconds. | [optional] | + + + +## Enum: EventEnum + +| Name | Value | +|---- | -----| +| TITLE_UPDATED | "TITLE_UPDATED" | + + + diff --git a/docs/EventTOOLCALLARGSDELTA.md b/docs/EventTOOLCALLARGSDELTA.md new file mode 100644 index 0000000..df2bb7b --- /dev/null +++ b/docs/EventTOOLCALLARGSDELTA.md @@ -0,0 +1,24 @@ + + +# EventTOOLCALLARGSDELTA + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**data** | **SseEventToolCallArgsDeltaData** | | | +|**event** | [**EventEnum**](#EventEnum) | The event name. | | +|**id** | **Integer** | The event ID. | [optional] | +|**retry** | **Integer** | The retry time in milliseconds. | [optional] | + + + +## Enum: EventEnum + +| Name | Value | +|---- | -----| +| TOOL_CALL_ARGS_DELTA | "TOOL_CALL_ARGS_DELTA" | + + + diff --git a/docs/EventTOOLCALLEND.md b/docs/EventTOOLCALLEND.md new file mode 100644 index 0000000..11ced9f --- /dev/null +++ b/docs/EventTOOLCALLEND.md @@ -0,0 +1,24 @@ + + +# EventTOOLCALLEND + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**data** | **SseEventToolCallEndData** | | | +|**event** | [**EventEnum**](#EventEnum) | The event name. | | +|**id** | **Integer** | The event ID. | [optional] | +|**retry** | **Integer** | The retry time in milliseconds. | [optional] | + + + +## Enum: EventEnum + +| Name | Value | +|---- | -----| +| TOOL_CALL_END | "TOOL_CALL_END" | + + + diff --git a/docs/EventTOOLCALLRESULT.md b/docs/EventTOOLCALLRESULT.md new file mode 100644 index 0000000..3787f6d --- /dev/null +++ b/docs/EventTOOLCALLRESULT.md @@ -0,0 +1,24 @@ + + +# EventTOOLCALLRESULT + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**data** | **SseEventToolCallResultData** | | | +|**event** | [**EventEnum**](#EventEnum) | The event name. | | +|**id** | **Integer** | The event ID. | [optional] | +|**retry** | **Integer** | The retry time in milliseconds. | [optional] | + + + +## Enum: EventEnum + +| Name | Value | +|---- | -----| +| TOOL_CALL_RESULT | "TOOL_CALL_RESULT" | + + + diff --git a/docs/EventTOOLCALLSTART.md b/docs/EventTOOLCALLSTART.md new file mode 100644 index 0000000..3a01ded --- /dev/null +++ b/docs/EventTOOLCALLSTART.md @@ -0,0 +1,24 @@ + + +# EventTOOLCALLSTART + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**data** | **SseEventToolCallStartData** | | | +|**event** | [**EventEnum**](#EventEnum) | The event name. | | +|**id** | **Integer** | The event ID. | [optional] | +|**retry** | **Integer** | The retry time in milliseconds. | [optional] | + + + +## Enum: EventEnum + +| Name | Value | +|---- | -----| +| TOOL_CALL_START | "TOOL_CALL_START" | + + + diff --git a/docs/EventTOOLCONFIRMATIONREQUIRED.md b/docs/EventTOOLCONFIRMATIONREQUIRED.md new file mode 100644 index 0000000..fbce4f1 --- /dev/null +++ b/docs/EventTOOLCONFIRMATIONREQUIRED.md @@ -0,0 +1,24 @@ + + +# EventTOOLCONFIRMATIONREQUIRED + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**data** | **SseEventToolConfirmationRequiredData** | | | +|**event** | [**EventEnum**](#EventEnum) | The event name. | | +|**id** | **Integer** | The event ID. | [optional] | +|**retry** | **Integer** | The retry time in milliseconds. | [optional] | + + + +## Enum: EventEnum + +| Name | Value | +|---- | -----| +| TOOL_CONFIRMATION_REQUIRED | "TOOL_CONFIRMATION_REQUIRED" | + + + diff --git a/docs/NetworkOverviewMetadata.md b/docs/NetworkOverviewMetadata.md deleted file mode 100644 index 74f5bf1..0000000 --- a/docs/NetworkOverviewMetadata.md +++ /dev/null @@ -1,24 +0,0 @@ - - -# NetworkOverviewMetadata - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**host** | **String** | | | -|**countryCode** | **String** | | | -|**ASN** | **String** | | | -|**type** | [**TypeEnum**](#TypeEnum) | | | - - - -## Enum: TypeEnum - -| Name | Value | -|---- | -----| -| METADATA | "metadata" | - - - diff --git a/docs/NetworkOverviewResponse.md b/docs/NetworkOverviewResponse.md deleted file mode 100644 index 9c11e8b..0000000 --- a/docs/NetworkOverviewResponse.md +++ /dev/null @@ -1,14 +0,0 @@ - - -# NetworkOverviewResponse - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**dns** | [**List<NetworkOverviewDns>**](NetworkOverviewDns.md) | | | -|**metadata** | [**List<NetworkOverviewMetadata>**](NetworkOverviewMetadata.md) | | | - - - diff --git a/docs/PipelineStageStatus.md b/docs/PipelineStageStatus.md deleted file mode 100644 index cc1c268..0000000 --- a/docs/PipelineStageStatus.md +++ /dev/null @@ -1,19 +0,0 @@ - - -# PipelineStageStatus - -## Enum - - -* `PENDING` (value: `"PENDING"`) - -* `QUEUED` (value: `"QUEUED"`) - -* `STARTED` (value: `"STARTED"`) - -* `FINISHED` (value: `"FINISHED"`) - -* `ERROR` (value: `"ERROR"`) - - - diff --git a/docs/PipelineStatusResponse.md b/docs/PipelineStatusResponse.md deleted file mode 100644 index 69924c9..0000000 --- a/docs/PipelineStatusResponse.md +++ /dev/null @@ -1,13 +0,0 @@ - - -# PipelineStatusResponse - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**stages** | [**List<StageStatus>**](StageStatus.md) | | | - - - diff --git a/docs/Process.md b/docs/Process.md deleted file mode 100644 index c4be98f..0000000 --- a/docs/Process.md +++ /dev/null @@ -1,19 +0,0 @@ - - -# Process - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**pid** | **Integer** | | | -|**procname** | **String** | | | -|**executableName** | **String** | | | -|**args** | **List<String>** | | | -|**tsFrom** | **BigDecimal** | | | -|**tsTo** | **BigDecimal** | | | -|**children** | **List<Object>** | | | - - - diff --git a/docs/ProcessDump.md b/docs/ProcessDump.md deleted file mode 100644 index 3469b61..0000000 --- a/docs/ProcessDump.md +++ /dev/null @@ -1,16 +0,0 @@ - - -# ProcessDump - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**baseAddress** | **Integer** | | | -|**actualFilename** | **String** | | | -|**filenameFriendly** | **String** | | | -|**extendedMetadata** | [**ProcessDumpMetadata**](ProcessDumpMetadata.md) | | | - - - diff --git a/docs/ProcessDumps.md b/docs/ProcessDumps.md deleted file mode 100644 index df47022..0000000 --- a/docs/ProcessDumps.md +++ /dev/null @@ -1,14 +0,0 @@ - - -# ProcessDumps - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**success** | **Boolean** | | | -|**data** | [**ProcessDumpsData**](ProcessDumpsData.md) | | | - - - diff --git a/docs/ProcessDumpsData.md b/docs/ProcessDumpsData.md deleted file mode 100644 index 72803b5..0000000 --- a/docs/ProcessDumpsData.md +++ /dev/null @@ -1,14 +0,0 @@ - - -# ProcessDumpsData - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**count** | **Integer** | | | -|**dumps** | [**List<ProcessDump>**](ProcessDump.md) | | | - - - diff --git a/docs/ProcessRegistry.md b/docs/ProcessRegistry.md deleted file mode 100644 index 6ddc14d..0000000 --- a/docs/ProcessRegistry.md +++ /dev/null @@ -1,14 +0,0 @@ - - -# ProcessRegistry - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**success** | **Boolean** | | | -|**data** | **Map<String, List<Registry>>** | | | - - - diff --git a/docs/ProcessTree.md b/docs/ProcessTree.md deleted file mode 100644 index 8b3bef2..0000000 --- a/docs/ProcessTree.md +++ /dev/null @@ -1,14 +0,0 @@ - - -# ProcessTree - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**success** | **Boolean** | | | -|**data** | [**List<Process>**](Process.md) | | | - - - diff --git a/docs/QueuePositionResponse.md b/docs/QueuePositionResponse.md new file mode 100644 index 0000000..5671810 --- /dev/null +++ b/docs/QueuePositionResponse.md @@ -0,0 +1,14 @@ + + +# QueuePositionResponse + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**$schema** | **URI** | A URL to the JSON Schema for this object. | [optional] [readonly] | +|**queuePosition** | **Long** | Number of Processing analyses ahead of this one in the queue. 0 if this analysis is not Processing or has no analyses ahead of it. | | + + + diff --git a/docs/Registry.md b/docs/Registry.md deleted file mode 100644 index 33824b9..0000000 --- a/docs/Registry.md +++ /dev/null @@ -1,16 +0,0 @@ - - -# Registry - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**method** | **String** | | | -|**key** | **String** | | | -|**valueName** | **String** | | | -|**value** | **String** | | | - - - diff --git a/docs/SendMessageRequest.md b/docs/SendMessageRequest.md new file mode 100644 index 0000000..05e6618 --- /dev/null +++ b/docs/SendMessageRequest.md @@ -0,0 +1,15 @@ + + +# SendMessageRequest + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**$schema** | **URI** | A URL to the JSON Schema for this object. | [optional] [readonly] | +|**content** | **String** | | | +|**context** | **ConversationContext** | | [optional] | + + + diff --git a/docs/NetworkOverviewDns.md b/docs/SseEventContextCompactedData.md similarity index 51% rename from docs/NetworkOverviewDns.md rename to docs/SseEventContextCompactedData.md index 87adc6d..1e8cd48 100644 --- a/docs/NetworkOverviewDns.md +++ b/docs/SseEventContextCompactedData.md @@ -1,15 +1,15 @@ -# NetworkOverviewDns +# SseEventContextCompactedData ## Properties | Name | Type | Description | Notes | |------------ | ------------- | ------------- | -------------| -|**host** | **String** | | | +|**data** | **Object** | | | +|**eventId** | **Long** | | | |**type** | **String** | | | -|**answers** | [**List<NetworkOverviewDnsAnswer>**](NetworkOverviewDnsAnswer.md) | | | diff --git a/docs/SseEventRunCancelledData.md b/docs/SseEventRunCancelledData.md new file mode 100644 index 0000000..0519f90 --- /dev/null +++ b/docs/SseEventRunCancelledData.md @@ -0,0 +1,15 @@ + + +# SseEventRunCancelledData + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**data** | **Object** | | | +|**eventId** | **Long** | | | +|**type** | **String** | | | + + + diff --git a/docs/NetworkOverviewDnsAnswer.md b/docs/SseEventRunErrorData.md similarity index 64% rename from docs/NetworkOverviewDnsAnswer.md rename to docs/SseEventRunErrorData.md index ba9a429..a46113d 100644 --- a/docs/NetworkOverviewDnsAnswer.md +++ b/docs/SseEventRunErrorData.md @@ -1,14 +1,15 @@ -# NetworkOverviewDnsAnswer +# SseEventRunErrorData ## Properties | Name | Type | Description | Notes | |------------ | ------------- | ------------- | -------------| +|**data** | **Object** | | | +|**eventId** | **Long** | | | |**type** | **String** | | | -|**data** | **String** | | | diff --git a/docs/AppServicesDynamicExecutionSchemasDynamicExecutionStatus.md b/docs/SseEventRunFinishedData.md similarity index 50% rename from docs/AppServicesDynamicExecutionSchemasDynamicExecutionStatus.md rename to docs/SseEventRunFinishedData.md index 90a6cfc..5eeec5b 100644 --- a/docs/AppServicesDynamicExecutionSchemasDynamicExecutionStatus.md +++ b/docs/SseEventRunFinishedData.md @@ -1,13 +1,15 @@ -# AppServicesDynamicExecutionSchemasDynamicExecutionStatus +# SseEventRunFinishedData ## Properties | Name | Type | Description | Notes | |------------ | ------------- | ------------- | -------------| -|**status** | **String** | | | +|**data** | **Object** | | | +|**eventId** | **Long** | | | +|**type** | **String** | | | diff --git a/docs/ProcessDumpMetadata.md b/docs/SseEventRunStartedData.md similarity index 63% rename from docs/ProcessDumpMetadata.md rename to docs/SseEventRunStartedData.md index 5b2064f..1c86cb1 100644 --- a/docs/ProcessDumpMetadata.md +++ b/docs/SseEventRunStartedData.md @@ -1,15 +1,15 @@ -# ProcessDumpMetadata +# SseEventRunStartedData ## Properties | Name | Type | Description | Notes | |------------ | ------------- | ------------- | -------------| -|**sha256** | **String** | | | +|**data** | **Object** | | | +|**eventId** | **Long** | | | |**type** | **String** | | | -|**size** | **Integer** | | | diff --git a/docs/SseEventStepFinishedData.md b/docs/SseEventStepFinishedData.md new file mode 100644 index 0000000..d9cdf64 --- /dev/null +++ b/docs/SseEventStepFinishedData.md @@ -0,0 +1,15 @@ + + +# SseEventStepFinishedData + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**data** | **Object** | | | +|**eventId** | **Long** | | | +|**type** | **String** | | | + + + diff --git a/docs/SseEventStepStartedData.md b/docs/SseEventStepStartedData.md new file mode 100644 index 0000000..f037ef9 --- /dev/null +++ b/docs/SseEventStepStartedData.md @@ -0,0 +1,15 @@ + + +# SseEventStepStartedData + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**data** | **Object** | | | +|**eventId** | **Long** | | | +|**type** | **String** | | | + + + diff --git a/docs/SseEventTextMessageContentData.md b/docs/SseEventTextMessageContentData.md new file mode 100644 index 0000000..6309b58 --- /dev/null +++ b/docs/SseEventTextMessageContentData.md @@ -0,0 +1,15 @@ + + +# SseEventTextMessageContentData + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**data** | **Object** | | | +|**eventId** | **Long** | | | +|**type** | **String** | | | + + + diff --git a/docs/SseEventTextMessageEndData.md b/docs/SseEventTextMessageEndData.md new file mode 100644 index 0000000..eeb8e32 --- /dev/null +++ b/docs/SseEventTextMessageEndData.md @@ -0,0 +1,15 @@ + + +# SseEventTextMessageEndData + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**data** | **Object** | | | +|**eventId** | **Long** | | | +|**type** | **String** | | | + + + diff --git a/docs/SseEventTextMessageStartData.md b/docs/SseEventTextMessageStartData.md new file mode 100644 index 0000000..955ebb6 --- /dev/null +++ b/docs/SseEventTextMessageStartData.md @@ -0,0 +1,15 @@ + + +# SseEventTextMessageStartData + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**data** | **Object** | | | +|**eventId** | **Long** | | | +|**type** | **String** | | | + + + diff --git a/docs/SseEventTitleUpdatedData.md b/docs/SseEventTitleUpdatedData.md new file mode 100644 index 0000000..b64797a --- /dev/null +++ b/docs/SseEventTitleUpdatedData.md @@ -0,0 +1,15 @@ + + +# SseEventTitleUpdatedData + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**data** | **Object** | | | +|**eventId** | **Long** | | | +|**type** | **String** | | | + + + diff --git a/docs/SseEventToolCallArgsDeltaData.md b/docs/SseEventToolCallArgsDeltaData.md new file mode 100644 index 0000000..5a1fc6b --- /dev/null +++ b/docs/SseEventToolCallArgsDeltaData.md @@ -0,0 +1,15 @@ + + +# SseEventToolCallArgsDeltaData + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**data** | **Object** | | | +|**eventId** | **Long** | | | +|**type** | **String** | | | + + + diff --git a/docs/SseEventToolCallEndData.md b/docs/SseEventToolCallEndData.md new file mode 100644 index 0000000..cdabbde --- /dev/null +++ b/docs/SseEventToolCallEndData.md @@ -0,0 +1,15 @@ + + +# SseEventToolCallEndData + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**data** | **Object** | | | +|**eventId** | **Long** | | | +|**type** | **String** | | | + + + diff --git a/docs/SseEventToolCallResultData.md b/docs/SseEventToolCallResultData.md new file mode 100644 index 0000000..5541b7b --- /dev/null +++ b/docs/SseEventToolCallResultData.md @@ -0,0 +1,15 @@ + + +# SseEventToolCallResultData + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**data** | **Object** | | | +|**eventId** | **Long** | | | +|**type** | **String** | | | + + + diff --git a/docs/SseEventToolCallStartData.md b/docs/SseEventToolCallStartData.md new file mode 100644 index 0000000..71e97ff --- /dev/null +++ b/docs/SseEventToolCallStartData.md @@ -0,0 +1,15 @@ + + +# SseEventToolCallStartData + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**data** | **Object** | | | +|**eventId** | **Long** | | | +|**type** | **String** | | | + + + diff --git a/docs/SseEventToolConfirmationRequiredData.md b/docs/SseEventToolConfirmationRequiredData.md new file mode 100644 index 0000000..b9e3440 --- /dev/null +++ b/docs/SseEventToolConfirmationRequiredData.md @@ -0,0 +1,15 @@ + + +# SseEventToolConfirmationRequiredData + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**data** | **Object** | | | +|**eventId** | **Long** | | | +|**type** | **String** | | | + + + diff --git a/docs/StageEvent.md b/docs/StageEvent.md deleted file mode 100644 index f46d32d..0000000 --- a/docs/StageEvent.md +++ /dev/null @@ -1,15 +0,0 @@ - - -# StageEvent - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**stage** | **AnalysisStage** | | | -|**status** | **AnalysisStageStatus** | | | -|**timestamp** | **String** | | | - - - diff --git a/docs/StageStatus.md b/docs/StageStatus.md deleted file mode 100644 index 1c8c0bd..0000000 --- a/docs/StageStatus.md +++ /dev/null @@ -1,15 +0,0 @@ - - -# StageStatus - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**stage** | **AnalysisStage** | | | -|**status** | **PipelineStageStatus** | | | -|**numAhead** | **Integer** | | | - - - diff --git a/docs/StatusResponse.md b/docs/StatusResponse.md new file mode 100644 index 0000000..b3c7f7a --- /dev/null +++ b/docs/StatusResponse.md @@ -0,0 +1,16 @@ + + +# StatusResponse + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**$schema** | **URI** | A URL to the JSON Schema for this object. | [optional] [readonly] | +|**conversationUuid** | **UUID** | | | +|**status** | **String** | | | +|**traceId** | **String** | OpenTelemetry trace ID for this run. Use this to look up tool call spans in your trace backend. | [optional] | + + + diff --git a/docs/StreamEvents200ResponseInner.md b/docs/StreamEvents200ResponseInner.md new file mode 100644 index 0000000..e3d0fb2 --- /dev/null +++ b/docs/StreamEvents200ResponseInner.md @@ -0,0 +1,24 @@ + + +# StreamEvents200ResponseInner + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**data** | **SseEventToolConfirmationRequiredData** | | | +|**event** | [**EventEnum**](#EventEnum) | The event name. | | +|**id** | **Integer** | The event ID. | [optional] | +|**retry** | **Integer** | The retry time in milliseconds. | [optional] | + + + +## Enum: EventEnum + +| Name | Value | +|---- | -----| +| TOOL_CONFIRMATION_REQUIRED | "TOOL_CONFIRMATION_REQUIRED" | + + + diff --git a/docs/TTPS.md b/docs/TTPS.md deleted file mode 100644 index dd1e639..0000000 --- a/docs/TTPS.md +++ /dev/null @@ -1,14 +0,0 @@ - - -# TTPS - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**success** | **Boolean** | | | -|**data** | [**TTPSData**](TTPSData.md) | | | - - - diff --git a/docs/TTPSAttack.md b/docs/TTPSAttack.md deleted file mode 100644 index 9360666..0000000 --- a/docs/TTPSAttack.md +++ /dev/null @@ -1,14 +0,0 @@ - - -# TTPSAttack - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**id** | **String** | | | -|**name** | **String** | | | - - - diff --git a/docs/TTPSData.md b/docs/TTPSData.md deleted file mode 100644 index d39a828..0000000 --- a/docs/TTPSData.md +++ /dev/null @@ -1,14 +0,0 @@ - - -# TTPSData - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**score** | **Integer** | | | -|**ttps** | [**List<TTPSElement>**](TTPSElement.md) | | | - - - diff --git a/docs/TTPSElement.md b/docs/TTPSElement.md deleted file mode 100644 index 867909f..0000000 --- a/docs/TTPSElement.md +++ /dev/null @@ -1,16 +0,0 @@ - - -# TTPSElement - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**name** | **String** | | | -|**attack** | [**List<TTPSAttack>**](TTPSAttack.md) | | | -|**occurrences** | [**List<TTPSOccurance>**](TTPSOccurance.md) | | | -|**score** | **Integer** | | | - - - diff --git a/docs/TTPSOccurance.md b/docs/TTPSOccurance.md deleted file mode 100644 index 99f53d3..0000000 --- a/docs/TTPSOccurance.md +++ /dev/null @@ -1,14 +0,0 @@ - - -# TTPSOccurance - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**ppid** | **Integer** | | | -|**pid** | **Integer** | | | - - - diff --git a/pom.xml b/pom.xml index 7e32f65..00b1633 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ sdk jar sdk - 3.74.4 + 3.79.0 https://github.com/RevEngAI/sdk-java Java SDK for the RevEng.AI API diff --git a/src/main/java/ai/reveng/api/AnalysesApi.java b/src/main/java/ai/reveng/api/AnalysesApi.java new file mode 100644 index 0000000..3d98c96 --- /dev/null +++ b/src/main/java/ai/reveng/api/AnalysesApi.java @@ -0,0 +1,218 @@ +/* + * 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.QueuePositionResponse; + +import java.lang.reflect.Type; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +public class AnalysesApi { + private ApiClient localVarApiClient; + private int localHostIndex; + private String localCustomBaseUrl; + + public AnalysesApi() { + this(Configuration.getDefaultApiClient()); + } + + public AnalysesApi(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 getAnalysisQueuePosition + * @param analysisId Analysis ID (required) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + + + + +
Response Details
Status Code Description Response Headers
200 OK -
403 Forbidden -
404 Not Found -
422 Unprocessable Entity -
500 Internal Server Error -
+ */ + public okhttp3.Call getAnalysisQueuePositionCall(@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}/queue-position" + .replace("{" + "analysis_id" + "}", localVarApiClient.escapeString(analysisId.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "APIKey" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getAnalysisQueuePositionValidateBeforeCall(@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 getAnalysisQueuePosition(Async)"); + } + + return getAnalysisQueuePositionCall(analysisId, _callback); + + } + + /** + * Get the queue position of an analysis + * Returns the number of Processing analyses with a lower analysis_id than the given one. Useful for showing the user where they sit in the processing queue while waiting for their analysis to start. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied + * @param analysisId Analysis ID (required) + * @return QueuePositionResponse + * @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 QueuePositionResponse getAnalysisQueuePosition(@javax.annotation.Nonnull Long analysisId) throws ApiException { + ApiResponse localVarResp = getAnalysisQueuePositionWithHttpInfo(analysisId); + return localVarResp.getData(); + } + + /** + * Get the queue position of an analysis + * Returns the number of Processing analyses with a lower analysis_id than the given one. Useful for showing the user where they sit in the processing queue while waiting for their analysis to start. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied + * @param analysisId Analysis ID (required) + * @return ApiResponse<QueuePositionResponse> + * @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 getAnalysisQueuePositionWithHttpInfo(@javax.annotation.Nonnull Long analysisId) throws ApiException { + okhttp3.Call localVarCall = getAnalysisQueuePositionValidateBeforeCall(analysisId, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Get the queue position of an analysis (asynchronously) + * Returns the number of Processing analyses with a lower analysis_id than the given one. Useful for showing the user where they sit in the processing queue while waiting for their analysis to start. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied + * @param analysisId Analysis ID (required) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + + + + + +
Response Details
Status Code Description Response Headers
200 OK -
403 Forbidden -
404 Not Found -
422 Unprocessable Entity -
500 Internal Server Error -
+ */ + public okhttp3.Call getAnalysisQueuePositionAsync(@javax.annotation.Nonnull Long analysisId, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = getAnalysisQueuePositionValidateBeforeCall(analysisId, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } +} diff --git a/src/main/java/ai/reveng/api/AnalysesCoreApi.java b/src/main/java/ai/reveng/api/AnalysesCoreApi.java index f054dff..1f89794 100644 --- a/src/main/java/ai/reveng/api/AnalysesCoreApi.java +++ b/src/main/java/ai/reveng/api/AnalysesCoreApi.java @@ -43,7 +43,7 @@ import ai.reveng.model.BaseResponseRecent; import ai.reveng.model.BaseResponseStatus; import ai.reveng.model.BaseResponseUploadResponse; -import ai.reveng.model.DynamicExecutionStatusInput; +import ai.reveng.model.DynamicExecutionStatus; import ai.reveng.model.InsertAnalysisLogRequest; import ai.reveng.model.ModelName; import ai.reveng.model.Order; @@ -1491,7 +1491,7 @@ public okhttp3.Call insertAnalysisLogAsync(@javax.annotation.Nonnull Integer ana 422 Invalid request parameters - */ - public okhttp3.Call listAnalysesCall(@javax.annotation.Nullable String searchTerm, @javax.annotation.Nullable List workspace, @javax.annotation.Nullable List status, @javax.annotation.Nullable List modelName, @javax.annotation.Nullable DynamicExecutionStatusInput dynamicExecutionStatus, @javax.annotation.Nullable List usernames, @javax.annotation.Nullable String sha256Hash, @javax.annotation.Nullable Integer limit, @javax.annotation.Nullable Integer offset, @javax.annotation.Nullable AppApiRestV2AnalysesEnumsOrderBy orderBy, @javax.annotation.Nullable Order order, final ApiCallback _callback) throws ApiException { + public okhttp3.Call listAnalysesCall(@javax.annotation.Nullable String searchTerm, @javax.annotation.Nullable List workspace, @javax.annotation.Nullable List status, @javax.annotation.Nullable List modelName, @javax.annotation.Nullable DynamicExecutionStatus dynamicExecutionStatus, @javax.annotation.Nullable List usernames, @javax.annotation.Nullable String sha256Hash, @javax.annotation.Nullable Integer limit, @javax.annotation.Nullable Integer offset, @javax.annotation.Nullable AppApiRestV2AnalysesEnumsOrderBy orderBy, @javax.annotation.Nullable Order order, final ApiCallback _callback) throws ApiException { String basePath = null; // Operation Servers String[] localBasePaths = new String[] { }; @@ -1580,7 +1580,7 @@ public okhttp3.Call listAnalysesCall(@javax.annotation.Nullable String searchTer } @SuppressWarnings("rawtypes") - private okhttp3.Call listAnalysesValidateBeforeCall(@javax.annotation.Nullable String searchTerm, @javax.annotation.Nullable List workspace, @javax.annotation.Nullable List status, @javax.annotation.Nullable List modelName, @javax.annotation.Nullable DynamicExecutionStatusInput dynamicExecutionStatus, @javax.annotation.Nullable List usernames, @javax.annotation.Nullable String sha256Hash, @javax.annotation.Nullable Integer limit, @javax.annotation.Nullable Integer offset, @javax.annotation.Nullable AppApiRestV2AnalysesEnumsOrderBy orderBy, @javax.annotation.Nullable Order order, final ApiCallback _callback) throws ApiException { + private okhttp3.Call listAnalysesValidateBeforeCall(@javax.annotation.Nullable String searchTerm, @javax.annotation.Nullable List workspace, @javax.annotation.Nullable List status, @javax.annotation.Nullable List modelName, @javax.annotation.Nullable DynamicExecutionStatus dynamicExecutionStatus, @javax.annotation.Nullable List usernames, @javax.annotation.Nullable String sha256Hash, @javax.annotation.Nullable Integer limit, @javax.annotation.Nullable Integer offset, @javax.annotation.Nullable AppApiRestV2AnalysesEnumsOrderBy orderBy, @javax.annotation.Nullable Order order, final ApiCallback _callback) throws ApiException { return listAnalysesCall(searchTerm, workspace, status, modelName, dynamicExecutionStatus, usernames, sha256Hash, limit, offset, orderBy, order, _callback); } @@ -1609,7 +1609,7 @@ private okhttp3.Call listAnalysesValidateBeforeCall(@javax.annotation.Nullable S 422 Invalid request parameters - */ - public BaseResponseRecent listAnalyses(@javax.annotation.Nullable String searchTerm, @javax.annotation.Nullable List workspace, @javax.annotation.Nullable List status, @javax.annotation.Nullable List modelName, @javax.annotation.Nullable DynamicExecutionStatusInput dynamicExecutionStatus, @javax.annotation.Nullable List usernames, @javax.annotation.Nullable String sha256Hash, @javax.annotation.Nullable Integer limit, @javax.annotation.Nullable Integer offset, @javax.annotation.Nullable AppApiRestV2AnalysesEnumsOrderBy orderBy, @javax.annotation.Nullable Order order) throws ApiException { + public BaseResponseRecent listAnalyses(@javax.annotation.Nullable String searchTerm, @javax.annotation.Nullable List workspace, @javax.annotation.Nullable List status, @javax.annotation.Nullable List modelName, @javax.annotation.Nullable DynamicExecutionStatus dynamicExecutionStatus, @javax.annotation.Nullable List usernames, @javax.annotation.Nullable String sha256Hash, @javax.annotation.Nullable Integer limit, @javax.annotation.Nullable Integer offset, @javax.annotation.Nullable AppApiRestV2AnalysesEnumsOrderBy orderBy, @javax.annotation.Nullable Order order) throws ApiException { ApiResponse localVarResp = listAnalysesWithHttpInfo(searchTerm, workspace, status, modelName, dynamicExecutionStatus, usernames, sha256Hash, limit, offset, orderBy, order); return localVarResp.getData(); } @@ -1638,7 +1638,7 @@ public BaseResponseRecent listAnalyses(@javax.annotation.Nullable String searchT 422 Invalid request parameters - */ - public ApiResponse listAnalysesWithHttpInfo(@javax.annotation.Nullable String searchTerm, @javax.annotation.Nullable List workspace, @javax.annotation.Nullable List status, @javax.annotation.Nullable List modelName, @javax.annotation.Nullable DynamicExecutionStatusInput dynamicExecutionStatus, @javax.annotation.Nullable List usernames, @javax.annotation.Nullable String sha256Hash, @javax.annotation.Nullable Integer limit, @javax.annotation.Nullable Integer offset, @javax.annotation.Nullable AppApiRestV2AnalysesEnumsOrderBy orderBy, @javax.annotation.Nullable Order order) throws ApiException { + public ApiResponse listAnalysesWithHttpInfo(@javax.annotation.Nullable String searchTerm, @javax.annotation.Nullable List workspace, @javax.annotation.Nullable List status, @javax.annotation.Nullable List modelName, @javax.annotation.Nullable DynamicExecutionStatus dynamicExecutionStatus, @javax.annotation.Nullable List usernames, @javax.annotation.Nullable String sha256Hash, @javax.annotation.Nullable Integer limit, @javax.annotation.Nullable Integer offset, @javax.annotation.Nullable AppApiRestV2AnalysesEnumsOrderBy orderBy, @javax.annotation.Nullable Order order) throws ApiException { okhttp3.Call localVarCall = listAnalysesValidateBeforeCall(searchTerm, workspace, status, modelName, dynamicExecutionStatus, usernames, sha256Hash, limit, offset, orderBy, order, null); Type localVarReturnType = new TypeToken(){}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); @@ -1669,7 +1669,7 @@ public ApiResponse listAnalysesWithHttpInfo(@javax.annotatio 422 Invalid request parameters - */ - public okhttp3.Call listAnalysesAsync(@javax.annotation.Nullable String searchTerm, @javax.annotation.Nullable List workspace, @javax.annotation.Nullable List status, @javax.annotation.Nullable List modelName, @javax.annotation.Nullable DynamicExecutionStatusInput dynamicExecutionStatus, @javax.annotation.Nullable List usernames, @javax.annotation.Nullable String sha256Hash, @javax.annotation.Nullable Integer limit, @javax.annotation.Nullable Integer offset, @javax.annotation.Nullable AppApiRestV2AnalysesEnumsOrderBy orderBy, @javax.annotation.Nullable Order order, final ApiCallback _callback) throws ApiException { + public okhttp3.Call listAnalysesAsync(@javax.annotation.Nullable String searchTerm, @javax.annotation.Nullable List workspace, @javax.annotation.Nullable List status, @javax.annotation.Nullable List modelName, @javax.annotation.Nullable DynamicExecutionStatus dynamicExecutionStatus, @javax.annotation.Nullable List usernames, @javax.annotation.Nullable String sha256Hash, @javax.annotation.Nullable Integer limit, @javax.annotation.Nullable Integer offset, @javax.annotation.Nullable AppApiRestV2AnalysesEnumsOrderBy orderBy, @javax.annotation.Nullable Order order, final ApiCallback _callback) throws ApiException { okhttp3.Call localVarCall = listAnalysesValidateBeforeCall(searchTerm, workspace, status, modelName, dynamicExecutionStatus, usernames, sha256Hash, limit, offset, orderBy, order, _callback); Type localVarReturnType = new TypeToken(){}.getType(); diff --git a/src/main/java/ai/reveng/api/AnalysesDynamicExecutionApi.java b/src/main/java/ai/reveng/api/AnalysesDynamicExecutionApi.java deleted file mode 100644 index 789d685..0000000 --- a/src/main/java/ai/reveng/api/AnalysesDynamicExecutionApi.java +++ /dev/null @@ -1,1007 +0,0 @@ -/* - * RevEng.AI API - * RevEng.AI is an AI-powered binary analysis platform for reverse engineering and malware analysis. It provides similarity search across executable binaries and functions, AI-driven decompilation, dynamic execution analysis, firmware unpacking, and integration with external threat intelligence sources like VirusTotal. - * - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package ai.reveng.api; - -import ai.reveng.invoker.ApiCallback; -import ai.reveng.invoker.ApiClient; -import ai.reveng.invoker.ApiException; -import ai.reveng.invoker.ApiResponse; -import ai.reveng.invoker.Configuration; -import ai.reveng.invoker.Pair; -import ai.reveng.invoker.ProgressRequestBody; -import ai.reveng.invoker.ProgressResponseBody; - -import com.google.gson.reflect.TypeToken; - -import java.io.IOException; - - -import ai.reveng.model.BaseResponse; -import ai.reveng.model.BaseResponseDynamicExecutionStatus; -import ai.reveng.model.BaseResponseNetworkOverviewResponse; -import ai.reveng.model.BaseResponseProcessDumps; -import ai.reveng.model.BaseResponseProcessRegistry; -import ai.reveng.model.BaseResponseProcessTree; -import ai.reveng.model.BaseResponseTTPS; - -import java.lang.reflect.Type; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -public class AnalysesDynamicExecutionApi { - private ApiClient localVarApiClient; - private int localHostIndex; - private String localCustomBaseUrl; - - public AnalysesDynamicExecutionApi() { - this(Configuration.getDefaultApiClient()); - } - - public AnalysesDynamicExecutionApi(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 getDynamicExecutionStatus - * @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 -
- */ - public okhttp3.Call getDynamicExecutionStatusCall(@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/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" }; - return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call getDynamicExecutionStatusValidateBeforeCall(@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 getDynamicExecutionStatus(Async)"); - } - - return getDynamicExecutionStatusCall(analysisId, _callback); - - } - - /** - * Get the status of a dynamic execution task - * - * @param analysisId (required) - * @return BaseResponseDynamicExecutionStatus - * @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 -
- */ - public BaseResponseDynamicExecutionStatus getDynamicExecutionStatus(@javax.annotation.Nonnull Integer analysisId) throws ApiException { - ApiResponse localVarResp = getDynamicExecutionStatusWithHttpInfo(analysisId); - return localVarResp.getData(); - } - - /** - * Get the status of a dynamic execution task - * - * @param analysisId (required) - * @return ApiResponse<BaseResponseDynamicExecutionStatus> - * @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 -
- */ - public ApiResponse getDynamicExecutionStatusWithHttpInfo(@javax.annotation.Nonnull Integer analysisId) throws ApiException { - okhttp3.Call localVarCall = getDynamicExecutionStatusValidateBeforeCall(analysisId, null); - Type localVarReturnType = new TypeToken(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * Get the status of a dynamic execution task (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 -
- */ - public okhttp3.Call getDynamicExecutionStatusAsync(@javax.annotation.Nonnull Integer 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 getNetworkOverview - * @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 -
- */ - public okhttp3.Call getNetworkOverviewCall(@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/analyses/{analysis_id}/dynamic-execution/network-overview" - .replace("{" + "analysis_id" + "}", localVarApiClient.escapeString(analysisId.toString())); - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = { - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - - String[] localVarAuthNames = new String[] { "APIKey" }; - return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call getNetworkOverviewValidateBeforeCall(@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 getNetworkOverview(Async)"); - } - - return getNetworkOverviewCall(analysisId, _callback); - - } - - /** - * Get the dynamic execution results for network overview - * - * @param analysisId (required) - * @return BaseResponseNetworkOverviewResponse - * @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 -
- */ - public BaseResponseNetworkOverviewResponse getNetworkOverview(@javax.annotation.Nonnull Integer analysisId) throws ApiException { - ApiResponse localVarResp = getNetworkOverviewWithHttpInfo(analysisId); - return localVarResp.getData(); - } - - /** - * Get the dynamic execution results for network overview - * - * @param analysisId (required) - * @return ApiResponse<BaseResponseNetworkOverviewResponse> - * @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 -
- */ - public ApiResponse getNetworkOverviewWithHttpInfo(@javax.annotation.Nonnull Integer analysisId) throws ApiException { - okhttp3.Call localVarCall = getNetworkOverviewValidateBeforeCall(analysisId, null); - Type localVarReturnType = new TypeToken(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * Get the dynamic execution results for network overview (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 -
- */ - public okhttp3.Call getNetworkOverviewAsync(@javax.annotation.Nonnull Integer analysisId, final ApiCallback _callback) throws ApiException { - - okhttp3.Call localVarCall = getNetworkOverviewValidateBeforeCall(analysisId, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); - return localVarCall; - } - /** - * Build call for getProcessDump - * @param analysisId (required) - * @param dumpName (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 -
- */ - public okhttp3.Call getProcessDumpCall(@javax.annotation.Nonnull Integer analysisId, @javax.annotation.Nonnull String dumpName, 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/process-dumps/{dump_name}" - .replace("{" + "analysis_id" + "}", localVarApiClient.escapeString(analysisId.toString())) - .replace("{" + "dump_name" + "}", localVarApiClient.escapeString(dumpName.toString())); - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = { - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - - String[] localVarAuthNames = new String[] { "APIKey" }; - return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call getProcessDumpValidateBeforeCall(@javax.annotation.Nonnull Integer analysisId, @javax.annotation.Nonnull String dumpName, 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 getProcessDump(Async)"); - } - - // verify the required parameter 'dumpName' is set - if (dumpName == null) { - throw new ApiException("Missing the required parameter 'dumpName' when calling getProcessDump(Async)"); - } - - return getProcessDumpCall(analysisId, dumpName, _callback); - - } - - /** - * Get the dynamic execution results for a specific process dump - * - * @param analysisId (required) - * @param dumpName (required) - * @return Object - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - - -
Response Details
Status Code Description Response Headers
200 Successful Response -
422 Invalid request parameters -
- */ - public Object getProcessDump(@javax.annotation.Nonnull Integer analysisId, @javax.annotation.Nonnull String dumpName) throws ApiException { - ApiResponse localVarResp = getProcessDumpWithHttpInfo(analysisId, dumpName); - return localVarResp.getData(); - } - - /** - * Get the dynamic execution results for a specific process dump - * - * @param analysisId (required) - * @param dumpName (required) - * @return ApiResponse<Object> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - - -
Response Details
Status Code Description Response Headers
200 Successful Response -
422 Invalid request parameters -
- */ - public ApiResponse getProcessDumpWithHttpInfo(@javax.annotation.Nonnull Integer analysisId, @javax.annotation.Nonnull String dumpName) throws ApiException { - okhttp3.Call localVarCall = getProcessDumpValidateBeforeCall(analysisId, dumpName, null); - Type localVarReturnType = new TypeToken(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * Get the dynamic execution results for a specific process dump (asynchronously) - * - * @param analysisId (required) - * @param dumpName (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 -
- */ - public okhttp3.Call getProcessDumpAsync(@javax.annotation.Nonnull Integer analysisId, @javax.annotation.Nonnull String dumpName, final ApiCallback _callback) throws ApiException { - - okhttp3.Call localVarCall = getProcessDumpValidateBeforeCall(analysisId, dumpName, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); - return localVarCall; - } - /** - * Build call for getProcessDumps - * @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 -
- */ - public okhttp3.Call getProcessDumpsCall(@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/analyses/{analysis_id}/dynamic-execution/process-dumps" - .replace("{" + "analysis_id" + "}", localVarApiClient.escapeString(analysisId.toString())); - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = { - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - - String[] localVarAuthNames = new String[] { "APIKey" }; - return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call getProcessDumpsValidateBeforeCall(@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 getProcessDumps(Async)"); - } - - return getProcessDumpsCall(analysisId, _callback); - - } - - /** - * Get the dynamic execution results for process dumps - * - * @param analysisId (required) - * @return BaseResponseProcessDumps - * @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 -
- */ - public BaseResponseProcessDumps getProcessDumps(@javax.annotation.Nonnull Integer analysisId) throws ApiException { - ApiResponse localVarResp = getProcessDumpsWithHttpInfo(analysisId); - return localVarResp.getData(); - } - - /** - * Get the dynamic execution results for process dumps - * - * @param analysisId (required) - * @return ApiResponse<BaseResponseProcessDumps> - * @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 -
- */ - public ApiResponse getProcessDumpsWithHttpInfo(@javax.annotation.Nonnull Integer analysisId) throws ApiException { - okhttp3.Call localVarCall = getProcessDumpsValidateBeforeCall(analysisId, null); - Type localVarReturnType = new TypeToken(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * Get the dynamic execution results for process dumps (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 -
- */ - public okhttp3.Call getProcessDumpsAsync(@javax.annotation.Nonnull Integer analysisId, final ApiCallback _callback) throws ApiException { - - okhttp3.Call localVarCall = getProcessDumpsValidateBeforeCall(analysisId, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); - return localVarCall; - } - /** - * Build call for getProcessRegistry - * @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 -
- */ - public okhttp3.Call getProcessRegistryCall(@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/analyses/{analysis_id}/dynamic-execution/process-registry" - .replace("{" + "analysis_id" + "}", localVarApiClient.escapeString(analysisId.toString())); - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = { - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - - String[] localVarAuthNames = new String[] { "APIKey" }; - return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call getProcessRegistryValidateBeforeCall(@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 getProcessRegistry(Async)"); - } - - return getProcessRegistryCall(analysisId, _callback); - - } - - /** - * Get the dynamic execution results for process registry - * - * @param analysisId (required) - * @return BaseResponseProcessRegistry - * @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 -
- */ - public BaseResponseProcessRegistry getProcessRegistry(@javax.annotation.Nonnull Integer analysisId) throws ApiException { - ApiResponse localVarResp = getProcessRegistryWithHttpInfo(analysisId); - return localVarResp.getData(); - } - - /** - * Get the dynamic execution results for process registry - * - * @param analysisId (required) - * @return ApiResponse<BaseResponseProcessRegistry> - * @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 -
- */ - public ApiResponse getProcessRegistryWithHttpInfo(@javax.annotation.Nonnull Integer analysisId) throws ApiException { - okhttp3.Call localVarCall = getProcessRegistryValidateBeforeCall(analysisId, null); - Type localVarReturnType = new TypeToken(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * Get the dynamic execution results for process registry (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 -
- */ - public okhttp3.Call getProcessRegistryAsync(@javax.annotation.Nonnull Integer analysisId, final ApiCallback _callback) throws ApiException { - - okhttp3.Call localVarCall = getProcessRegistryValidateBeforeCall(analysisId, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); - return localVarCall; - } - /** - * Build call for getProcessTree - * @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 -
- */ - public okhttp3.Call getProcessTreeCall(@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/analyses/{analysis_id}/dynamic-execution/process-tree" - .replace("{" + "analysis_id" + "}", localVarApiClient.escapeString(analysisId.toString())); - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = { - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - - String[] localVarAuthNames = new String[] { "APIKey" }; - return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call getProcessTreeValidateBeforeCall(@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 getProcessTree(Async)"); - } - - return getProcessTreeCall(analysisId, _callback); - - } - - /** - * Get the dynamic execution results for process tree - * - * @param analysisId (required) - * @return BaseResponseProcessTree - * @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 -
- */ - public BaseResponseProcessTree getProcessTree(@javax.annotation.Nonnull Integer analysisId) throws ApiException { - ApiResponse localVarResp = getProcessTreeWithHttpInfo(analysisId); - return localVarResp.getData(); - } - - /** - * Get the dynamic execution results for process tree - * - * @param analysisId (required) - * @return ApiResponse<BaseResponseProcessTree> - * @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 -
- */ - public ApiResponse getProcessTreeWithHttpInfo(@javax.annotation.Nonnull Integer analysisId) throws ApiException { - okhttp3.Call localVarCall = getProcessTreeValidateBeforeCall(analysisId, null); - Type localVarReturnType = new TypeToken(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * Get the dynamic execution results for process tree (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 -
- */ - public okhttp3.Call getProcessTreeAsync(@javax.annotation.Nonnull Integer analysisId, final ApiCallback _callback) throws ApiException { - - okhttp3.Call localVarCall = getProcessTreeValidateBeforeCall(analysisId, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); - return localVarCall; - } - /** - * Build call for getTtps - * @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 -
- */ - public okhttp3.Call getTtpsCall(@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/analyses/{analysis_id}/dynamic-execution/ttps" - .replace("{" + "analysis_id" + "}", localVarApiClient.escapeString(analysisId.toString())); - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = { - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - - String[] localVarAuthNames = new String[] { "APIKey" }; - return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call getTtpsValidateBeforeCall(@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 getTtps(Async)"); - } - - return getTtpsCall(analysisId, _callback); - - } - - /** - * Get the dynamic execution results for ttps - * - * @param analysisId (required) - * @return BaseResponseTTPS - * @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 -
- */ - public BaseResponseTTPS getTtps(@javax.annotation.Nonnull Integer analysisId) throws ApiException { - ApiResponse localVarResp = getTtpsWithHttpInfo(analysisId); - return localVarResp.getData(); - } - - /** - * Get the dynamic execution results for ttps - * - * @param analysisId (required) - * @return ApiResponse<BaseResponseTTPS> - * @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 -
- */ - public ApiResponse getTtpsWithHttpInfo(@javax.annotation.Nonnull Integer analysisId) throws ApiException { - okhttp3.Call localVarCall = getTtpsValidateBeforeCall(analysisId, null); - Type localVarReturnType = new TypeToken(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * Get the dynamic execution results for ttps (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 -
- */ - public okhttp3.Call getTtpsAsync(@javax.annotation.Nonnull Integer analysisId, final ApiCallback _callback) throws ApiException { - - okhttp3.Call localVarCall = getTtpsValidateBeforeCall(analysisId, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); - return localVarCall; - } -} diff --git a/src/main/java/ai/reveng/api/AnalysisStagesApi.java b/src/main/java/ai/reveng/api/AnalysisStagesApi.java deleted file mode 100644 index 31de277..0000000 --- a/src/main/java/ai/reveng/api/AnalysisStagesApi.java +++ /dev/null @@ -1,338 +0,0 @@ -/* - * RevEng.AI API - * RevEng.AI is an AI-powered binary analysis platform for reverse engineering and malware analysis. It provides similarity search across executable binaries and functions, AI-driven decompilation, dynamic execution analysis, firmware unpacking, and integration with external threat intelligence sources like VirusTotal. - * - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package ai.reveng.api; - -import ai.reveng.invoker.ApiCallback; -import ai.reveng.invoker.ApiClient; -import ai.reveng.invoker.ApiException; -import ai.reveng.invoker.ApiResponse; -import ai.reveng.invoker.Configuration; -import ai.reveng.invoker.Pair; -import ai.reveng.invoker.ProgressRequestBody; -import ai.reveng.invoker.ProgressResponseBody; - -import com.google.gson.reflect.TypeToken; - -import java.io.IOException; - - -import ai.reveng.model.BaseResponse; -import ai.reveng.model.BaseResponseAnalysisStagesResponse; -import ai.reveng.model.BaseResponsePipelineStatusResponse; - -import java.lang.reflect.Type; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -public class AnalysisStagesApi { - private ApiClient localVarApiClient; - private int localHostIndex; - private String localCustomBaseUrl; - - public AnalysisStagesApi() { - this(Configuration.getDefaultApiClient()); - } - - public AnalysisStagesApi(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 getAnalysisStages - * @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 -
- */ - public okhttp3.Call getAnalysisStagesCall(@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-stages/{analysis_id}" - .replace("{" + "analysis_id" + "}", localVarApiClient.escapeString(analysisId.toString())); - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = { - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - - String[] localVarAuthNames = new String[] { "APIKey" }; - return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call getAnalysisStagesValidateBeforeCall(@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 getAnalysisStages(Async)"); - } - - return getAnalysisStagesCall(analysisId, _callback); - - } - - /** - * Get Analysis Stages - * Returns all stage events for an analysis ordered by timestamp. - * @param analysisId (required) - * @return BaseResponseAnalysisStagesResponse - * @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 -
- */ - public BaseResponseAnalysisStagesResponse getAnalysisStages(@javax.annotation.Nonnull Integer analysisId) throws ApiException { - ApiResponse localVarResp = getAnalysisStagesWithHttpInfo(analysisId); - return localVarResp.getData(); - } - - /** - * Get Analysis Stages - * Returns all stage events for an analysis ordered by timestamp. - * @param analysisId (required) - * @return ApiResponse<BaseResponseAnalysisStagesResponse> - * @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 -
- */ - public ApiResponse getAnalysisStagesWithHttpInfo(@javax.annotation.Nonnull Integer analysisId) throws ApiException { - okhttp3.Call localVarCall = getAnalysisStagesValidateBeforeCall(analysisId, null); - Type localVarReturnType = new TypeToken(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * Get Analysis Stages (asynchronously) - * Returns all stage events for an analysis ordered by timestamp. - * @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 -
- */ - public okhttp3.Call getAnalysisStagesAsync(@javax.annotation.Nonnull Integer analysisId, final ApiCallback _callback) throws ApiException { - - okhttp3.Call localVarCall = getAnalysisStagesValidateBeforeCall(analysisId, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); - return localVarCall; - } - /** - * Build call for getPipelineStatus - * @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 -
- */ - public okhttp3.Call getPipelineStatusCall(@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-stages/{analysis_id}/pipeline-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" }; - return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call getPipelineStatusValidateBeforeCall(@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 getPipelineStatus(Async)"); - } - - return getPipelineStatusCall(analysisId, _callback); - - } - - /** - * Get Pipeline Status - * Returns the latest status for each core pipeline stage with the number of analyses ahead in the queue. - * @param analysisId (required) - * @return BaseResponsePipelineStatusResponse - * @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 -
- */ - public BaseResponsePipelineStatusResponse getPipelineStatus(@javax.annotation.Nonnull Integer analysisId) throws ApiException { - ApiResponse localVarResp = getPipelineStatusWithHttpInfo(analysisId); - return localVarResp.getData(); - } - - /** - * Get Pipeline Status - * Returns the latest status for each core pipeline stage with the number of analyses ahead in the queue. - * @param analysisId (required) - * @return ApiResponse<BaseResponsePipelineStatusResponse> - * @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 -
- */ - public ApiResponse getPipelineStatusWithHttpInfo(@javax.annotation.Nonnull Integer analysisId) throws ApiException { - okhttp3.Call localVarCall = getPipelineStatusValidateBeforeCall(analysisId, null); - Type localVarReturnType = new TypeToken(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * Get Pipeline Status (asynchronously) - * Returns the latest status for each core pipeline stage with the number of analyses ahead in the queue. - * @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 -
- */ - public okhttp3.Call getPipelineStatusAsync(@javax.annotation.Nonnull Integer analysisId, final ApiCallback _callback) throws ApiException { - - okhttp3.Call localVarCall = getPipelineStatusValidateBeforeCall(analysisId, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); - return localVarCall; - } -} diff --git a/src/main/java/ai/reveng/api/ConversationsApi.java b/src/main/java/ai/reveng/api/ConversationsApi.java new file mode 100644 index 0000000..b8bc354 --- /dev/null +++ b/src/main/java/ai/reveng/api/ConversationsApi.java @@ -0,0 +1,1086 @@ +/* + * 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.ConfirmToolInputBody; +import ai.reveng.model.Conversation; +import ai.reveng.model.ConversationWithEvents; +import ai.reveng.model.CreateConversationRequest; +import ai.reveng.model.SendMessageRequest; +import ai.reveng.model.StatusResponse; +import ai.reveng.model.StreamEvents200ResponseInner; +import java.util.UUID; + +import java.lang.reflect.Type; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +public class ConversationsApi { + private ApiClient localVarApiClient; + private int localHostIndex; + private String localCustomBaseUrl; + + public ConversationsApi() { + this(Configuration.getDefaultApiClient()); + } + + public ConversationsApi(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 cancelRun + * @param id Conversation UUID (required) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + + + + +
Response Details
Status Code Description Response Headers
200 OK -
400 Bad Request -
404 Not Found -
422 Unprocessable Entity -
500 Internal Server Error -
+ */ + public okhttp3.Call cancelRunCall(@javax.annotation.Nonnull UUID id, 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/conversations/{id}/cancel" + .replace("{" + "id" + "}", localVarApiClient.escapeString(id.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "APIKey" }; + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call cancelRunValidateBeforeCall(@javax.annotation.Nonnull UUID id, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'id' is set + if (id == null) { + throw new ApiException("Missing the required parameter 'id' when calling cancelRun(Async)"); + } + + return cancelRunCall(id, _callback); + + } + + /** + * 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 + * @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 + * @http.response.details + + + + + + + + +
Response Details
Status Code Description Response Headers
200 OK -
400 Bad Request -
404 Not Found -
422 Unprocessable Entity -
500 Internal Server Error -
+ */ + public StatusResponse cancelRun(@javax.annotation.Nonnull UUID id) throws ApiException { + ApiResponse localVarResp = cancelRunWithHttpInfo(id); + return localVarResp.getData(); + } + + /** + * 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 + * @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 + * @http.response.details + + + + + + + + +
Response Details
Status Code Description Response Headers
200 OK -
400 Bad Request -
404 Not Found -
422 Unprocessable Entity -
500 Internal Server Error -
+ */ + public ApiResponse cancelRunWithHttpInfo(@javax.annotation.Nonnull UUID id) throws ApiException { + okhttp3.Call localVarCall = cancelRunValidateBeforeCall(id, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * 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 + * @param id Conversation UUID (required) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + + + + + +
Response Details
Status Code Description Response Headers
200 OK -
400 Bad Request -
404 Not Found -
422 Unprocessable Entity -
500 Internal Server Error -
+ */ + public okhttp3.Call cancelRunAsync(@javax.annotation.Nonnull UUID id, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = cancelRunValidateBeforeCall(id, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for confirmTool + * @param id Conversation UUID (required) + * @param confirmToolInputBody (required) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + + + + +
Response Details
Status Code Description Response Headers
200 OK -
400 Bad Request -
404 Not Found -
422 Unprocessable Entity -
500 Internal Server Error -
+ */ + public okhttp3.Call confirmToolCall(@javax.annotation.Nonnull UUID id, @javax.annotation.Nonnull ConfirmToolInputBody confirmToolInputBody, 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 = confirmToolInputBody; + + // create path and map variables + String localVarPath = "/v2/conversations/{id}/confirm" + .replace("{" + "id" + "}", localVarApiClient.escapeString(id.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" }; + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call confirmToolValidateBeforeCall(@javax.annotation.Nonnull UUID id, @javax.annotation.Nonnull ConfirmToolInputBody confirmToolInputBody, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'id' is set + if (id == null) { + throw new ApiException("Missing the required parameter 'id' when calling confirmTool(Async)"); + } + + // verify the required parameter 'confirmToolInputBody' is set + if (confirmToolInputBody == null) { + throw new ApiException("Missing the required parameter 'confirmToolInputBody' when calling confirmTool(Async)"); + } + + return confirmToolCall(id, confirmToolInputBody, _callback); + + } + + /** + * 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 + * @param id Conversation UUID (required) + * @param confirmToolInputBody (required) + * @return StatusResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + + + +
Response Details
Status Code Description Response Headers
200 OK -
400 Bad Request -
404 Not Found -
422 Unprocessable Entity -
500 Internal Server Error -
+ */ + public StatusResponse confirmTool(@javax.annotation.Nonnull UUID id, @javax.annotation.Nonnull ConfirmToolInputBody confirmToolInputBody) throws ApiException { + ApiResponse localVarResp = confirmToolWithHttpInfo(id, confirmToolInputBody); + return localVarResp.getData(); + } + + /** + * 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 + * @param id Conversation UUID (required) + * @param confirmToolInputBody (required) + * @return ApiResponse<StatusResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + + + +
Response Details
Status Code Description Response Headers
200 OK -
400 Bad Request -
404 Not Found -
422 Unprocessable Entity -
500 Internal Server Error -
+ */ + public ApiResponse confirmToolWithHttpInfo(@javax.annotation.Nonnull UUID id, @javax.annotation.Nonnull ConfirmToolInputBody confirmToolInputBody) throws ApiException { + okhttp3.Call localVarCall = confirmToolValidateBeforeCall(id, confirmToolInputBody, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * 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 + * @param id Conversation UUID (required) + * @param confirmToolInputBody (required) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + + + + + +
Response Details
Status Code Description Response Headers
200 OK -
400 Bad Request -
404 Not Found -
422 Unprocessable Entity -
500 Internal Server Error -
+ */ + public okhttp3.Call confirmToolAsync(@javax.annotation.Nonnull UUID id, @javax.annotation.Nonnull ConfirmToolInputBody confirmToolInputBody, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = confirmToolValidateBeforeCall(id, confirmToolInputBody, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for createConversation + * @param createConversationRequest (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 -
400 Bad Request -
422 Unprocessable Entity -
500 Internal Server Error -
+ */ + public okhttp3.Call createConversationCall(@javax.annotation.Nonnull CreateConversationRequest createConversationRequest, 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 = createConversationRequest; + + // create path and map variables + String localVarPath = "/v2/conversations"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "APIKey" }; + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call createConversationValidateBeforeCall(@javax.annotation.Nonnull CreateConversationRequest createConversationRequest, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'createConversationRequest' is set + if (createConversationRequest == null) { + throw new ApiException("Missing the required parameter 'createConversationRequest' when calling createConversation(Async)"); + } + + return createConversationCall(createConversationRequest, _callback); + + } + + /** + * Create a new conversation + * Creates a new conversation for the authenticated user. Optionally include a binary analysis context to scope the assistant to a specific analysis. **Error codes:** - `400` [`BAD_REQUEST`](/errors/BAD_REQUEST) — Bad Request + * @param createConversationRequest (required) + * @return Conversation + * @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 -
400 Bad Request -
422 Unprocessable Entity -
500 Internal Server Error -
+ */ + public Conversation createConversation(@javax.annotation.Nonnull CreateConversationRequest createConversationRequest) throws ApiException { + ApiResponse localVarResp = createConversationWithHttpInfo(createConversationRequest); + return localVarResp.getData(); + } + + /** + * Create a new conversation + * Creates a new conversation for the authenticated user. Optionally include a binary analysis context to scope the assistant to a specific analysis. **Error codes:** - `400` [`BAD_REQUEST`](/errors/BAD_REQUEST) — Bad Request + * @param createConversationRequest (required) + * @return ApiResponse<Conversation> + * @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 -
400 Bad Request -
422 Unprocessable Entity -
500 Internal Server Error -
+ */ + public ApiResponse createConversationWithHttpInfo(@javax.annotation.Nonnull CreateConversationRequest createConversationRequest) throws ApiException { + okhttp3.Call localVarCall = createConversationValidateBeforeCall(createConversationRequest, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Create a new conversation (asynchronously) + * Creates a new conversation for the authenticated user. Optionally include a binary analysis context to scope the assistant to a specific analysis. **Error codes:** - `400` [`BAD_REQUEST`](/errors/BAD_REQUEST) — Bad Request + * @param createConversationRequest (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 -
400 Bad Request -
422 Unprocessable Entity -
500 Internal Server Error -
+ */ + public okhttp3.Call createConversationAsync(@javax.annotation.Nonnull CreateConversationRequest createConversationRequest, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = createConversationValidateBeforeCall(createConversationRequest, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for getConversation + * @param id Conversation UUID (required) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + + + + +
Response Details
Status Code Description Response Headers
200 OK -
400 Bad Request -
404 Not Found -
422 Unprocessable Entity -
500 Internal Server Error -
+ */ + public okhttp3.Call getConversationCall(@javax.annotation.Nonnull UUID id, 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/conversations/{id}" + .replace("{" + "id" + "}", localVarApiClient.escapeString(id.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "APIKey" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getConversationValidateBeforeCall(@javax.annotation.Nonnull UUID id, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'id' is set + if (id == null) { + throw new ApiException("Missing the required parameter 'id' when calling getConversation(Async)"); + } + + return getConversationCall(id, _callback); + + } + + /** + * Get a conversation with its events + * Returns the conversation metadata along with all persisted events. Useful for reconstructing the full conversation history on page load. **Error codes:** - `400` [`INVALID_CONVERSATION_ID`](/errors/INVALID_CONVERSATION_ID) — Invalid Conversation ID - `404` [`CONVERSATION_NOT_FOUND`](/errors/CONVERSATION_NOT_FOUND) — Conversation Not Found + * @param id Conversation UUID (required) + * @return ConversationWithEvents + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + + + +
Response Details
Status Code Description Response Headers
200 OK -
400 Bad Request -
404 Not Found -
422 Unprocessable Entity -
500 Internal Server Error -
+ */ + public ConversationWithEvents getConversation(@javax.annotation.Nonnull UUID id) throws ApiException { + ApiResponse localVarResp = getConversationWithHttpInfo(id); + return localVarResp.getData(); + } + + /** + * Get a conversation with its events + * Returns the conversation metadata along with all persisted events. Useful for reconstructing the full conversation history on page load. **Error codes:** - `400` [`INVALID_CONVERSATION_ID`](/errors/INVALID_CONVERSATION_ID) — Invalid Conversation ID - `404` [`CONVERSATION_NOT_FOUND`](/errors/CONVERSATION_NOT_FOUND) — Conversation Not Found + * @param id Conversation UUID (required) + * @return ApiResponse<ConversationWithEvents> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + + + +
Response Details
Status Code Description Response Headers
200 OK -
400 Bad Request -
404 Not Found -
422 Unprocessable Entity -
500 Internal Server Error -
+ */ + public ApiResponse getConversationWithHttpInfo(@javax.annotation.Nonnull UUID id) throws ApiException { + okhttp3.Call localVarCall = getConversationValidateBeforeCall(id, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Get a conversation with its events (asynchronously) + * Returns the conversation metadata along with all persisted events. Useful for reconstructing the full conversation history on page load. **Error codes:** - `400` [`INVALID_CONVERSATION_ID`](/errors/INVALID_CONVERSATION_ID) — Invalid Conversation ID - `404` [`CONVERSATION_NOT_FOUND`](/errors/CONVERSATION_NOT_FOUND) — Conversation Not Found + * @param id Conversation UUID (required) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + + + + + +
Response Details
Status Code Description Response Headers
200 OK -
400 Bad Request -
404 Not Found -
422 Unprocessable Entity -
500 Internal Server Error -
+ */ + public okhttp3.Call getConversationAsync(@javax.annotation.Nonnull UUID id, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = getConversationValidateBeforeCall(id, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for listConversations + * @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 listConversationsCall(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/conversations"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "APIKey" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call listConversationsValidateBeforeCall(final ApiCallback _callback) throws ApiException { + return listConversationsCall(_callback); + + } + + /** + * List conversations for the authenticated user + * Returns all conversations owned by the authenticated user, ordered by most recently updated. + * @return List<Conversation> + * @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 List listConversations() throws ApiException { + ApiResponse> localVarResp = listConversationsWithHttpInfo(); + return localVarResp.getData(); + } + + /** + * List conversations for the authenticated user + * Returns all conversations owned by the authenticated user, ordered by most recently updated. + * @return ApiResponse<List<Conversation>> + * @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> listConversationsWithHttpInfo() throws ApiException { + okhttp3.Call localVarCall = listConversationsValidateBeforeCall(null); + Type localVarReturnType = new TypeToken>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * List conversations for the authenticated user (asynchronously) + * Returns all conversations owned by the authenticated user, ordered by most recently updated. + * @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 listConversationsAsync(final ApiCallback> _callback) throws ApiException { + + okhttp3.Call localVarCall = listConversationsValidateBeforeCall(_callback); + Type localVarReturnType = new TypeToken>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for sendMessage + * @param id Conversation UUID (required) + * @param sendMessageRequest (required) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + + + + + + + +
Response Details
Status Code Description Response Headers
202 Accepted -
400 Bad Request -
402 Payment Required -
403 Forbidden -
404 Not Found -
409 Conflict -
422 Unprocessable Entity -
500 Internal Server Error -
+ */ + public okhttp3.Call sendMessageCall(@javax.annotation.Nonnull UUID id, @javax.annotation.Nonnull SendMessageRequest sendMessageRequest, 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 = sendMessageRequest; + + // create path and map variables + String localVarPath = "/v2/conversations/{id}/messages" + .replace("{" + "id" + "}", localVarApiClient.escapeString(id.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" }; + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call sendMessageValidateBeforeCall(@javax.annotation.Nonnull UUID id, @javax.annotation.Nonnull SendMessageRequest sendMessageRequest, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'id' is set + if (id == null) { + throw new ApiException("Missing the required parameter 'id' when calling sendMessage(Async)"); + } + + // verify the required parameter 'sendMessageRequest' is set + if (sendMessageRequest == null) { + throw new ApiException("Missing the required parameter 'sendMessageRequest' when calling sendMessage(Async)"); + } + + return sendMessageCall(id, sendMessageRequest, _callback); + + } + + /** + * 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 + * @param id Conversation UUID (required) + * @param sendMessageRequest (required) + * @return StatusResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + + + + + + +
Response Details
Status Code Description Response Headers
202 Accepted -
400 Bad Request -
402 Payment Required -
403 Forbidden -
404 Not Found -
409 Conflict -
422 Unprocessable Entity -
500 Internal Server Error -
+ */ + public StatusResponse sendMessage(@javax.annotation.Nonnull UUID id, @javax.annotation.Nonnull SendMessageRequest sendMessageRequest) throws ApiException { + ApiResponse localVarResp = sendMessageWithHttpInfo(id, sendMessageRequest); + return localVarResp.getData(); + } + + /** + * 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 + * @param id Conversation UUID (required) + * @param sendMessageRequest (required) + * @return ApiResponse<StatusResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + + + + + + +
Response Details
Status Code Description Response Headers
202 Accepted -
400 Bad Request -
402 Payment Required -
403 Forbidden -
404 Not Found -
409 Conflict -
422 Unprocessable Entity -
500 Internal Server Error -
+ */ + public ApiResponse sendMessageWithHttpInfo(@javax.annotation.Nonnull UUID id, @javax.annotation.Nonnull SendMessageRequest sendMessageRequest) throws ApiException { + okhttp3.Call localVarCall = sendMessageValidateBeforeCall(id, sendMessageRequest, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * 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 + * @param id Conversation UUID (required) + * @param sendMessageRequest (required) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + + + + + + + + +
Response Details
Status Code Description Response Headers
202 Accepted -
400 Bad Request -
402 Payment Required -
403 Forbidden -
404 Not Found -
409 Conflict -
422 Unprocessable Entity -
500 Internal Server Error -
+ */ + public okhttp3.Call sendMessageAsync(@javax.annotation.Nonnull UUID id, @javax.annotation.Nonnull SendMessageRequest sendMessageRequest, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = sendMessageValidateBeforeCall(id, sendMessageRequest, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for streamEvents + * @param id Conversation UUID (required) + * @param lastEventId Replay events after this ID (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
200 OK -
0 Error -
+ */ + public okhttp3.Call streamEventsCall(@javax.annotation.Nonnull UUID id, @javax.annotation.Nullable Long lastEventId, 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/conversations/{id}/events" + .replace("{" + "id" + "}", localVarApiClient.escapeString(id.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + if (lastEventId != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("last_event_id", lastEventId)); + } + + final String[] localVarAccepts = { + "text/event-stream", + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "APIKey" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call streamEventsValidateBeforeCall(@javax.annotation.Nonnull UUID id, @javax.annotation.Nullable Long lastEventId, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'id' is set + if (id == null) { + throw new ApiException("Missing the required parameter 'id' when calling streamEvents(Async)"); + } + + return streamEventsCall(id, lastEventId, _callback); + + } + + /** + * Stream conversation events (SSE) + * Opens a Server-Sent Events stream for the given conversation. Events include run lifecycle updates, streaming text deltas, tool call progress, and more. Use the `last_event_id` query parameter to replay missed events after a reconnection. + * @param id Conversation UUID (required) + * @param lastEventId Replay events after this ID (optional) + * @return List<StreamEvents200ResponseInner> + * @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 List streamEvents(@javax.annotation.Nonnull UUID id, @javax.annotation.Nullable Long lastEventId) throws ApiException { + ApiResponse> localVarResp = streamEventsWithHttpInfo(id, lastEventId); + return localVarResp.getData(); + } + + /** + * Stream conversation events (SSE) + * Opens a Server-Sent Events stream for the given conversation. Events include run lifecycle updates, streaming text deltas, tool call progress, and more. Use the `last_event_id` query parameter to replay missed events after a reconnection. + * @param id Conversation UUID (required) + * @param lastEventId Replay events after this ID (optional) + * @return ApiResponse<List<StreamEvents200ResponseInner>> + * @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> streamEventsWithHttpInfo(@javax.annotation.Nonnull UUID id, @javax.annotation.Nullable Long lastEventId) throws ApiException { + okhttp3.Call localVarCall = streamEventsValidateBeforeCall(id, lastEventId, null); + Type localVarReturnType = new TypeToken>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Stream conversation events (SSE) (asynchronously) + * Opens a Server-Sent Events stream for the given conversation. Events include run lifecycle updates, streaming text deltas, tool call progress, and more. Use the `last_event_id` query parameter to replay missed events after a reconnection. + * @param id Conversation UUID (required) + * @param lastEventId Replay events after this ID (optional) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + + +
Response Details
Status Code Description Response Headers
200 OK -
0 Error -
+ */ + public okhttp3.Call streamEventsAsync(@javax.annotation.Nonnull UUID id, @javax.annotation.Nullable Long lastEventId, final ApiCallback> _callback) throws ApiException { + + okhttp3.Call localVarCall = streamEventsValidateBeforeCall(id, lastEventId, _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 b0484a8..81dbf51 100644 --- a/src/main/java/ai/reveng/invoker/ApiClient.java +++ b/src/main/java/ai/reveng/invoker/ApiClient.java @@ -146,7 +146,7 @@ protected void init() { json = new JSON(); // Set default User-Agent. - setUserAgent("OpenAPI-Generator/3.74.4/java"); + setUserAgent("OpenAPI-Generator/3.79.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 3de10e0..8959c6f 100644 --- a/src/main/java/ai/reveng/invoker/Configuration.java +++ b/src/main/java/ai/reveng/invoker/Configuration.java @@ -18,7 +18,7 @@ @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class Configuration { - public static final String VERSION = "3.74.4"; + public static final String VERSION = "3.79.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 d99c964..e996f5f 100644 --- a/src/main/java/ai/reveng/invoker/JSON.java +++ b/src/main/java/ai/reveng/invoker/JSON.java @@ -98,6 +98,7 @@ private static Class getClassByDiscriminator(Map classByDiscriminatorValue, Stri gsonBuilder.registerTypeAdapter(OffsetDateTime.class, offsetDateTimeTypeAdapter); gsonBuilder.registerTypeAdapter(LocalDate.class, localDateTypeAdapter); gsonBuilder.registerTypeAdapter(byte[].class, byteArrayAdapter); + gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.APIError.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.AdditionalDetailsStatusResponse.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.Addr.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.AiUnstripRequest.CustomTypeAdapterFactory()); @@ -114,7 +115,6 @@ private static Class getClassByDiscriminator(Map classByDiscriminatorValue, Stri gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.AnalysisFunctions.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.AnalysisFunctionsList.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.AnalysisRecord.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.AnalysisStagesResponse.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.AnalysisStringInput.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.AnalysisStringsResponse.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.AnalysisStringsStatusResponse.CustomTypeAdapterFactory()); @@ -126,7 +126,6 @@ private static Class getClassByDiscriminator(Map classByDiscriminatorValue, Stri gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.AppApiRestV2FunctionsResponsesFunction.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.AppApiRestV2FunctionsTypesFunction.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.AppApiRestV2InfoTypesCapability.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.AppServicesDynamicExecutionSchemasDynamicExecutionStatus.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.Argument.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.AutoRunAgents.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.AutoUnstripRequest.CustomTypeAdapterFactory()); @@ -139,7 +138,6 @@ private static Class getClassByDiscriminator(Map classByDiscriminatorValue, Stri gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.BaseResponseAnalysisFunctionMapping.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.BaseResponseAnalysisFunctions.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.BaseResponseAnalysisFunctionsList.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.BaseResponseAnalysisStagesResponse.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.BaseResponseAnalysisStringsResponse.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.BaseResponseAnalysisStringsStatusResponse.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.BaseResponseAnalysisTags.CustomTypeAdapterFactory()); @@ -163,7 +161,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.BaseResponseDynamicExecutionStatus.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()); @@ -187,18 +184,12 @@ private static Class getClassByDiscriminator(Map classByDiscriminatorValue, Stri gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.BaseResponseListUserActivityResponse.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.BaseResponseLogs.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.BaseResponseModelsResponse.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.BaseResponseNetworkOverviewResponse.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.BaseResponseParams.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.BaseResponsePipelineStatusResponse.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.BaseResponseProcessDumps.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.BaseResponseProcessRegistry.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.BaseResponseProcessTree.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.BaseResponseQueuedWorkflowTaskResponse.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.BaseResponseRecent.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.BaseResponseReportAnalysisResponse.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.BaseResponseStatus.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.BaseResponseStr.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.BaseResponseTTPS.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()); @@ -240,7 +231,12 @@ private static Class getClassByDiscriminator(Map classByDiscriminatorValue, Stri gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.CommentResponse.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.CommentUpdateRequest.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.ConfigResponse.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.ConfirmToolInputBody.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.Context.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.Conversation.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.ConversationContext.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.ConversationWithEvents.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.CreateConversationRequest.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.Created.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.DecompilationCommentContext.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.DieMatch.CustomTypeAdapterFactory()); @@ -254,7 +250,25 @@ private static Class getClassByDiscriminator(Map classByDiscriminatorValue, Stri gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.ElfDynamicEntry.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.EntrypointModel.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.Enumeration.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.EventCONTEXTCOMPACTED.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.EventRUNCANCELLED.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.EventRUNERROR.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.EventRUNFINISHED.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.EventRUNSTARTED.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.EventSTEPFINISHED.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.EventSTEPSTARTED.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.EventTEXTMESSAGECONTENT.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.EventTEXTMESSAGEEND.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.EventTEXTMESSAGESTART.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.EventTITLEUPDATED.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.EventTOOLCALLARGSDELTA.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.EventTOOLCALLEND.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.EventTOOLCALLRESULT.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.EventTOOLCALLSTART.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.EventTOOLCONFIRMATIONREQUIRED.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.ExportModel.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.ExternalResponse.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.FileHashes.CustomTypeAdapterFactory()); @@ -318,27 +332,15 @@ private static Class getClassByDiscriminator(Map classByDiscriminatorValue, Stri gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.ModelsResponse.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.NameConfidence.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.NameSourceType.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.NetworkOverviewDns.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.NetworkOverviewDnsAnswer.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.NetworkOverviewMetadata.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.NetworkOverviewResponse.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.PDBDebugModel.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.PEModel.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.PaginationModel.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.Params.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.PipelineStatusResponse.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.Process.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.ProcessDump.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.ProcessDumpMetadata.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.ProcessDumps.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.ProcessDumpsData.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.ProcessRegistry.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.ProcessTree.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.PutAnalysisStringsRequest.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.QueuePositionResponse.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.QueuedWorkflowTaskResponse.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.ReAnalysisForm.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.Recent.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.Registry.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.RelativeBinaryResponse.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.ReportAnalysisResponse.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.SBOM.CustomTypeAdapterFactory()); @@ -348,24 +350,36 @@ private static Class getClassByDiscriminator(Map classByDiscriminatorValue, Stri gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.SectionModel.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.SecurityModel.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.SegmentInfo.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.SendMessageRequest.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.SingleCodeCertificateModel.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.SingleCodeSignatureModel.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.SinglePDBEntryModel.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.SingleSectionModel.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()); + gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.SseEventRunFinishedData.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.SseEventRunStartedData.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.SseEventStepFinishedData.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.SseEventStepStartedData.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.SseEventTextMessageContentData.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.SseEventTextMessageEndData.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.SseEventTextMessageStartData.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.SseEventTitleUpdatedData.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.SseEventToolCallArgsDeltaData.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.SseEventToolCallEndData.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.SseEventToolCallResultData.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.SseEventToolCallStartData.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.SseEventToolConfirmationRequiredData.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.StackVariable.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.StageEvent.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.StageStatus.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.StatusOutput.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.StatusResponse.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.StreamEvents200ResponseInner.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.StringFunctions.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.Structure.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.StructureMember.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.SubmitUserFeedbackRequest.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.Symbols.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.TTPS.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.TTPSAttack.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.TTPSData.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.TTPSElement.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.TTPSOccurance.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.Tag.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.TagItem.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.TagResponse.CustomTypeAdapterFactory()); diff --git a/src/main/java/ai/reveng/model/TTPS.java b/src/main/java/ai/reveng/model/APIError.java similarity index 73% rename from src/main/java/ai/reveng/model/TTPS.java rename to src/main/java/ai/reveng/model/APIError.java index b8df65c..4c7944b 100644 --- a/src/main/java/ai/reveng/model/TTPS.java +++ b/src/main/java/ai/reveng/model/APIError.java @@ -14,13 +14,14 @@ import java.util.Objects; import java.util.Locale; -import ai.reveng.model.TTPSData; +import ai.reveng.model.ErrorBody; 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.net.URI; import java.util.Arrays; import com.google.gson.Gson; @@ -48,58 +49,57 @@ import ai.reveng.invoker.JSON; /** - * TTPS + * APIError */ @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class TTPS { - public static final String SERIALIZED_NAME_SUCCESS = "success"; - @SerializedName(SERIALIZED_NAME_SUCCESS) +public class APIError { + public static final String SERIALIZED_NAME_$_SCHEMA = "$schema"; + @SerializedName(SERIALIZED_NAME_$_SCHEMA) + @javax.annotation.Nullable + private URI $schema; + + public static final String SERIALIZED_NAME_ERROR = "error"; + @SerializedName(SERIALIZED_NAME_ERROR) @javax.annotation.Nonnull - private Boolean success; + private ErrorBody error; - public static final String SERIALIZED_NAME_DATA = "data"; - @SerializedName(SERIALIZED_NAME_DATA) - @javax.annotation.Nonnull - private TTPSData data; - - public TTPS() { + public APIError() { } - public TTPS success(@javax.annotation.Nonnull Boolean success) { - this.success = success; - return this; + public APIError( + URI $schema + ) { + this(); + this.$schema = $schema; } /** - * Get success - * @return success + * A URL to the JSON Schema for this object. + * @return $schema */ - @javax.annotation.Nonnull - public Boolean getSuccess() { - return success; + @javax.annotation.Nullable + public URI get$Schema() { + return $schema; } - public void setSuccess(@javax.annotation.Nonnull Boolean success) { - this.success = success; - } - public TTPS data(@javax.annotation.Nonnull TTPSData data) { - this.data = data; + public APIError error(@javax.annotation.Nonnull ErrorBody error) { + this.error = error; return this; } /** - * Get data - * @return data + * Get error + * @return error */ @javax.annotation.Nonnull - public TTPSData getData() { - return data; + public ErrorBody getError() { + return error; } - public void setData(@javax.annotation.Nonnull TTPSData data) { - this.data = data; + public void setError(@javax.annotation.Nonnull ErrorBody error) { + this.error = error; } /** @@ -115,9 +115,9 @@ public void setData(@javax.annotation.Nonnull TTPSData data) { * * @param key name of the property * @param value value of the property - * @return the TTPS instance itself + * @return the APIError instance itself */ - public TTPS putAdditionalProperty(String key, Object value) { + public APIError putAdditionalProperty(String key, Object value) { if (this.additionalProperties == null) { this.additionalProperties = new HashMap(); } @@ -156,23 +156,23 @@ public boolean equals(Object o) { if (o == null || getClass() != o.getClass()) { return false; } - TTPS TTPS = (TTPS) o; - return Objects.equals(this.success, TTPS.success) && - Objects.equals(this.data, TTPS.data)&& - Objects.equals(this.additionalProperties, TTPS.additionalProperties); + APIError apIError = (APIError) o; + return Objects.equals(this.$schema, apIError.$schema) && + Objects.equals(this.error, apIError.error)&& + Objects.equals(this.additionalProperties, apIError.additionalProperties); } @Override public int hashCode() { - return Objects.hash(success, data, additionalProperties); + return Objects.hash($schema, error, additionalProperties); } @Override public String toString() { StringBuilder sb = new StringBuilder(); - sb.append("class TTPS {\n"); - sb.append(" success: ").append(toIndentedString(success)).append("\n"); - sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append("class APIError {\n"); + sb.append(" $schema: ").append(toIndentedString($schema)).append("\n"); + sb.append(" error: ").append(toIndentedString(error)).append("\n"); sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); sb.append("}"); return sb.toString(); @@ -195,50 +195,51 @@ private String toIndentedString(Object o) { static { // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(Arrays.asList("success", "data")); + openapiFields = new HashSet(Arrays.asList("$schema", "error")); // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(Arrays.asList("success", "data")); + openapiRequiredFields = new HashSet(Arrays.asList("error")); } /** * 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 TTPS + * @throws IOException if the JSON Element is invalid with respect to APIError */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (jsonElement == null) { - if (!TTPS.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format(Locale.ROOT, "The required field(s) %s in TTPS is not found in the empty JSON string", TTPS.openapiRequiredFields.toString())); + if (!APIError.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format(Locale.ROOT, "The required field(s) %s in APIError is not found in the empty JSON string", APIError.openapiRequiredFields.toString())); } } // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : TTPS.openapiRequiredFields) { + for (String requiredField : APIError.openapiRequiredFields) { if (jsonElement.getAsJsonObject().get(requiredField) == null) { throw new IllegalArgumentException(String.format(Locale.ROOT, "The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); } } JsonObject jsonObj = jsonElement.getAsJsonObject(); - // validate the required field `data` - TTPSData.validateJsonElement(jsonObj.get("data")); + if ((jsonObj.get("$schema") != null && !jsonObj.get("$schema").isJsonNull()) && !jsonObj.get("$schema").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(Locale.ROOT, "Expected the field `$schema` to be a primitive type in the JSON string but got `%s`", jsonObj.get("$schema").toString())); + } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @SuppressWarnings("unchecked") @Override public TypeAdapter create(Gson gson, TypeToken type) { - if (!TTPS.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'TTPS' and its subtypes + if (!APIError.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'APIError' and its subtypes } final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(TTPS.class)); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(APIError.class)); - return (TypeAdapter) new TypeAdapter() { + return (TypeAdapter) new TypeAdapter() { @Override - public void write(JsonWriter out, TTPS value) throws IOException { + public void write(JsonWriter out, APIError value) throws IOException { JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); obj.remove("additionalProperties"); // serialize additional properties @@ -266,12 +267,12 @@ else if (entry.getValue() instanceof Character) } @Override - public TTPS read(JsonReader in) throws IOException { + public APIError read(JsonReader in) throws IOException { JsonElement jsonElement = elementAdapter.read(in); validateJsonElement(jsonElement); JsonObject jsonObj = jsonElement.getAsJsonObject(); // store additional fields in the deserialized instance - TTPS instance = thisAdapter.fromJsonTree(jsonObj); + APIError instance = thisAdapter.fromJsonTree(jsonObj); for (Map.Entry entry : jsonObj.entrySet()) { if (!openapiFields.contains(entry.getKey())) { if (entry.getValue().isJsonPrimitive()) { // primitive type @@ -298,18 +299,18 @@ else if (entry.getValue().getAsJsonPrimitive().isBoolean()) } /** - * Create an instance of TTPS given an JSON string + * Create an instance of APIError given an JSON string * * @param jsonString JSON string - * @return An instance of TTPS - * @throws IOException if the JSON string is invalid with respect to TTPS + * @return An instance of APIError + * @throws IOException if the JSON string is invalid with respect to APIError */ - public static TTPS fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, TTPS.class); + public static APIError fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, APIError.class); } /** - * Convert an instance of TTPS to an JSON string + * Convert an instance of APIError to an JSON string * * @return JSON string */ diff --git a/src/main/java/ai/reveng/model/AnalysisRecord.java b/src/main/java/ai/reveng/model/AnalysisRecord.java index b6e5b26..f49dc00 100644 --- a/src/main/java/ai/reveng/model/AnalysisRecord.java +++ b/src/main/java/ai/reveng/model/AnalysisRecord.java @@ -14,7 +14,7 @@ import java.util.Objects; import java.util.Locale; -import ai.reveng.model.AppApiRestV2AnalysesEnumsDynamicExecutionStatus; +import ai.reveng.model.DynamicExecutionStatus; import ai.reveng.model.TagItem; import com.google.gson.TypeAdapter; import com.google.gson.annotations.JsonAdapter; @@ -126,7 +126,7 @@ public class AnalysisRecord { public static final String SERIALIZED_NAME_DYNAMIC_EXECUTION_STATUS = "dynamic_execution_status"; @SerializedName(SERIALIZED_NAME_DYNAMIC_EXECUTION_STATUS) @javax.annotation.Nullable - private AppApiRestV2AnalysesEnumsDynamicExecutionStatus dynamicExecutionStatus; + private DynamicExecutionStatus dynamicExecutionStatus; public static final String SERIALIZED_NAME_DYNAMIC_EXECUTION_TASK_ID = "dynamic_execution_task_id"; @SerializedName(SERIALIZED_NAME_DYNAMIC_EXECUTION_TASK_ID) @@ -393,7 +393,7 @@ public void setUsername(@javax.annotation.Nonnull String username) { } - public AnalysisRecord dynamicExecutionStatus(@javax.annotation.Nullable AppApiRestV2AnalysesEnumsDynamicExecutionStatus dynamicExecutionStatus) { + public AnalysisRecord dynamicExecutionStatus(@javax.annotation.Nullable DynamicExecutionStatus dynamicExecutionStatus) { this.dynamicExecutionStatus = dynamicExecutionStatus; return this; } @@ -403,11 +403,11 @@ public AnalysisRecord dynamicExecutionStatus(@javax.annotation.Nullable AppApiRe * @return dynamicExecutionStatus */ @javax.annotation.Nullable - public AppApiRestV2AnalysesEnumsDynamicExecutionStatus getDynamicExecutionStatus() { + public DynamicExecutionStatus getDynamicExecutionStatus() { return dynamicExecutionStatus; } - public void setDynamicExecutionStatus(@javax.annotation.Nullable AppApiRestV2AnalysesEnumsDynamicExecutionStatus dynamicExecutionStatus) { + public void setDynamicExecutionStatus(@javax.annotation.Nullable DynamicExecutionStatus dynamicExecutionStatus) { this.dynamicExecutionStatus = dynamicExecutionStatus; } @@ -659,7 +659,7 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti } // validate the optional field `dynamic_execution_status` if (jsonObj.get("dynamic_execution_status") != null && !jsonObj.get("dynamic_execution_status").isJsonNull()) { - AppApiRestV2AnalysesEnumsDynamicExecutionStatus.validateJsonElement(jsonObj.get("dynamic_execution_status")); + DynamicExecutionStatus.validateJsonElement(jsonObj.get("dynamic_execution_status")); } if (jsonObj.get("tags") != null && !jsonObj.get("tags").isJsonNull()) { JsonArray jsonArraytags = jsonObj.getAsJsonArray("tags"); diff --git a/src/main/java/ai/reveng/model/AnalysisStage.java b/src/main/java/ai/reveng/model/AnalysisStage.java deleted file mode 100644 index 0ad83ae..0000000 --- a/src/main/java/ai/reveng/model/AnalysisStage.java +++ /dev/null @@ -1,81 +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 java.util.Locale; -import com.google.gson.annotations.SerializedName; - -import java.io.IOException; -import java.util.Locale; -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 AnalysisStage - */ -@JsonAdapter(AnalysisStage.Adapter.class) -public enum AnalysisStage { - - ANALYSIS("ANALYSIS"), - - POST_PROCESSING("POST_PROCESSING"), - - INFERENCE("INFERENCE"); - - private String value; - - AnalysisStage(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - public static AnalysisStage fromValue(String value) { - for (AnalysisStage b : AnalysisStage.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - - public static class Adapter extends TypeAdapter { - @Override - public void write(final JsonWriter jsonWriter, final AnalysisStage enumeration) throws IOException { - jsonWriter.value(enumeration.getValue()); - } - - @Override - public AnalysisStage read(final JsonReader jsonReader) throws IOException { - String value = jsonReader.nextString(); - return AnalysisStage.fromValue(value); - } - } - - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - String value = jsonElement.getAsString(); - AnalysisStage.fromValue(value); - } -} - diff --git a/src/main/java/ai/reveng/model/AnalysisStageStatus.java b/src/main/java/ai/reveng/model/AnalysisStageStatus.java deleted file mode 100644 index e5b8785..0000000 --- a/src/main/java/ai/reveng/model/AnalysisStageStatus.java +++ /dev/null @@ -1,83 +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 java.util.Locale; -import com.google.gson.annotations.SerializedName; - -import java.io.IOException; -import java.util.Locale; -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 AnalysisStageStatus - */ -@JsonAdapter(AnalysisStageStatus.Adapter.class) -public enum AnalysisStageStatus { - - QUEUED("QUEUED"), - - STARTED("STARTED"), - - FINISHED("FINISHED"), - - ERROR("ERROR"); - - private String value; - - AnalysisStageStatus(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - public static AnalysisStageStatus fromValue(String value) { - for (AnalysisStageStatus b : AnalysisStageStatus.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - - public static class Adapter extends TypeAdapter { - @Override - public void write(final JsonWriter jsonWriter, final AnalysisStageStatus enumeration) throws IOException { - jsonWriter.value(enumeration.getValue()); - } - - @Override - public AnalysisStageStatus read(final JsonReader jsonReader) throws IOException { - String value = jsonReader.nextString(); - return AnalysisStageStatus.fromValue(value); - } - } - - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - String value = jsonElement.getAsString(); - AnalysisStageStatus.fromValue(value); - } -} - diff --git a/src/main/java/ai/reveng/model/AppApiRestV2AnalysesEnumsDynamicExecutionStatus.java b/src/main/java/ai/reveng/model/AppApiRestV2AnalysesEnumsDynamicExecutionStatus.java deleted file mode 100644 index bd5afd9..0000000 --- a/src/main/java/ai/reveng/model/AppApiRestV2AnalysesEnumsDynamicExecutionStatus.java +++ /dev/null @@ -1,83 +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 java.util.Locale; -import com.google.gson.annotations.SerializedName; - -import java.io.IOException; -import java.util.Locale; -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; - -/** - * Custom enum for the dynamic execution status - */ -@JsonAdapter(AppApiRestV2AnalysesEnumsDynamicExecutionStatus.Adapter.class) -public enum AppApiRestV2AnalysesEnumsDynamicExecutionStatus { - - PENDING("PENDING"), - - ERROR("ERROR"), - - SUCCESS("SUCCESS"), - - ALL("ALL"); - - private String value; - - AppApiRestV2AnalysesEnumsDynamicExecutionStatus(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - public static AppApiRestV2AnalysesEnumsDynamicExecutionStatus fromValue(String value) { - for (AppApiRestV2AnalysesEnumsDynamicExecutionStatus b : AppApiRestV2AnalysesEnumsDynamicExecutionStatus.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - - public static class Adapter extends TypeAdapter { - @Override - public void write(final JsonWriter jsonWriter, final AppApiRestV2AnalysesEnumsDynamicExecutionStatus enumeration) throws IOException { - jsonWriter.value(enumeration.getValue()); - } - - @Override - public AppApiRestV2AnalysesEnumsDynamicExecutionStatus read(final JsonReader jsonReader) throws IOException { - String value = jsonReader.nextString(); - return AppApiRestV2AnalysesEnumsDynamicExecutionStatus.fromValue(value); - } - } - - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - String value = jsonElement.getAsString(); - AppApiRestV2AnalysesEnumsDynamicExecutionStatus.fromValue(value); - } -} - diff --git a/src/main/java/ai/reveng/model/BaseResponseAnalysisStagesResponse.java b/src/main/java/ai/reveng/model/BaseResponseAnalysisStagesResponse.java deleted file mode 100644 index 362b400..0000000 --- a/src/main/java/ai/reveng/model/BaseResponseAnalysisStagesResponse.java +++ /dev/null @@ -1,438 +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 java.util.Locale; -import ai.reveng.model.AnalysisStagesResponse; -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; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; -import java.util.Locale; - -import ai.reveng.invoker.JSON; - -/** - * BaseResponseAnalysisStagesResponse - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class BaseResponseAnalysisStagesResponse { - 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 AnalysisStagesResponse data; - - 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) - @javax.annotation.Nullable - private List errors; - - public static final String SERIALIZED_NAME_META = "meta"; - @SerializedName(SERIALIZED_NAME_META) - @javax.annotation.Nullable - private MetaModel meta; - - public BaseResponseAnalysisStagesResponse() { - } - - public BaseResponseAnalysisStagesResponse status(@javax.annotation.Nullable Boolean status) { - this.status = status; - return this; - } - - /** - * Response status on whether the request succeeded - * @return status - */ - @javax.annotation.Nullable - public Boolean getStatus() { - return status; - } - - public void setStatus(@javax.annotation.Nullable Boolean status) { - this.status = status; - } - - - public BaseResponseAnalysisStagesResponse data(@javax.annotation.Nullable AnalysisStagesResponse data) { - this.data = data; - return this; - } - - /** - * Get data - * @return data - */ - @javax.annotation.Nullable - public AnalysisStagesResponse getData() { - return data; - } - - public void setData(@javax.annotation.Nullable AnalysisStagesResponse data) { - this.data = data; - } - - - public BaseResponseAnalysisStagesResponse 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 BaseResponseAnalysisStagesResponse errors(@javax.annotation.Nullable List errors) { - this.errors = errors; - return this; - } - - public BaseResponseAnalysisStagesResponse addErrorsItem(ErrorModel errorsItem) { - if (this.errors == null) { - this.errors = new ArrayList<>(); - } - this.errors.add(errorsItem); - return this; - } - - /** - * Get errors - * @return errors - */ - @javax.annotation.Nullable - public List getErrors() { - return errors; - } - - public void setErrors(@javax.annotation.Nullable List errors) { - this.errors = errors; - } - - - public BaseResponseAnalysisStagesResponse meta(@javax.annotation.Nullable MetaModel meta) { - this.meta = meta; - return this; - } - - /** - * Metadata - * @return meta - */ - @javax.annotation.Nullable - public MetaModel getMeta() { - return meta; - } - - public void setMeta(@javax.annotation.Nullable MetaModel meta) { - this.meta = meta; - } - - /** - * 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 BaseResponseAnalysisStagesResponse instance itself - */ - public BaseResponseAnalysisStagesResponse 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; - } - BaseResponseAnalysisStagesResponse baseResponseAnalysisStagesResponse = (BaseResponseAnalysisStagesResponse) o; - return Objects.equals(this.status, baseResponseAnalysisStagesResponse.status) && - Objects.equals(this.data, baseResponseAnalysisStagesResponse.data) && - Objects.equals(this.message, baseResponseAnalysisStagesResponse.message) && - Objects.equals(this.errors, baseResponseAnalysisStagesResponse.errors) && - Objects.equals(this.meta, baseResponseAnalysisStagesResponse.meta)&& - Objects.equals(this.additionalProperties, baseResponseAnalysisStagesResponse.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(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; - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class BaseResponseAnalysisStagesResponse {\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(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(Arrays.asList("status", "data", "message", "errors", "meta")); - - // 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 BaseResponseAnalysisStagesResponse - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!BaseResponseAnalysisStagesResponse.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format(Locale.ROOT, "The required field(s) %s in BaseResponseAnalysisStagesResponse is not found in the empty JSON string", BaseResponseAnalysisStagesResponse.openapiRequiredFields.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // validate the optional field `data` - if (jsonObj.get("data") != null && !jsonObj.get("data").isJsonNull()) { - AnalysisStagesResponse.validateJsonElement(jsonObj.get("data")); - } - if ((jsonObj.get("message") != null && !jsonObj.get("message").isJsonNull()) && !jsonObj.get("message").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format(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(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 optional field `meta` - if (jsonObj.get("meta") != null && !jsonObj.get("meta").isJsonNull()) { - MetaModel.validateJsonElement(jsonObj.get("meta")); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!BaseResponseAnalysisStagesResponse.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'BaseResponseAnalysisStagesResponse' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(BaseResponseAnalysisStagesResponse.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, BaseResponseAnalysisStagesResponse 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 BaseResponseAnalysisStagesResponse read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // store additional fields in the deserialized instance - BaseResponseAnalysisStagesResponse instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format(Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else if (entry.getValue().isJsonArray()) { - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); - } else { // JSON object - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; - } - - }.nullSafe(); - } - } - - /** - * Create an instance of BaseResponseAnalysisStagesResponse given an JSON string - * - * @param jsonString JSON string - * @return An instance of BaseResponseAnalysisStagesResponse - * @throws IOException if the JSON string is invalid with respect to BaseResponseAnalysisStagesResponse - */ - public static BaseResponseAnalysisStagesResponse fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, BaseResponseAnalysisStagesResponse.class); - } - - /** - * Convert an instance of BaseResponseAnalysisStagesResponse to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/ai/reveng/model/BaseResponseDynamicExecutionStatus.java b/src/main/java/ai/reveng/model/BaseResponseDynamicExecutionStatus.java deleted file mode 100644 index 1a9ad05..0000000 --- a/src/main/java/ai/reveng/model/BaseResponseDynamicExecutionStatus.java +++ /dev/null @@ -1,438 +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 java.util.Locale; -import ai.reveng.model.AppServicesDynamicExecutionSchemasDynamicExecutionStatus; -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; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; -import java.util.Locale; - -import ai.reveng.invoker.JSON; - -/** - * BaseResponseDynamicExecutionStatus - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class BaseResponseDynamicExecutionStatus { - 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 AppServicesDynamicExecutionSchemasDynamicExecutionStatus data; - - 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) - @javax.annotation.Nullable - private List errors; - - public static final String SERIALIZED_NAME_META = "meta"; - @SerializedName(SERIALIZED_NAME_META) - @javax.annotation.Nullable - private MetaModel meta; - - public BaseResponseDynamicExecutionStatus() { - } - - public BaseResponseDynamicExecutionStatus status(@javax.annotation.Nullable Boolean status) { - this.status = status; - return this; - } - - /** - * Response status on whether the request succeeded - * @return status - */ - @javax.annotation.Nullable - public Boolean getStatus() { - return status; - } - - public void setStatus(@javax.annotation.Nullable Boolean status) { - this.status = status; - } - - - public BaseResponseDynamicExecutionStatus data(@javax.annotation.Nullable AppServicesDynamicExecutionSchemasDynamicExecutionStatus data) { - this.data = data; - return this; - } - - /** - * Get data - * @return data - */ - @javax.annotation.Nullable - public AppServicesDynamicExecutionSchemasDynamicExecutionStatus getData() { - return data; - } - - public void setData(@javax.annotation.Nullable AppServicesDynamicExecutionSchemasDynamicExecutionStatus data) { - this.data = data; - } - - - public BaseResponseDynamicExecutionStatus 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 BaseResponseDynamicExecutionStatus errors(@javax.annotation.Nullable List errors) { - this.errors = errors; - return this; - } - - public BaseResponseDynamicExecutionStatus addErrorsItem(ErrorModel errorsItem) { - if (this.errors == null) { - this.errors = new ArrayList<>(); - } - this.errors.add(errorsItem); - return this; - } - - /** - * Get errors - * @return errors - */ - @javax.annotation.Nullable - public List getErrors() { - return errors; - } - - public void setErrors(@javax.annotation.Nullable List errors) { - this.errors = errors; - } - - - public BaseResponseDynamicExecutionStatus meta(@javax.annotation.Nullable MetaModel meta) { - this.meta = meta; - return this; - } - - /** - * Metadata - * @return meta - */ - @javax.annotation.Nullable - public MetaModel getMeta() { - return meta; - } - - public void setMeta(@javax.annotation.Nullable MetaModel meta) { - this.meta = meta; - } - - /** - * 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 BaseResponseDynamicExecutionStatus instance itself - */ - public BaseResponseDynamicExecutionStatus 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; - } - BaseResponseDynamicExecutionStatus baseResponseDynamicExecutionStatus = (BaseResponseDynamicExecutionStatus) o; - return Objects.equals(this.status, baseResponseDynamicExecutionStatus.status) && - Objects.equals(this.data, baseResponseDynamicExecutionStatus.data) && - Objects.equals(this.message, baseResponseDynamicExecutionStatus.message) && - Objects.equals(this.errors, baseResponseDynamicExecutionStatus.errors) && - Objects.equals(this.meta, baseResponseDynamicExecutionStatus.meta)&& - Objects.equals(this.additionalProperties, baseResponseDynamicExecutionStatus.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(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; - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class BaseResponseDynamicExecutionStatus {\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(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(Arrays.asList("status", "data", "message", "errors", "meta")); - - // 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 BaseResponseDynamicExecutionStatus - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!BaseResponseDynamicExecutionStatus.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format(Locale.ROOT, "The required field(s) %s in BaseResponseDynamicExecutionStatus is not found in the empty JSON string", BaseResponseDynamicExecutionStatus.openapiRequiredFields.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // validate the optional field `data` - if (jsonObj.get("data") != null && !jsonObj.get("data").isJsonNull()) { - AppServicesDynamicExecutionSchemasDynamicExecutionStatus.validateJsonElement(jsonObj.get("data")); - } - if ((jsonObj.get("message") != null && !jsonObj.get("message").isJsonNull()) && !jsonObj.get("message").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format(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(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 optional field `meta` - if (jsonObj.get("meta") != null && !jsonObj.get("meta").isJsonNull()) { - MetaModel.validateJsonElement(jsonObj.get("meta")); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!BaseResponseDynamicExecutionStatus.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'BaseResponseDynamicExecutionStatus' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(BaseResponseDynamicExecutionStatus.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, BaseResponseDynamicExecutionStatus 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 BaseResponseDynamicExecutionStatus read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // store additional fields in the deserialized instance - BaseResponseDynamicExecutionStatus instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format(Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else if (entry.getValue().isJsonArray()) { - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); - } else { // JSON object - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; - } - - }.nullSafe(); - } - } - - /** - * Create an instance of BaseResponseDynamicExecutionStatus given an JSON string - * - * @param jsonString JSON string - * @return An instance of BaseResponseDynamicExecutionStatus - * @throws IOException if the JSON string is invalid with respect to BaseResponseDynamicExecutionStatus - */ - public static BaseResponseDynamicExecutionStatus fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, BaseResponseDynamicExecutionStatus.class); - } - - /** - * Convert an instance of BaseResponseDynamicExecutionStatus to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/ai/reveng/model/BaseResponseNetworkOverviewResponse.java b/src/main/java/ai/reveng/model/BaseResponseNetworkOverviewResponse.java deleted file mode 100644 index 42d92e6..0000000 --- a/src/main/java/ai/reveng/model/BaseResponseNetworkOverviewResponse.java +++ /dev/null @@ -1,438 +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 java.util.Locale; -import ai.reveng.model.ErrorModel; -import ai.reveng.model.MetaModel; -import ai.reveng.model.NetworkOverviewResponse; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; -import org.openapitools.jackson.nullable.JsonNullable; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; -import java.util.Locale; - -import ai.reveng.invoker.JSON; - -/** - * BaseResponseNetworkOverviewResponse - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class BaseResponseNetworkOverviewResponse { - 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 NetworkOverviewResponse data; - - 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) - @javax.annotation.Nullable - private List errors; - - public static final String SERIALIZED_NAME_META = "meta"; - @SerializedName(SERIALIZED_NAME_META) - @javax.annotation.Nullable - private MetaModel meta; - - public BaseResponseNetworkOverviewResponse() { - } - - public BaseResponseNetworkOverviewResponse status(@javax.annotation.Nullable Boolean status) { - this.status = status; - return this; - } - - /** - * Response status on whether the request succeeded - * @return status - */ - @javax.annotation.Nullable - public Boolean getStatus() { - return status; - } - - public void setStatus(@javax.annotation.Nullable Boolean status) { - this.status = status; - } - - - public BaseResponseNetworkOverviewResponse data(@javax.annotation.Nullable NetworkOverviewResponse data) { - this.data = data; - return this; - } - - /** - * Get data - * @return data - */ - @javax.annotation.Nullable - public NetworkOverviewResponse getData() { - return data; - } - - public void setData(@javax.annotation.Nullable NetworkOverviewResponse data) { - this.data = data; - } - - - public BaseResponseNetworkOverviewResponse 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 BaseResponseNetworkOverviewResponse errors(@javax.annotation.Nullable List errors) { - this.errors = errors; - return this; - } - - public BaseResponseNetworkOverviewResponse addErrorsItem(ErrorModel errorsItem) { - if (this.errors == null) { - this.errors = new ArrayList<>(); - } - this.errors.add(errorsItem); - return this; - } - - /** - * Get errors - * @return errors - */ - @javax.annotation.Nullable - public List getErrors() { - return errors; - } - - public void setErrors(@javax.annotation.Nullable List errors) { - this.errors = errors; - } - - - public BaseResponseNetworkOverviewResponse meta(@javax.annotation.Nullable MetaModel meta) { - this.meta = meta; - return this; - } - - /** - * Metadata - * @return meta - */ - @javax.annotation.Nullable - public MetaModel getMeta() { - return meta; - } - - public void setMeta(@javax.annotation.Nullable MetaModel meta) { - this.meta = meta; - } - - /** - * 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 BaseResponseNetworkOverviewResponse instance itself - */ - public BaseResponseNetworkOverviewResponse 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; - } - BaseResponseNetworkOverviewResponse baseResponseNetworkOverviewResponse = (BaseResponseNetworkOverviewResponse) o; - return Objects.equals(this.status, baseResponseNetworkOverviewResponse.status) && - Objects.equals(this.data, baseResponseNetworkOverviewResponse.data) && - Objects.equals(this.message, baseResponseNetworkOverviewResponse.message) && - Objects.equals(this.errors, baseResponseNetworkOverviewResponse.errors) && - Objects.equals(this.meta, baseResponseNetworkOverviewResponse.meta)&& - Objects.equals(this.additionalProperties, baseResponseNetworkOverviewResponse.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(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; - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class BaseResponseNetworkOverviewResponse {\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(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(Arrays.asList("status", "data", "message", "errors", "meta")); - - // 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 BaseResponseNetworkOverviewResponse - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!BaseResponseNetworkOverviewResponse.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format(Locale.ROOT, "The required field(s) %s in BaseResponseNetworkOverviewResponse is not found in the empty JSON string", BaseResponseNetworkOverviewResponse.openapiRequiredFields.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // validate the optional field `data` - if (jsonObj.get("data") != null && !jsonObj.get("data").isJsonNull()) { - NetworkOverviewResponse.validateJsonElement(jsonObj.get("data")); - } - if ((jsonObj.get("message") != null && !jsonObj.get("message").isJsonNull()) && !jsonObj.get("message").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format(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(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 optional field `meta` - if (jsonObj.get("meta") != null && !jsonObj.get("meta").isJsonNull()) { - MetaModel.validateJsonElement(jsonObj.get("meta")); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!BaseResponseNetworkOverviewResponse.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'BaseResponseNetworkOverviewResponse' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(BaseResponseNetworkOverviewResponse.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, BaseResponseNetworkOverviewResponse 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 BaseResponseNetworkOverviewResponse read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // store additional fields in the deserialized instance - BaseResponseNetworkOverviewResponse instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format(Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else if (entry.getValue().isJsonArray()) { - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); - } else { // JSON object - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; - } - - }.nullSafe(); - } - } - - /** - * Create an instance of BaseResponseNetworkOverviewResponse given an JSON string - * - * @param jsonString JSON string - * @return An instance of BaseResponseNetworkOverviewResponse - * @throws IOException if the JSON string is invalid with respect to BaseResponseNetworkOverviewResponse - */ - public static BaseResponseNetworkOverviewResponse fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, BaseResponseNetworkOverviewResponse.class); - } - - /** - * Convert an instance of BaseResponseNetworkOverviewResponse to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/ai/reveng/model/BaseResponsePipelineStatusResponse.java b/src/main/java/ai/reveng/model/BaseResponsePipelineStatusResponse.java deleted file mode 100644 index 2e41aaa..0000000 --- a/src/main/java/ai/reveng/model/BaseResponsePipelineStatusResponse.java +++ /dev/null @@ -1,438 +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 java.util.Locale; -import ai.reveng.model.ErrorModel; -import ai.reveng.model.MetaModel; -import ai.reveng.model.PipelineStatusResponse; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; -import org.openapitools.jackson.nullable.JsonNullable; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; -import java.util.Locale; - -import ai.reveng.invoker.JSON; - -/** - * BaseResponsePipelineStatusResponse - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class BaseResponsePipelineStatusResponse { - 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 PipelineStatusResponse data; - - 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) - @javax.annotation.Nullable - private List errors; - - public static final String SERIALIZED_NAME_META = "meta"; - @SerializedName(SERIALIZED_NAME_META) - @javax.annotation.Nullable - private MetaModel meta; - - public BaseResponsePipelineStatusResponse() { - } - - public BaseResponsePipelineStatusResponse status(@javax.annotation.Nullable Boolean status) { - this.status = status; - return this; - } - - /** - * Response status on whether the request succeeded - * @return status - */ - @javax.annotation.Nullable - public Boolean getStatus() { - return status; - } - - public void setStatus(@javax.annotation.Nullable Boolean status) { - this.status = status; - } - - - public BaseResponsePipelineStatusResponse data(@javax.annotation.Nullable PipelineStatusResponse data) { - this.data = data; - return this; - } - - /** - * Get data - * @return data - */ - @javax.annotation.Nullable - public PipelineStatusResponse getData() { - return data; - } - - public void setData(@javax.annotation.Nullable PipelineStatusResponse data) { - this.data = data; - } - - - public BaseResponsePipelineStatusResponse 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 BaseResponsePipelineStatusResponse errors(@javax.annotation.Nullable List errors) { - this.errors = errors; - return this; - } - - public BaseResponsePipelineStatusResponse addErrorsItem(ErrorModel errorsItem) { - if (this.errors == null) { - this.errors = new ArrayList<>(); - } - this.errors.add(errorsItem); - return this; - } - - /** - * Get errors - * @return errors - */ - @javax.annotation.Nullable - public List getErrors() { - return errors; - } - - public void setErrors(@javax.annotation.Nullable List errors) { - this.errors = errors; - } - - - public BaseResponsePipelineStatusResponse meta(@javax.annotation.Nullable MetaModel meta) { - this.meta = meta; - return this; - } - - /** - * Metadata - * @return meta - */ - @javax.annotation.Nullable - public MetaModel getMeta() { - return meta; - } - - public void setMeta(@javax.annotation.Nullable MetaModel meta) { - this.meta = meta; - } - - /** - * 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 BaseResponsePipelineStatusResponse instance itself - */ - public BaseResponsePipelineStatusResponse 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; - } - BaseResponsePipelineStatusResponse baseResponsePipelineStatusResponse = (BaseResponsePipelineStatusResponse) o; - return Objects.equals(this.status, baseResponsePipelineStatusResponse.status) && - Objects.equals(this.data, baseResponsePipelineStatusResponse.data) && - Objects.equals(this.message, baseResponsePipelineStatusResponse.message) && - Objects.equals(this.errors, baseResponsePipelineStatusResponse.errors) && - Objects.equals(this.meta, baseResponsePipelineStatusResponse.meta)&& - Objects.equals(this.additionalProperties, baseResponsePipelineStatusResponse.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(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; - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class BaseResponsePipelineStatusResponse {\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(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(Arrays.asList("status", "data", "message", "errors", "meta")); - - // 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 BaseResponsePipelineStatusResponse - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!BaseResponsePipelineStatusResponse.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format(Locale.ROOT, "The required field(s) %s in BaseResponsePipelineStatusResponse is not found in the empty JSON string", BaseResponsePipelineStatusResponse.openapiRequiredFields.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // validate the optional field `data` - if (jsonObj.get("data") != null && !jsonObj.get("data").isJsonNull()) { - PipelineStatusResponse.validateJsonElement(jsonObj.get("data")); - } - if ((jsonObj.get("message") != null && !jsonObj.get("message").isJsonNull()) && !jsonObj.get("message").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format(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(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 optional field `meta` - if (jsonObj.get("meta") != null && !jsonObj.get("meta").isJsonNull()) { - MetaModel.validateJsonElement(jsonObj.get("meta")); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!BaseResponsePipelineStatusResponse.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'BaseResponsePipelineStatusResponse' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(BaseResponsePipelineStatusResponse.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, BaseResponsePipelineStatusResponse 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 BaseResponsePipelineStatusResponse read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // store additional fields in the deserialized instance - BaseResponsePipelineStatusResponse instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format(Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else if (entry.getValue().isJsonArray()) { - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); - } else { // JSON object - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; - } - - }.nullSafe(); - } - } - - /** - * Create an instance of BaseResponsePipelineStatusResponse given an JSON string - * - * @param jsonString JSON string - * @return An instance of BaseResponsePipelineStatusResponse - * @throws IOException if the JSON string is invalid with respect to BaseResponsePipelineStatusResponse - */ - public static BaseResponsePipelineStatusResponse fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, BaseResponsePipelineStatusResponse.class); - } - - /** - * Convert an instance of BaseResponsePipelineStatusResponse to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/ai/reveng/model/BaseResponseProcessDumps.java b/src/main/java/ai/reveng/model/BaseResponseProcessDumps.java deleted file mode 100644 index 35a5471..0000000 --- a/src/main/java/ai/reveng/model/BaseResponseProcessDumps.java +++ /dev/null @@ -1,438 +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 java.util.Locale; -import ai.reveng.model.ErrorModel; -import ai.reveng.model.MetaModel; -import ai.reveng.model.ProcessDumps; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; -import org.openapitools.jackson.nullable.JsonNullable; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; -import java.util.Locale; - -import ai.reveng.invoker.JSON; - -/** - * BaseResponseProcessDumps - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class BaseResponseProcessDumps { - 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 ProcessDumps data; - - 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) - @javax.annotation.Nullable - private List errors; - - public static final String SERIALIZED_NAME_META = "meta"; - @SerializedName(SERIALIZED_NAME_META) - @javax.annotation.Nullable - private MetaModel meta; - - public BaseResponseProcessDumps() { - } - - public BaseResponseProcessDumps status(@javax.annotation.Nullable Boolean status) { - this.status = status; - return this; - } - - /** - * Response status on whether the request succeeded - * @return status - */ - @javax.annotation.Nullable - public Boolean getStatus() { - return status; - } - - public void setStatus(@javax.annotation.Nullable Boolean status) { - this.status = status; - } - - - public BaseResponseProcessDumps data(@javax.annotation.Nullable ProcessDumps data) { - this.data = data; - return this; - } - - /** - * Get data - * @return data - */ - @javax.annotation.Nullable - public ProcessDumps getData() { - return data; - } - - public void setData(@javax.annotation.Nullable ProcessDumps data) { - this.data = data; - } - - - public BaseResponseProcessDumps 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 BaseResponseProcessDumps errors(@javax.annotation.Nullable List errors) { - this.errors = errors; - return this; - } - - public BaseResponseProcessDumps addErrorsItem(ErrorModel errorsItem) { - if (this.errors == null) { - this.errors = new ArrayList<>(); - } - this.errors.add(errorsItem); - return this; - } - - /** - * Get errors - * @return errors - */ - @javax.annotation.Nullable - public List getErrors() { - return errors; - } - - public void setErrors(@javax.annotation.Nullable List errors) { - this.errors = errors; - } - - - public BaseResponseProcessDumps meta(@javax.annotation.Nullable MetaModel meta) { - this.meta = meta; - return this; - } - - /** - * Metadata - * @return meta - */ - @javax.annotation.Nullable - public MetaModel getMeta() { - return meta; - } - - public void setMeta(@javax.annotation.Nullable MetaModel meta) { - this.meta = meta; - } - - /** - * 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 BaseResponseProcessDumps instance itself - */ - public BaseResponseProcessDumps 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; - } - BaseResponseProcessDumps baseResponseProcessDumps = (BaseResponseProcessDumps) o; - return Objects.equals(this.status, baseResponseProcessDumps.status) && - Objects.equals(this.data, baseResponseProcessDumps.data) && - Objects.equals(this.message, baseResponseProcessDumps.message) && - Objects.equals(this.errors, baseResponseProcessDumps.errors) && - Objects.equals(this.meta, baseResponseProcessDumps.meta)&& - Objects.equals(this.additionalProperties, baseResponseProcessDumps.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(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; - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class BaseResponseProcessDumps {\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(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(Arrays.asList("status", "data", "message", "errors", "meta")); - - // 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 BaseResponseProcessDumps - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!BaseResponseProcessDumps.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format(Locale.ROOT, "The required field(s) %s in BaseResponseProcessDumps is not found in the empty JSON string", BaseResponseProcessDumps.openapiRequiredFields.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // validate the optional field `data` - if (jsonObj.get("data") != null && !jsonObj.get("data").isJsonNull()) { - ProcessDumps.validateJsonElement(jsonObj.get("data")); - } - if ((jsonObj.get("message") != null && !jsonObj.get("message").isJsonNull()) && !jsonObj.get("message").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format(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(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 optional field `meta` - if (jsonObj.get("meta") != null && !jsonObj.get("meta").isJsonNull()) { - MetaModel.validateJsonElement(jsonObj.get("meta")); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!BaseResponseProcessDumps.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'BaseResponseProcessDumps' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(BaseResponseProcessDumps.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, BaseResponseProcessDumps 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 BaseResponseProcessDumps read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // store additional fields in the deserialized instance - BaseResponseProcessDumps instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format(Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else if (entry.getValue().isJsonArray()) { - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); - } else { // JSON object - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; - } - - }.nullSafe(); - } - } - - /** - * Create an instance of BaseResponseProcessDumps given an JSON string - * - * @param jsonString JSON string - * @return An instance of BaseResponseProcessDumps - * @throws IOException if the JSON string is invalid with respect to BaseResponseProcessDumps - */ - public static BaseResponseProcessDumps fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, BaseResponseProcessDumps.class); - } - - /** - * Convert an instance of BaseResponseProcessDumps to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/ai/reveng/model/BaseResponseProcessRegistry.java b/src/main/java/ai/reveng/model/BaseResponseProcessRegistry.java deleted file mode 100644 index c9704d3..0000000 --- a/src/main/java/ai/reveng/model/BaseResponseProcessRegistry.java +++ /dev/null @@ -1,438 +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 java.util.Locale; -import ai.reveng.model.ErrorModel; -import ai.reveng.model.MetaModel; -import ai.reveng.model.ProcessRegistry; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; -import org.openapitools.jackson.nullable.JsonNullable; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; -import java.util.Locale; - -import ai.reveng.invoker.JSON; - -/** - * BaseResponseProcessRegistry - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class BaseResponseProcessRegistry { - 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 ProcessRegistry data; - - 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) - @javax.annotation.Nullable - private List errors; - - public static final String SERIALIZED_NAME_META = "meta"; - @SerializedName(SERIALIZED_NAME_META) - @javax.annotation.Nullable - private MetaModel meta; - - public BaseResponseProcessRegistry() { - } - - public BaseResponseProcessRegistry status(@javax.annotation.Nullable Boolean status) { - this.status = status; - return this; - } - - /** - * Response status on whether the request succeeded - * @return status - */ - @javax.annotation.Nullable - public Boolean getStatus() { - return status; - } - - public void setStatus(@javax.annotation.Nullable Boolean status) { - this.status = status; - } - - - public BaseResponseProcessRegistry data(@javax.annotation.Nullable ProcessRegistry data) { - this.data = data; - return this; - } - - /** - * Get data - * @return data - */ - @javax.annotation.Nullable - public ProcessRegistry getData() { - return data; - } - - public void setData(@javax.annotation.Nullable ProcessRegistry data) { - this.data = data; - } - - - public BaseResponseProcessRegistry 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 BaseResponseProcessRegistry errors(@javax.annotation.Nullable List errors) { - this.errors = errors; - return this; - } - - public BaseResponseProcessRegistry addErrorsItem(ErrorModel errorsItem) { - if (this.errors == null) { - this.errors = new ArrayList<>(); - } - this.errors.add(errorsItem); - return this; - } - - /** - * Get errors - * @return errors - */ - @javax.annotation.Nullable - public List getErrors() { - return errors; - } - - public void setErrors(@javax.annotation.Nullable List errors) { - this.errors = errors; - } - - - public BaseResponseProcessRegistry meta(@javax.annotation.Nullable MetaModel meta) { - this.meta = meta; - return this; - } - - /** - * Metadata - * @return meta - */ - @javax.annotation.Nullable - public MetaModel getMeta() { - return meta; - } - - public void setMeta(@javax.annotation.Nullable MetaModel meta) { - this.meta = meta; - } - - /** - * 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 BaseResponseProcessRegistry instance itself - */ - public BaseResponseProcessRegistry 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; - } - BaseResponseProcessRegistry baseResponseProcessRegistry = (BaseResponseProcessRegistry) o; - return Objects.equals(this.status, baseResponseProcessRegistry.status) && - Objects.equals(this.data, baseResponseProcessRegistry.data) && - Objects.equals(this.message, baseResponseProcessRegistry.message) && - Objects.equals(this.errors, baseResponseProcessRegistry.errors) && - Objects.equals(this.meta, baseResponseProcessRegistry.meta)&& - Objects.equals(this.additionalProperties, baseResponseProcessRegistry.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(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; - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class BaseResponseProcessRegistry {\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(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(Arrays.asList("status", "data", "message", "errors", "meta")); - - // 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 BaseResponseProcessRegistry - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!BaseResponseProcessRegistry.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format(Locale.ROOT, "The required field(s) %s in BaseResponseProcessRegistry is not found in the empty JSON string", BaseResponseProcessRegistry.openapiRequiredFields.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // validate the optional field `data` - if (jsonObj.get("data") != null && !jsonObj.get("data").isJsonNull()) { - ProcessRegistry.validateJsonElement(jsonObj.get("data")); - } - if ((jsonObj.get("message") != null && !jsonObj.get("message").isJsonNull()) && !jsonObj.get("message").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format(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(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 optional field `meta` - if (jsonObj.get("meta") != null && !jsonObj.get("meta").isJsonNull()) { - MetaModel.validateJsonElement(jsonObj.get("meta")); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!BaseResponseProcessRegistry.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'BaseResponseProcessRegistry' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(BaseResponseProcessRegistry.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, BaseResponseProcessRegistry 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 BaseResponseProcessRegistry read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // store additional fields in the deserialized instance - BaseResponseProcessRegistry instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format(Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else if (entry.getValue().isJsonArray()) { - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); - } else { // JSON object - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; - } - - }.nullSafe(); - } - } - - /** - * Create an instance of BaseResponseProcessRegistry given an JSON string - * - * @param jsonString JSON string - * @return An instance of BaseResponseProcessRegistry - * @throws IOException if the JSON string is invalid with respect to BaseResponseProcessRegistry - */ - public static BaseResponseProcessRegistry fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, BaseResponseProcessRegistry.class); - } - - /** - * Convert an instance of BaseResponseProcessRegistry to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/ai/reveng/model/BaseResponseProcessTree.java b/src/main/java/ai/reveng/model/BaseResponseProcessTree.java deleted file mode 100644 index 8cc1e97..0000000 --- a/src/main/java/ai/reveng/model/BaseResponseProcessTree.java +++ /dev/null @@ -1,438 +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 java.util.Locale; -import ai.reveng.model.ErrorModel; -import ai.reveng.model.MetaModel; -import ai.reveng.model.ProcessTree; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; -import org.openapitools.jackson.nullable.JsonNullable; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; -import java.util.Locale; - -import ai.reveng.invoker.JSON; - -/** - * BaseResponseProcessTree - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class BaseResponseProcessTree { - 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 ProcessTree data; - - 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) - @javax.annotation.Nullable - private List errors; - - public static final String SERIALIZED_NAME_META = "meta"; - @SerializedName(SERIALIZED_NAME_META) - @javax.annotation.Nullable - private MetaModel meta; - - public BaseResponseProcessTree() { - } - - public BaseResponseProcessTree status(@javax.annotation.Nullable Boolean status) { - this.status = status; - return this; - } - - /** - * Response status on whether the request succeeded - * @return status - */ - @javax.annotation.Nullable - public Boolean getStatus() { - return status; - } - - public void setStatus(@javax.annotation.Nullable Boolean status) { - this.status = status; - } - - - public BaseResponseProcessTree data(@javax.annotation.Nullable ProcessTree data) { - this.data = data; - return this; - } - - /** - * Get data - * @return data - */ - @javax.annotation.Nullable - public ProcessTree getData() { - return data; - } - - public void setData(@javax.annotation.Nullable ProcessTree data) { - this.data = data; - } - - - public BaseResponseProcessTree 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 BaseResponseProcessTree errors(@javax.annotation.Nullable List errors) { - this.errors = errors; - return this; - } - - public BaseResponseProcessTree addErrorsItem(ErrorModel errorsItem) { - if (this.errors == null) { - this.errors = new ArrayList<>(); - } - this.errors.add(errorsItem); - return this; - } - - /** - * Get errors - * @return errors - */ - @javax.annotation.Nullable - public List getErrors() { - return errors; - } - - public void setErrors(@javax.annotation.Nullable List errors) { - this.errors = errors; - } - - - public BaseResponseProcessTree meta(@javax.annotation.Nullable MetaModel meta) { - this.meta = meta; - return this; - } - - /** - * Metadata - * @return meta - */ - @javax.annotation.Nullable - public MetaModel getMeta() { - return meta; - } - - public void setMeta(@javax.annotation.Nullable MetaModel meta) { - this.meta = meta; - } - - /** - * 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 BaseResponseProcessTree instance itself - */ - public BaseResponseProcessTree 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; - } - BaseResponseProcessTree baseResponseProcessTree = (BaseResponseProcessTree) o; - return Objects.equals(this.status, baseResponseProcessTree.status) && - Objects.equals(this.data, baseResponseProcessTree.data) && - Objects.equals(this.message, baseResponseProcessTree.message) && - Objects.equals(this.errors, baseResponseProcessTree.errors) && - Objects.equals(this.meta, baseResponseProcessTree.meta)&& - Objects.equals(this.additionalProperties, baseResponseProcessTree.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(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; - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class BaseResponseProcessTree {\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(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(Arrays.asList("status", "data", "message", "errors", "meta")); - - // 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 BaseResponseProcessTree - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!BaseResponseProcessTree.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format(Locale.ROOT, "The required field(s) %s in BaseResponseProcessTree is not found in the empty JSON string", BaseResponseProcessTree.openapiRequiredFields.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // validate the optional field `data` - if (jsonObj.get("data") != null && !jsonObj.get("data").isJsonNull()) { - ProcessTree.validateJsonElement(jsonObj.get("data")); - } - if ((jsonObj.get("message") != null && !jsonObj.get("message").isJsonNull()) && !jsonObj.get("message").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format(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(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 optional field `meta` - if (jsonObj.get("meta") != null && !jsonObj.get("meta").isJsonNull()) { - MetaModel.validateJsonElement(jsonObj.get("meta")); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!BaseResponseProcessTree.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'BaseResponseProcessTree' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(BaseResponseProcessTree.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, BaseResponseProcessTree 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 BaseResponseProcessTree read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // store additional fields in the deserialized instance - BaseResponseProcessTree instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format(Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else if (entry.getValue().isJsonArray()) { - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); - } else { // JSON object - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; - } - - }.nullSafe(); - } - } - - /** - * Create an instance of BaseResponseProcessTree given an JSON string - * - * @param jsonString JSON string - * @return An instance of BaseResponseProcessTree - * @throws IOException if the JSON string is invalid with respect to BaseResponseProcessTree - */ - public static BaseResponseProcessTree fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, BaseResponseProcessTree.class); - } - - /** - * Convert an instance of BaseResponseProcessTree to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/ai/reveng/model/BaseResponseTTPS.java b/src/main/java/ai/reveng/model/BaseResponseTTPS.java deleted file mode 100644 index 3911ea2..0000000 --- a/src/main/java/ai/reveng/model/BaseResponseTTPS.java +++ /dev/null @@ -1,438 +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 java.util.Locale; -import ai.reveng.model.ErrorModel; -import ai.reveng.model.MetaModel; -import ai.reveng.model.TTPS; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; -import org.openapitools.jackson.nullable.JsonNullable; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; -import java.util.Locale; - -import ai.reveng.invoker.JSON; - -/** - * BaseResponseTTPS - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class BaseResponseTTPS { - 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 TTPS data; - - 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) - @javax.annotation.Nullable - private List errors; - - public static final String SERIALIZED_NAME_META = "meta"; - @SerializedName(SERIALIZED_NAME_META) - @javax.annotation.Nullable - private MetaModel meta; - - public BaseResponseTTPS() { - } - - public BaseResponseTTPS status(@javax.annotation.Nullable Boolean status) { - this.status = status; - return this; - } - - /** - * Response status on whether the request succeeded - * @return status - */ - @javax.annotation.Nullable - public Boolean getStatus() { - return status; - } - - public void setStatus(@javax.annotation.Nullable Boolean status) { - this.status = status; - } - - - public BaseResponseTTPS data(@javax.annotation.Nullable TTPS data) { - this.data = data; - return this; - } - - /** - * Get data - * @return data - */ - @javax.annotation.Nullable - public TTPS getData() { - return data; - } - - public void setData(@javax.annotation.Nullable TTPS data) { - this.data = data; - } - - - public BaseResponseTTPS 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 BaseResponseTTPS errors(@javax.annotation.Nullable List errors) { - this.errors = errors; - return this; - } - - public BaseResponseTTPS addErrorsItem(ErrorModel errorsItem) { - if (this.errors == null) { - this.errors = new ArrayList<>(); - } - this.errors.add(errorsItem); - return this; - } - - /** - * Get errors - * @return errors - */ - @javax.annotation.Nullable - public List getErrors() { - return errors; - } - - public void setErrors(@javax.annotation.Nullable List errors) { - this.errors = errors; - } - - - public BaseResponseTTPS meta(@javax.annotation.Nullable MetaModel meta) { - this.meta = meta; - return this; - } - - /** - * Metadata - * @return meta - */ - @javax.annotation.Nullable - public MetaModel getMeta() { - return meta; - } - - public void setMeta(@javax.annotation.Nullable MetaModel meta) { - this.meta = meta; - } - - /** - * 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 BaseResponseTTPS instance itself - */ - public BaseResponseTTPS 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; - } - BaseResponseTTPS baseResponseTTPS = (BaseResponseTTPS) o; - return Objects.equals(this.status, baseResponseTTPS.status) && - Objects.equals(this.data, baseResponseTTPS.data) && - Objects.equals(this.message, baseResponseTTPS.message) && - Objects.equals(this.errors, baseResponseTTPS.errors) && - Objects.equals(this.meta, baseResponseTTPS.meta)&& - Objects.equals(this.additionalProperties, baseResponseTTPS.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(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; - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class BaseResponseTTPS {\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(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(Arrays.asList("status", "data", "message", "errors", "meta")); - - // 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 BaseResponseTTPS - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!BaseResponseTTPS.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format(Locale.ROOT, "The required field(s) %s in BaseResponseTTPS is not found in the empty JSON string", BaseResponseTTPS.openapiRequiredFields.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // validate the optional field `data` - if (jsonObj.get("data") != null && !jsonObj.get("data").isJsonNull()) { - TTPS.validateJsonElement(jsonObj.get("data")); - } - if ((jsonObj.get("message") != null && !jsonObj.get("message").isJsonNull()) && !jsonObj.get("message").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format(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(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 optional field `meta` - if (jsonObj.get("meta") != null && !jsonObj.get("meta").isJsonNull()) { - MetaModel.validateJsonElement(jsonObj.get("meta")); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!BaseResponseTTPS.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'BaseResponseTTPS' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(BaseResponseTTPS.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, BaseResponseTTPS 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 BaseResponseTTPS read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // store additional fields in the deserialized instance - BaseResponseTTPS instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format(Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else if (entry.getValue().isJsonArray()) { - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); - } else { // JSON object - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; - } - - }.nullSafe(); - } - } - - /** - * Create an instance of BaseResponseTTPS given an JSON string - * - * @param jsonString JSON string - * @return An instance of BaseResponseTTPS - * @throws IOException if the JSON string is invalid with respect to BaseResponseTTPS - */ - public static BaseResponseTTPS fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, BaseResponseTTPS.class); - } - - /** - * Convert an instance of BaseResponseTTPS to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/ai/reveng/model/TTPSAttack.java b/src/main/java/ai/reveng/model/ConfirmToolInputBody.java similarity index 71% rename from src/main/java/ai/reveng/model/TTPSAttack.java rename to src/main/java/ai/reveng/model/ConfirmToolInputBody.java index 8bf7da2..75fe836 100644 --- a/src/main/java/ai/reveng/model/TTPSAttack.java +++ b/src/main/java/ai/reveng/model/ConfirmToolInputBody.java @@ -20,6 +20,7 @@ import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import java.io.IOException; +import java.net.URI; import java.util.Arrays; import com.google.gson.Gson; @@ -47,58 +48,57 @@ import ai.reveng.invoker.JSON; /** - * TTPSAttack + * ConfirmToolInputBody */ @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class TTPSAttack { - public static final String SERIALIZED_NAME_ID = "id"; - @SerializedName(SERIALIZED_NAME_ID) +public class ConfirmToolInputBody { + public static final String SERIALIZED_NAME_$_SCHEMA = "$schema"; + @SerializedName(SERIALIZED_NAME_$_SCHEMA) + @javax.annotation.Nullable + private URI $schema; + + public static final String SERIALIZED_NAME_APPROVED = "approved"; + @SerializedName(SERIALIZED_NAME_APPROVED) @javax.annotation.Nonnull - private String id; + private Boolean approved; - public static final String SERIALIZED_NAME_NAME = "name"; - @SerializedName(SERIALIZED_NAME_NAME) - @javax.annotation.Nonnull - private String name; - - public TTPSAttack() { + public ConfirmToolInputBody() { } - public TTPSAttack id(@javax.annotation.Nonnull String id) { - this.id = id; - return this; + public ConfirmToolInputBody( + URI $schema + ) { + this(); + this.$schema = $schema; } /** - * Get id - * @return id + * A URL to the JSON Schema for this object. + * @return $schema */ - @javax.annotation.Nonnull - public String getId() { - return id; + @javax.annotation.Nullable + public URI get$Schema() { + return $schema; } - public void setId(@javax.annotation.Nonnull String id) { - this.id = id; - } - public TTPSAttack name(@javax.annotation.Nonnull String name) { - this.name = name; + public ConfirmToolInputBody approved(@javax.annotation.Nonnull Boolean approved) { + this.approved = approved; return this; } /** - * Get name - * @return name + * Whether the user approves the pending tool call. + * @return approved */ @javax.annotation.Nonnull - public String getName() { - return name; + public Boolean getApproved() { + return approved; } - public void setName(@javax.annotation.Nonnull String name) { - this.name = name; + public void setApproved(@javax.annotation.Nonnull Boolean approved) { + this.approved = approved; } /** @@ -114,9 +114,9 @@ public void setName(@javax.annotation.Nonnull String name) { * * @param key name of the property * @param value value of the property - * @return the TTPSAttack instance itself + * @return the ConfirmToolInputBody instance itself */ - public TTPSAttack putAdditionalProperty(String key, Object value) { + public ConfirmToolInputBody putAdditionalProperty(String key, Object value) { if (this.additionalProperties == null) { this.additionalProperties = new HashMap(); } @@ -155,23 +155,23 @@ public boolean equals(Object o) { if (o == null || getClass() != o.getClass()) { return false; } - TTPSAttack ttPSAttack = (TTPSAttack) o; - return Objects.equals(this.id, ttPSAttack.id) && - Objects.equals(this.name, ttPSAttack.name)&& - Objects.equals(this.additionalProperties, ttPSAttack.additionalProperties); + ConfirmToolInputBody confirmToolInputBody = (ConfirmToolInputBody) o; + return Objects.equals(this.$schema, confirmToolInputBody.$schema) && + Objects.equals(this.approved, confirmToolInputBody.approved)&& + Objects.equals(this.additionalProperties, confirmToolInputBody.additionalProperties); } @Override public int hashCode() { - return Objects.hash(id, name, additionalProperties); + return Objects.hash($schema, approved, additionalProperties); } @Override public String toString() { StringBuilder sb = new StringBuilder(); - sb.append("class TTPSAttack {\n"); - sb.append(" id: ").append(toIndentedString(id)).append("\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append("class ConfirmToolInputBody {\n"); + sb.append(" $schema: ").append(toIndentedString($schema)).append("\n"); + sb.append(" approved: ").append(toIndentedString(approved)).append("\n"); sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); sb.append("}"); return sb.toString(); @@ -194,37 +194,34 @@ private String toIndentedString(Object o) { static { // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(Arrays.asList("id", "name")); + openapiFields = new HashSet(Arrays.asList("$schema", "approved")); // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(Arrays.asList("id", "name")); + openapiRequiredFields = new HashSet(Arrays.asList("approved")); } /** * 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 TTPSAttack + * @throws IOException if the JSON Element is invalid with respect to ConfirmToolInputBody */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (jsonElement == null) { - if (!TTPSAttack.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format(Locale.ROOT, "The required field(s) %s in TTPSAttack is not found in the empty JSON string", TTPSAttack.openapiRequiredFields.toString())); + if (!ConfirmToolInputBody.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format(Locale.ROOT, "The required field(s) %s in ConfirmToolInputBody is not found in the empty JSON string", ConfirmToolInputBody.openapiRequiredFields.toString())); } } // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : TTPSAttack.openapiRequiredFields) { + for (String requiredField : ConfirmToolInputBody.openapiRequiredFields) { if (jsonElement.getAsJsonObject().get(requiredField) == null) { throw new IllegalArgumentException(String.format(Locale.ROOT, "The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); } } JsonObject jsonObj = jsonElement.getAsJsonObject(); - if (!jsonObj.get("id").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format(Locale.ROOT, "Expected the field `id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("id").toString())); - } - if (!jsonObj.get("name").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format(Locale.ROOT, "Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString())); + if ((jsonObj.get("$schema") != null && !jsonObj.get("$schema").isJsonNull()) && !jsonObj.get("$schema").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(Locale.ROOT, "Expected the field `$schema` to be a primitive type in the JSON string but got `%s`", jsonObj.get("$schema").toString())); } } @@ -232,16 +229,16 @@ public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @SuppressWarnings("unchecked") @Override public TypeAdapter create(Gson gson, TypeToken type) { - if (!TTPSAttack.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'TTPSAttack' and its subtypes + if (!ConfirmToolInputBody.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ConfirmToolInputBody' and its subtypes } final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(TTPSAttack.class)); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ConfirmToolInputBody.class)); - return (TypeAdapter) new TypeAdapter() { + return (TypeAdapter) new TypeAdapter() { @Override - public void write(JsonWriter out, TTPSAttack value) throws IOException { + public void write(JsonWriter out, ConfirmToolInputBody value) throws IOException { JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); obj.remove("additionalProperties"); // serialize additional properties @@ -269,12 +266,12 @@ else if (entry.getValue() instanceof Character) } @Override - public TTPSAttack read(JsonReader in) throws IOException { + public ConfirmToolInputBody read(JsonReader in) throws IOException { JsonElement jsonElement = elementAdapter.read(in); validateJsonElement(jsonElement); JsonObject jsonObj = jsonElement.getAsJsonObject(); // store additional fields in the deserialized instance - TTPSAttack instance = thisAdapter.fromJsonTree(jsonObj); + ConfirmToolInputBody instance = thisAdapter.fromJsonTree(jsonObj); for (Map.Entry entry : jsonObj.entrySet()) { if (!openapiFields.contains(entry.getKey())) { if (entry.getValue().isJsonPrimitive()) { // primitive type @@ -301,18 +298,18 @@ else if (entry.getValue().getAsJsonPrimitive().isBoolean()) } /** - * Create an instance of TTPSAttack given an JSON string + * Create an instance of ConfirmToolInputBody given an JSON string * * @param jsonString JSON string - * @return An instance of TTPSAttack - * @throws IOException if the JSON string is invalid with respect to TTPSAttack + * @return An instance of ConfirmToolInputBody + * @throws IOException if the JSON string is invalid with respect to ConfirmToolInputBody */ - public static TTPSAttack fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, TTPSAttack.class); + public static ConfirmToolInputBody fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ConfirmToolInputBody.class); } /** - * Convert an instance of TTPSAttack to an JSON string + * Convert an instance of ConfirmToolInputBody to an JSON string * * @return JSON string */ diff --git a/src/main/java/ai/reveng/model/Process.java b/src/main/java/ai/reveng/model/Conversation.java similarity index 55% rename from src/main/java/ai/reveng/model/Process.java rename to src/main/java/ai/reveng/model/Conversation.java index bc8caed..59214f9 100644 --- a/src/main/java/ai/reveng/model/Process.java +++ b/src/main/java/ai/reveng/model/Conversation.java @@ -20,10 +20,10 @@ import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import java.io.IOException; -import java.math.BigDecimal; -import java.util.ArrayList; +import java.net.URI; +import java.time.OffsetDateTime; 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,194 +50,177 @@ import ai.reveng.invoker.JSON; /** - * Process + * Conversation */ @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class Process { - public static final String SERIALIZED_NAME_PID = "pid"; - @SerializedName(SERIALIZED_NAME_PID) - @javax.annotation.Nonnull - private Integer pid; +public class Conversation { + public static final String SERIALIZED_NAME_$_SCHEMA = "$schema"; + @SerializedName(SERIALIZED_NAME_$_SCHEMA) + @javax.annotation.Nullable + private URI $schema; - public static final String SERIALIZED_NAME_PROCNAME = "procname"; - @SerializedName(SERIALIZED_NAME_PROCNAME) - @javax.annotation.Nonnull - private String procname; + public static final String SERIALIZED_NAME_CONTEXT = "context"; + @SerializedName(SERIALIZED_NAME_CONTEXT) + @javax.annotation.Nullable + private Object context = null; - public static final String SERIALIZED_NAME_EXECUTABLE_NAME = "executable_name"; - @SerializedName(SERIALIZED_NAME_EXECUTABLE_NAME) + public static final String SERIALIZED_NAME_CONVERSATION_UUID = "conversation_uuid"; + @SerializedName(SERIALIZED_NAME_CONVERSATION_UUID) @javax.annotation.Nonnull - private String executableName; + private String conversationUuid; - public static final String SERIALIZED_NAME_ARGS = "args"; - @SerializedName(SERIALIZED_NAME_ARGS) + public static final String SERIALIZED_NAME_CREATED_AT = "created_at"; + @SerializedName(SERIALIZED_NAME_CREATED_AT) @javax.annotation.Nonnull - private List args = new ArrayList<>(); + private OffsetDateTime createdAt; - public static final String SERIALIZED_NAME_TS_FROM = "ts_from"; - @SerializedName(SERIALIZED_NAME_TS_FROM) + public static final String SERIALIZED_NAME_TITLE = "title"; + @SerializedName(SERIALIZED_NAME_TITLE) @javax.annotation.Nonnull - private BigDecimal tsFrom; + private String title; - public static final String SERIALIZED_NAME_TS_TO = "ts_to"; - @SerializedName(SERIALIZED_NAME_TS_TO) - @javax.annotation.Nullable - private BigDecimal tsTo; + public static final String SERIALIZED_NAME_UPDATED_AT = "updated_at"; + @SerializedName(SERIALIZED_NAME_UPDATED_AT) + @javax.annotation.Nonnull + private OffsetDateTime updatedAt; - public static final String SERIALIZED_NAME_CHILDREN = "children"; - @SerializedName(SERIALIZED_NAME_CHILDREN) + public static final String SERIALIZED_NAME_USER_ID = "user_id"; + @SerializedName(SERIALIZED_NAME_USER_ID) @javax.annotation.Nonnull - private List children = new ArrayList<>(); + private Long userId; - public Process() { + public Conversation() { } - public Process pid(@javax.annotation.Nonnull Integer pid) { - this.pid = pid; - return this; + public Conversation( + URI $schema + ) { + this(); + this.$schema = $schema; } /** - * Get pid - * @return pid + * A URL to the JSON Schema for this object. + * @return $schema */ - @javax.annotation.Nonnull - public Integer getPid() { - return pid; + @javax.annotation.Nullable + public URI get$Schema() { + return $schema; } - public void setPid(@javax.annotation.Nonnull Integer pid) { - this.pid = pid; - } - public Process procname(@javax.annotation.Nonnull String procname) { - this.procname = procname; + public Conversation context(@javax.annotation.Nullable Object context) { + this.context = context; return this; } /** - * Get procname - * @return procname + * Get context + * @return context */ - @javax.annotation.Nonnull - public String getProcname() { - return procname; + @javax.annotation.Nullable + public Object getContext() { + return context; } - public void setProcname(@javax.annotation.Nonnull String procname) { - this.procname = procname; + public void setContext(@javax.annotation.Nullable Object context) { + this.context = context; } - public Process executableName(@javax.annotation.Nonnull String executableName) { - this.executableName = executableName; + public Conversation conversationUuid(@javax.annotation.Nonnull String conversationUuid) { + this.conversationUuid = conversationUuid; return this; } /** - * Get executableName - * @return executableName + * Get conversationUuid + * @return conversationUuid */ @javax.annotation.Nonnull - public String getExecutableName() { - return executableName; + public String getConversationUuid() { + return conversationUuid; } - public void setExecutableName(@javax.annotation.Nonnull String executableName) { - this.executableName = executableName; + public void setConversationUuid(@javax.annotation.Nonnull String conversationUuid) { + this.conversationUuid = conversationUuid; } - public Process args(@javax.annotation.Nonnull List args) { - this.args = args; - return this; - } - - public Process addArgsItem(String argsItem) { - if (this.args == null) { - this.args = new ArrayList<>(); - } - this.args.add(argsItem); + public Conversation createdAt(@javax.annotation.Nonnull OffsetDateTime createdAt) { + this.createdAt = createdAt; return this; } /** - * Get args - * @return args + * Get createdAt + * @return createdAt */ @javax.annotation.Nonnull - public List getArgs() { - return args; + public OffsetDateTime getCreatedAt() { + return createdAt; } - public void setArgs(@javax.annotation.Nonnull List args) { - this.args = args; + public void setCreatedAt(@javax.annotation.Nonnull OffsetDateTime createdAt) { + this.createdAt = createdAt; } - public Process tsFrom(@javax.annotation.Nonnull BigDecimal tsFrom) { - this.tsFrom = tsFrom; + public Conversation title(@javax.annotation.Nonnull String title) { + this.title = title; return this; } /** - * Get tsFrom - * @return tsFrom + * Get title + * @return title */ @javax.annotation.Nonnull - public BigDecimal getTsFrom() { - return tsFrom; + public String getTitle() { + return title; } - public void setTsFrom(@javax.annotation.Nonnull BigDecimal tsFrom) { - this.tsFrom = tsFrom; + public void setTitle(@javax.annotation.Nonnull String title) { + this.title = title; } - public Process tsTo(@javax.annotation.Nullable BigDecimal tsTo) { - this.tsTo = tsTo; + public Conversation updatedAt(@javax.annotation.Nonnull OffsetDateTime updatedAt) { + this.updatedAt = updatedAt; return this; } /** - * Get tsTo - * @return tsTo + * Get updatedAt + * @return updatedAt */ - @javax.annotation.Nullable - public BigDecimal getTsTo() { - return tsTo; + @javax.annotation.Nonnull + public OffsetDateTime getUpdatedAt() { + return updatedAt; } - public void setTsTo(@javax.annotation.Nullable BigDecimal tsTo) { - this.tsTo = tsTo; + public void setUpdatedAt(@javax.annotation.Nonnull OffsetDateTime updatedAt) { + this.updatedAt = updatedAt; } - public Process children(@javax.annotation.Nonnull List children) { - this.children = children; - return this; - } - - public Process addChildrenItem(Object childrenItem) { - if (this.children == null) { - this.children = new ArrayList<>(); - } - this.children.add(childrenItem); + public Conversation userId(@javax.annotation.Nonnull Long userId) { + this.userId = userId; return this; } /** - * Get children - * @return children + * Get userId + * @return userId */ @javax.annotation.Nonnull - public List getChildren() { - return children; + public Long getUserId() { + return userId; } - public void setChildren(@javax.annotation.Nonnull List children) { - this.children = children; + public void setUserId(@javax.annotation.Nonnull Long userId) { + this.userId = userId; } /** @@ -253,9 +236,9 @@ public void setChildren(@javax.annotation.Nonnull List children) { * * @param key name of the property * @param value value of the property - * @return the Process instance itself + * @return the Conversation instance itself */ - public Process putAdditionalProperty(String key, Object value) { + public Conversation putAdditionalProperty(String key, Object value) { if (this.additionalProperties == null) { this.additionalProperties = new HashMap(); } @@ -294,33 +277,44 @@ public boolean equals(Object o) { if (o == null || getClass() != o.getClass()) { return false; } - Process process = (Process) o; - return Objects.equals(this.pid, process.pid) && - Objects.equals(this.procname, process.procname) && - Objects.equals(this.executableName, process.executableName) && - Objects.equals(this.args, process.args) && - Objects.equals(this.tsFrom, process.tsFrom) && - Objects.equals(this.tsTo, process.tsTo) && - Objects.equals(this.children, process.children)&& - Objects.equals(this.additionalProperties, process.additionalProperties); + Conversation conversation = (Conversation) o; + return Objects.equals(this.$schema, conversation.$schema) && + Objects.equals(this.context, conversation.context) && + Objects.equals(this.conversationUuid, conversation.conversationUuid) && + Objects.equals(this.createdAt, conversation.createdAt) && + 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(pid, procname, executableName, args, tsFrom, tsTo, children, additionalProperties); + return Objects.hash($schema, 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; } @Override public String toString() { StringBuilder sb = new StringBuilder(); - sb.append("class Process {\n"); - sb.append(" pid: ").append(toIndentedString(pid)).append("\n"); - sb.append(" procname: ").append(toIndentedString(procname)).append("\n"); - sb.append(" executableName: ").append(toIndentedString(executableName)).append("\n"); - sb.append(" args: ").append(toIndentedString(args)).append("\n"); - sb.append(" tsFrom: ").append(toIndentedString(tsFrom)).append("\n"); - sb.append(" tsTo: ").append(toIndentedString(tsTo)).append("\n"); - sb.append(" children: ").append(toIndentedString(children)).append("\n"); + sb.append("class Conversation {\n"); + sb.append(" $schema: ").append(toIndentedString($schema)).append("\n"); + 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(" title: ").append(toIndentedString(title)).append("\n"); + sb.append(" updatedAt: ").append(toIndentedString(updatedAt)).append("\n"); + sb.append(" userId: ").append(toIndentedString(userId)).append("\n"); sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); sb.append("}"); return sb.toString(); @@ -343,49 +337,40 @@ private String toIndentedString(Object o) { static { // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(Arrays.asList("pid", "procname", "executable_name", "args", "ts_from", "ts_to", "children")); + openapiFields = new HashSet(Arrays.asList("$schema", "context", "conversation_uuid", "created_at", "title", "updated_at", "user_id")); // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(Arrays.asList("pid", "procname", "executable_name", "args", "ts_from", "ts_to", "children")); + openapiRequiredFields = new HashSet(Arrays.asList("conversation_uuid", "created_at", "title", "updated_at", "user_id")); } /** * Validates the JSON Element and throws an exception if issues found * * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to Process + * @throws IOException if the JSON Element is invalid with respect to Conversation */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (jsonElement == null) { - if (!Process.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format(Locale.ROOT, "The required field(s) %s in Process is not found in the empty JSON string", Process.openapiRequiredFields.toString())); + if (!Conversation.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format(Locale.ROOT, "The required field(s) %s in Conversation is not found in the empty JSON string", Conversation.openapiRequiredFields.toString())); } } // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : Process.openapiRequiredFields) { + for (String requiredField : Conversation.openapiRequiredFields) { if (jsonElement.getAsJsonObject().get(requiredField) == null) { throw new IllegalArgumentException(String.format(Locale.ROOT, "The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); } } JsonObject jsonObj = jsonElement.getAsJsonObject(); - if (!jsonObj.get("procname").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format(Locale.ROOT, "Expected the field `procname` to be a primitive type in the JSON string but got `%s`", jsonObj.get("procname").toString())); - } - if (!jsonObj.get("executable_name").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format(Locale.ROOT, "Expected the field `executable_name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("executable_name").toString())); + if ((jsonObj.get("$schema") != null && !jsonObj.get("$schema").isJsonNull()) && !jsonObj.get("$schema").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(Locale.ROOT, "Expected the field `$schema` to be a primitive type in the JSON string but got `%s`", jsonObj.get("$schema").toString())); } - // ensure the required json array is present - if (jsonObj.get("args") == null) { - throw new IllegalArgumentException("Expected the field `linkedContent` to be an array in the JSON string but got `null`"); - } else if (!jsonObj.get("args").isJsonArray()) { - throw new IllegalArgumentException(String.format(Locale.ROOT, "Expected the field `args` to be an array in the JSON string but got `%s`", jsonObj.get("args").toString())); + if (!jsonObj.get("conversation_uuid").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(Locale.ROOT, "Expected the field `conversation_uuid` to be a primitive type in the JSON string but got `%s`", jsonObj.get("conversation_uuid").toString())); } - // ensure the required json array is present - if (jsonObj.get("children") == null) { - throw new IllegalArgumentException("Expected the field `linkedContent` to be an array in the JSON string but got `null`"); - } else if (!jsonObj.get("children").isJsonArray()) { - throw new IllegalArgumentException(String.format(Locale.ROOT, "Expected the field `children` to be an array in the JSON string but got `%s`", jsonObj.get("children").toString())); + if (!jsonObj.get("title").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(Locale.ROOT, "Expected the field `title` to be a primitive type in the JSON string but got `%s`", jsonObj.get("title").toString())); } } @@ -393,16 +378,16 @@ public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @SuppressWarnings("unchecked") @Override public TypeAdapter create(Gson gson, TypeToken type) { - if (!Process.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'Process' and its subtypes + if (!Conversation.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'Conversation' and its subtypes } final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(Process.class)); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(Conversation.class)); - return (TypeAdapter) new TypeAdapter() { + return (TypeAdapter) new TypeAdapter() { @Override - public void write(JsonWriter out, Process value) throws IOException { + public void write(JsonWriter out, Conversation value) throws IOException { JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); obj.remove("additionalProperties"); // serialize additional properties @@ -430,12 +415,12 @@ else if (entry.getValue() instanceof Character) } @Override - public Process read(JsonReader in) throws IOException { + public Conversation read(JsonReader in) throws IOException { JsonElement jsonElement = elementAdapter.read(in); validateJsonElement(jsonElement); JsonObject jsonObj = jsonElement.getAsJsonObject(); // store additional fields in the deserialized instance - Process instance = thisAdapter.fromJsonTree(jsonObj); + Conversation instance = thisAdapter.fromJsonTree(jsonObj); for (Map.Entry entry : jsonObj.entrySet()) { if (!openapiFields.contains(entry.getKey())) { if (entry.getValue().isJsonPrimitive()) { // primitive type @@ -462,18 +447,18 @@ else if (entry.getValue().getAsJsonPrimitive().isBoolean()) } /** - * Create an instance of Process given an JSON string + * Create an instance of Conversation given an JSON string * * @param jsonString JSON string - * @return An instance of Process - * @throws IOException if the JSON string is invalid with respect to Process + * @return An instance of Conversation + * @throws IOException if the JSON string is invalid with respect to Conversation */ - public static Process fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, Process.class); + public static Conversation fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, Conversation.class); } /** - * Convert an instance of Process to an JSON string + * Convert an instance of Conversation to an JSON string * * @return JSON string */ diff --git a/src/main/java/ai/reveng/model/TTPSOccurance.java b/src/main/java/ai/reveng/model/ConversationContext.java similarity index 71% rename from src/main/java/ai/reveng/model/TTPSOccurance.java rename to src/main/java/ai/reveng/model/ConversationContext.java index 9e708eb..470e211 100644 --- a/src/main/java/ai/reveng/model/TTPSOccurance.java +++ b/src/main/java/ai/reveng/model/ConversationContext.java @@ -47,58 +47,58 @@ import ai.reveng.invoker.JSON; /** - * TTPSOccurance + * ConversationContext */ @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class TTPSOccurance { - public static final String SERIALIZED_NAME_PPID = "ppid"; - @SerializedName(SERIALIZED_NAME_PPID) - @javax.annotation.Nonnull - private Integer ppid; - - public static final String SERIALIZED_NAME_PID = "pid"; - @SerializedName(SERIALIZED_NAME_PID) - @javax.annotation.Nonnull - private Integer pid; - - public TTPSOccurance() { +public class ConversationContext { + 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_FUNCTION_ID = "function_id"; + @SerializedName(SERIALIZED_NAME_FUNCTION_ID) + @javax.annotation.Nullable + private Long functionId; + + public ConversationContext() { } - public TTPSOccurance ppid(@javax.annotation.Nonnull Integer ppid) { - this.ppid = ppid; + public ConversationContext analysisId(@javax.annotation.Nullable Long analysisId) { + this.analysisId = analysisId; return this; } /** - * Get ppid - * @return ppid + * Get analysisId + * @return analysisId */ - @javax.annotation.Nonnull - public Integer getPpid() { - return ppid; + @javax.annotation.Nullable + public Long getAnalysisId() { + return analysisId; } - public void setPpid(@javax.annotation.Nonnull Integer ppid) { - this.ppid = ppid; + public void setAnalysisId(@javax.annotation.Nullable Long analysisId) { + this.analysisId = analysisId; } - public TTPSOccurance pid(@javax.annotation.Nonnull Integer pid) { - this.pid = pid; + public ConversationContext functionId(@javax.annotation.Nullable Long functionId) { + this.functionId = functionId; return this; } /** - * Get pid - * @return pid + * Get functionId + * @return functionId */ - @javax.annotation.Nonnull - public Integer getPid() { - return pid; + @javax.annotation.Nullable + public Long getFunctionId() { + return functionId; } - public void setPid(@javax.annotation.Nonnull Integer pid) { - this.pid = pid; + public void setFunctionId(@javax.annotation.Nullable Long functionId) { + this.functionId = functionId; } /** @@ -114,9 +114,9 @@ public void setPid(@javax.annotation.Nonnull Integer pid) { * * @param key name of the property * @param value value of the property - * @return the TTPSOccurance instance itself + * @return the ConversationContext instance itself */ - public TTPSOccurance putAdditionalProperty(String key, Object value) { + public ConversationContext putAdditionalProperty(String key, Object value) { if (this.additionalProperties == null) { this.additionalProperties = new HashMap(); } @@ -155,23 +155,23 @@ public boolean equals(Object o) { if (o == null || getClass() != o.getClass()) { return false; } - TTPSOccurance ttPSOccurance = (TTPSOccurance) o; - return Objects.equals(this.ppid, ttPSOccurance.ppid) && - Objects.equals(this.pid, ttPSOccurance.pid)&& - Objects.equals(this.additionalProperties, ttPSOccurance.additionalProperties); + ConversationContext conversationContext = (ConversationContext) o; + return Objects.equals(this.analysisId, conversationContext.analysisId) && + Objects.equals(this.functionId, conversationContext.functionId)&& + Objects.equals(this.additionalProperties, conversationContext.additionalProperties); } @Override public int hashCode() { - return Objects.hash(ppid, pid, additionalProperties); + return Objects.hash(analysisId, functionId, additionalProperties); } @Override public String toString() { StringBuilder sb = new StringBuilder(); - sb.append("class TTPSOccurance {\n"); - sb.append(" ppid: ").append(toIndentedString(ppid)).append("\n"); - sb.append(" pid: ").append(toIndentedString(pid)).append("\n"); + sb.append("class ConversationContext {\n"); + sb.append(" analysisId: ").append(toIndentedString(analysisId)).append("\n"); + sb.append(" functionId: ").append(toIndentedString(functionId)).append("\n"); sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); sb.append("}"); return sb.toString(); @@ -194,29 +194,22 @@ private String toIndentedString(Object o) { static { // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(Arrays.asList("ppid", "pid")); + openapiFields = new HashSet(Arrays.asList("analysis_id", "function_id")); // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(Arrays.asList("ppid", "pid")); + 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 TTPSOccurance + * @throws IOException if the JSON Element is invalid with respect to ConversationContext */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (jsonElement == null) { - if (!TTPSOccurance.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format(Locale.ROOT, "The required field(s) %s in TTPSOccurance is not found in the empty JSON string", TTPSOccurance.openapiRequiredFields.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : TTPSOccurance.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException(String.format(Locale.ROOT, "The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + if (!ConversationContext.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format(Locale.ROOT, "The required field(s) %s in ConversationContext is not found in the empty JSON string", ConversationContext.openapiRequiredFields.toString())); } } JsonObject jsonObj = jsonElement.getAsJsonObject(); @@ -226,16 +219,16 @@ public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @SuppressWarnings("unchecked") @Override public TypeAdapter create(Gson gson, TypeToken type) { - if (!TTPSOccurance.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'TTPSOccurance' and its subtypes + if (!ConversationContext.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ConversationContext' and its subtypes } final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(TTPSOccurance.class)); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ConversationContext.class)); - return (TypeAdapter) new TypeAdapter() { + return (TypeAdapter) new TypeAdapter() { @Override - public void write(JsonWriter out, TTPSOccurance value) throws IOException { + public void write(JsonWriter out, ConversationContext value) throws IOException { JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); obj.remove("additionalProperties"); // serialize additional properties @@ -263,12 +256,12 @@ else if (entry.getValue() instanceof Character) } @Override - public TTPSOccurance read(JsonReader in) throws IOException { + public ConversationContext read(JsonReader in) throws IOException { JsonElement jsonElement = elementAdapter.read(in); validateJsonElement(jsonElement); JsonObject jsonObj = jsonElement.getAsJsonObject(); // store additional fields in the deserialized instance - TTPSOccurance instance = thisAdapter.fromJsonTree(jsonObj); + ConversationContext instance = thisAdapter.fromJsonTree(jsonObj); for (Map.Entry entry : jsonObj.entrySet()) { if (!openapiFields.contains(entry.getKey())) { if (entry.getValue().isJsonPrimitive()) { // primitive type @@ -295,18 +288,18 @@ else if (entry.getValue().getAsJsonPrimitive().isBoolean()) } /** - * Create an instance of TTPSOccurance given an JSON string + * Create an instance of ConversationContext given an JSON string * * @param jsonString JSON string - * @return An instance of TTPSOccurance - * @throws IOException if the JSON string is invalid with respect to TTPSOccurance + * @return An instance of ConversationContext + * @throws IOException if the JSON string is invalid with respect to ConversationContext */ - public static TTPSOccurance fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, TTPSOccurance.class); + public static ConversationContext fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ConversationContext.class); } /** - * Convert an instance of TTPSOccurance to an JSON string + * Convert an instance of ConversationContext to an JSON string * * @return JSON string */ diff --git a/src/main/java/ai/reveng/model/AnalysisStagesResponse.java b/src/main/java/ai/reveng/model/ConversationWithEvents.java similarity index 50% rename from src/main/java/ai/reveng/model/AnalysisStagesResponse.java rename to src/main/java/ai/reveng/model/ConversationWithEvents.java index d7fae1a..f5efa7d 100644 --- a/src/main/java/ai/reveng/model/AnalysisStagesResponse.java +++ b/src/main/java/ai/reveng/model/ConversationWithEvents.java @@ -14,16 +14,19 @@ import java.util.Objects; import java.util.Locale; -import ai.reveng.model.StageEvent; +import ai.reveng.model.Event; 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.net.URI; +import java.time.OffsetDateTime; import java.util.ArrayList; import java.util.Arrays; import java.util.List; +import org.openapitools.jackson.nullable.JsonNullable; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -50,24 +53,134 @@ import ai.reveng.invoker.JSON; /** - * AnalysisStagesResponse + * ConversationWithEvents */ @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class AnalysisStagesResponse { +public class ConversationWithEvents { + public static final String SERIALIZED_NAME_$_SCHEMA = "$schema"; + @SerializedName(SERIALIZED_NAME_$_SCHEMA) + @javax.annotation.Nullable + private URI $schema; + + public static final String SERIALIZED_NAME_CONTEXT = "context"; + @SerializedName(SERIALIZED_NAME_CONTEXT) + @javax.annotation.Nullable + private Object context = null; + + 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_EVENTS = "events"; @SerializedName(SERIALIZED_NAME_EVENTS) + @javax.annotation.Nullable + private List events; + + 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 static final String SERIALIZED_NAME_USER_ID = "user_id"; + @SerializedName(SERIALIZED_NAME_USER_ID) + @javax.annotation.Nonnull + private Long userId; + + public ConversationWithEvents() { + } + + public ConversationWithEvents( + URI $schema + ) { + this(); + this.$schema = $schema; + } + + /** + * A URL to the JSON Schema for this object. + * @return $schema + */ + @javax.annotation.Nullable + public URI get$Schema() { + return $schema; + } + + + + public ConversationWithEvents context(@javax.annotation.Nullable Object context) { + this.context = context; + return this; + } + + /** + * Get context + * @return context + */ + @javax.annotation.Nullable + public Object getContext() { + return context; + } + + public void setContext(@javax.annotation.Nullable Object context) { + this.context = context; + } + + + public ConversationWithEvents conversationUuid(@javax.annotation.Nonnull String conversationUuid) { + this.conversationUuid = conversationUuid; + return this; + } + + /** + * Get conversationUuid + * @return conversationUuid + */ + @javax.annotation.Nonnull + public String getConversationUuid() { + return conversationUuid; + } + + public void setConversationUuid(@javax.annotation.Nonnull String conversationUuid) { + this.conversationUuid = conversationUuid; + } + + + public ConversationWithEvents createdAt(@javax.annotation.Nonnull OffsetDateTime createdAt) { + this.createdAt = createdAt; + return this; + } + + /** + * Get createdAt + * @return createdAt + */ @javax.annotation.Nonnull - private List events = new ArrayList<>(); + public OffsetDateTime getCreatedAt() { + return createdAt; + } - public AnalysisStagesResponse() { + public void setCreatedAt(@javax.annotation.Nonnull OffsetDateTime createdAt) { + this.createdAt = createdAt; } - public AnalysisStagesResponse events(@javax.annotation.Nonnull List events) { + + public ConversationWithEvents events(@javax.annotation.Nullable List events) { this.events = events; return this; } - public AnalysisStagesResponse addEventsItem(StageEvent eventsItem) { + public ConversationWithEvents addEventsItem(Event eventsItem) { if (this.events == null) { this.events = new ArrayList<>(); } @@ -79,15 +192,72 @@ public AnalysisStagesResponse addEventsItem(StageEvent eventsItem) { * Get events * @return events */ - @javax.annotation.Nonnull - public List getEvents() { + @javax.annotation.Nullable + public List getEvents() { return events; } - public void setEvents(@javax.annotation.Nonnull List events) { + public void setEvents(@javax.annotation.Nullable List events) { this.events = events; } + + public ConversationWithEvents 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 ConversationWithEvents updatedAt(@javax.annotation.Nonnull OffsetDateTime updatedAt) { + this.updatedAt = updatedAt; + return this; + } + + /** + * Get updatedAt + * @return updatedAt + */ + @javax.annotation.Nonnull + public OffsetDateTime getUpdatedAt() { + return updatedAt; + } + + public void setUpdatedAt(@javax.annotation.Nonnull OffsetDateTime updatedAt) { + this.updatedAt = updatedAt; + } + + + public ConversationWithEvents userId(@javax.annotation.Nonnull Long userId) { + this.userId = userId; + return this; + } + + /** + * Get userId + * @return userId + */ + @javax.annotation.Nonnull + public Long getUserId() { + return userId; + } + + public void setUserId(@javax.annotation.Nonnull Long userId) { + this.userId = userId; + } + /** * A container for additional, undeclared properties. * This is a holder for any undeclared properties as specified with @@ -101,9 +271,9 @@ public void setEvents(@javax.annotation.Nonnull List events) { * * @param key name of the property * @param value value of the property - * @return the AnalysisStagesResponse instance itself + * @return the ConversationWithEvents instance itself */ - public AnalysisStagesResponse putAdditionalProperty(String key, Object value) { + public ConversationWithEvents putAdditionalProperty(String key, Object value) { if (this.additionalProperties == null) { this.additionalProperties = new HashMap(); } @@ -142,21 +312,46 @@ public boolean equals(Object o) { if (o == null || getClass() != o.getClass()) { return false; } - AnalysisStagesResponse analysisStagesResponse = (AnalysisStagesResponse) o; - return Objects.equals(this.events, analysisStagesResponse.events)&& - Objects.equals(this.additionalProperties, analysisStagesResponse.additionalProperties); + ConversationWithEvents conversationWithEvents = (ConversationWithEvents) o; + return Objects.equals(this.$schema, conversationWithEvents.$schema) && + Objects.equals(this.context, conversationWithEvents.context) && + Objects.equals(this.conversationUuid, conversationWithEvents.conversationUuid) && + Objects.equals(this.createdAt, conversationWithEvents.createdAt) && + Objects.equals(this.events, conversationWithEvents.events) && + 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(events, additionalProperties); + return Objects.hash($schema, 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; } @Override public String toString() { StringBuilder sb = new StringBuilder(); - sb.append("class AnalysisStagesResponse {\n"); + sb.append("class ConversationWithEvents {\n"); + sb.append(" $schema: ").append(toIndentedString($schema)).append("\n"); + 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(" events: ").append(toIndentedString(events)).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"); sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); sb.append("}"); return sb.toString(); @@ -179,58 +374,63 @@ private String toIndentedString(Object o) { static { // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(Arrays.asList("events")); + openapiFields = new HashSet(Arrays.asList("$schema", "context", "conversation_uuid", "created_at", "events", "title", "updated_at", "user_id")); // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(Arrays.asList("events")); + openapiRequiredFields = new HashSet(Arrays.asList("conversation_uuid", "created_at", "events", "title", "updated_at", "user_id")); } /** * Validates the JSON Element and throws an exception if issues found * * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to AnalysisStagesResponse + * @throws IOException if the JSON Element is invalid with respect to ConversationWithEvents */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (jsonElement == null) { - if (!AnalysisStagesResponse.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format(Locale.ROOT, "The required field(s) %s in AnalysisStagesResponse is not found in the empty JSON string", AnalysisStagesResponse.openapiRequiredFields.toString())); + if (!ConversationWithEvents.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format(Locale.ROOT, "The required field(s) %s in ConversationWithEvents is not found in the empty JSON string", ConversationWithEvents.openapiRequiredFields.toString())); } } // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : AnalysisStagesResponse.openapiRequiredFields) { + for (String requiredField : ConversationWithEvents.openapiRequiredFields) { if (jsonElement.getAsJsonObject().get(requiredField) == null) { throw new IllegalArgumentException(String.format(Locale.ROOT, "The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); } } JsonObject jsonObj = jsonElement.getAsJsonObject(); - // ensure the json data is an array - if (!jsonObj.get("events").isJsonArray()) { + if ((jsonObj.get("$schema") != null && !jsonObj.get("$schema").isJsonNull()) && !jsonObj.get("$schema").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(Locale.ROOT, "Expected the field `$schema` to be a primitive type in the JSON string but got `%s`", jsonObj.get("$schema").toString())); + } + if (!jsonObj.get("conversation_uuid").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(Locale.ROOT, "Expected the field `conversation_uuid` to be a primitive type in the JSON string but got `%s`", jsonObj.get("conversation_uuid").toString())); + } + // ensure the required json array is present + if (jsonObj.get("events") == null) { + throw new IllegalArgumentException("Expected the field `linkedContent` to be an array in the JSON string but got `null`"); + } else if (!jsonObj.get("events").isJsonArray()) { throw new IllegalArgumentException(String.format(Locale.ROOT, "Expected the field `events` to be an array in the JSON string but got `%s`", jsonObj.get("events").toString())); } - - JsonArray jsonArrayevents = jsonObj.getAsJsonArray("events"); - // validate the required field `events` (array) - for (int i = 0; i < jsonArrayevents.size(); i++) { - StageEvent.validateJsonElement(jsonArrayevents.get(i)); - }; + if (!jsonObj.get("title").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(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 (!AnalysisStagesResponse.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'AnalysisStagesResponse' and its subtypes + if (!ConversationWithEvents.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ConversationWithEvents' and its subtypes } final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(AnalysisStagesResponse.class)); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ConversationWithEvents.class)); - return (TypeAdapter) new TypeAdapter() { + return (TypeAdapter) new TypeAdapter() { @Override - public void write(JsonWriter out, AnalysisStagesResponse value) throws IOException { + public void write(JsonWriter out, ConversationWithEvents value) throws IOException { JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); obj.remove("additionalProperties"); // serialize additional properties @@ -258,12 +458,12 @@ else if (entry.getValue() instanceof Character) } @Override - public AnalysisStagesResponse read(JsonReader in) throws IOException { + public ConversationWithEvents read(JsonReader in) throws IOException { JsonElement jsonElement = elementAdapter.read(in); validateJsonElement(jsonElement); JsonObject jsonObj = jsonElement.getAsJsonObject(); // store additional fields in the deserialized instance - AnalysisStagesResponse instance = thisAdapter.fromJsonTree(jsonObj); + ConversationWithEvents instance = thisAdapter.fromJsonTree(jsonObj); for (Map.Entry entry : jsonObj.entrySet()) { if (!openapiFields.contains(entry.getKey())) { if (entry.getValue().isJsonPrimitive()) { // primitive type @@ -290,18 +490,18 @@ else if (entry.getValue().getAsJsonPrimitive().isBoolean()) } /** - * Create an instance of AnalysisStagesResponse given an JSON string + * Create an instance of ConversationWithEvents given an JSON string * * @param jsonString JSON string - * @return An instance of AnalysisStagesResponse - * @throws IOException if the JSON string is invalid with respect to AnalysisStagesResponse + * @return An instance of ConversationWithEvents + * @throws IOException if the JSON string is invalid with respect to ConversationWithEvents */ - public static AnalysisStagesResponse fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, AnalysisStagesResponse.class); + public static ConversationWithEvents fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ConversationWithEvents.class); } /** - * Convert an instance of AnalysisStagesResponse to an JSON string + * Convert an instance of ConversationWithEvents to an JSON string * * @return JSON string */ diff --git a/src/main/java/ai/reveng/model/CreateConversationRequest.java b/src/main/java/ai/reveng/model/CreateConversationRequest.java new file mode 100644 index 0000000..4103095 --- /dev/null +++ b/src/main/java/ai/reveng/model/CreateConversationRequest.java @@ -0,0 +1,343 @@ +/* + * RevEng.AI API + * RevEng.AI is an AI-powered binary analysis platform for reverse engineering and malware analysis. It provides similarity search across executable binaries and functions, AI-driven decompilation, dynamic execution analysis, firmware unpacking, and integration with external threat intelligence sources like VirusTotal. + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package ai.reveng.model; + +import java.util.Objects; +import java.util.Locale; +import ai.reveng.model.ConversationContext; +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.net.URI; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; +import java.util.Locale; + +import ai.reveng.invoker.JSON; + +/** + * CreateConversationRequest + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class CreateConversationRequest { + public static final String SERIALIZED_NAME_$_SCHEMA = "$schema"; + @SerializedName(SERIALIZED_NAME_$_SCHEMA) + @javax.annotation.Nullable + private URI $schema; + + public static final String SERIALIZED_NAME_CONTEXT = "context"; + @SerializedName(SERIALIZED_NAME_CONTEXT) + @javax.annotation.Nullable + private ConversationContext context; + + public static final String SERIALIZED_NAME_TITLE = "title"; + @SerializedName(SERIALIZED_NAME_TITLE) + @javax.annotation.Nullable + private String title; + + public CreateConversationRequest() { + } + + public CreateConversationRequest( + URI $schema + ) { + this(); + this.$schema = $schema; + } + + /** + * A URL to the JSON Schema for this object. + * @return $schema + */ + @javax.annotation.Nullable + public URI get$Schema() { + return $schema; + } + + + + public CreateConversationRequest context(@javax.annotation.Nullable ConversationContext context) { + this.context = context; + return this; + } + + /** + * Get context + * @return context + */ + @javax.annotation.Nullable + public ConversationContext getContext() { + return context; + } + + public void setContext(@javax.annotation.Nullable ConversationContext context) { + this.context = context; + } + + + public CreateConversationRequest 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 CreateConversationRequest instance itself + */ + public CreateConversationRequest 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; + } + CreateConversationRequest createConversationRequest = (CreateConversationRequest) o; + return Objects.equals(this.$schema, createConversationRequest.$schema) && + Objects.equals(this.context, createConversationRequest.context) && + Objects.equals(this.title, createConversationRequest.title)&& + Objects.equals(this.additionalProperties, createConversationRequest.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash($schema, context, title, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CreateConversationRequest {\n"); + sb.append(" $schema: ").append(toIndentedString($schema)).append("\n"); + sb.append(" context: ").append(toIndentedString(context)).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) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(Arrays.asList("$schema", "context", "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 CreateConversationRequest + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!CreateConversationRequest.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format(Locale.ROOT, "The required field(s) %s in CreateConversationRequest is not found in the empty JSON string", CreateConversationRequest.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("$schema") != null && !jsonObj.get("$schema").isJsonNull()) && !jsonObj.get("$schema").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(Locale.ROOT, "Expected the field `$schema` to be a primitive type in the JSON string but got `%s`", jsonObj.get("$schema").toString())); + } + if ((jsonObj.get("title") != null && !jsonObj.get("title").isJsonNull()) && !jsonObj.get("title").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(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 (!CreateConversationRequest.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'CreateConversationRequest' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(CreateConversationRequest.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, CreateConversationRequest 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 CreateConversationRequest read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + CreateConversationRequest instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format(Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of CreateConversationRequest given an JSON string + * + * @param jsonString JSON string + * @return An instance of CreateConversationRequest + * @throws IOException if the JSON string is invalid with respect to CreateConversationRequest + */ + public static CreateConversationRequest fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, CreateConversationRequest.class); + } + + /** + * Convert an instance of CreateConversationRequest to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/ai/reveng/model/DynamicExecutionStatusInput.java b/src/main/java/ai/reveng/model/DynamicExecutionStatus.java similarity index 75% rename from src/main/java/ai/reveng/model/DynamicExecutionStatusInput.java rename to src/main/java/ai/reveng/model/DynamicExecutionStatus.java index 837c340..b7e209f 100644 --- a/src/main/java/ai/reveng/model/DynamicExecutionStatusInput.java +++ b/src/main/java/ai/reveng/model/DynamicExecutionStatus.java @@ -27,8 +27,8 @@ /** * Custom enum for the dynamic execution status */ -@JsonAdapter(DynamicExecutionStatusInput.Adapter.class) -public enum DynamicExecutionStatusInput { +@JsonAdapter(DynamicExecutionStatus.Adapter.class) +public enum DynamicExecutionStatus { PENDING("PENDING"), @@ -40,7 +40,7 @@ public enum DynamicExecutionStatusInput { private String value; - DynamicExecutionStatusInput(String value) { + DynamicExecutionStatus(String value) { this.value = value; } @@ -53,8 +53,8 @@ public String toString() { return String.valueOf(value); } - public static DynamicExecutionStatusInput fromValue(String value) { - for (DynamicExecutionStatusInput b : DynamicExecutionStatusInput.values()) { + public static DynamicExecutionStatus fromValue(String value) { + for (DynamicExecutionStatus b : DynamicExecutionStatus.values()) { if (b.value.equals(value)) { return b; } @@ -62,22 +62,22 @@ public static DynamicExecutionStatusInput fromValue(String value) { throw new IllegalArgumentException("Unexpected value '" + value + "'"); } - public static class Adapter extends TypeAdapter { + public static class Adapter extends TypeAdapter { @Override - public void write(final JsonWriter jsonWriter, final DynamicExecutionStatusInput enumeration) throws IOException { + public void write(final JsonWriter jsonWriter, final DynamicExecutionStatus enumeration) throws IOException { jsonWriter.value(enumeration.getValue()); } @Override - public DynamicExecutionStatusInput read(final JsonReader jsonReader) throws IOException { + public DynamicExecutionStatus read(final JsonReader jsonReader) throws IOException { String value = jsonReader.nextString(); - return DynamicExecutionStatusInput.fromValue(value); + return DynamicExecutionStatus.fromValue(value); } } public static void validateJsonElement(JsonElement jsonElement) throws IOException { String value = jsonElement.getAsString(); - DynamicExecutionStatusInput.fromValue(value); + DynamicExecutionStatus.fromValue(value); } } diff --git a/src/main/java/ai/reveng/model/ErrorBody.java b/src/main/java/ai/reveng/model/ErrorBody.java new file mode 100644 index 0000000..9898097 --- /dev/null +++ b/src/main/java/ai/reveng/model/ErrorBody.java @@ -0,0 +1,540 @@ +/* + * RevEng.AI API + * RevEng.AI is an AI-powered binary analysis platform for reverse engineering and malware analysis. It provides similarity search across executable binaries and functions, AI-driven decompilation, dynamic execution analysis, firmware unpacking, and integration with external threat intelligence sources like VirusTotal. + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package ai.reveng.model; + +import java.util.Objects; +import java.util.Locale; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; +import java.util.Locale; + +import ai.reveng.invoker.JSON; + +/** + * ErrorBody + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class ErrorBody { + /** + * Stable, machine-readable error code. Versioned and documented. + */ + @JsonAdapter(CodeEnum.Adapter.class) + public enum CodeEnum { + ACCESS_DENIED("ACCESS_DENIED"), + + ALREADY_EXISTS("ALREADY_EXISTS"), + + ANALYSIS_NOT_READY("ANALYSIS_NOT_READY"), + + BAD_REQUEST("BAD_REQUEST"), + + CONFLICT("CONFLICT"), + + CONVERSATION_NOT_FOUND("CONVERSATION_NOT_FOUND"), + + DOMAIN_ALREADY_CLAIMED("DOMAIN_ALREADY_CLAIMED"), + + DOMAIN_VERIFICATION_PENDING("DOMAIN_VERIFICATION_PENDING"), + + EMAIL_NOT_VERIFIED("EMAIL_NOT_VERIFIED"), + + EXTERNAL_USER("EXTERNAL_USER"), + + FORBIDDEN("FORBIDDEN"), + + GATEWAY_TIMEOUT("GATEWAY_TIMEOUT"), + + INSUFFICIENT_CREDITS("INSUFFICIENT_CREDITS"), + + INTERNAL_ERROR("INTERNAL_ERROR"), + + INTERNAL_ISSUER("INTERNAL_ISSUER"), + + INVALID_CONVERSATION_ID("INVALID_CONVERSATION_ID"), + + INVALID_CREDENTIALS("INVALID_CREDENTIALS"), + + INVALID_RESET_CODE("INVALID_RESET_CODE"), + + LAST_ORG_OWNER("LAST_ORG_OWNER"), + + LINKED_TO_ORG("LINKED_TO_ORG"), + + METHOD_NOT_ALLOWED("METHOD_NOT_ALLOWED"), + + NOT_ACCEPTABLE("NOT_ACCEPTABLE"), + + NOT_FOUND("NOT_FOUND"), + + NO_ACTIVE_RUN("NO_ACTIVE_RUN"), + + NO_PENDING_CONFIRMATION("NO_PENDING_CONFIRMATION"), + + OIDC_DISCOVERY_FAILED("OIDC_DISCOVERY_FAILED"), + + PASSWORD_RESET_REQUIRED("PASSWORD_RESET_REQUIRED"), + + PAYMENT_REQUIRED("PAYMENT_REQUIRED"), + + REQUEST_ENTITY_TOO_LARGE("REQUEST_ENTITY_TOO_LARGE"), + + RUN_ALREADY_ACTIVE("RUN_ALREADY_ACTIVE"), + + SELF_DELETION_NOT_ALLOWED("SELF_DELETION_NOT_ALLOWED"), + + SERVICE_UNAVAILABLE("SERVICE_UNAVAILABLE"), + + TOKEN_EXPIRED("TOKEN_EXPIRED"), + + TOKEN_REUSED("TOKEN_REUSED"), + + TOO_MANY_REQUESTS("TOO_MANY_REQUESTS"), + + UNAUTHORIZED("UNAUTHORIZED"), + + UNSUPPORTED_MEDIA_TYPE("UNSUPPORTED_MEDIA_TYPE"), + + VALIDATION_FAILED("VALIDATION_FAILED"), + + VERIFICATION_EXPIRED("VERIFICATION_EXPIRED"), + + VERIFICATION_NOT_FOUND("VERIFICATION_NOT_FOUND"); + + private String value; + + CodeEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static CodeEnum fromValue(String value) { + for (CodeEnum b : CodeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final CodeEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public CodeEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return CodeEnum.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + CodeEnum.fromValue(value); + } + } + + public static final String SERIALIZED_NAME_CODE = "code"; + @SerializedName(SERIALIZED_NAME_CODE) + @javax.annotation.Nonnull + private CodeEnum code; + + public static final String SERIALIZED_NAME_DETAIL = "detail"; + @SerializedName(SERIALIZED_NAME_DETAIL) + @javax.annotation.Nullable + private String detail; + + public static final String SERIALIZED_NAME_DOC_URL = "doc_url"; + @SerializedName(SERIALIZED_NAME_DOC_URL) + @javax.annotation.Nullable + private String docUrl; + + public static final String SERIALIZED_NAME_MESSAGE = "message"; + @SerializedName(SERIALIZED_NAME_MESSAGE) + @javax.annotation.Nonnull + private String message; + + public static final String SERIALIZED_NAME_TRACE_ID = "trace_id"; + @SerializedName(SERIALIZED_NAME_TRACE_ID) + @javax.annotation.Nonnull + private String traceId; + + public ErrorBody() { + } + + public ErrorBody code(@javax.annotation.Nonnull CodeEnum code) { + this.code = code; + return this; + } + + /** + * Stable, machine-readable error code. Versioned and documented. + * @return code + */ + @javax.annotation.Nonnull + public CodeEnum getCode() { + return code; + } + + public void setCode(@javax.annotation.Nonnull CodeEnum code) { + this.code = code; + } + + + public ErrorBody detail(@javax.annotation.Nullable String detail) { + this.detail = detail; + return this; + } + + /** + * Additional context where helpful (quota numbers, validation specifics, etc.). + * @return detail + */ + @javax.annotation.Nullable + public String getDetail() { + return detail; + } + + public void setDetail(@javax.annotation.Nullable String detail) { + this.detail = detail; + } + + + public ErrorBody docUrl(@javax.annotation.Nullable String docUrl) { + this.docUrl = docUrl; + return this; + } + + /** + * Link to documentation explaining this error and resolution steps. + * @return docUrl + */ + @javax.annotation.Nullable + public String getDocUrl() { + return docUrl; + } + + public void setDocUrl(@javax.annotation.Nullable String docUrl) { + this.docUrl = docUrl; + } + + + public ErrorBody message(@javax.annotation.Nonnull String message) { + this.message = message; + return this; + } + + /** + * Human-readable summary. Never contains internals. Suitable for direct display. + * @return message + */ + @javax.annotation.Nonnull + public String getMessage() { + return message; + } + + public void setMessage(@javax.annotation.Nonnull String message) { + this.message = message; + } + + + public ErrorBody traceId(@javax.annotation.Nonnull String traceId) { + this.traceId = traceId; + return this; + } + + /** + * Correlation ID from the request. Quote this in support requests. + * @return traceId + */ + @javax.annotation.Nonnull + public String getTraceId() { + return traceId; + } + + public void setTraceId(@javax.annotation.Nonnull String traceId) { + this.traceId = traceId; + } + + /** + * 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 ErrorBody instance itself + */ + public ErrorBody 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; + } + ErrorBody errorBody = (ErrorBody) o; + return Objects.equals(this.code, errorBody.code) && + Objects.equals(this.detail, errorBody.detail) && + Objects.equals(this.docUrl, errorBody.docUrl) && + Objects.equals(this.message, errorBody.message) && + Objects.equals(this.traceId, errorBody.traceId)&& + Objects.equals(this.additionalProperties, errorBody.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(code, detail, docUrl, message, traceId, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ErrorBody {\n"); + sb.append(" code: ").append(toIndentedString(code)).append("\n"); + sb.append(" detail: ").append(toIndentedString(detail)).append("\n"); + sb.append(" docUrl: ").append(toIndentedString(docUrl)).append("\n"); + sb.append(" message: ").append(toIndentedString(message)).append("\n"); + sb.append(" traceId: ").append(toIndentedString(traceId)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(Arrays.asList("code", "detail", "doc_url", "message", "trace_id")); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(Arrays.asList("code", "message", "trace_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 ErrorBody + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ErrorBody.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format(Locale.ROOT, "The required field(s) %s in ErrorBody is not found in the empty JSON string", ErrorBody.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : ErrorBody.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format(Locale.ROOT, "The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("code").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(Locale.ROOT, "Expected the field `code` to be a primitive type in the JSON string but got `%s`", jsonObj.get("code").toString())); + } + // validate the required field `code` + CodeEnum.validateJsonElement(jsonObj.get("code")); + if ((jsonObj.get("detail") != null && !jsonObj.get("detail").isJsonNull()) && !jsonObj.get("detail").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(Locale.ROOT, "Expected the field `detail` to be a primitive type in the JSON string but got `%s`", jsonObj.get("detail").toString())); + } + if ((jsonObj.get("doc_url") != null && !jsonObj.get("doc_url").isJsonNull()) && !jsonObj.get("doc_url").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(Locale.ROOT, "Expected the field `doc_url` to be a primitive type in the JSON string but got `%s`", jsonObj.get("doc_url").toString())); + } + if (!jsonObj.get("message").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(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("trace_id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(Locale.ROOT, "Expected the field `trace_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("trace_id").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ErrorBody.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ErrorBody' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ErrorBody.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, ErrorBody 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 ErrorBody read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + ErrorBody instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format(Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ErrorBody given an JSON string + * + * @param jsonString JSON string + * @return An instance of ErrorBody + * @throws IOException if the JSON string is invalid with respect to ErrorBody + */ + public static ErrorBody fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ErrorBody.class); + } + + /** + * Convert an instance of ErrorBody to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/ai/reveng/model/Event.java b/src/main/java/ai/reveng/model/Event.java new file mode 100644 index 0000000..d0dc60d --- /dev/null +++ b/src/main/java/ai/reveng/model/Event.java @@ -0,0 +1,451 @@ +/* + * RevEng.AI API + * RevEng.AI is an AI-powered binary analysis platform for reverse engineering and malware analysis. It provides similarity search across executable binaries and functions, AI-driven decompilation, dynamic execution analysis, firmware unpacking, and integration with external threat intelligence sources like VirusTotal. + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package ai.reveng.model; + +import java.util.Objects; +import java.util.Locale; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; +import java.util.Locale; + +import ai.reveng.invoker.JSON; + +/** + * Event + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class Event { + 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_DATA = "data"; + @SerializedName(SERIALIZED_NAME_DATA) + @javax.annotation.Nullable + private Object data = null; + + 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_ROLE = "role"; + @SerializedName(SERIALIZED_NAME_ROLE) + @javax.annotation.Nonnull + private Integer role; + + public static final String SERIALIZED_NAME_TOKENS_USED = "tokens_used"; + @SerializedName(SERIALIZED_NAME_TOKENS_USED) + @javax.annotation.Nonnull + private Long tokensUsed; + + public static final String SERIALIZED_NAME_TYPE = "type"; + @SerializedName(SERIALIZED_NAME_TYPE) + @javax.annotation.Nonnull + private Integer type; + + public Event() { + } + + public Event conversationUuid(@javax.annotation.Nonnull String conversationUuid) { + this.conversationUuid = conversationUuid; + return this; + } + + /** + * Get conversationUuid + * @return conversationUuid + */ + @javax.annotation.Nonnull + public String getConversationUuid() { + return conversationUuid; + } + + public void setConversationUuid(@javax.annotation.Nonnull String conversationUuid) { + this.conversationUuid = conversationUuid; + } + + + public Event 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 Event data(@javax.annotation.Nullable Object data) { + this.data = data; + return this; + } + + /** + * Get data + * @return data + */ + @javax.annotation.Nullable + public Object getData() { + return data; + } + + public void setData(@javax.annotation.Nullable Object data) { + this.data = data; + } + + + public Event eventId(@javax.annotation.Nonnull Long eventId) { + this.eventId = eventId; + return this; + } + + /** + * Get eventId + * @return eventId + */ + @javax.annotation.Nonnull + public Long getEventId() { + return eventId; + } + + public void setEventId(@javax.annotation.Nonnull Long eventId) { + this.eventId = eventId; + } + + + public Event role(@javax.annotation.Nonnull Integer role) { + this.role = role; + return this; + } + + /** + * Get role + * @return role + */ + @javax.annotation.Nonnull + public Integer getRole() { + return role; + } + + public void setRole(@javax.annotation.Nonnull Integer role) { + this.role = role; + } + + + public Event tokensUsed(@javax.annotation.Nonnull Long tokensUsed) { + this.tokensUsed = tokensUsed; + return this; + } + + /** + * Get tokensUsed + * @return tokensUsed + */ + @javax.annotation.Nonnull + public Long getTokensUsed() { + return tokensUsed; + } + + public void setTokensUsed(@javax.annotation.Nonnull Long tokensUsed) { + this.tokensUsed = tokensUsed; + } + + + public Event type(@javax.annotation.Nonnull Integer type) { + this.type = type; + return this; + } + + /** + * Get type + * @return type + */ + @javax.annotation.Nonnull + public Integer getType() { + return type; + } + + public void setType(@javax.annotation.Nonnull Integer 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 Event instance itself + */ + public Event 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; + } + Event event = (Event) o; + return Objects.equals(this.conversationUuid, event.conversationUuid) && + Objects.equals(this.createdAt, event.createdAt) && + Objects.equals(this.data, event.data) && + Objects.equals(this.eventId, event.eventId) && + Objects.equals(this.role, event.role) && + Objects.equals(this.tokensUsed, event.tokensUsed) && + Objects.equals(this.type, event.type)&& + Objects.equals(this.additionalProperties, event.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(conversationUuid, createdAt, data, eventId, role, tokensUsed, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Event {\n"); + sb.append(" conversationUuid: ").append(toIndentedString(conversationUuid)).append("\n"); + sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" eventId: ").append(toIndentedString(eventId)).append("\n"); + sb.append(" role: ").append(toIndentedString(role)).append("\n"); + sb.append(" tokensUsed: ").append(toIndentedString(tokensUsed)).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) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(Arrays.asList("conversation_uuid", "created_at", "data", "event_id", "role", "tokens_used", "type")); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(Arrays.asList("conversation_uuid", "created_at", "data", "event_id", "role", "tokens_used", "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 Event + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!Event.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format(Locale.ROOT, "The required field(s) %s in Event is not found in the empty JSON string", Event.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : Event.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format(Locale.ROOT, "The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("conversation_uuid").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(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 (!Event.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'Event' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(Event.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, Event 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 Event read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + Event instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format(Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of Event given an JSON string + * + * @param jsonString JSON string + * @return An instance of Event + * @throws IOException if the JSON string is invalid with respect to Event + */ + public static Event fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, Event.class); + } + + /** + * Convert an instance of Event to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/ai/reveng/model/EventCONTEXTCOMPACTED.java b/src/main/java/ai/reveng/model/EventCONTEXTCOMPACTED.java new file mode 100644 index 0000000..66f55ad --- /dev/null +++ b/src/main/java/ai/reveng/model/EventCONTEXTCOMPACTED.java @@ -0,0 +1,425 @@ +/* + * RevEng.AI API + * RevEng.AI is an AI-powered binary analysis platform for reverse engineering and malware analysis. It provides similarity search across executable binaries and functions, AI-driven decompilation, dynamic execution analysis, firmware unpacking, and integration with external threat intelligence sources like VirusTotal. + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package ai.reveng.model; + +import java.util.Objects; +import java.util.Locale; +import ai.reveng.model.SseEventContextCompactedData; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; +import java.util.Locale; + +import ai.reveng.invoker.JSON; + +/** + * EventCONTEXTCOMPACTED + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class EventCONTEXTCOMPACTED { + public static final String SERIALIZED_NAME_DATA = "data"; + @SerializedName(SERIALIZED_NAME_DATA) + @javax.annotation.Nonnull + private SseEventContextCompactedData data; + + /** + * The event name. + */ + @JsonAdapter(EventEnum.Adapter.class) + public enum EventEnum { + CONTEXT_COMPACTED("CONTEXT_COMPACTED"); + + 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; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + 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 EventCONTEXTCOMPACTED() { + } + + public EventCONTEXTCOMPACTED data(@javax.annotation.Nonnull SseEventContextCompactedData data) { + this.data = data; + return this; + } + + /** + * Get data + * @return data + */ + @javax.annotation.Nonnull + public SseEventContextCompactedData getData() { + return data; + } + + public void setData(@javax.annotation.Nonnull SseEventContextCompactedData data) { + this.data = data; + } + + + public EventCONTEXTCOMPACTED 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 EventCONTEXTCOMPACTED 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 EventCONTEXTCOMPACTED 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 EventCONTEXTCOMPACTED instance itself + */ + public EventCONTEXTCOMPACTED 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; + } + EventCONTEXTCOMPACTED eventCONTEXTCOMPACTED = (EventCONTEXTCOMPACTED) o; + return Objects.equals(this.data, eventCONTEXTCOMPACTED.data) && + Objects.equals(this.event, eventCONTEXTCOMPACTED.event) && + Objects.equals(this.id, eventCONTEXTCOMPACTED.id) && + Objects.equals(this.retry, eventCONTEXTCOMPACTED.retry)&& + Objects.equals(this.additionalProperties, eventCONTEXTCOMPACTED.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, event, id, retry, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class EventCONTEXTCOMPACTED {\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) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(Arrays.asList("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 EventCONTEXTCOMPACTED + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!EventCONTEXTCOMPACTED.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format(Locale.ROOT, "The required field(s) %s in EventCONTEXTCOMPACTED is not found in the empty JSON string", EventCONTEXTCOMPACTED.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : EventCONTEXTCOMPACTED.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format(Locale.ROOT, "The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("event").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(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 (!EventCONTEXTCOMPACTED.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'EventCONTEXTCOMPACTED' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(EventCONTEXTCOMPACTED.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, EventCONTEXTCOMPACTED 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 EventCONTEXTCOMPACTED read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + EventCONTEXTCOMPACTED instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format(Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of EventCONTEXTCOMPACTED given an JSON string + * + * @param jsonString JSON string + * @return An instance of EventCONTEXTCOMPACTED + * @throws IOException if the JSON string is invalid with respect to EventCONTEXTCOMPACTED + */ + public static EventCONTEXTCOMPACTED fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, EventCONTEXTCOMPACTED.class); + } + + /** + * Convert an instance of EventCONTEXTCOMPACTED to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/ai/reveng/model/EventRUNCANCELLED.java b/src/main/java/ai/reveng/model/EventRUNCANCELLED.java new file mode 100644 index 0000000..445f989 --- /dev/null +++ b/src/main/java/ai/reveng/model/EventRUNCANCELLED.java @@ -0,0 +1,425 @@ +/* + * RevEng.AI API + * RevEng.AI is an AI-powered binary analysis platform for reverse engineering and malware analysis. It provides similarity search across executable binaries and functions, AI-driven decompilation, dynamic execution analysis, firmware unpacking, and integration with external threat intelligence sources like VirusTotal. + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package ai.reveng.model; + +import java.util.Objects; +import java.util.Locale; +import ai.reveng.model.SseEventRunCancelledData; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; +import java.util.Locale; + +import ai.reveng.invoker.JSON; + +/** + * EventRUNCANCELLED + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class EventRUNCANCELLED { + public static final String SERIALIZED_NAME_DATA = "data"; + @SerializedName(SERIALIZED_NAME_DATA) + @javax.annotation.Nonnull + private SseEventRunCancelledData data; + + /** + * The event name. + */ + @JsonAdapter(EventEnum.Adapter.class) + public enum EventEnum { + RUN_CANCELLED("RUN_CANCELLED"); + + 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; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + 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 EventRUNCANCELLED() { + } + + public EventRUNCANCELLED data(@javax.annotation.Nonnull SseEventRunCancelledData data) { + this.data = data; + return this; + } + + /** + * Get data + * @return data + */ + @javax.annotation.Nonnull + public SseEventRunCancelledData getData() { + return data; + } + + public void setData(@javax.annotation.Nonnull SseEventRunCancelledData data) { + this.data = data; + } + + + public EventRUNCANCELLED 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 EventRUNCANCELLED 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 EventRUNCANCELLED 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 EventRUNCANCELLED instance itself + */ + public EventRUNCANCELLED 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; + } + EventRUNCANCELLED eventRUNCANCELLED = (EventRUNCANCELLED) o; + return Objects.equals(this.data, eventRUNCANCELLED.data) && + Objects.equals(this.event, eventRUNCANCELLED.event) && + Objects.equals(this.id, eventRUNCANCELLED.id) && + Objects.equals(this.retry, eventRUNCANCELLED.retry)&& + Objects.equals(this.additionalProperties, eventRUNCANCELLED.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, event, id, retry, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class EventRUNCANCELLED {\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) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(Arrays.asList("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 EventRUNCANCELLED + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!EventRUNCANCELLED.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format(Locale.ROOT, "The required field(s) %s in EventRUNCANCELLED is not found in the empty JSON string", EventRUNCANCELLED.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : EventRUNCANCELLED.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format(Locale.ROOT, "The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("event").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(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 (!EventRUNCANCELLED.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'EventRUNCANCELLED' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(EventRUNCANCELLED.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, EventRUNCANCELLED 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 EventRUNCANCELLED read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + EventRUNCANCELLED instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format(Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of EventRUNCANCELLED given an JSON string + * + * @param jsonString JSON string + * @return An instance of EventRUNCANCELLED + * @throws IOException if the JSON string is invalid with respect to EventRUNCANCELLED + */ + public static EventRUNCANCELLED fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, EventRUNCANCELLED.class); + } + + /** + * Convert an instance of EventRUNCANCELLED to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/ai/reveng/model/Registry.java b/src/main/java/ai/reveng/model/EventRUNERROR.java similarity index 61% rename from src/main/java/ai/reveng/model/Registry.java rename to src/main/java/ai/reveng/model/EventRUNERROR.java index 9b18552..f42b29f 100644 --- a/src/main/java/ai/reveng/model/Registry.java +++ b/src/main/java/ai/reveng/model/EventRUNERROR.java @@ -14,6 +14,7 @@ import java.util.Objects; import java.util.Locale; +import ai.reveng.model.SseEventRunErrorData; import com.google.gson.TypeAdapter; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; @@ -47,106 +48,156 @@ import ai.reveng.invoker.JSON; /** - * Registry + * EventRUNERROR */ @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class Registry { - public static final String SERIALIZED_NAME_METHOD = "method"; - @SerializedName(SERIALIZED_NAME_METHOD) +public class EventRUNERROR { + public static final String SERIALIZED_NAME_DATA = "data"; + @SerializedName(SERIALIZED_NAME_DATA) @javax.annotation.Nonnull - private String method; + private SseEventRunErrorData data; - public static final String SERIALIZED_NAME_KEY = "key"; - @SerializedName(SERIALIZED_NAME_KEY) + /** + * The event name. + */ + @JsonAdapter(EventEnum.Adapter.class) + public enum EventEnum { + RUN_ERROR("RUN_ERROR"); + + 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; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + 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 String key; + private EventEnum event; - public static final String SERIALIZED_NAME_VALUE_NAME = "value_name"; - @SerializedName(SERIALIZED_NAME_VALUE_NAME) + public static final String SERIALIZED_NAME_ID = "id"; + @SerializedName(SERIALIZED_NAME_ID) @javax.annotation.Nullable - private String valueName; + private Integer id; - public static final String SERIALIZED_NAME_VALUE = "value"; - @SerializedName(SERIALIZED_NAME_VALUE) + public static final String SERIALIZED_NAME_RETRY = "retry"; + @SerializedName(SERIALIZED_NAME_RETRY) @javax.annotation.Nullable - private String value; + private Integer retry; - public Registry() { + public EventRUNERROR() { } - public Registry method(@javax.annotation.Nonnull String method) { - this.method = method; + public EventRUNERROR data(@javax.annotation.Nonnull SseEventRunErrorData data) { + this.data = data; return this; } /** - * Get method - * @return method + * Get data + * @return data */ @javax.annotation.Nonnull - public String getMethod() { - return method; + public SseEventRunErrorData getData() { + return data; } - public void setMethod(@javax.annotation.Nonnull String method) { - this.method = method; + public void setData(@javax.annotation.Nonnull SseEventRunErrorData data) { + this.data = data; } - public Registry key(@javax.annotation.Nonnull String key) { - this.key = key; + public EventRUNERROR event(@javax.annotation.Nonnull EventEnum event) { + this.event = event; return this; } /** - * Get key - * @return key + * The event name. + * @return event */ @javax.annotation.Nonnull - public String getKey() { - return key; + public EventEnum getEvent() { + return event; } - public void setKey(@javax.annotation.Nonnull String key) { - this.key = key; + public void setEvent(@javax.annotation.Nonnull EventEnum event) { + this.event = event; } - public Registry valueName(@javax.annotation.Nullable String valueName) { - this.valueName = valueName; + public EventRUNERROR id(@javax.annotation.Nullable Integer id) { + this.id = id; return this; } /** - * Get valueName - * @return valueName + * The event ID. + * @return id */ @javax.annotation.Nullable - public String getValueName() { - return valueName; + public Integer getId() { + return id; } - public void setValueName(@javax.annotation.Nullable String valueName) { - this.valueName = valueName; + public void setId(@javax.annotation.Nullable Integer id) { + this.id = id; } - public Registry value(@javax.annotation.Nullable String value) { - this.value = value; + public EventRUNERROR retry(@javax.annotation.Nullable Integer retry) { + this.retry = retry; return this; } /** - * Get value - * @return value + * The retry time in milliseconds. + * @return retry */ @javax.annotation.Nullable - public String getValue() { - return value; + public Integer getRetry() { + return retry; } - public void setValue(@javax.annotation.Nullable String value) { - this.value = value; + public void setRetry(@javax.annotation.Nullable Integer retry) { + this.retry = retry; } /** @@ -162,9 +213,9 @@ public void setValue(@javax.annotation.Nullable String value) { * * @param key name of the property * @param value value of the property - * @return the Registry instance itself + * @return the EventRUNERROR instance itself */ - public Registry putAdditionalProperty(String key, Object value) { + public EventRUNERROR putAdditionalProperty(String key, Object value) { if (this.additionalProperties == null) { this.additionalProperties = new HashMap(); } @@ -203,27 +254,27 @@ public boolean equals(Object o) { if (o == null || getClass() != o.getClass()) { return false; } - Registry registry = (Registry) o; - return Objects.equals(this.method, registry.method) && - Objects.equals(this.key, registry.key) && - Objects.equals(this.valueName, registry.valueName) && - Objects.equals(this.value, registry.value)&& - Objects.equals(this.additionalProperties, registry.additionalProperties); + EventRUNERROR eventRUNERROR = (EventRUNERROR) o; + return Objects.equals(this.data, eventRUNERROR.data) && + Objects.equals(this.event, eventRUNERROR.event) && + Objects.equals(this.id, eventRUNERROR.id) && + Objects.equals(this.retry, eventRUNERROR.retry)&& + Objects.equals(this.additionalProperties, eventRUNERROR.additionalProperties); } @Override public int hashCode() { - return Objects.hash(method, key, valueName, value, additionalProperties); + return Objects.hash(data, event, id, retry, additionalProperties); } @Override public String toString() { StringBuilder sb = new StringBuilder(); - sb.append("class Registry {\n"); - sb.append(" method: ").append(toIndentedString(method)).append("\n"); - sb.append(" key: ").append(toIndentedString(key)).append("\n"); - sb.append(" valueName: ").append(toIndentedString(valueName)).append("\n"); - sb.append(" value: ").append(toIndentedString(value)).append("\n"); + sb.append("class EventRUNERROR {\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(); @@ -246,60 +297,53 @@ private String toIndentedString(Object o) { static { // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(Arrays.asList("method", "key", "value_name", "value")); + openapiFields = new HashSet(Arrays.asList("data", "event", "id", "retry")); // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(Arrays.asList("method", "key", "value_name", "value")); + 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 Registry + * @throws IOException if the JSON Element is invalid with respect to EventRUNERROR */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (jsonElement == null) { - if (!Registry.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format(Locale.ROOT, "The required field(s) %s in Registry is not found in the empty JSON string", Registry.openapiRequiredFields.toString())); + if (!EventRUNERROR.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format(Locale.ROOT, "The required field(s) %s in EventRUNERROR is not found in the empty JSON string", EventRUNERROR.openapiRequiredFields.toString())); } } // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : Registry.openapiRequiredFields) { + for (String requiredField : EventRUNERROR.openapiRequiredFields) { if (jsonElement.getAsJsonObject().get(requiredField) == null) { throw new IllegalArgumentException(String.format(Locale.ROOT, "The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); } } JsonObject jsonObj = jsonElement.getAsJsonObject(); - if (!jsonObj.get("method").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format(Locale.ROOT, "Expected the field `method` to be a primitive type in the JSON string but got `%s`", jsonObj.get("method").toString())); - } - if (!jsonObj.get("key").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format(Locale.ROOT, "Expected the field `key` to be a primitive type in the JSON string but got `%s`", jsonObj.get("key").toString())); - } - if ((jsonObj.get("value_name") != null && !jsonObj.get("value_name").isJsonNull()) && !jsonObj.get("value_name").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format(Locale.ROOT, "Expected the field `value_name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("value_name").toString())); - } - if ((jsonObj.get("value") != null && !jsonObj.get("value").isJsonNull()) && !jsonObj.get("value").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format(Locale.ROOT, "Expected the field `value` to be a primitive type in the JSON string but got `%s`", jsonObj.get("value").toString())); + if (!jsonObj.get("event").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(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 (!Registry.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'Registry' and its subtypes + if (!EventRUNERROR.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'EventRUNERROR' and its subtypes } final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(Registry.class)); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(EventRUNERROR.class)); - return (TypeAdapter) new TypeAdapter() { + return (TypeAdapter) new TypeAdapter() { @Override - public void write(JsonWriter out, Registry value) throws IOException { + public void write(JsonWriter out, EventRUNERROR value) throws IOException { JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); obj.remove("additionalProperties"); // serialize additional properties @@ -327,12 +371,12 @@ else if (entry.getValue() instanceof Character) } @Override - public Registry read(JsonReader in) throws IOException { + public EventRUNERROR read(JsonReader in) throws IOException { JsonElement jsonElement = elementAdapter.read(in); validateJsonElement(jsonElement); JsonObject jsonObj = jsonElement.getAsJsonObject(); // store additional fields in the deserialized instance - Registry instance = thisAdapter.fromJsonTree(jsonObj); + EventRUNERROR instance = thisAdapter.fromJsonTree(jsonObj); for (Map.Entry entry : jsonObj.entrySet()) { if (!openapiFields.contains(entry.getKey())) { if (entry.getValue().isJsonPrimitive()) { // primitive type @@ -359,18 +403,18 @@ else if (entry.getValue().getAsJsonPrimitive().isBoolean()) } /** - * Create an instance of Registry given an JSON string + * Create an instance of EventRUNERROR given an JSON string * * @param jsonString JSON string - * @return An instance of Registry - * @throws IOException if the JSON string is invalid with respect to Registry + * @return An instance of EventRUNERROR + * @throws IOException if the JSON string is invalid with respect to EventRUNERROR */ - public static Registry fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, Registry.class); + public static EventRUNERROR fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, EventRUNERROR.class); } /** - * Convert an instance of Registry to an JSON string + * Convert an instance of EventRUNERROR to an JSON string * * @return JSON string */ diff --git a/src/main/java/ai/reveng/model/EventRUNFINISHED.java b/src/main/java/ai/reveng/model/EventRUNFINISHED.java new file mode 100644 index 0000000..b1f3eca --- /dev/null +++ b/src/main/java/ai/reveng/model/EventRUNFINISHED.java @@ -0,0 +1,425 @@ +/* + * RevEng.AI API + * RevEng.AI is an AI-powered binary analysis platform for reverse engineering and malware analysis. It provides similarity search across executable binaries and functions, AI-driven decompilation, dynamic execution analysis, firmware unpacking, and integration with external threat intelligence sources like VirusTotal. + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package ai.reveng.model; + +import java.util.Objects; +import java.util.Locale; +import ai.reveng.model.SseEventRunFinishedData; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; +import java.util.Locale; + +import ai.reveng.invoker.JSON; + +/** + * EventRUNFINISHED + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class EventRUNFINISHED { + public static final String SERIALIZED_NAME_DATA = "data"; + @SerializedName(SERIALIZED_NAME_DATA) + @javax.annotation.Nonnull + private SseEventRunFinishedData data; + + /** + * The event name. + */ + @JsonAdapter(EventEnum.Adapter.class) + public enum EventEnum { + RUN_FINISHED("RUN_FINISHED"); + + 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; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + 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 EventRUNFINISHED() { + } + + public EventRUNFINISHED data(@javax.annotation.Nonnull SseEventRunFinishedData data) { + this.data = data; + return this; + } + + /** + * Get data + * @return data + */ + @javax.annotation.Nonnull + public SseEventRunFinishedData getData() { + return data; + } + + public void setData(@javax.annotation.Nonnull SseEventRunFinishedData data) { + this.data = data; + } + + + public EventRUNFINISHED 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 EventRUNFINISHED 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 EventRUNFINISHED 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 EventRUNFINISHED instance itself + */ + public EventRUNFINISHED 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; + } + EventRUNFINISHED eventRUNFINISHED = (EventRUNFINISHED) o; + return Objects.equals(this.data, eventRUNFINISHED.data) && + Objects.equals(this.event, eventRUNFINISHED.event) && + Objects.equals(this.id, eventRUNFINISHED.id) && + Objects.equals(this.retry, eventRUNFINISHED.retry)&& + Objects.equals(this.additionalProperties, eventRUNFINISHED.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, event, id, retry, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class EventRUNFINISHED {\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) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(Arrays.asList("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 EventRUNFINISHED + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!EventRUNFINISHED.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format(Locale.ROOT, "The required field(s) %s in EventRUNFINISHED is not found in the empty JSON string", EventRUNFINISHED.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : EventRUNFINISHED.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format(Locale.ROOT, "The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("event").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(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 (!EventRUNFINISHED.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'EventRUNFINISHED' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(EventRUNFINISHED.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, EventRUNFINISHED 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 EventRUNFINISHED read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + EventRUNFINISHED instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format(Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of EventRUNFINISHED given an JSON string + * + * @param jsonString JSON string + * @return An instance of EventRUNFINISHED + * @throws IOException if the JSON string is invalid with respect to EventRUNFINISHED + */ + public static EventRUNFINISHED fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, EventRUNFINISHED.class); + } + + /** + * Convert an instance of EventRUNFINISHED to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/ai/reveng/model/EventRUNSTARTED.java b/src/main/java/ai/reveng/model/EventRUNSTARTED.java new file mode 100644 index 0000000..6741257 --- /dev/null +++ b/src/main/java/ai/reveng/model/EventRUNSTARTED.java @@ -0,0 +1,425 @@ +/* + * RevEng.AI API + * RevEng.AI is an AI-powered binary analysis platform for reverse engineering and malware analysis. It provides similarity search across executable binaries and functions, AI-driven decompilation, dynamic execution analysis, firmware unpacking, and integration with external threat intelligence sources like VirusTotal. + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package ai.reveng.model; + +import java.util.Objects; +import java.util.Locale; +import ai.reveng.model.SseEventRunStartedData; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; +import java.util.Locale; + +import ai.reveng.invoker.JSON; + +/** + * EventRUNSTARTED + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class EventRUNSTARTED { + public static final String SERIALIZED_NAME_DATA = "data"; + @SerializedName(SERIALIZED_NAME_DATA) + @javax.annotation.Nonnull + private SseEventRunStartedData data; + + /** + * The event name. + */ + @JsonAdapter(EventEnum.Adapter.class) + public enum EventEnum { + RUN_STARTED("RUN_STARTED"); + + 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; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + 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 EventRUNSTARTED() { + } + + public EventRUNSTARTED data(@javax.annotation.Nonnull SseEventRunStartedData data) { + this.data = data; + return this; + } + + /** + * Get data + * @return data + */ + @javax.annotation.Nonnull + public SseEventRunStartedData getData() { + return data; + } + + public void setData(@javax.annotation.Nonnull SseEventRunStartedData data) { + this.data = data; + } + + + public EventRUNSTARTED 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 EventRUNSTARTED 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 EventRUNSTARTED 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 EventRUNSTARTED instance itself + */ + public EventRUNSTARTED 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; + } + EventRUNSTARTED eventRUNSTARTED = (EventRUNSTARTED) o; + return Objects.equals(this.data, eventRUNSTARTED.data) && + Objects.equals(this.event, eventRUNSTARTED.event) && + Objects.equals(this.id, eventRUNSTARTED.id) && + Objects.equals(this.retry, eventRUNSTARTED.retry)&& + Objects.equals(this.additionalProperties, eventRUNSTARTED.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, event, id, retry, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class EventRUNSTARTED {\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) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(Arrays.asList("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 EventRUNSTARTED + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!EventRUNSTARTED.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format(Locale.ROOT, "The required field(s) %s in EventRUNSTARTED is not found in the empty JSON string", EventRUNSTARTED.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : EventRUNSTARTED.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format(Locale.ROOT, "The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("event").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(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 (!EventRUNSTARTED.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'EventRUNSTARTED' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(EventRUNSTARTED.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, EventRUNSTARTED 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 EventRUNSTARTED read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + EventRUNSTARTED instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format(Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of EventRUNSTARTED given an JSON string + * + * @param jsonString JSON string + * @return An instance of EventRUNSTARTED + * @throws IOException if the JSON string is invalid with respect to EventRUNSTARTED + */ + public static EventRUNSTARTED fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, EventRUNSTARTED.class); + } + + /** + * Convert an instance of EventRUNSTARTED to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/ai/reveng/model/EventSTEPFINISHED.java b/src/main/java/ai/reveng/model/EventSTEPFINISHED.java new file mode 100644 index 0000000..1fa80e0 --- /dev/null +++ b/src/main/java/ai/reveng/model/EventSTEPFINISHED.java @@ -0,0 +1,425 @@ +/* + * RevEng.AI API + * RevEng.AI is an AI-powered binary analysis platform for reverse engineering and malware analysis. It provides similarity search across executable binaries and functions, AI-driven decompilation, dynamic execution analysis, firmware unpacking, and integration with external threat intelligence sources like VirusTotal. + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package ai.reveng.model; + +import java.util.Objects; +import java.util.Locale; +import ai.reveng.model.SseEventStepFinishedData; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; +import java.util.Locale; + +import ai.reveng.invoker.JSON; + +/** + * EventSTEPFINISHED + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class EventSTEPFINISHED { + public static final String SERIALIZED_NAME_DATA = "data"; + @SerializedName(SERIALIZED_NAME_DATA) + @javax.annotation.Nonnull + private SseEventStepFinishedData data; + + /** + * The event name. + */ + @JsonAdapter(EventEnum.Adapter.class) + public enum EventEnum { + STEP_FINISHED("STEP_FINISHED"); + + 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; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + 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 EventSTEPFINISHED() { + } + + public EventSTEPFINISHED data(@javax.annotation.Nonnull SseEventStepFinishedData data) { + this.data = data; + return this; + } + + /** + * Get data + * @return data + */ + @javax.annotation.Nonnull + public SseEventStepFinishedData getData() { + return data; + } + + public void setData(@javax.annotation.Nonnull SseEventStepFinishedData data) { + this.data = data; + } + + + public EventSTEPFINISHED 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 EventSTEPFINISHED 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 EventSTEPFINISHED 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 EventSTEPFINISHED instance itself + */ + public EventSTEPFINISHED 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; + } + EventSTEPFINISHED eventSTEPFINISHED = (EventSTEPFINISHED) o; + return Objects.equals(this.data, eventSTEPFINISHED.data) && + Objects.equals(this.event, eventSTEPFINISHED.event) && + Objects.equals(this.id, eventSTEPFINISHED.id) && + Objects.equals(this.retry, eventSTEPFINISHED.retry)&& + Objects.equals(this.additionalProperties, eventSTEPFINISHED.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, event, id, retry, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class EventSTEPFINISHED {\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) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(Arrays.asList("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 EventSTEPFINISHED + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!EventSTEPFINISHED.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format(Locale.ROOT, "The required field(s) %s in EventSTEPFINISHED is not found in the empty JSON string", EventSTEPFINISHED.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : EventSTEPFINISHED.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format(Locale.ROOT, "The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("event").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(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 (!EventSTEPFINISHED.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'EventSTEPFINISHED' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(EventSTEPFINISHED.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, EventSTEPFINISHED 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 EventSTEPFINISHED read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + EventSTEPFINISHED instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format(Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of EventSTEPFINISHED given an JSON string + * + * @param jsonString JSON string + * @return An instance of EventSTEPFINISHED + * @throws IOException if the JSON string is invalid with respect to EventSTEPFINISHED + */ + public static EventSTEPFINISHED fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, EventSTEPFINISHED.class); + } + + /** + * Convert an instance of EventSTEPFINISHED to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/ai/reveng/model/EventSTEPSTARTED.java b/src/main/java/ai/reveng/model/EventSTEPSTARTED.java new file mode 100644 index 0000000..efad784 --- /dev/null +++ b/src/main/java/ai/reveng/model/EventSTEPSTARTED.java @@ -0,0 +1,425 @@ +/* + * RevEng.AI API + * RevEng.AI is an AI-powered binary analysis platform for reverse engineering and malware analysis. It provides similarity search across executable binaries and functions, AI-driven decompilation, dynamic execution analysis, firmware unpacking, and integration with external threat intelligence sources like VirusTotal. + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package ai.reveng.model; + +import java.util.Objects; +import java.util.Locale; +import ai.reveng.model.SseEventStepStartedData; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; +import java.util.Locale; + +import ai.reveng.invoker.JSON; + +/** + * EventSTEPSTARTED + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class EventSTEPSTARTED { + public static final String SERIALIZED_NAME_DATA = "data"; + @SerializedName(SERIALIZED_NAME_DATA) + @javax.annotation.Nonnull + private SseEventStepStartedData data; + + /** + * The event name. + */ + @JsonAdapter(EventEnum.Adapter.class) + public enum EventEnum { + STEP_STARTED("STEP_STARTED"); + + 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; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + 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 EventSTEPSTARTED() { + } + + public EventSTEPSTARTED data(@javax.annotation.Nonnull SseEventStepStartedData data) { + this.data = data; + return this; + } + + /** + * Get data + * @return data + */ + @javax.annotation.Nonnull + public SseEventStepStartedData getData() { + return data; + } + + public void setData(@javax.annotation.Nonnull SseEventStepStartedData data) { + this.data = data; + } + + + public EventSTEPSTARTED 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 EventSTEPSTARTED 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 EventSTEPSTARTED 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 EventSTEPSTARTED instance itself + */ + public EventSTEPSTARTED 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; + } + EventSTEPSTARTED eventSTEPSTARTED = (EventSTEPSTARTED) o; + return Objects.equals(this.data, eventSTEPSTARTED.data) && + Objects.equals(this.event, eventSTEPSTARTED.event) && + Objects.equals(this.id, eventSTEPSTARTED.id) && + Objects.equals(this.retry, eventSTEPSTARTED.retry)&& + Objects.equals(this.additionalProperties, eventSTEPSTARTED.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, event, id, retry, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class EventSTEPSTARTED {\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) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(Arrays.asList("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 EventSTEPSTARTED + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!EventSTEPSTARTED.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format(Locale.ROOT, "The required field(s) %s in EventSTEPSTARTED is not found in the empty JSON string", EventSTEPSTARTED.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : EventSTEPSTARTED.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format(Locale.ROOT, "The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("event").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(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 (!EventSTEPSTARTED.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'EventSTEPSTARTED' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(EventSTEPSTARTED.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, EventSTEPSTARTED 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 EventSTEPSTARTED read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + EventSTEPSTARTED instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format(Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of EventSTEPSTARTED given an JSON string + * + * @param jsonString JSON string + * @return An instance of EventSTEPSTARTED + * @throws IOException if the JSON string is invalid with respect to EventSTEPSTARTED + */ + public static EventSTEPSTARTED fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, EventSTEPSTARTED.class); + } + + /** + * Convert an instance of EventSTEPSTARTED to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/ai/reveng/model/NetworkOverviewMetadata.java b/src/main/java/ai/reveng/model/EventTEXTMESSAGECONTENT.java similarity index 62% rename from src/main/java/ai/reveng/model/NetworkOverviewMetadata.java rename to src/main/java/ai/reveng/model/EventTEXTMESSAGECONTENT.java index b1e4cea..a72b6b4 100644 --- a/src/main/java/ai/reveng/model/NetworkOverviewMetadata.java +++ b/src/main/java/ai/reveng/model/EventTEXTMESSAGECONTENT.java @@ -14,6 +14,7 @@ import java.util.Objects; import java.util.Locale; +import ai.reveng.model.SseEventTextMessageContentData; import com.google.gson.TypeAdapter; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; @@ -47,35 +48,25 @@ import ai.reveng.invoker.JSON; /** - * NetworkOverviewMetadata + * EventTEXTMESSAGECONTENT */ @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class NetworkOverviewMetadata { - public static final String SERIALIZED_NAME_HOST = "host"; - @SerializedName(SERIALIZED_NAME_HOST) +public class EventTEXTMESSAGECONTENT { + public static final String SERIALIZED_NAME_DATA = "data"; + @SerializedName(SERIALIZED_NAME_DATA) @javax.annotation.Nonnull - private String host; - - public static final String SERIALIZED_NAME_COUNTRY_CODE = "country_code"; - @SerializedName(SERIALIZED_NAME_COUNTRY_CODE) - @javax.annotation.Nonnull - private String countryCode; - - public static final String SERIALIZED_NAME_A_S_N = "ASN"; - @SerializedName(SERIALIZED_NAME_A_S_N) - @javax.annotation.Nonnull - private String ASN; + private SseEventTextMessageContentData data; /** - * Gets or Sets type + * The event name. */ - @JsonAdapter(TypeEnum.Adapter.class) - public enum TypeEnum { - METADATA("metadata"); + @JsonAdapter(EventEnum.Adapter.class) + public enum EventEnum { + TEXT_MESSAGE_CONTENT("TEXT_MESSAGE_CONTENT"); private String value; - TypeEnum(String value) { + EventEnum(String value) { this.value = value; } @@ -88,8 +79,8 @@ public String toString() { return String.valueOf(value); } - public static TypeEnum fromValue(String value) { - for (TypeEnum b : TypeEnum.values()) { + public static EventEnum fromValue(String value) { + for (EventEnum b : EventEnum.values()) { if (b.value.equals(value)) { return b; } @@ -97,106 +88,116 @@ public static TypeEnum fromValue(String value) { throw new IllegalArgumentException("Unexpected value '" + value + "'"); } - public static class Adapter extends TypeAdapter { + public static class Adapter extends TypeAdapter { @Override - public void write(final JsonWriter jsonWriter, final TypeEnum enumeration) throws IOException { + public void write(final JsonWriter jsonWriter, final EventEnum enumeration) throws IOException { jsonWriter.value(enumeration.getValue()); } @Override - public TypeEnum read(final JsonReader jsonReader) throws IOException { + public EventEnum read(final JsonReader jsonReader) throws IOException { String value = jsonReader.nextString(); - return TypeEnum.fromValue(value); + return EventEnum.fromValue(value); } } public static void validateJsonElement(JsonElement jsonElement) throws IOException { String value = jsonElement.getAsString(); - TypeEnum.fromValue(value); + EventEnum.fromValue(value); } } - public static final String SERIALIZED_NAME_TYPE = "type"; - @SerializedName(SERIALIZED_NAME_TYPE) + public static final String SERIALIZED_NAME_EVENT = "event"; + @SerializedName(SERIALIZED_NAME_EVENT) @javax.annotation.Nonnull - private TypeEnum type; + 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 NetworkOverviewMetadata() { + public EventTEXTMESSAGECONTENT() { } - public NetworkOverviewMetadata host(@javax.annotation.Nonnull String host) { - this.host = host; + public EventTEXTMESSAGECONTENT data(@javax.annotation.Nonnull SseEventTextMessageContentData data) { + this.data = data; return this; } /** - * Get host - * @return host + * Get data + * @return data */ @javax.annotation.Nonnull - public String getHost() { - return host; + public SseEventTextMessageContentData getData() { + return data; } - public void setHost(@javax.annotation.Nonnull String host) { - this.host = host; + public void setData(@javax.annotation.Nonnull SseEventTextMessageContentData data) { + this.data = data; } - public NetworkOverviewMetadata countryCode(@javax.annotation.Nonnull String countryCode) { - this.countryCode = countryCode; + public EventTEXTMESSAGECONTENT event(@javax.annotation.Nonnull EventEnum event) { + this.event = event; return this; } /** - * Get countryCode - * @return countryCode + * The event name. + * @return event */ @javax.annotation.Nonnull - public String getCountryCode() { - return countryCode; + public EventEnum getEvent() { + return event; } - public void setCountryCode(@javax.annotation.Nonnull String countryCode) { - this.countryCode = countryCode; + public void setEvent(@javax.annotation.Nonnull EventEnum event) { + this.event = event; } - public NetworkOverviewMetadata ASN(@javax.annotation.Nonnull String ASN) { - this.ASN = ASN; + public EventTEXTMESSAGECONTENT id(@javax.annotation.Nullable Integer id) { + this.id = id; return this; } /** - * Get ASN - * @return ASN + * The event ID. + * @return id */ - @javax.annotation.Nonnull - public String getASN() { - return ASN; + @javax.annotation.Nullable + public Integer getId() { + return id; } - public void setASN(@javax.annotation.Nonnull String ASN) { - this.ASN = ASN; + public void setId(@javax.annotation.Nullable Integer id) { + this.id = id; } - public NetworkOverviewMetadata type(@javax.annotation.Nonnull TypeEnum type) { - this.type = type; + public EventTEXTMESSAGECONTENT retry(@javax.annotation.Nullable Integer retry) { + this.retry = retry; return this; } /** - * Get type - * @return type + * The retry time in milliseconds. + * @return retry */ - @javax.annotation.Nonnull - public TypeEnum getType() { - return type; + @javax.annotation.Nullable + public Integer getRetry() { + return retry; } - public void setType(@javax.annotation.Nonnull TypeEnum type) { - this.type = type; + public void setRetry(@javax.annotation.Nullable Integer retry) { + this.retry = retry; } /** @@ -212,9 +213,9 @@ public void setType(@javax.annotation.Nonnull TypeEnum type) { * * @param key name of the property * @param value value of the property - * @return the NetworkOverviewMetadata instance itself + * @return the EventTEXTMESSAGECONTENT instance itself */ - public NetworkOverviewMetadata putAdditionalProperty(String key, Object value) { + public EventTEXTMESSAGECONTENT putAdditionalProperty(String key, Object value) { if (this.additionalProperties == null) { this.additionalProperties = new HashMap(); } @@ -253,27 +254,27 @@ public boolean equals(Object o) { if (o == null || getClass() != o.getClass()) { return false; } - NetworkOverviewMetadata networkOverviewMetadata = (NetworkOverviewMetadata) o; - return Objects.equals(this.host, networkOverviewMetadata.host) && - Objects.equals(this.countryCode, networkOverviewMetadata.countryCode) && - Objects.equals(this.ASN, networkOverviewMetadata.ASN) && - Objects.equals(this.type, networkOverviewMetadata.type)&& - Objects.equals(this.additionalProperties, networkOverviewMetadata.additionalProperties); + EventTEXTMESSAGECONTENT eventTEXTMESSAGECONTENT = (EventTEXTMESSAGECONTENT) o; + return Objects.equals(this.data, eventTEXTMESSAGECONTENT.data) && + Objects.equals(this.event, eventTEXTMESSAGECONTENT.event) && + Objects.equals(this.id, eventTEXTMESSAGECONTENT.id) && + Objects.equals(this.retry, eventTEXTMESSAGECONTENT.retry)&& + Objects.equals(this.additionalProperties, eventTEXTMESSAGECONTENT.additionalProperties); } @Override public int hashCode() { - return Objects.hash(host, countryCode, ASN, type, additionalProperties); + return Objects.hash(data, event, id, retry, additionalProperties); } @Override public String toString() { StringBuilder sb = new StringBuilder(); - sb.append("class NetworkOverviewMetadata {\n"); - sb.append(" host: ").append(toIndentedString(host)).append("\n"); - sb.append(" countryCode: ").append(toIndentedString(countryCode)).append("\n"); - sb.append(" ASN: ").append(toIndentedString(ASN)).append("\n"); - sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append("class EventTEXTMESSAGECONTENT {\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(); @@ -296,62 +297,53 @@ private String toIndentedString(Object o) { static { // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(Arrays.asList("host", "country_code", "ASN", "type")); + openapiFields = new HashSet(Arrays.asList("data", "event", "id", "retry")); // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(Arrays.asList("host", "country_code", "ASN", "type")); + 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 NetworkOverviewMetadata + * @throws IOException if the JSON Element is invalid with respect to EventTEXTMESSAGECONTENT */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (jsonElement == null) { - if (!NetworkOverviewMetadata.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format(Locale.ROOT, "The required field(s) %s in NetworkOverviewMetadata is not found in the empty JSON string", NetworkOverviewMetadata.openapiRequiredFields.toString())); + if (!EventTEXTMESSAGECONTENT.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format(Locale.ROOT, "The required field(s) %s in EventTEXTMESSAGECONTENT is not found in the empty JSON string", EventTEXTMESSAGECONTENT.openapiRequiredFields.toString())); } } // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : NetworkOverviewMetadata.openapiRequiredFields) { + for (String requiredField : EventTEXTMESSAGECONTENT.openapiRequiredFields) { if (jsonElement.getAsJsonObject().get(requiredField) == null) { throw new IllegalArgumentException(String.format(Locale.ROOT, "The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); } } JsonObject jsonObj = jsonElement.getAsJsonObject(); - if (!jsonObj.get("host").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format(Locale.ROOT, "Expected the field `host` to be a primitive type in the JSON string but got `%s`", jsonObj.get("host").toString())); - } - if (!jsonObj.get("country_code").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format(Locale.ROOT, "Expected the field `country_code` to be a primitive type in the JSON string but got `%s`", jsonObj.get("country_code").toString())); - } - if (!jsonObj.get("ASN").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format(Locale.ROOT, "Expected the field `ASN` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ASN").toString())); - } - if (!jsonObj.get("type").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format(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("event").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(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 `type` - TypeEnum.validateJsonElement(jsonObj.get("type")); + // 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 (!NetworkOverviewMetadata.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'NetworkOverviewMetadata' and its subtypes + if (!EventTEXTMESSAGECONTENT.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'EventTEXTMESSAGECONTENT' and its subtypes } final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(NetworkOverviewMetadata.class)); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(EventTEXTMESSAGECONTENT.class)); - return (TypeAdapter) new TypeAdapter() { + return (TypeAdapter) new TypeAdapter() { @Override - public void write(JsonWriter out, NetworkOverviewMetadata value) throws IOException { + public void write(JsonWriter out, EventTEXTMESSAGECONTENT value) throws IOException { JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); obj.remove("additionalProperties"); // serialize additional properties @@ -379,12 +371,12 @@ else if (entry.getValue() instanceof Character) } @Override - public NetworkOverviewMetadata read(JsonReader in) throws IOException { + public EventTEXTMESSAGECONTENT read(JsonReader in) throws IOException { JsonElement jsonElement = elementAdapter.read(in); validateJsonElement(jsonElement); JsonObject jsonObj = jsonElement.getAsJsonObject(); // store additional fields in the deserialized instance - NetworkOverviewMetadata instance = thisAdapter.fromJsonTree(jsonObj); + EventTEXTMESSAGECONTENT instance = thisAdapter.fromJsonTree(jsonObj); for (Map.Entry entry : jsonObj.entrySet()) { if (!openapiFields.contains(entry.getKey())) { if (entry.getValue().isJsonPrimitive()) { // primitive type @@ -411,18 +403,18 @@ else if (entry.getValue().getAsJsonPrimitive().isBoolean()) } /** - * Create an instance of NetworkOverviewMetadata given an JSON string + * Create an instance of EventTEXTMESSAGECONTENT given an JSON string * * @param jsonString JSON string - * @return An instance of NetworkOverviewMetadata - * @throws IOException if the JSON string is invalid with respect to NetworkOverviewMetadata + * @return An instance of EventTEXTMESSAGECONTENT + * @throws IOException if the JSON string is invalid with respect to EventTEXTMESSAGECONTENT */ - public static NetworkOverviewMetadata fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, NetworkOverviewMetadata.class); + public static EventTEXTMESSAGECONTENT fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, EventTEXTMESSAGECONTENT.class); } /** - * Convert an instance of NetworkOverviewMetadata to an JSON string + * Convert an instance of EventTEXTMESSAGECONTENT to an JSON string * * @return JSON string */ diff --git a/src/main/java/ai/reveng/model/EventTEXTMESSAGEEND.java b/src/main/java/ai/reveng/model/EventTEXTMESSAGEEND.java new file mode 100644 index 0000000..f332e64 --- /dev/null +++ b/src/main/java/ai/reveng/model/EventTEXTMESSAGEEND.java @@ -0,0 +1,425 @@ +/* + * RevEng.AI API + * RevEng.AI is an AI-powered binary analysis platform for reverse engineering and malware analysis. It provides similarity search across executable binaries and functions, AI-driven decompilation, dynamic execution analysis, firmware unpacking, and integration with external threat intelligence sources like VirusTotal. + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package ai.reveng.model; + +import java.util.Objects; +import java.util.Locale; +import ai.reveng.model.SseEventTextMessageEndData; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; +import java.util.Locale; + +import ai.reveng.invoker.JSON; + +/** + * EventTEXTMESSAGEEND + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class EventTEXTMESSAGEEND { + public static final String SERIALIZED_NAME_DATA = "data"; + @SerializedName(SERIALIZED_NAME_DATA) + @javax.annotation.Nonnull + private SseEventTextMessageEndData data; + + /** + * The event name. + */ + @JsonAdapter(EventEnum.Adapter.class) + public enum EventEnum { + TEXT_MESSAGE_END("TEXT_MESSAGE_END"); + + 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; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + 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 EventTEXTMESSAGEEND() { + } + + public EventTEXTMESSAGEEND data(@javax.annotation.Nonnull SseEventTextMessageEndData data) { + this.data = data; + return this; + } + + /** + * Get data + * @return data + */ + @javax.annotation.Nonnull + public SseEventTextMessageEndData getData() { + return data; + } + + public void setData(@javax.annotation.Nonnull SseEventTextMessageEndData data) { + this.data = data; + } + + + public EventTEXTMESSAGEEND 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 EventTEXTMESSAGEEND 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 EventTEXTMESSAGEEND 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 EventTEXTMESSAGEEND instance itself + */ + public EventTEXTMESSAGEEND 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; + } + EventTEXTMESSAGEEND eventTEXTMESSAGEEND = (EventTEXTMESSAGEEND) o; + return Objects.equals(this.data, eventTEXTMESSAGEEND.data) && + Objects.equals(this.event, eventTEXTMESSAGEEND.event) && + Objects.equals(this.id, eventTEXTMESSAGEEND.id) && + Objects.equals(this.retry, eventTEXTMESSAGEEND.retry)&& + Objects.equals(this.additionalProperties, eventTEXTMESSAGEEND.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, event, id, retry, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class EventTEXTMESSAGEEND {\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) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(Arrays.asList("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 EventTEXTMESSAGEEND + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!EventTEXTMESSAGEEND.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format(Locale.ROOT, "The required field(s) %s in EventTEXTMESSAGEEND is not found in the empty JSON string", EventTEXTMESSAGEEND.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : EventTEXTMESSAGEEND.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format(Locale.ROOT, "The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("event").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(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 (!EventTEXTMESSAGEEND.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'EventTEXTMESSAGEEND' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(EventTEXTMESSAGEEND.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, EventTEXTMESSAGEEND 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 EventTEXTMESSAGEEND read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + EventTEXTMESSAGEEND instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format(Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of EventTEXTMESSAGEEND given an JSON string + * + * @param jsonString JSON string + * @return An instance of EventTEXTMESSAGEEND + * @throws IOException if the JSON string is invalid with respect to EventTEXTMESSAGEEND + */ + public static EventTEXTMESSAGEEND fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, EventTEXTMESSAGEEND.class); + } + + /** + * Convert an instance of EventTEXTMESSAGEEND to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/ai/reveng/model/EventTEXTMESSAGESTART.java b/src/main/java/ai/reveng/model/EventTEXTMESSAGESTART.java new file mode 100644 index 0000000..1b0b875 --- /dev/null +++ b/src/main/java/ai/reveng/model/EventTEXTMESSAGESTART.java @@ -0,0 +1,425 @@ +/* + * RevEng.AI API + * RevEng.AI is an AI-powered binary analysis platform for reverse engineering and malware analysis. It provides similarity search across executable binaries and functions, AI-driven decompilation, dynamic execution analysis, firmware unpacking, and integration with external threat intelligence sources like VirusTotal. + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package ai.reveng.model; + +import java.util.Objects; +import java.util.Locale; +import ai.reveng.model.SseEventTextMessageStartData; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; +import java.util.Locale; + +import ai.reveng.invoker.JSON; + +/** + * EventTEXTMESSAGESTART + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class EventTEXTMESSAGESTART { + public static final String SERIALIZED_NAME_DATA = "data"; + @SerializedName(SERIALIZED_NAME_DATA) + @javax.annotation.Nonnull + private SseEventTextMessageStartData data; + + /** + * The event name. + */ + @JsonAdapter(EventEnum.Adapter.class) + public enum EventEnum { + TEXT_MESSAGE_START("TEXT_MESSAGE_START"); + + 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; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + 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 EventTEXTMESSAGESTART() { + } + + public EventTEXTMESSAGESTART data(@javax.annotation.Nonnull SseEventTextMessageStartData data) { + this.data = data; + return this; + } + + /** + * Get data + * @return data + */ + @javax.annotation.Nonnull + public SseEventTextMessageStartData getData() { + return data; + } + + public void setData(@javax.annotation.Nonnull SseEventTextMessageStartData data) { + this.data = data; + } + + + public EventTEXTMESSAGESTART 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 EventTEXTMESSAGESTART 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 EventTEXTMESSAGESTART 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 EventTEXTMESSAGESTART instance itself + */ + public EventTEXTMESSAGESTART 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; + } + EventTEXTMESSAGESTART eventTEXTMESSAGESTART = (EventTEXTMESSAGESTART) o; + return Objects.equals(this.data, eventTEXTMESSAGESTART.data) && + Objects.equals(this.event, eventTEXTMESSAGESTART.event) && + Objects.equals(this.id, eventTEXTMESSAGESTART.id) && + Objects.equals(this.retry, eventTEXTMESSAGESTART.retry)&& + Objects.equals(this.additionalProperties, eventTEXTMESSAGESTART.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, event, id, retry, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class EventTEXTMESSAGESTART {\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) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(Arrays.asList("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 EventTEXTMESSAGESTART + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!EventTEXTMESSAGESTART.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format(Locale.ROOT, "The required field(s) %s in EventTEXTMESSAGESTART is not found in the empty JSON string", EventTEXTMESSAGESTART.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : EventTEXTMESSAGESTART.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format(Locale.ROOT, "The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("event").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(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 (!EventTEXTMESSAGESTART.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'EventTEXTMESSAGESTART' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(EventTEXTMESSAGESTART.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, EventTEXTMESSAGESTART 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 EventTEXTMESSAGESTART read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + EventTEXTMESSAGESTART instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format(Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of EventTEXTMESSAGESTART given an JSON string + * + * @param jsonString JSON string + * @return An instance of EventTEXTMESSAGESTART + * @throws IOException if the JSON string is invalid with respect to EventTEXTMESSAGESTART + */ + public static EventTEXTMESSAGESTART fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, EventTEXTMESSAGESTART.class); + } + + /** + * Convert an instance of EventTEXTMESSAGESTART to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/ai/reveng/model/EventTITLEUPDATED.java b/src/main/java/ai/reveng/model/EventTITLEUPDATED.java new file mode 100644 index 0000000..f646917 --- /dev/null +++ b/src/main/java/ai/reveng/model/EventTITLEUPDATED.java @@ -0,0 +1,425 @@ +/* + * RevEng.AI API + * RevEng.AI is an AI-powered binary analysis platform for reverse engineering and malware analysis. It provides similarity search across executable binaries and functions, AI-driven decompilation, dynamic execution analysis, firmware unpacking, and integration with external threat intelligence sources like VirusTotal. + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package ai.reveng.model; + +import java.util.Objects; +import java.util.Locale; +import ai.reveng.model.SseEventTitleUpdatedData; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; +import java.util.Locale; + +import ai.reveng.invoker.JSON; + +/** + * EventTITLEUPDATED + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class EventTITLEUPDATED { + public static final String SERIALIZED_NAME_DATA = "data"; + @SerializedName(SERIALIZED_NAME_DATA) + @javax.annotation.Nonnull + private SseEventTitleUpdatedData data; + + /** + * The event name. + */ + @JsonAdapter(EventEnum.Adapter.class) + public enum EventEnum { + TITLE_UPDATED("TITLE_UPDATED"); + + 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; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + 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 EventTITLEUPDATED() { + } + + public EventTITLEUPDATED data(@javax.annotation.Nonnull SseEventTitleUpdatedData data) { + this.data = data; + return this; + } + + /** + * Get data + * @return data + */ + @javax.annotation.Nonnull + public SseEventTitleUpdatedData getData() { + return data; + } + + public void setData(@javax.annotation.Nonnull SseEventTitleUpdatedData data) { + this.data = data; + } + + + public EventTITLEUPDATED 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 EventTITLEUPDATED 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 EventTITLEUPDATED 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 EventTITLEUPDATED instance itself + */ + public EventTITLEUPDATED 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; + } + EventTITLEUPDATED eventTITLEUPDATED = (EventTITLEUPDATED) o; + return Objects.equals(this.data, eventTITLEUPDATED.data) && + Objects.equals(this.event, eventTITLEUPDATED.event) && + Objects.equals(this.id, eventTITLEUPDATED.id) && + Objects.equals(this.retry, eventTITLEUPDATED.retry)&& + Objects.equals(this.additionalProperties, eventTITLEUPDATED.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, event, id, retry, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class EventTITLEUPDATED {\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) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(Arrays.asList("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 EventTITLEUPDATED + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!EventTITLEUPDATED.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format(Locale.ROOT, "The required field(s) %s in EventTITLEUPDATED is not found in the empty JSON string", EventTITLEUPDATED.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : EventTITLEUPDATED.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format(Locale.ROOT, "The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("event").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(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 (!EventTITLEUPDATED.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'EventTITLEUPDATED' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(EventTITLEUPDATED.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, EventTITLEUPDATED 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 EventTITLEUPDATED read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + EventTITLEUPDATED instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format(Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of EventTITLEUPDATED given an JSON string + * + * @param jsonString JSON string + * @return An instance of EventTITLEUPDATED + * @throws IOException if the JSON string is invalid with respect to EventTITLEUPDATED + */ + public static EventTITLEUPDATED fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, EventTITLEUPDATED.class); + } + + /** + * Convert an instance of EventTITLEUPDATED to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/ai/reveng/model/EventTOOLCALLARGSDELTA.java b/src/main/java/ai/reveng/model/EventTOOLCALLARGSDELTA.java new file mode 100644 index 0000000..84b91d4 --- /dev/null +++ b/src/main/java/ai/reveng/model/EventTOOLCALLARGSDELTA.java @@ -0,0 +1,425 @@ +/* + * RevEng.AI API + * RevEng.AI is an AI-powered binary analysis platform for reverse engineering and malware analysis. It provides similarity search across executable binaries and functions, AI-driven decompilation, dynamic execution analysis, firmware unpacking, and integration with external threat intelligence sources like VirusTotal. + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package ai.reveng.model; + +import java.util.Objects; +import java.util.Locale; +import ai.reveng.model.SseEventToolCallArgsDeltaData; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; +import java.util.Locale; + +import ai.reveng.invoker.JSON; + +/** + * EventTOOLCALLARGSDELTA + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class EventTOOLCALLARGSDELTA { + public static final String SERIALIZED_NAME_DATA = "data"; + @SerializedName(SERIALIZED_NAME_DATA) + @javax.annotation.Nonnull + private SseEventToolCallArgsDeltaData data; + + /** + * The event name. + */ + @JsonAdapter(EventEnum.Adapter.class) + public enum EventEnum { + TOOL_CALL_ARGS_DELTA("TOOL_CALL_ARGS_DELTA"); + + 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; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + 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 EventTOOLCALLARGSDELTA() { + } + + public EventTOOLCALLARGSDELTA data(@javax.annotation.Nonnull SseEventToolCallArgsDeltaData data) { + this.data = data; + return this; + } + + /** + * Get data + * @return data + */ + @javax.annotation.Nonnull + public SseEventToolCallArgsDeltaData getData() { + return data; + } + + public void setData(@javax.annotation.Nonnull SseEventToolCallArgsDeltaData data) { + this.data = data; + } + + + public EventTOOLCALLARGSDELTA 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 EventTOOLCALLARGSDELTA 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 EventTOOLCALLARGSDELTA 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 EventTOOLCALLARGSDELTA instance itself + */ + public EventTOOLCALLARGSDELTA 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; + } + EventTOOLCALLARGSDELTA eventTOOLCALLARGSDELTA = (EventTOOLCALLARGSDELTA) o; + return Objects.equals(this.data, eventTOOLCALLARGSDELTA.data) && + Objects.equals(this.event, eventTOOLCALLARGSDELTA.event) && + Objects.equals(this.id, eventTOOLCALLARGSDELTA.id) && + Objects.equals(this.retry, eventTOOLCALLARGSDELTA.retry)&& + Objects.equals(this.additionalProperties, eventTOOLCALLARGSDELTA.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, event, id, retry, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class EventTOOLCALLARGSDELTA {\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) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(Arrays.asList("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 EventTOOLCALLARGSDELTA + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!EventTOOLCALLARGSDELTA.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format(Locale.ROOT, "The required field(s) %s in EventTOOLCALLARGSDELTA is not found in the empty JSON string", EventTOOLCALLARGSDELTA.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : EventTOOLCALLARGSDELTA.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format(Locale.ROOT, "The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("event").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(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 (!EventTOOLCALLARGSDELTA.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'EventTOOLCALLARGSDELTA' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(EventTOOLCALLARGSDELTA.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, EventTOOLCALLARGSDELTA 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 EventTOOLCALLARGSDELTA read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + EventTOOLCALLARGSDELTA instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format(Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of EventTOOLCALLARGSDELTA given an JSON string + * + * @param jsonString JSON string + * @return An instance of EventTOOLCALLARGSDELTA + * @throws IOException if the JSON string is invalid with respect to EventTOOLCALLARGSDELTA + */ + public static EventTOOLCALLARGSDELTA fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, EventTOOLCALLARGSDELTA.class); + } + + /** + * Convert an instance of EventTOOLCALLARGSDELTA to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/ai/reveng/model/EventTOOLCALLEND.java b/src/main/java/ai/reveng/model/EventTOOLCALLEND.java new file mode 100644 index 0000000..f66d465 --- /dev/null +++ b/src/main/java/ai/reveng/model/EventTOOLCALLEND.java @@ -0,0 +1,425 @@ +/* + * RevEng.AI API + * RevEng.AI is an AI-powered binary analysis platform for reverse engineering and malware analysis. It provides similarity search across executable binaries and functions, AI-driven decompilation, dynamic execution analysis, firmware unpacking, and integration with external threat intelligence sources like VirusTotal. + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package ai.reveng.model; + +import java.util.Objects; +import java.util.Locale; +import ai.reveng.model.SseEventToolCallEndData; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; +import java.util.Locale; + +import ai.reveng.invoker.JSON; + +/** + * EventTOOLCALLEND + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class EventTOOLCALLEND { + public static final String SERIALIZED_NAME_DATA = "data"; + @SerializedName(SERIALIZED_NAME_DATA) + @javax.annotation.Nonnull + private SseEventToolCallEndData data; + + /** + * The event name. + */ + @JsonAdapter(EventEnum.Adapter.class) + public enum EventEnum { + TOOL_CALL_END("TOOL_CALL_END"); + + 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; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + 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 EventTOOLCALLEND() { + } + + public EventTOOLCALLEND data(@javax.annotation.Nonnull SseEventToolCallEndData data) { + this.data = data; + return this; + } + + /** + * Get data + * @return data + */ + @javax.annotation.Nonnull + public SseEventToolCallEndData getData() { + return data; + } + + public void setData(@javax.annotation.Nonnull SseEventToolCallEndData data) { + this.data = data; + } + + + public EventTOOLCALLEND 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 EventTOOLCALLEND 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 EventTOOLCALLEND 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 EventTOOLCALLEND instance itself + */ + public EventTOOLCALLEND 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; + } + EventTOOLCALLEND eventTOOLCALLEND = (EventTOOLCALLEND) o; + return Objects.equals(this.data, eventTOOLCALLEND.data) && + Objects.equals(this.event, eventTOOLCALLEND.event) && + Objects.equals(this.id, eventTOOLCALLEND.id) && + Objects.equals(this.retry, eventTOOLCALLEND.retry)&& + Objects.equals(this.additionalProperties, eventTOOLCALLEND.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, event, id, retry, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class EventTOOLCALLEND {\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) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(Arrays.asList("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 EventTOOLCALLEND + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!EventTOOLCALLEND.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format(Locale.ROOT, "The required field(s) %s in EventTOOLCALLEND is not found in the empty JSON string", EventTOOLCALLEND.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : EventTOOLCALLEND.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format(Locale.ROOT, "The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("event").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(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 (!EventTOOLCALLEND.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'EventTOOLCALLEND' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(EventTOOLCALLEND.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, EventTOOLCALLEND 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 EventTOOLCALLEND read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + EventTOOLCALLEND instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format(Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of EventTOOLCALLEND given an JSON string + * + * @param jsonString JSON string + * @return An instance of EventTOOLCALLEND + * @throws IOException if the JSON string is invalid with respect to EventTOOLCALLEND + */ + public static EventTOOLCALLEND fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, EventTOOLCALLEND.class); + } + + /** + * Convert an instance of EventTOOLCALLEND to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/ai/reveng/model/EventTOOLCALLRESULT.java b/src/main/java/ai/reveng/model/EventTOOLCALLRESULT.java new file mode 100644 index 0000000..14bae59 --- /dev/null +++ b/src/main/java/ai/reveng/model/EventTOOLCALLRESULT.java @@ -0,0 +1,425 @@ +/* + * RevEng.AI API + * RevEng.AI is an AI-powered binary analysis platform for reverse engineering and malware analysis. It provides similarity search across executable binaries and functions, AI-driven decompilation, dynamic execution analysis, firmware unpacking, and integration with external threat intelligence sources like VirusTotal. + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package ai.reveng.model; + +import java.util.Objects; +import java.util.Locale; +import ai.reveng.model.SseEventToolCallResultData; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; +import java.util.Locale; + +import ai.reveng.invoker.JSON; + +/** + * EventTOOLCALLRESULT + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class EventTOOLCALLRESULT { + public static final String SERIALIZED_NAME_DATA = "data"; + @SerializedName(SERIALIZED_NAME_DATA) + @javax.annotation.Nonnull + private SseEventToolCallResultData data; + + /** + * The event name. + */ + @JsonAdapter(EventEnum.Adapter.class) + public enum EventEnum { + TOOL_CALL_RESULT("TOOL_CALL_RESULT"); + + 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; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + 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 EventTOOLCALLRESULT() { + } + + public EventTOOLCALLRESULT data(@javax.annotation.Nonnull SseEventToolCallResultData data) { + this.data = data; + return this; + } + + /** + * Get data + * @return data + */ + @javax.annotation.Nonnull + public SseEventToolCallResultData getData() { + return data; + } + + public void setData(@javax.annotation.Nonnull SseEventToolCallResultData data) { + this.data = data; + } + + + public EventTOOLCALLRESULT 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 EventTOOLCALLRESULT 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 EventTOOLCALLRESULT 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 EventTOOLCALLRESULT instance itself + */ + public EventTOOLCALLRESULT 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; + } + EventTOOLCALLRESULT eventTOOLCALLRESULT = (EventTOOLCALLRESULT) o; + return Objects.equals(this.data, eventTOOLCALLRESULT.data) && + Objects.equals(this.event, eventTOOLCALLRESULT.event) && + Objects.equals(this.id, eventTOOLCALLRESULT.id) && + Objects.equals(this.retry, eventTOOLCALLRESULT.retry)&& + Objects.equals(this.additionalProperties, eventTOOLCALLRESULT.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, event, id, retry, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class EventTOOLCALLRESULT {\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) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(Arrays.asList("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 EventTOOLCALLRESULT + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!EventTOOLCALLRESULT.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format(Locale.ROOT, "The required field(s) %s in EventTOOLCALLRESULT is not found in the empty JSON string", EventTOOLCALLRESULT.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : EventTOOLCALLRESULT.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format(Locale.ROOT, "The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("event").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(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 (!EventTOOLCALLRESULT.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'EventTOOLCALLRESULT' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(EventTOOLCALLRESULT.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, EventTOOLCALLRESULT 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 EventTOOLCALLRESULT read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + EventTOOLCALLRESULT instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format(Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of EventTOOLCALLRESULT given an JSON string + * + * @param jsonString JSON string + * @return An instance of EventTOOLCALLRESULT + * @throws IOException if the JSON string is invalid with respect to EventTOOLCALLRESULT + */ + public static EventTOOLCALLRESULT fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, EventTOOLCALLRESULT.class); + } + + /** + * Convert an instance of EventTOOLCALLRESULT to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/ai/reveng/model/NetworkOverviewDns.java b/src/main/java/ai/reveng/model/EventTOOLCALLSTART.java similarity index 61% rename from src/main/java/ai/reveng/model/NetworkOverviewDns.java rename to src/main/java/ai/reveng/model/EventTOOLCALLSTART.java index 1c0553f..da2c042 100644 --- a/src/main/java/ai/reveng/model/NetworkOverviewDns.java +++ b/src/main/java/ai/reveng/model/EventTOOLCALLSTART.java @@ -14,16 +14,14 @@ import java.util.Objects; import java.util.Locale; -import ai.reveng.model.NetworkOverviewDnsAnswer; +import ai.reveng.model.SseEventToolCallStartData; 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; @@ -50,90 +48,156 @@ import ai.reveng.invoker.JSON; /** - * NetworkOverviewDns + * EventTOOLCALLSTART */ @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class NetworkOverviewDns { - public static final String SERIALIZED_NAME_HOST = "host"; - @SerializedName(SERIALIZED_NAME_HOST) +public class EventTOOLCALLSTART { + public static final String SERIALIZED_NAME_DATA = "data"; + @SerializedName(SERIALIZED_NAME_DATA) @javax.annotation.Nonnull - private String host; + private SseEventToolCallStartData data; - public static final String SERIALIZED_NAME_TYPE = "type"; - @SerializedName(SERIALIZED_NAME_TYPE) - @javax.annotation.Nonnull - private String type; + /** + * The event name. + */ + @JsonAdapter(EventEnum.Adapter.class) + public enum EventEnum { + TOOL_CALL_START("TOOL_CALL_START"); + + 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; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + 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_ANSWERS = "answers"; - @SerializedName(SERIALIZED_NAME_ANSWERS) + public static final String SERIALIZED_NAME_EVENT = "event"; + @SerializedName(SERIALIZED_NAME_EVENT) @javax.annotation.Nonnull - private List answers = new ArrayList<>(); + private EventEnum event; - public NetworkOverviewDns() { + 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 EventTOOLCALLSTART() { } - public NetworkOverviewDns host(@javax.annotation.Nonnull String host) { - this.host = host; + public EventTOOLCALLSTART data(@javax.annotation.Nonnull SseEventToolCallStartData data) { + this.data = data; return this; } /** - * Get host - * @return host + * Get data + * @return data */ @javax.annotation.Nonnull - public String getHost() { - return host; + public SseEventToolCallStartData getData() { + return data; } - public void setHost(@javax.annotation.Nonnull String host) { - this.host = host; + public void setData(@javax.annotation.Nonnull SseEventToolCallStartData data) { + this.data = data; } - public NetworkOverviewDns type(@javax.annotation.Nonnull String type) { - this.type = type; + public EventTOOLCALLSTART event(@javax.annotation.Nonnull EventEnum event) { + this.event = event; return this; } /** - * Get type - * @return type + * The event name. + * @return event */ @javax.annotation.Nonnull - public String getType() { - return type; + public EventEnum getEvent() { + return event; } - public void setType(@javax.annotation.Nonnull String type) { - this.type = type; + public void setEvent(@javax.annotation.Nonnull EventEnum event) { + this.event = event; } - public NetworkOverviewDns answers(@javax.annotation.Nonnull List answers) { - this.answers = answers; + public EventTOOLCALLSTART id(@javax.annotation.Nullable Integer id) { + this.id = id; return this; } - public NetworkOverviewDns addAnswersItem(NetworkOverviewDnsAnswer answersItem) { - if (this.answers == null) { - this.answers = new ArrayList<>(); - } - this.answers.add(answersItem); + /** + * 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 EventTOOLCALLSTART retry(@javax.annotation.Nullable Integer retry) { + this.retry = retry; return this; } /** - * Get answers - * @return answers + * The retry time in milliseconds. + * @return retry */ - @javax.annotation.Nonnull - public List getAnswers() { - return answers; + @javax.annotation.Nullable + public Integer getRetry() { + return retry; } - public void setAnswers(@javax.annotation.Nonnull List answers) { - this.answers = answers; + public void setRetry(@javax.annotation.Nullable Integer retry) { + this.retry = retry; } /** @@ -149,9 +213,9 @@ public void setAnswers(@javax.annotation.Nonnull List * * @param key name of the property * @param value value of the property - * @return the NetworkOverviewDns instance itself + * @return the EventTOOLCALLSTART instance itself */ - public NetworkOverviewDns putAdditionalProperty(String key, Object value) { + public EventTOOLCALLSTART putAdditionalProperty(String key, Object value) { if (this.additionalProperties == null) { this.additionalProperties = new HashMap(); } @@ -190,25 +254,27 @@ public boolean equals(Object o) { if (o == null || getClass() != o.getClass()) { return false; } - NetworkOverviewDns networkOverviewDns = (NetworkOverviewDns) o; - return Objects.equals(this.host, networkOverviewDns.host) && - Objects.equals(this.type, networkOverviewDns.type) && - Objects.equals(this.answers, networkOverviewDns.answers)&& - Objects.equals(this.additionalProperties, networkOverviewDns.additionalProperties); + EventTOOLCALLSTART eventTOOLCALLSTART = (EventTOOLCALLSTART) o; + return Objects.equals(this.data, eventTOOLCALLSTART.data) && + Objects.equals(this.event, eventTOOLCALLSTART.event) && + Objects.equals(this.id, eventTOOLCALLSTART.id) && + Objects.equals(this.retry, eventTOOLCALLSTART.retry)&& + Objects.equals(this.additionalProperties, eventTOOLCALLSTART.additionalProperties); } @Override public int hashCode() { - return Objects.hash(host, type, answers, additionalProperties); + return Objects.hash(data, event, id, retry, additionalProperties); } @Override public String toString() { StringBuilder sb = new StringBuilder(); - sb.append("class NetworkOverviewDns {\n"); - sb.append(" host: ").append(toIndentedString(host)).append("\n"); - sb.append(" type: ").append(toIndentedString(type)).append("\n"); - sb.append(" answers: ").append(toIndentedString(answers)).append("\n"); + sb.append("class EventTOOLCALLSTART {\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(); @@ -231,64 +297,53 @@ private String toIndentedString(Object o) { static { // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(Arrays.asList("host", "type", "answers")); + openapiFields = new HashSet(Arrays.asList("data", "event", "id", "retry")); // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(Arrays.asList("host", "type", "answers")); + 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 NetworkOverviewDns + * @throws IOException if the JSON Element is invalid with respect to EventTOOLCALLSTART */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (jsonElement == null) { - if (!NetworkOverviewDns.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format(Locale.ROOT, "The required field(s) %s in NetworkOverviewDns is not found in the empty JSON string", NetworkOverviewDns.openapiRequiredFields.toString())); + if (!EventTOOLCALLSTART.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format(Locale.ROOT, "The required field(s) %s in EventTOOLCALLSTART is not found in the empty JSON string", EventTOOLCALLSTART.openapiRequiredFields.toString())); } } // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : NetworkOverviewDns.openapiRequiredFields) { + for (String requiredField : EventTOOLCALLSTART.openapiRequiredFields) { if (jsonElement.getAsJsonObject().get(requiredField) == null) { throw new IllegalArgumentException(String.format(Locale.ROOT, "The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); } } JsonObject jsonObj = jsonElement.getAsJsonObject(); - if (!jsonObj.get("host").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format(Locale.ROOT, "Expected the field `host` to be a primitive type in the JSON string but got `%s`", jsonObj.get("host").toString())); - } - if (!jsonObj.get("type").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format(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("event").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(Locale.ROOT, "Expected the field `event` to be a primitive type in the JSON string but got `%s`", jsonObj.get("event").toString())); } - // ensure the json data is an array - if (!jsonObj.get("answers").isJsonArray()) { - throw new IllegalArgumentException(String.format(Locale.ROOT, "Expected the field `answers` to be an array in the JSON string but got `%s`", jsonObj.get("answers").toString())); - } - - JsonArray jsonArrayanswers = jsonObj.getAsJsonArray("answers"); - // validate the required field `answers` (array) - for (int i = 0; i < jsonArrayanswers.size(); i++) { - NetworkOverviewDnsAnswer.validateJsonElement(jsonArrayanswers.get(i)); - }; + // 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 (!NetworkOverviewDns.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'NetworkOverviewDns' and its subtypes + if (!EventTOOLCALLSTART.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'EventTOOLCALLSTART' and its subtypes } final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(NetworkOverviewDns.class)); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(EventTOOLCALLSTART.class)); - return (TypeAdapter) new TypeAdapter() { + return (TypeAdapter) new TypeAdapter() { @Override - public void write(JsonWriter out, NetworkOverviewDns value) throws IOException { + public void write(JsonWriter out, EventTOOLCALLSTART value) throws IOException { JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); obj.remove("additionalProperties"); // serialize additional properties @@ -316,12 +371,12 @@ else if (entry.getValue() instanceof Character) } @Override - public NetworkOverviewDns read(JsonReader in) throws IOException { + public EventTOOLCALLSTART read(JsonReader in) throws IOException { JsonElement jsonElement = elementAdapter.read(in); validateJsonElement(jsonElement); JsonObject jsonObj = jsonElement.getAsJsonObject(); // store additional fields in the deserialized instance - NetworkOverviewDns instance = thisAdapter.fromJsonTree(jsonObj); + EventTOOLCALLSTART instance = thisAdapter.fromJsonTree(jsonObj); for (Map.Entry entry : jsonObj.entrySet()) { if (!openapiFields.contains(entry.getKey())) { if (entry.getValue().isJsonPrimitive()) { // primitive type @@ -348,18 +403,18 @@ else if (entry.getValue().getAsJsonPrimitive().isBoolean()) } /** - * Create an instance of NetworkOverviewDns given an JSON string + * Create an instance of EventTOOLCALLSTART given an JSON string * * @param jsonString JSON string - * @return An instance of NetworkOverviewDns - * @throws IOException if the JSON string is invalid with respect to NetworkOverviewDns + * @return An instance of EventTOOLCALLSTART + * @throws IOException if the JSON string is invalid with respect to EventTOOLCALLSTART */ - public static NetworkOverviewDns fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, NetworkOverviewDns.class); + public static EventTOOLCALLSTART fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, EventTOOLCALLSTART.class); } /** - * Convert an instance of NetworkOverviewDns to an JSON string + * Convert an instance of EventTOOLCALLSTART to an JSON string * * @return JSON string */ diff --git a/src/main/java/ai/reveng/model/EventTOOLCONFIRMATIONREQUIRED.java b/src/main/java/ai/reveng/model/EventTOOLCONFIRMATIONREQUIRED.java new file mode 100644 index 0000000..cbb458d --- /dev/null +++ b/src/main/java/ai/reveng/model/EventTOOLCONFIRMATIONREQUIRED.java @@ -0,0 +1,425 @@ +/* + * RevEng.AI API + * RevEng.AI is an AI-powered binary analysis platform for reverse engineering and malware analysis. It provides similarity search across executable binaries and functions, AI-driven decompilation, dynamic execution analysis, firmware unpacking, and integration with external threat intelligence sources like VirusTotal. + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package ai.reveng.model; + +import java.util.Objects; +import java.util.Locale; +import ai.reveng.model.SseEventToolConfirmationRequiredData; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; +import java.util.Locale; + +import ai.reveng.invoker.JSON; + +/** + * EventTOOLCONFIRMATIONREQUIRED + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class EventTOOLCONFIRMATIONREQUIRED { + public static final String SERIALIZED_NAME_DATA = "data"; + @SerializedName(SERIALIZED_NAME_DATA) + @javax.annotation.Nonnull + private SseEventToolConfirmationRequiredData data; + + /** + * The event name. + */ + @JsonAdapter(EventEnum.Adapter.class) + public enum EventEnum { + TOOL_CONFIRMATION_REQUIRED("TOOL_CONFIRMATION_REQUIRED"); + + 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; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + 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 EventTOOLCONFIRMATIONREQUIRED() { + } + + public EventTOOLCONFIRMATIONREQUIRED data(@javax.annotation.Nonnull SseEventToolConfirmationRequiredData data) { + this.data = data; + return this; + } + + /** + * Get data + * @return data + */ + @javax.annotation.Nonnull + public SseEventToolConfirmationRequiredData getData() { + return data; + } + + public void setData(@javax.annotation.Nonnull SseEventToolConfirmationRequiredData data) { + this.data = data; + } + + + public EventTOOLCONFIRMATIONREQUIRED 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 EventTOOLCONFIRMATIONREQUIRED 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 EventTOOLCONFIRMATIONREQUIRED 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 EventTOOLCONFIRMATIONREQUIRED instance itself + */ + public EventTOOLCONFIRMATIONREQUIRED 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; + } + EventTOOLCONFIRMATIONREQUIRED eventTOOLCONFIRMATIONREQUIRED = (EventTOOLCONFIRMATIONREQUIRED) o; + return Objects.equals(this.data, eventTOOLCONFIRMATIONREQUIRED.data) && + Objects.equals(this.event, eventTOOLCONFIRMATIONREQUIRED.event) && + Objects.equals(this.id, eventTOOLCONFIRMATIONREQUIRED.id) && + Objects.equals(this.retry, eventTOOLCONFIRMATIONREQUIRED.retry)&& + Objects.equals(this.additionalProperties, eventTOOLCONFIRMATIONREQUIRED.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, event, id, retry, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class EventTOOLCONFIRMATIONREQUIRED {\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) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(Arrays.asList("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 EventTOOLCONFIRMATIONREQUIRED + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!EventTOOLCONFIRMATIONREQUIRED.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format(Locale.ROOT, "The required field(s) %s in EventTOOLCONFIRMATIONREQUIRED is not found in the empty JSON string", EventTOOLCONFIRMATIONREQUIRED.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : EventTOOLCONFIRMATIONREQUIRED.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format(Locale.ROOT, "The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("event").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(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 (!EventTOOLCONFIRMATIONREQUIRED.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'EventTOOLCONFIRMATIONREQUIRED' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(EventTOOLCONFIRMATIONREQUIRED.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, EventTOOLCONFIRMATIONREQUIRED 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 EventTOOLCONFIRMATIONREQUIRED read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + EventTOOLCONFIRMATIONREQUIRED instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format(Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of EventTOOLCONFIRMATIONREQUIRED given an JSON string + * + * @param jsonString JSON string + * @return An instance of EventTOOLCONFIRMATIONREQUIRED + * @throws IOException if the JSON string is invalid with respect to EventTOOLCONFIRMATIONREQUIRED + */ + public static EventTOOLCONFIRMATIONREQUIRED fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, EventTOOLCONFIRMATIONREQUIRED.class); + } + + /** + * Convert an instance of EventTOOLCONFIRMATIONREQUIRED to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/ai/reveng/model/NetworkOverviewResponse.java b/src/main/java/ai/reveng/model/NetworkOverviewResponse.java deleted file mode 100644 index d695b03..0000000 --- a/src/main/java/ai/reveng/model/NetworkOverviewResponse.java +++ /dev/null @@ -1,357 +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 java.util.Locale; -import ai.reveng.model.NetworkOverviewDns; -import ai.reveng.model.NetworkOverviewMetadata; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; -import java.util.Locale; - -import ai.reveng.invoker.JSON; - -/** - * NetworkOverviewResponse - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class NetworkOverviewResponse { - public static final String SERIALIZED_NAME_DNS = "dns"; - @SerializedName(SERIALIZED_NAME_DNS) - @javax.annotation.Nonnull - private List dns = new ArrayList<>(); - - public static final String SERIALIZED_NAME_METADATA = "metadata"; - @SerializedName(SERIALIZED_NAME_METADATA) - @javax.annotation.Nonnull - private List metadata = new ArrayList<>(); - - public NetworkOverviewResponse() { - } - - public NetworkOverviewResponse dns(@javax.annotation.Nonnull List dns) { - this.dns = dns; - return this; - } - - public NetworkOverviewResponse addDnsItem(NetworkOverviewDns dnsItem) { - if (this.dns == null) { - this.dns = new ArrayList<>(); - } - this.dns.add(dnsItem); - return this; - } - - /** - * Get dns - * @return dns - */ - @javax.annotation.Nonnull - public List getDns() { - return dns; - } - - public void setDns(@javax.annotation.Nonnull List dns) { - this.dns = dns; - } - - - public NetworkOverviewResponse metadata(@javax.annotation.Nonnull List metadata) { - this.metadata = metadata; - return this; - } - - public NetworkOverviewResponse addMetadataItem(NetworkOverviewMetadata metadataItem) { - if (this.metadata == null) { - this.metadata = new ArrayList<>(); - } - this.metadata.add(metadataItem); - return this; - } - - /** - * Get metadata - * @return metadata - */ - @javax.annotation.Nonnull - public List getMetadata() { - return metadata; - } - - public void setMetadata(@javax.annotation.Nonnull List metadata) { - this.metadata = metadata; - } - - /** - * 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 NetworkOverviewResponse instance itself - */ - public NetworkOverviewResponse 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; - } - NetworkOverviewResponse networkOverviewResponse = (NetworkOverviewResponse) o; - return Objects.equals(this.dns, networkOverviewResponse.dns) && - Objects.equals(this.metadata, networkOverviewResponse.metadata)&& - Objects.equals(this.additionalProperties, networkOverviewResponse.additionalProperties); - } - - @Override - public int hashCode() { - return Objects.hash(dns, metadata, additionalProperties); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class NetworkOverviewResponse {\n"); - sb.append(" dns: ").append(toIndentedString(dns)).append("\n"); - sb.append(" metadata: ").append(toIndentedString(metadata)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(Arrays.asList("dns", "metadata")); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(Arrays.asList("dns", "metadata")); - } - - /** - * 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 NetworkOverviewResponse - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!NetworkOverviewResponse.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format(Locale.ROOT, "The required field(s) %s in NetworkOverviewResponse is not found in the empty JSON string", NetworkOverviewResponse.openapiRequiredFields.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : NetworkOverviewResponse.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException(String.format(Locale.ROOT, "The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // ensure the json data is an array - if (!jsonObj.get("dns").isJsonArray()) { - throw new IllegalArgumentException(String.format(Locale.ROOT, "Expected the field `dns` to be an array in the JSON string but got `%s`", jsonObj.get("dns").toString())); - } - - JsonArray jsonArraydns = jsonObj.getAsJsonArray("dns"); - // validate the required field `dns` (array) - for (int i = 0; i < jsonArraydns.size(); i++) { - NetworkOverviewDns.validateJsonElement(jsonArraydns.get(i)); - }; - // ensure the json data is an array - if (!jsonObj.get("metadata").isJsonArray()) { - throw new IllegalArgumentException(String.format(Locale.ROOT, "Expected the field `metadata` to be an array in the JSON string but got `%s`", jsonObj.get("metadata").toString())); - } - - JsonArray jsonArraymetadata = jsonObj.getAsJsonArray("metadata"); - // validate the required field `metadata` (array) - for (int i = 0; i < jsonArraymetadata.size(); i++) { - NetworkOverviewMetadata.validateJsonElement(jsonArraymetadata.get(i)); - }; - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!NetworkOverviewResponse.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'NetworkOverviewResponse' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(NetworkOverviewResponse.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, NetworkOverviewResponse 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 NetworkOverviewResponse read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // store additional fields in the deserialized instance - NetworkOverviewResponse instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format(Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else if (entry.getValue().isJsonArray()) { - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); - } else { // JSON object - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; - } - - }.nullSafe(); - } - } - - /** - * Create an instance of NetworkOverviewResponse given an JSON string - * - * @param jsonString JSON string - * @return An instance of NetworkOverviewResponse - * @throws IOException if the JSON string is invalid with respect to NetworkOverviewResponse - */ - public static NetworkOverviewResponse fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, NetworkOverviewResponse.class); - } - - /** - * Convert an instance of NetworkOverviewResponse to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/ai/reveng/model/PipelineStageStatus.java b/src/main/java/ai/reveng/model/PipelineStageStatus.java deleted file mode 100644 index 71033f7..0000000 --- a/src/main/java/ai/reveng/model/PipelineStageStatus.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 java.util.Locale; -import com.google.gson.annotations.SerializedName; - -import java.io.IOException; -import java.util.Locale; -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 PipelineStageStatus - */ -@JsonAdapter(PipelineStageStatus.Adapter.class) -public enum PipelineStageStatus { - - PENDING("PENDING"), - - QUEUED("QUEUED"), - - STARTED("STARTED"), - - FINISHED("FINISHED"), - - ERROR("ERROR"); - - private String value; - - PipelineStageStatus(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - public static PipelineStageStatus fromValue(String value) { - for (PipelineStageStatus b : PipelineStageStatus.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - - public static class Adapter extends TypeAdapter { - @Override - public void write(final JsonWriter jsonWriter, final PipelineStageStatus enumeration) throws IOException { - jsonWriter.value(enumeration.getValue()); - } - - @Override - public PipelineStageStatus read(final JsonReader jsonReader) throws IOException { - String value = jsonReader.nextString(); - return PipelineStageStatus.fromValue(value); - } - } - - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - String value = jsonElement.getAsString(); - PipelineStageStatus.fromValue(value); - } -} - diff --git a/src/main/java/ai/reveng/model/PipelineStatusResponse.java b/src/main/java/ai/reveng/model/PipelineStatusResponse.java deleted file mode 100644 index 5704b58..0000000 --- a/src/main/java/ai/reveng/model/PipelineStatusResponse.java +++ /dev/null @@ -1,312 +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 java.util.Locale; -import ai.reveng.model.StageStatus; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; -import java.util.Locale; - -import ai.reveng.invoker.JSON; - -/** - * PipelineStatusResponse - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class PipelineStatusResponse { - public static final String SERIALIZED_NAME_STAGES = "stages"; - @SerializedName(SERIALIZED_NAME_STAGES) - @javax.annotation.Nonnull - private List stages = new ArrayList<>(); - - public PipelineStatusResponse() { - } - - public PipelineStatusResponse stages(@javax.annotation.Nonnull List stages) { - this.stages = stages; - return this; - } - - public PipelineStatusResponse addStagesItem(StageStatus stagesItem) { - if (this.stages == null) { - this.stages = new ArrayList<>(); - } - this.stages.add(stagesItem); - return this; - } - - /** - * Get stages - * @return stages - */ - @javax.annotation.Nonnull - public List getStages() { - return stages; - } - - public void setStages(@javax.annotation.Nonnull List stages) { - this.stages = stages; - } - - /** - * 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 PipelineStatusResponse instance itself - */ - public PipelineStatusResponse 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; - } - PipelineStatusResponse pipelineStatusResponse = (PipelineStatusResponse) o; - return Objects.equals(this.stages, pipelineStatusResponse.stages)&& - Objects.equals(this.additionalProperties, pipelineStatusResponse.additionalProperties); - } - - @Override - public int hashCode() { - return Objects.hash(stages, additionalProperties); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class PipelineStatusResponse {\n"); - sb.append(" stages: ").append(toIndentedString(stages)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(Arrays.asList("stages")); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(Arrays.asList("stages")); - } - - /** - * 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 PipelineStatusResponse - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!PipelineStatusResponse.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format(Locale.ROOT, "The required field(s) %s in PipelineStatusResponse is not found in the empty JSON string", PipelineStatusResponse.openapiRequiredFields.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : PipelineStatusResponse.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException(String.format(Locale.ROOT, "The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // ensure the json data is an array - if (!jsonObj.get("stages").isJsonArray()) { - throw new IllegalArgumentException(String.format(Locale.ROOT, "Expected the field `stages` to be an array in the JSON string but got `%s`", jsonObj.get("stages").toString())); - } - - JsonArray jsonArraystages = jsonObj.getAsJsonArray("stages"); - // validate the required field `stages` (array) - for (int i = 0; i < jsonArraystages.size(); i++) { - StageStatus.validateJsonElement(jsonArraystages.get(i)); - }; - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!PipelineStatusResponse.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'PipelineStatusResponse' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(PipelineStatusResponse.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, PipelineStatusResponse 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 PipelineStatusResponse read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // store additional fields in the deserialized instance - PipelineStatusResponse instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format(Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else if (entry.getValue().isJsonArray()) { - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); - } else { // JSON object - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; - } - - }.nullSafe(); - } - } - - /** - * Create an instance of PipelineStatusResponse given an JSON string - * - * @param jsonString JSON string - * @return An instance of PipelineStatusResponse - * @throws IOException if the JSON string is invalid with respect to PipelineStatusResponse - */ - public static PipelineStatusResponse fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, PipelineStatusResponse.class); - } - - /** - * Convert an instance of PipelineStatusResponse to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/ai/reveng/model/ProcessDump.java b/src/main/java/ai/reveng/model/ProcessDump.java deleted file mode 100644 index 6098650..0000000 --- a/src/main/java/ai/reveng/model/ProcessDump.java +++ /dev/null @@ -1,378 +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 java.util.Locale; -import ai.reveng.model.ProcessDumpMetadata; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.Arrays; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; -import java.util.Locale; - -import ai.reveng.invoker.JSON; - -/** - * ProcessDump - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class ProcessDump { - public static final String SERIALIZED_NAME_BASE_ADDRESS = "base_address"; - @SerializedName(SERIALIZED_NAME_BASE_ADDRESS) - @javax.annotation.Nonnull - private Integer baseAddress; - - public static final String SERIALIZED_NAME_ACTUAL_FILENAME = "actual_filename"; - @SerializedName(SERIALIZED_NAME_ACTUAL_FILENAME) - @javax.annotation.Nonnull - private String actualFilename; - - public static final String SERIALIZED_NAME_FILENAME_FRIENDLY = "filename_friendly"; - @SerializedName(SERIALIZED_NAME_FILENAME_FRIENDLY) - @javax.annotation.Nonnull - private String filenameFriendly; - - public static final String SERIALIZED_NAME_EXTENDED_METADATA = "extended_metadata"; - @SerializedName(SERIALIZED_NAME_EXTENDED_METADATA) - @javax.annotation.Nonnull - private ProcessDumpMetadata extendedMetadata; - - public ProcessDump() { - } - - public ProcessDump baseAddress(@javax.annotation.Nonnull Integer baseAddress) { - this.baseAddress = baseAddress; - return this; - } - - /** - * Get baseAddress - * @return baseAddress - */ - @javax.annotation.Nonnull - public Integer getBaseAddress() { - return baseAddress; - } - - public void setBaseAddress(@javax.annotation.Nonnull Integer baseAddress) { - this.baseAddress = baseAddress; - } - - - public ProcessDump actualFilename(@javax.annotation.Nonnull String actualFilename) { - this.actualFilename = actualFilename; - return this; - } - - /** - * Get actualFilename - * @return actualFilename - */ - @javax.annotation.Nonnull - public String getActualFilename() { - return actualFilename; - } - - public void setActualFilename(@javax.annotation.Nonnull String actualFilename) { - this.actualFilename = actualFilename; - } - - - public ProcessDump filenameFriendly(@javax.annotation.Nonnull String filenameFriendly) { - this.filenameFriendly = filenameFriendly; - return this; - } - - /** - * Get filenameFriendly - * @return filenameFriendly - */ - @javax.annotation.Nonnull - public String getFilenameFriendly() { - return filenameFriendly; - } - - public void setFilenameFriendly(@javax.annotation.Nonnull String filenameFriendly) { - this.filenameFriendly = filenameFriendly; - } - - - public ProcessDump extendedMetadata(@javax.annotation.Nonnull ProcessDumpMetadata extendedMetadata) { - this.extendedMetadata = extendedMetadata; - return this; - } - - /** - * Get extendedMetadata - * @return extendedMetadata - */ - @javax.annotation.Nonnull - public ProcessDumpMetadata getExtendedMetadata() { - return extendedMetadata; - } - - public void setExtendedMetadata(@javax.annotation.Nonnull ProcessDumpMetadata extendedMetadata) { - this.extendedMetadata = extendedMetadata; - } - - /** - * 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 ProcessDump instance itself - */ - public ProcessDump 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; - } - ProcessDump processDump = (ProcessDump) o; - return Objects.equals(this.baseAddress, processDump.baseAddress) && - Objects.equals(this.actualFilename, processDump.actualFilename) && - Objects.equals(this.filenameFriendly, processDump.filenameFriendly) && - Objects.equals(this.extendedMetadata, processDump.extendedMetadata)&& - Objects.equals(this.additionalProperties, processDump.additionalProperties); - } - - @Override - public int hashCode() { - return Objects.hash(baseAddress, actualFilename, filenameFriendly, extendedMetadata, additionalProperties); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class ProcessDump {\n"); - sb.append(" baseAddress: ").append(toIndentedString(baseAddress)).append("\n"); - sb.append(" actualFilename: ").append(toIndentedString(actualFilename)).append("\n"); - sb.append(" filenameFriendly: ").append(toIndentedString(filenameFriendly)).append("\n"); - sb.append(" extendedMetadata: ").append(toIndentedString(extendedMetadata)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(Arrays.asList("base_address", "actual_filename", "filename_friendly", "extended_metadata")); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(Arrays.asList("base_address", "actual_filename", "filename_friendly", "extended_metadata")); - } - - /** - * 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 ProcessDump - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!ProcessDump.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format(Locale.ROOT, "The required field(s) %s in ProcessDump is not found in the empty JSON string", ProcessDump.openapiRequiredFields.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : ProcessDump.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException(String.format(Locale.ROOT, "The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if (!jsonObj.get("actual_filename").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format(Locale.ROOT, "Expected the field `actual_filename` to be a primitive type in the JSON string but got `%s`", jsonObj.get("actual_filename").toString())); - } - if (!jsonObj.get("filename_friendly").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format(Locale.ROOT, "Expected the field `filename_friendly` to be a primitive type in the JSON string but got `%s`", jsonObj.get("filename_friendly").toString())); - } - // validate the required field `extended_metadata` - ProcessDumpMetadata.validateJsonElement(jsonObj.get("extended_metadata")); - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!ProcessDump.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'ProcessDump' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(ProcessDump.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, ProcessDump 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 ProcessDump read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // store additional fields in the deserialized instance - ProcessDump instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format(Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else if (entry.getValue().isJsonArray()) { - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); - } else { // JSON object - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; - } - - }.nullSafe(); - } - } - - /** - * Create an instance of ProcessDump given an JSON string - * - * @param jsonString JSON string - * @return An instance of ProcessDump - * @throws IOException if the JSON string is invalid with respect to ProcessDump - */ - public static ProcessDump fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, ProcessDump.class); - } - - /** - * Convert an instance of ProcessDump to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/ai/reveng/model/TTPSData.java b/src/main/java/ai/reveng/model/QueuePositionResponse.java similarity index 69% rename from src/main/java/ai/reveng/model/TTPSData.java rename to src/main/java/ai/reveng/model/QueuePositionResponse.java index 670e84e..2413cff 100644 --- a/src/main/java/ai/reveng/model/TTPSData.java +++ b/src/main/java/ai/reveng/model/QueuePositionResponse.java @@ -14,16 +14,14 @@ import java.util.Objects; import java.util.Locale; -import ai.reveng.model.TTPSElement; 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.net.URI; import java.util.Arrays; -import java.util.List; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -50,66 +48,57 @@ import ai.reveng.invoker.JSON; /** - * TTPSData + * QueuePositionResponse */ @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class TTPSData { - public static final String SERIALIZED_NAME_SCORE = "score"; - @SerializedName(SERIALIZED_NAME_SCORE) - @javax.annotation.Nonnull - private Integer score; - - public static final String SERIALIZED_NAME_TTPS = "ttps"; - @SerializedName(SERIALIZED_NAME_TTPS) +public class QueuePositionResponse { + public static final String SERIALIZED_NAME_$_SCHEMA = "$schema"; + @SerializedName(SERIALIZED_NAME_$_SCHEMA) + @javax.annotation.Nullable + private URI $schema; + + public static final String SERIALIZED_NAME_QUEUE_POSITION = "queue_position"; + @SerializedName(SERIALIZED_NAME_QUEUE_POSITION) @javax.annotation.Nonnull - private List ttps = new ArrayList<>(); + private Long queuePosition; - public TTPSData() { + public QueuePositionResponse() { } - public TTPSData score(@javax.annotation.Nonnull Integer score) { - this.score = score; - return this; + public QueuePositionResponse( + URI $schema + ) { + this(); + this.$schema = $schema; } /** - * Get score - * @return score + * A URL to the JSON Schema for this object. + * @return $schema */ - @javax.annotation.Nonnull - public Integer getScore() { - return score; + @javax.annotation.Nullable + public URI get$Schema() { + return $schema; } - public void setScore(@javax.annotation.Nonnull Integer score) { - this.score = score; - } - public TTPSData ttps(@javax.annotation.Nonnull List ttps) { - this.ttps = ttps; - return this; - } - - public TTPSData addTtpsItem(TTPSElement ttpsItem) { - if (this.ttps == null) { - this.ttps = new ArrayList<>(); - } - this.ttps.add(ttpsItem); + public QueuePositionResponse queuePosition(@javax.annotation.Nonnull Long queuePosition) { + this.queuePosition = queuePosition; return this; } /** - * Get ttps - * @return ttps + * Number of Processing analyses ahead of this one in the queue. 0 if this analysis is not Processing or has no analyses ahead of it. + * @return queuePosition */ @javax.annotation.Nonnull - public List getTtps() { - return ttps; + public Long getQueuePosition() { + return queuePosition; } - public void setTtps(@javax.annotation.Nonnull List ttps) { - this.ttps = ttps; + public void setQueuePosition(@javax.annotation.Nonnull Long queuePosition) { + this.queuePosition = queuePosition; } /** @@ -125,9 +114,9 @@ public void setTtps(@javax.annotation.Nonnull List ttps) { * * @param key name of the property * @param value value of the property - * @return the TTPSData instance itself + * @return the QueuePositionResponse instance itself */ - public TTPSData putAdditionalProperty(String key, Object value) { + public QueuePositionResponse putAdditionalProperty(String key, Object value) { if (this.additionalProperties == null) { this.additionalProperties = new HashMap(); } @@ -166,23 +155,23 @@ public boolean equals(Object o) { if (o == null || getClass() != o.getClass()) { return false; } - TTPSData ttPSData = (TTPSData) o; - return Objects.equals(this.score, ttPSData.score) && - Objects.equals(this.ttps, ttPSData.ttps)&& - Objects.equals(this.additionalProperties, ttPSData.additionalProperties); + QueuePositionResponse queuePositionResponse = (QueuePositionResponse) o; + return Objects.equals(this.$schema, queuePositionResponse.$schema) && + Objects.equals(this.queuePosition, queuePositionResponse.queuePosition)&& + Objects.equals(this.additionalProperties, queuePositionResponse.additionalProperties); } @Override public int hashCode() { - return Objects.hash(score, ttps, additionalProperties); + return Objects.hash($schema, queuePosition, additionalProperties); } @Override public String toString() { StringBuilder sb = new StringBuilder(); - sb.append("class TTPSData {\n"); - sb.append(" score: ").append(toIndentedString(score)).append("\n"); - sb.append(" ttps: ").append(toIndentedString(ttps)).append("\n"); + sb.append("class QueuePositionResponse {\n"); + sb.append(" $schema: ").append(toIndentedString($schema)).append("\n"); + sb.append(" queuePosition: ").append(toIndentedString(queuePosition)).append("\n"); sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); sb.append("}"); return sb.toString(); @@ -205,58 +194,51 @@ private String toIndentedString(Object o) { static { // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(Arrays.asList("score", "ttps")); + openapiFields = new HashSet(Arrays.asList("$schema", "queue_position")); // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(Arrays.asList("score", "ttps")); + openapiRequiredFields = new HashSet(Arrays.asList("queue_position")); } /** * 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 TTPSData + * @throws IOException if the JSON Element is invalid with respect to QueuePositionResponse */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (jsonElement == null) { - if (!TTPSData.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format(Locale.ROOT, "The required field(s) %s in TTPSData is not found in the empty JSON string", TTPSData.openapiRequiredFields.toString())); + if (!QueuePositionResponse.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format(Locale.ROOT, "The required field(s) %s in QueuePositionResponse is not found in the empty JSON string", QueuePositionResponse.openapiRequiredFields.toString())); } } // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : TTPSData.openapiRequiredFields) { + for (String requiredField : QueuePositionResponse.openapiRequiredFields) { if (jsonElement.getAsJsonObject().get(requiredField) == null) { throw new IllegalArgumentException(String.format(Locale.ROOT, "The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); } } JsonObject jsonObj = jsonElement.getAsJsonObject(); - // ensure the json data is an array - if (!jsonObj.get("ttps").isJsonArray()) { - throw new IllegalArgumentException(String.format(Locale.ROOT, "Expected the field `ttps` to be an array in the JSON string but got `%s`", jsonObj.get("ttps").toString())); + if ((jsonObj.get("$schema") != null && !jsonObj.get("$schema").isJsonNull()) && !jsonObj.get("$schema").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(Locale.ROOT, "Expected the field `$schema` to be a primitive type in the JSON string but got `%s`", jsonObj.get("$schema").toString())); } - - JsonArray jsonArrayttps = jsonObj.getAsJsonArray("ttps"); - // validate the required field `ttps` (array) - for (int i = 0; i < jsonArrayttps.size(); i++) { - TTPSElement.validateJsonElement(jsonArrayttps.get(i)); - }; } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @SuppressWarnings("unchecked") @Override public TypeAdapter create(Gson gson, TypeToken type) { - if (!TTPSData.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'TTPSData' and its subtypes + if (!QueuePositionResponse.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'QueuePositionResponse' and its subtypes } final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(TTPSData.class)); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(QueuePositionResponse.class)); - return (TypeAdapter) new TypeAdapter() { + return (TypeAdapter) new TypeAdapter() { @Override - public void write(JsonWriter out, TTPSData value) throws IOException { + public void write(JsonWriter out, QueuePositionResponse value) throws IOException { JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); obj.remove("additionalProperties"); // serialize additional properties @@ -284,12 +266,12 @@ else if (entry.getValue() instanceof Character) } @Override - public TTPSData read(JsonReader in) throws IOException { + public QueuePositionResponse read(JsonReader in) throws IOException { JsonElement jsonElement = elementAdapter.read(in); validateJsonElement(jsonElement); JsonObject jsonObj = jsonElement.getAsJsonObject(); // store additional fields in the deserialized instance - TTPSData instance = thisAdapter.fromJsonTree(jsonObj); + QueuePositionResponse instance = thisAdapter.fromJsonTree(jsonObj); for (Map.Entry entry : jsonObj.entrySet()) { if (!openapiFields.contains(entry.getKey())) { if (entry.getValue().isJsonPrimitive()) { // primitive type @@ -316,18 +298,18 @@ else if (entry.getValue().getAsJsonPrimitive().isBoolean()) } /** - * Create an instance of TTPSData given an JSON string + * Create an instance of QueuePositionResponse given an JSON string * * @param jsonString JSON string - * @return An instance of TTPSData - * @throws IOException if the JSON string is invalid with respect to TTPSData + * @return An instance of QueuePositionResponse + * @throws IOException if the JSON string is invalid with respect to QueuePositionResponse */ - public static TTPSData fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, TTPSData.class); + public static QueuePositionResponse fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, QueuePositionResponse.class); } /** - * Convert an instance of TTPSData to an JSON string + * Convert an instance of QueuePositionResponse to an JSON string * * @return JSON string */ diff --git a/src/main/java/ai/reveng/model/ProcessDumpsData.java b/src/main/java/ai/reveng/model/SendMessageRequest.java similarity index 66% rename from src/main/java/ai/reveng/model/ProcessDumpsData.java rename to src/main/java/ai/reveng/model/SendMessageRequest.java index dba3512..50e1bea 100644 --- a/src/main/java/ai/reveng/model/ProcessDumpsData.java +++ b/src/main/java/ai/reveng/model/SendMessageRequest.java @@ -14,16 +14,15 @@ import java.util.Objects; import java.util.Locale; -import ai.reveng.model.ProcessDump; +import ai.reveng.model.ConversationContext; 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.net.URI; import java.util.Arrays; -import java.util.List; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -50,66 +49,81 @@ import ai.reveng.invoker.JSON; /** - * ProcessDumpsData + * SendMessageRequest */ @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class ProcessDumpsData { - public static final String SERIALIZED_NAME_COUNT = "count"; - @SerializedName(SERIALIZED_NAME_COUNT) +public class SendMessageRequest { + public static final String SERIALIZED_NAME_$_SCHEMA = "$schema"; + @SerializedName(SERIALIZED_NAME_$_SCHEMA) + @javax.annotation.Nullable + private URI $schema; + + public static final String SERIALIZED_NAME_CONTENT = "content"; + @SerializedName(SERIALIZED_NAME_CONTENT) @javax.annotation.Nonnull - private Integer count; + private String content; - public static final String SERIALIZED_NAME_DUMPS = "dumps"; - @SerializedName(SERIALIZED_NAME_DUMPS) - @javax.annotation.Nonnull - private List dumps = new ArrayList<>(); + public static final String SERIALIZED_NAME_CONTEXT = "context"; + @SerializedName(SERIALIZED_NAME_CONTEXT) + @javax.annotation.Nullable + private ConversationContext context; - public ProcessDumpsData() { + public SendMessageRequest() { } - public ProcessDumpsData count(@javax.annotation.Nonnull Integer count) { - this.count = count; - return this; + public SendMessageRequest( + URI $schema + ) { + this(); + this.$schema = $schema; } /** - * Get count - * @return count + * A URL to the JSON Schema for this object. + * @return $schema */ - @javax.annotation.Nonnull - public Integer getCount() { - return count; + @javax.annotation.Nullable + public URI get$Schema() { + return $schema; } - public void setCount(@javax.annotation.Nonnull Integer count) { - this.count = count; - } - public ProcessDumpsData dumps(@javax.annotation.Nonnull List dumps) { - this.dumps = dumps; + public SendMessageRequest content(@javax.annotation.Nonnull String content) { + this.content = content; return this; } - public ProcessDumpsData addDumpsItem(ProcessDump dumpsItem) { - if (this.dumps == null) { - this.dumps = new ArrayList<>(); - } - this.dumps.add(dumpsItem); + /** + * Get content + * @return content + */ + @javax.annotation.Nonnull + public String getContent() { + return content; + } + + public void setContent(@javax.annotation.Nonnull String content) { + this.content = content; + } + + + public SendMessageRequest context(@javax.annotation.Nullable ConversationContext context) { + this.context = context; return this; } /** - * Get dumps - * @return dumps + * Get context + * @return context */ - @javax.annotation.Nonnull - public List getDumps() { - return dumps; + @javax.annotation.Nullable + public ConversationContext getContext() { + return context; } - public void setDumps(@javax.annotation.Nonnull List dumps) { - this.dumps = dumps; + public void setContext(@javax.annotation.Nullable ConversationContext context) { + this.context = context; } /** @@ -125,9 +139,9 @@ public void setDumps(@javax.annotation.Nonnull List dumps) { * * @param key name of the property * @param value value of the property - * @return the ProcessDumpsData instance itself + * @return the SendMessageRequest instance itself */ - public ProcessDumpsData putAdditionalProperty(String key, Object value) { + public SendMessageRequest putAdditionalProperty(String key, Object value) { if (this.additionalProperties == null) { this.additionalProperties = new HashMap(); } @@ -166,23 +180,25 @@ public boolean equals(Object o) { if (o == null || getClass() != o.getClass()) { return false; } - ProcessDumpsData processDumpsData = (ProcessDumpsData) o; - return Objects.equals(this.count, processDumpsData.count) && - Objects.equals(this.dumps, processDumpsData.dumps)&& - Objects.equals(this.additionalProperties, processDumpsData.additionalProperties); + SendMessageRequest sendMessageRequest = (SendMessageRequest) o; + return Objects.equals(this.$schema, sendMessageRequest.$schema) && + Objects.equals(this.content, sendMessageRequest.content) && + Objects.equals(this.context, sendMessageRequest.context)&& + Objects.equals(this.additionalProperties, sendMessageRequest.additionalProperties); } @Override public int hashCode() { - return Objects.hash(count, dumps, additionalProperties); + return Objects.hash($schema, content, context, additionalProperties); } @Override public String toString() { StringBuilder sb = new StringBuilder(); - sb.append("class ProcessDumpsData {\n"); - sb.append(" count: ").append(toIndentedString(count)).append("\n"); - sb.append(" dumps: ").append(toIndentedString(dumps)).append("\n"); + sb.append("class SendMessageRequest {\n"); + sb.append(" $schema: ").append(toIndentedString($schema)).append("\n"); + sb.append(" content: ").append(toIndentedString(content)).append("\n"); + sb.append(" context: ").append(toIndentedString(context)).append("\n"); sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); sb.append("}"); return sb.toString(); @@ -205,58 +221,54 @@ private String toIndentedString(Object o) { static { // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(Arrays.asList("count", "dumps")); + openapiFields = new HashSet(Arrays.asList("$schema", "content", "context")); // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(Arrays.asList("count", "dumps")); + openapiRequiredFields = new HashSet(Arrays.asList("content")); } /** * 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 ProcessDumpsData + * @throws IOException if the JSON Element is invalid with respect to SendMessageRequest */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (jsonElement == null) { - if (!ProcessDumpsData.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format(Locale.ROOT, "The required field(s) %s in ProcessDumpsData is not found in the empty JSON string", ProcessDumpsData.openapiRequiredFields.toString())); + if (!SendMessageRequest.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format(Locale.ROOT, "The required field(s) %s in SendMessageRequest is not found in the empty JSON string", SendMessageRequest.openapiRequiredFields.toString())); } } // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : ProcessDumpsData.openapiRequiredFields) { + for (String requiredField : SendMessageRequest.openapiRequiredFields) { if (jsonElement.getAsJsonObject().get(requiredField) == null) { throw new IllegalArgumentException(String.format(Locale.ROOT, "The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); } } JsonObject jsonObj = jsonElement.getAsJsonObject(); - // ensure the json data is an array - if (!jsonObj.get("dumps").isJsonArray()) { - throw new IllegalArgumentException(String.format(Locale.ROOT, "Expected the field `dumps` to be an array in the JSON string but got `%s`", jsonObj.get("dumps").toString())); + if ((jsonObj.get("$schema") != null && !jsonObj.get("$schema").isJsonNull()) && !jsonObj.get("$schema").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(Locale.ROOT, "Expected the field `$schema` to be a primitive type in the JSON string but got `%s`", jsonObj.get("$schema").toString())); + } + if (!jsonObj.get("content").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(Locale.ROOT, "Expected the field `content` to be a primitive type in the JSON string but got `%s`", jsonObj.get("content").toString())); } - - JsonArray jsonArraydumps = jsonObj.getAsJsonArray("dumps"); - // validate the required field `dumps` (array) - for (int i = 0; i < jsonArraydumps.size(); i++) { - ProcessDump.validateJsonElement(jsonArraydumps.get(i)); - }; } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @SuppressWarnings("unchecked") @Override public TypeAdapter create(Gson gson, TypeToken type) { - if (!ProcessDumpsData.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'ProcessDumpsData' and its subtypes + if (!SendMessageRequest.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'SendMessageRequest' and its subtypes } final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(ProcessDumpsData.class)); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(SendMessageRequest.class)); - return (TypeAdapter) new TypeAdapter() { + return (TypeAdapter) new TypeAdapter() { @Override - public void write(JsonWriter out, ProcessDumpsData value) throws IOException { + public void write(JsonWriter out, SendMessageRequest value) throws IOException { JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); obj.remove("additionalProperties"); // serialize additional properties @@ -284,12 +296,12 @@ else if (entry.getValue() instanceof Character) } @Override - public ProcessDumpsData read(JsonReader in) throws IOException { + public SendMessageRequest read(JsonReader in) throws IOException { JsonElement jsonElement = elementAdapter.read(in); validateJsonElement(jsonElement); JsonObject jsonObj = jsonElement.getAsJsonObject(); // store additional fields in the deserialized instance - ProcessDumpsData instance = thisAdapter.fromJsonTree(jsonObj); + SendMessageRequest instance = thisAdapter.fromJsonTree(jsonObj); for (Map.Entry entry : jsonObj.entrySet()) { if (!openapiFields.contains(entry.getKey())) { if (entry.getValue().isJsonPrimitive()) { // primitive type @@ -316,18 +328,18 @@ else if (entry.getValue().getAsJsonPrimitive().isBoolean()) } /** - * Create an instance of ProcessDumpsData given an JSON string + * Create an instance of SendMessageRequest given an JSON string * * @param jsonString JSON string - * @return An instance of ProcessDumpsData - * @throws IOException if the JSON string is invalid with respect to ProcessDumpsData + * @return An instance of SendMessageRequest + * @throws IOException if the JSON string is invalid with respect to SendMessageRequest */ - public static ProcessDumpsData fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, ProcessDumpsData.class); + public static SendMessageRequest fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, SendMessageRequest.class); } /** - * Convert an instance of ProcessDumpsData to an JSON string + * Convert an instance of SendMessageRequest to an JSON string * * @return JSON string */ diff --git a/src/main/java/ai/reveng/model/SseEventContextCompactedData.java b/src/main/java/ai/reveng/model/SseEventContextCompactedData.java new file mode 100644 index 0000000..8810640 --- /dev/null +++ b/src/main/java/ai/reveng/model/SseEventContextCompactedData.java @@ -0,0 +1,346 @@ +/* + * RevEng.AI API + * RevEng.AI is an AI-powered binary analysis platform for reverse engineering and malware analysis. It provides similarity search across executable binaries and functions, AI-driven decompilation, dynamic execution analysis, firmware unpacking, and integration with external threat intelligence sources like VirusTotal. + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package ai.reveng.model; + +import java.util.Objects; +import java.util.Locale; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; +import java.util.Locale; + +import ai.reveng.invoker.JSON; + +/** + * SseEventContextCompactedData + */ +@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; + + 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_TYPE = "type"; + @SerializedName(SERIALIZED_NAME_TYPE) + @javax.annotation.Nonnull + private String type; + + public SseEventContextCompactedData() { + } + + public SseEventContextCompactedData data(@javax.annotation.Nullable Object data) { + this.data = data; + return this; + } + + /** + * Get data + * @return data + */ + @javax.annotation.Nullable + public Object getData() { + return data; + } + + public void setData(@javax.annotation.Nullable Object data) { + this.data = data; + } + + + public SseEventContextCompactedData eventId(@javax.annotation.Nonnull Long eventId) { + this.eventId = eventId; + return this; + } + + /** + * Get eventId + * @return eventId + */ + @javax.annotation.Nonnull + public Long getEventId() { + return eventId; + } + + public void setEventId(@javax.annotation.Nonnull Long eventId) { + this.eventId = eventId; + } + + + public SseEventContextCompactedData 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; + } + + /** + * 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 SseEventContextCompactedData instance itself + */ + public SseEventContextCompactedData 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; + } + SseEventContextCompactedData sseEventContextCompactedData = (SseEventContextCompactedData) o; + return Objects.equals(this.data, sseEventContextCompactedData.data) && + Objects.equals(this.eventId, sseEventContextCompactedData.eventId) && + Objects.equals(this.type, sseEventContextCompactedData.type)&& + Objects.equals(this.additionalProperties, sseEventContextCompactedData.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, eventId, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SseEventContextCompactedData {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" eventId: ").append(toIndentedString(eventId)).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) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(Arrays.asList("data", "event_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 SseEventContextCompactedData + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!SseEventContextCompactedData.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format(Locale.ROOT, "The required field(s) %s in SseEventContextCompactedData is not found in the empty JSON string", SseEventContextCompactedData.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : SseEventContextCompactedData.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format(Locale.ROOT, "The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("type").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(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 (!SseEventContextCompactedData.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'SseEventContextCompactedData' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(SseEventContextCompactedData.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, SseEventContextCompactedData 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 SseEventContextCompactedData read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + SseEventContextCompactedData instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format(Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of SseEventContextCompactedData given an JSON string + * + * @param jsonString JSON string + * @return An instance of SseEventContextCompactedData + * @throws IOException if the JSON string is invalid with respect to SseEventContextCompactedData + */ + public static SseEventContextCompactedData fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, SseEventContextCompactedData.class); + } + + /** + * Convert an instance of SseEventContextCompactedData to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/ai/reveng/model/NetworkOverviewDnsAnswer.java b/src/main/java/ai/reveng/model/SseEventRunCancelledData.java similarity index 76% rename from src/main/java/ai/reveng/model/NetworkOverviewDnsAnswer.java rename to src/main/java/ai/reveng/model/SseEventRunCancelledData.java index 43297df..20b6d84 100644 --- a/src/main/java/ai/reveng/model/NetworkOverviewDnsAnswer.java +++ b/src/main/java/ai/reveng/model/SseEventRunCancelledData.java @@ -47,58 +47,82 @@ import ai.reveng.invoker.JSON; /** - * NetworkOverviewDnsAnswer + * SseEventRunCancelledData */ @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class NetworkOverviewDnsAnswer { +public class SseEventRunCancelledData { + public static final String SERIALIZED_NAME_DATA = "data"; + @SerializedName(SERIALIZED_NAME_DATA) + @javax.annotation.Nullable + private Object data = null; + + 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_TYPE = "type"; @SerializedName(SERIALIZED_NAME_TYPE) @javax.annotation.Nonnull private String type; - public static final String SERIALIZED_NAME_DATA = "data"; - @SerializedName(SERIALIZED_NAME_DATA) - @javax.annotation.Nonnull - private String data; + public SseEventRunCancelledData() { + } + + public SseEventRunCancelledData data(@javax.annotation.Nullable Object data) { + this.data = data; + return this; + } - public NetworkOverviewDnsAnswer() { + /** + * Get data + * @return data + */ + @javax.annotation.Nullable + public Object getData() { + return data; } - public NetworkOverviewDnsAnswer type(@javax.annotation.Nonnull String type) { - this.type = type; + public void setData(@javax.annotation.Nullable Object data) { + this.data = data; + } + + + public SseEventRunCancelledData eventId(@javax.annotation.Nonnull Long eventId) { + this.eventId = eventId; return this; } /** - * Get type - * @return type + * Get eventId + * @return eventId */ @javax.annotation.Nonnull - public String getType() { - return type; + public Long getEventId() { + return eventId; } - public void setType(@javax.annotation.Nonnull String type) { - this.type = type; + public void setEventId(@javax.annotation.Nonnull Long eventId) { + this.eventId = eventId; } - public NetworkOverviewDnsAnswer data(@javax.annotation.Nonnull String data) { - this.data = data; + public SseEventRunCancelledData type(@javax.annotation.Nonnull String type) { + this.type = type; return this; } /** - * Get data - * @return data + * Get type + * @return type */ @javax.annotation.Nonnull - public String getData() { - return data; + public String getType() { + return type; } - public void setData(@javax.annotation.Nonnull String data) { - this.data = data; + public void setType(@javax.annotation.Nonnull String type) { + this.type = type; } /** @@ -114,9 +138,9 @@ public void setData(@javax.annotation.Nonnull String data) { * * @param key name of the property * @param value value of the property - * @return the NetworkOverviewDnsAnswer instance itself + * @return the SseEventRunCancelledData instance itself */ - public NetworkOverviewDnsAnswer putAdditionalProperty(String key, Object value) { + public SseEventRunCancelledData putAdditionalProperty(String key, Object value) { if (this.additionalProperties == null) { this.additionalProperties = new HashMap(); } @@ -155,23 +179,25 @@ public boolean equals(Object o) { if (o == null || getClass() != o.getClass()) { return false; } - NetworkOverviewDnsAnswer networkOverviewDnsAnswer = (NetworkOverviewDnsAnswer) o; - return Objects.equals(this.type, networkOverviewDnsAnswer.type) && - Objects.equals(this.data, networkOverviewDnsAnswer.data)&& - Objects.equals(this.additionalProperties, networkOverviewDnsAnswer.additionalProperties); + SseEventRunCancelledData sseEventRunCancelledData = (SseEventRunCancelledData) o; + return Objects.equals(this.data, sseEventRunCancelledData.data) && + Objects.equals(this.eventId, sseEventRunCancelledData.eventId) && + Objects.equals(this.type, sseEventRunCancelledData.type)&& + Objects.equals(this.additionalProperties, sseEventRunCancelledData.additionalProperties); } @Override public int hashCode() { - return Objects.hash(type, data, additionalProperties); + return Objects.hash(data, eventId, type, additionalProperties); } @Override public String toString() { StringBuilder sb = new StringBuilder(); - sb.append("class NetworkOverviewDnsAnswer {\n"); - sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append("class SseEventRunCancelledData {\n"); sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" eventId: ").append(toIndentedString(eventId)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); sb.append("}"); return sb.toString(); @@ -194,27 +220,27 @@ private String toIndentedString(Object o) { static { // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(Arrays.asList("type", "data")); + openapiFields = new HashSet(Arrays.asList("data", "event_id", "type")); // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(Arrays.asList("type", "data")); + 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 NetworkOverviewDnsAnswer + * @throws IOException if the JSON Element is invalid with respect to SseEventRunCancelledData */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (jsonElement == null) { - if (!NetworkOverviewDnsAnswer.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format(Locale.ROOT, "The required field(s) %s in NetworkOverviewDnsAnswer is not found in the empty JSON string", NetworkOverviewDnsAnswer.openapiRequiredFields.toString())); + if (!SseEventRunCancelledData.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format(Locale.ROOT, "The required field(s) %s in SseEventRunCancelledData is not found in the empty JSON string", SseEventRunCancelledData.openapiRequiredFields.toString())); } } // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : NetworkOverviewDnsAnswer.openapiRequiredFields) { + for (String requiredField : SseEventRunCancelledData.openapiRequiredFields) { if (jsonElement.getAsJsonObject().get(requiredField) == null) { throw new IllegalArgumentException(String.format(Locale.ROOT, "The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); } @@ -223,25 +249,22 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti if (!jsonObj.get("type").isJsonPrimitive()) { throw new IllegalArgumentException(String.format(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("data").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format(Locale.ROOT, "Expected the field `data` to be a primitive type in the JSON string but got `%s`", jsonObj.get("data").toString())); - } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @SuppressWarnings("unchecked") @Override public TypeAdapter create(Gson gson, TypeToken type) { - if (!NetworkOverviewDnsAnswer.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'NetworkOverviewDnsAnswer' and its subtypes + if (!SseEventRunCancelledData.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'SseEventRunCancelledData' and its subtypes } final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(NetworkOverviewDnsAnswer.class)); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(SseEventRunCancelledData.class)); - return (TypeAdapter) new TypeAdapter() { + return (TypeAdapter) new TypeAdapter() { @Override - public void write(JsonWriter out, NetworkOverviewDnsAnswer value) throws IOException { + public void write(JsonWriter out, SseEventRunCancelledData value) throws IOException { JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); obj.remove("additionalProperties"); // serialize additional properties @@ -269,12 +292,12 @@ else if (entry.getValue() instanceof Character) } @Override - public NetworkOverviewDnsAnswer read(JsonReader in) throws IOException { + public SseEventRunCancelledData read(JsonReader in) throws IOException { JsonElement jsonElement = elementAdapter.read(in); validateJsonElement(jsonElement); JsonObject jsonObj = jsonElement.getAsJsonObject(); // store additional fields in the deserialized instance - NetworkOverviewDnsAnswer instance = thisAdapter.fromJsonTree(jsonObj); + SseEventRunCancelledData instance = thisAdapter.fromJsonTree(jsonObj); for (Map.Entry entry : jsonObj.entrySet()) { if (!openapiFields.contains(entry.getKey())) { if (entry.getValue().isJsonPrimitive()) { // primitive type @@ -301,18 +324,18 @@ else if (entry.getValue().getAsJsonPrimitive().isBoolean()) } /** - * Create an instance of NetworkOverviewDnsAnswer given an JSON string + * Create an instance of SseEventRunCancelledData given an JSON string * * @param jsonString JSON string - * @return An instance of NetworkOverviewDnsAnswer - * @throws IOException if the JSON string is invalid with respect to NetworkOverviewDnsAnswer + * @return An instance of SseEventRunCancelledData + * @throws IOException if the JSON string is invalid with respect to SseEventRunCancelledData */ - public static NetworkOverviewDnsAnswer fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, NetworkOverviewDnsAnswer.class); + public static SseEventRunCancelledData fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, SseEventRunCancelledData.class); } /** - * Convert an instance of NetworkOverviewDnsAnswer to an JSON string + * Convert an instance of SseEventRunCancelledData to an JSON string * * @return JSON string */ diff --git a/src/main/java/ai/reveng/model/ProcessTree.java b/src/main/java/ai/reveng/model/SseEventRunErrorData.java similarity index 71% rename from src/main/java/ai/reveng/model/ProcessTree.java rename to src/main/java/ai/reveng/model/SseEventRunErrorData.java index 0d00fdf..004280a 100644 --- a/src/main/java/ai/reveng/model/ProcessTree.java +++ b/src/main/java/ai/reveng/model/SseEventRunErrorData.java @@ -14,16 +14,13 @@ import java.util.Objects; import java.util.Locale; -import ai.reveng.model.Process; 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; @@ -50,66 +47,82 @@ import ai.reveng.invoker.JSON; /** - * ProcessTree + * SseEventRunErrorData */ @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class ProcessTree { - public static final String SERIALIZED_NAME_SUCCESS = "success"; - @SerializedName(SERIALIZED_NAME_SUCCESS) - @javax.annotation.Nonnull - private Boolean success; - +public class SseEventRunErrorData { public static final String SERIALIZED_NAME_DATA = "data"; @SerializedName(SERIALIZED_NAME_DATA) + @javax.annotation.Nullable + private Object data = null; + + public static final String SERIALIZED_NAME_EVENT_ID = "event_id"; + @SerializedName(SERIALIZED_NAME_EVENT_ID) @javax.annotation.Nonnull - private List data = new ArrayList<>(); + private Long eventId; - public ProcessTree() { + public static final String SERIALIZED_NAME_TYPE = "type"; + @SerializedName(SERIALIZED_NAME_TYPE) + @javax.annotation.Nonnull + private String type; + + public SseEventRunErrorData() { } - public ProcessTree success(@javax.annotation.Nonnull Boolean success) { - this.success = success; + public SseEventRunErrorData data(@javax.annotation.Nullable Object data) { + this.data = data; return this; } /** - * Get success - * @return success + * Get data + * @return data */ - @javax.annotation.Nonnull - public Boolean getSuccess() { - return success; + @javax.annotation.Nullable + public Object getData() { + return data; } - public void setSuccess(@javax.annotation.Nonnull Boolean success) { - this.success = success; + public void setData(@javax.annotation.Nullable Object data) { + this.data = data; } - public ProcessTree data(@javax.annotation.Nonnull List data) { - this.data = data; + public SseEventRunErrorData eventId(@javax.annotation.Nonnull Long eventId) { + this.eventId = eventId; return this; } - public ProcessTree addDataItem(Process dataItem) { - if (this.data == null) { - this.data = new ArrayList<>(); - } - this.data.add(dataItem); + /** + * Get eventId + * @return eventId + */ + @javax.annotation.Nonnull + public Long getEventId() { + return eventId; + } + + public void setEventId(@javax.annotation.Nonnull Long eventId) { + this.eventId = eventId; + } + + + public SseEventRunErrorData type(@javax.annotation.Nonnull String type) { + this.type = type; return this; } /** - * Get data - * @return data + * Get type + * @return type */ @javax.annotation.Nonnull - public List getData() { - return data; + public String getType() { + return type; } - public void setData(@javax.annotation.Nonnull List data) { - this.data = data; + public void setType(@javax.annotation.Nonnull String type) { + this.type = type; } /** @@ -125,9 +138,9 @@ public void setData(@javax.annotation.Nonnull List data) { * * @param key name of the property * @param value value of the property - * @return the ProcessTree instance itself + * @return the SseEventRunErrorData instance itself */ - public ProcessTree putAdditionalProperty(String key, Object value) { + public SseEventRunErrorData putAdditionalProperty(String key, Object value) { if (this.additionalProperties == null) { this.additionalProperties = new HashMap(); } @@ -166,23 +179,25 @@ public boolean equals(Object o) { if (o == null || getClass() != o.getClass()) { return false; } - ProcessTree processTree = (ProcessTree) o; - return Objects.equals(this.success, processTree.success) && - Objects.equals(this.data, processTree.data)&& - Objects.equals(this.additionalProperties, processTree.additionalProperties); + SseEventRunErrorData sseEventRunErrorData = (SseEventRunErrorData) o; + return Objects.equals(this.data, sseEventRunErrorData.data) && + Objects.equals(this.eventId, sseEventRunErrorData.eventId) && + Objects.equals(this.type, sseEventRunErrorData.type)&& + Objects.equals(this.additionalProperties, sseEventRunErrorData.additionalProperties); } @Override public int hashCode() { - return Objects.hash(success, data, additionalProperties); + return Objects.hash(data, eventId, type, additionalProperties); } @Override public String toString() { StringBuilder sb = new StringBuilder(); - sb.append("class ProcessTree {\n"); - sb.append(" success: ").append(toIndentedString(success)).append("\n"); + sb.append("class SseEventRunErrorData {\n"); sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" eventId: ").append(toIndentedString(eventId)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); sb.append("}"); return sb.toString(); @@ -205,58 +220,51 @@ private String toIndentedString(Object o) { static { // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(Arrays.asList("success", "data")); + openapiFields = new HashSet(Arrays.asList("data", "event_id", "type")); // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(Arrays.asList("success", "data")); + 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 ProcessTree + * @throws IOException if the JSON Element is invalid with respect to SseEventRunErrorData */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (jsonElement == null) { - if (!ProcessTree.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format(Locale.ROOT, "The required field(s) %s in ProcessTree is not found in the empty JSON string", ProcessTree.openapiRequiredFields.toString())); + if (!SseEventRunErrorData.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format(Locale.ROOT, "The required field(s) %s in SseEventRunErrorData is not found in the empty JSON string", SseEventRunErrorData.openapiRequiredFields.toString())); } } // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : ProcessTree.openapiRequiredFields) { + for (String requiredField : SseEventRunErrorData.openapiRequiredFields) { if (jsonElement.getAsJsonObject().get(requiredField) == null) { throw new IllegalArgumentException(String.format(Locale.ROOT, "The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); } } JsonObject jsonObj = jsonElement.getAsJsonObject(); - // ensure the json data is an array - if (!jsonObj.get("data").isJsonArray()) { - throw new IllegalArgumentException(String.format(Locale.ROOT, "Expected the field `data` to be an array in the JSON string but got `%s`", jsonObj.get("data").toString())); + if (!jsonObj.get("type").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(Locale.ROOT, "Expected the field `type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("type").toString())); } - - JsonArray jsonArraydata = jsonObj.getAsJsonArray("data"); - // validate the required field `data` (array) - for (int i = 0; i < jsonArraydata.size(); i++) { - Process.validateJsonElement(jsonArraydata.get(i)); - }; } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @SuppressWarnings("unchecked") @Override public TypeAdapter create(Gson gson, TypeToken type) { - if (!ProcessTree.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'ProcessTree' and its subtypes + if (!SseEventRunErrorData.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'SseEventRunErrorData' and its subtypes } final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(ProcessTree.class)); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(SseEventRunErrorData.class)); - return (TypeAdapter) new TypeAdapter() { + return (TypeAdapter) new TypeAdapter() { @Override - public void write(JsonWriter out, ProcessTree value) throws IOException { + public void write(JsonWriter out, SseEventRunErrorData value) throws IOException { JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); obj.remove("additionalProperties"); // serialize additional properties @@ -284,12 +292,12 @@ else if (entry.getValue() instanceof Character) } @Override - public ProcessTree read(JsonReader in) throws IOException { + public SseEventRunErrorData read(JsonReader in) throws IOException { JsonElement jsonElement = elementAdapter.read(in); validateJsonElement(jsonElement); JsonObject jsonObj = jsonElement.getAsJsonObject(); // store additional fields in the deserialized instance - ProcessTree instance = thisAdapter.fromJsonTree(jsonObj); + SseEventRunErrorData instance = thisAdapter.fromJsonTree(jsonObj); for (Map.Entry entry : jsonObj.entrySet()) { if (!openapiFields.contains(entry.getKey())) { if (entry.getValue().isJsonPrimitive()) { // primitive type @@ -316,18 +324,18 @@ else if (entry.getValue().getAsJsonPrimitive().isBoolean()) } /** - * Create an instance of ProcessTree given an JSON string + * Create an instance of SseEventRunErrorData given an JSON string * * @param jsonString JSON string - * @return An instance of ProcessTree - * @throws IOException if the JSON string is invalid with respect to ProcessTree + * @return An instance of SseEventRunErrorData + * @throws IOException if the JSON string is invalid with respect to SseEventRunErrorData */ - public static ProcessTree fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, ProcessTree.class); + public static SseEventRunErrorData fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, SseEventRunErrorData.class); } /** - * Convert an instance of ProcessTree to an JSON string + * Convert an instance of SseEventRunErrorData to an JSON string * * @return JSON string */ diff --git a/src/main/java/ai/reveng/model/SseEventRunFinishedData.java b/src/main/java/ai/reveng/model/SseEventRunFinishedData.java new file mode 100644 index 0000000..c46224b --- /dev/null +++ b/src/main/java/ai/reveng/model/SseEventRunFinishedData.java @@ -0,0 +1,346 @@ +/* + * RevEng.AI API + * RevEng.AI is an AI-powered binary analysis platform for reverse engineering and malware analysis. It provides similarity search across executable binaries and functions, AI-driven decompilation, dynamic execution analysis, firmware unpacking, and integration with external threat intelligence sources like VirusTotal. + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package ai.reveng.model; + +import java.util.Objects; +import java.util.Locale; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; +import java.util.Locale; + +import ai.reveng.invoker.JSON; + +/** + * SseEventRunFinishedData + */ +@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; + + 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_TYPE = "type"; + @SerializedName(SERIALIZED_NAME_TYPE) + @javax.annotation.Nonnull + private String type; + + public SseEventRunFinishedData() { + } + + public SseEventRunFinishedData data(@javax.annotation.Nullable Object data) { + this.data = data; + return this; + } + + /** + * Get data + * @return data + */ + @javax.annotation.Nullable + public Object getData() { + return data; + } + + public void setData(@javax.annotation.Nullable Object data) { + this.data = data; + } + + + public SseEventRunFinishedData eventId(@javax.annotation.Nonnull Long eventId) { + this.eventId = eventId; + return this; + } + + /** + * Get eventId + * @return eventId + */ + @javax.annotation.Nonnull + public Long getEventId() { + return eventId; + } + + public void setEventId(@javax.annotation.Nonnull Long eventId) { + this.eventId = eventId; + } + + + public SseEventRunFinishedData 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; + } + + /** + * 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 SseEventRunFinishedData instance itself + */ + public SseEventRunFinishedData 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; + } + SseEventRunFinishedData sseEventRunFinishedData = (SseEventRunFinishedData) o; + return Objects.equals(this.data, sseEventRunFinishedData.data) && + Objects.equals(this.eventId, sseEventRunFinishedData.eventId) && + Objects.equals(this.type, sseEventRunFinishedData.type)&& + Objects.equals(this.additionalProperties, sseEventRunFinishedData.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, eventId, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SseEventRunFinishedData {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" eventId: ").append(toIndentedString(eventId)).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) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(Arrays.asList("data", "event_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 SseEventRunFinishedData + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!SseEventRunFinishedData.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format(Locale.ROOT, "The required field(s) %s in SseEventRunFinishedData is not found in the empty JSON string", SseEventRunFinishedData.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : SseEventRunFinishedData.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format(Locale.ROOT, "The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("type").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(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 (!SseEventRunFinishedData.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'SseEventRunFinishedData' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(SseEventRunFinishedData.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, SseEventRunFinishedData 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 SseEventRunFinishedData read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + SseEventRunFinishedData instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format(Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of SseEventRunFinishedData given an JSON string + * + * @param jsonString JSON string + * @return An instance of SseEventRunFinishedData + * @throws IOException if the JSON string is invalid with respect to SseEventRunFinishedData + */ + public static SseEventRunFinishedData fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, SseEventRunFinishedData.class); + } + + /** + * Convert an instance of SseEventRunFinishedData to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/ai/reveng/model/ProcessRegistry.java b/src/main/java/ai/reveng/model/SseEventRunStartedData.java similarity index 70% rename from src/main/java/ai/reveng/model/ProcessRegistry.java rename to src/main/java/ai/reveng/model/SseEventRunStartedData.java index e9c5c3f..87b25f7 100644 --- a/src/main/java/ai/reveng/model/ProcessRegistry.java +++ b/src/main/java/ai/reveng/model/SseEventRunStartedData.java @@ -14,7 +14,6 @@ import java.util.Objects; import java.util.Locale; -import ai.reveng.model.Registry; import com.google.gson.TypeAdapter; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; @@ -22,9 +21,6 @@ import com.google.gson.stream.JsonWriter; import java.io.IOException; 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; @@ -51,66 +47,82 @@ import ai.reveng.invoker.JSON; /** - * ProcessRegistry + * SseEventRunStartedData */ @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class ProcessRegistry { - public static final String SERIALIZED_NAME_SUCCESS = "success"; - @SerializedName(SERIALIZED_NAME_SUCCESS) - @javax.annotation.Nonnull - private Boolean success; - +public class SseEventRunStartedData { public static final String SERIALIZED_NAME_DATA = "data"; @SerializedName(SERIALIZED_NAME_DATA) + @javax.annotation.Nullable + private Object data = null; + + 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_TYPE = "type"; + @SerializedName(SERIALIZED_NAME_TYPE) @javax.annotation.Nonnull - private Map> data = new HashMap<>(); + private String type; - public ProcessRegistry() { + public SseEventRunStartedData() { } - public ProcessRegistry success(@javax.annotation.Nonnull Boolean success) { - this.success = success; + public SseEventRunStartedData data(@javax.annotation.Nullable Object data) { + this.data = data; return this; } /** - * Get success - * @return success + * Get data + * @return data */ - @javax.annotation.Nonnull - public Boolean getSuccess() { - return success; + @javax.annotation.Nullable + public Object getData() { + return data; } - public void setSuccess(@javax.annotation.Nonnull Boolean success) { - this.success = success; + public void setData(@javax.annotation.Nullable Object data) { + this.data = data; } - public ProcessRegistry data(@javax.annotation.Nonnull Map> data) { - this.data = data; + public SseEventRunStartedData eventId(@javax.annotation.Nonnull Long eventId) { + this.eventId = eventId; return this; } - public ProcessRegistry putDataItem(String key, List dataItem) { - if (this.data == null) { - this.data = new HashMap<>(); - } - this.data.put(key, dataItem); + /** + * Get eventId + * @return eventId + */ + @javax.annotation.Nonnull + public Long getEventId() { + return eventId; + } + + public void setEventId(@javax.annotation.Nonnull Long eventId) { + this.eventId = eventId; + } + + + public SseEventRunStartedData type(@javax.annotation.Nonnull String type) { + this.type = type; return this; } /** - * Get data - * @return data + * Get type + * @return type */ @javax.annotation.Nonnull - public Map> getData() { - return data; + public String getType() { + return type; } - public void setData(@javax.annotation.Nonnull Map> data) { - this.data = data; + public void setType(@javax.annotation.Nonnull String type) { + this.type = type; } /** @@ -126,9 +138,9 @@ public void setData(@javax.annotation.Nonnull Map> data) * * @param key name of the property * @param value value of the property - * @return the ProcessRegistry instance itself + * @return the SseEventRunStartedData instance itself */ - public ProcessRegistry putAdditionalProperty(String key, Object value) { + public SseEventRunStartedData putAdditionalProperty(String key, Object value) { if (this.additionalProperties == null) { this.additionalProperties = new HashMap(); } @@ -167,23 +179,25 @@ public boolean equals(Object o) { if (o == null || getClass() != o.getClass()) { return false; } - ProcessRegistry processRegistry = (ProcessRegistry) o; - return Objects.equals(this.success, processRegistry.success) && - Objects.equals(this.data, processRegistry.data)&& - Objects.equals(this.additionalProperties, processRegistry.additionalProperties); + SseEventRunStartedData sseEventRunStartedData = (SseEventRunStartedData) o; + return Objects.equals(this.data, sseEventRunStartedData.data) && + Objects.equals(this.eventId, sseEventRunStartedData.eventId) && + Objects.equals(this.type, sseEventRunStartedData.type)&& + Objects.equals(this.additionalProperties, sseEventRunStartedData.additionalProperties); } @Override public int hashCode() { - return Objects.hash(success, data, additionalProperties); + return Objects.hash(data, eventId, type, additionalProperties); } @Override public String toString() { StringBuilder sb = new StringBuilder(); - sb.append("class ProcessRegistry {\n"); - sb.append(" success: ").append(toIndentedString(success)).append("\n"); + sb.append("class SseEventRunStartedData {\n"); sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" eventId: ").append(toIndentedString(eventId)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); sb.append("}"); return sb.toString(); @@ -206,48 +220,51 @@ private String toIndentedString(Object o) { static { // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(Arrays.asList("success", "data")); + openapiFields = new HashSet(Arrays.asList("data", "event_id", "type")); // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(Arrays.asList("success", "data")); + 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 ProcessRegistry + * @throws IOException if the JSON Element is invalid with respect to SseEventRunStartedData */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (jsonElement == null) { - if (!ProcessRegistry.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format(Locale.ROOT, "The required field(s) %s in ProcessRegistry is not found in the empty JSON string", ProcessRegistry.openapiRequiredFields.toString())); + if (!SseEventRunStartedData.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format(Locale.ROOT, "The required field(s) %s in SseEventRunStartedData is not found in the empty JSON string", SseEventRunStartedData.openapiRequiredFields.toString())); } } // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : ProcessRegistry.openapiRequiredFields) { + for (String requiredField : SseEventRunStartedData.openapiRequiredFields) { if (jsonElement.getAsJsonObject().get(requiredField) == null) { throw new IllegalArgumentException(String.format(Locale.ROOT, "The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); } } JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("type").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(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 (!ProcessRegistry.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'ProcessRegistry' and its subtypes + if (!SseEventRunStartedData.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'SseEventRunStartedData' and its subtypes } final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(ProcessRegistry.class)); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(SseEventRunStartedData.class)); - return (TypeAdapter) new TypeAdapter() { + return (TypeAdapter) new TypeAdapter() { @Override - public void write(JsonWriter out, ProcessRegistry value) throws IOException { + public void write(JsonWriter out, SseEventRunStartedData value) throws IOException { JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); obj.remove("additionalProperties"); // serialize additional properties @@ -275,12 +292,12 @@ else if (entry.getValue() instanceof Character) } @Override - public ProcessRegistry read(JsonReader in) throws IOException { + public SseEventRunStartedData read(JsonReader in) throws IOException { JsonElement jsonElement = elementAdapter.read(in); validateJsonElement(jsonElement); JsonObject jsonObj = jsonElement.getAsJsonObject(); // store additional fields in the deserialized instance - ProcessRegistry instance = thisAdapter.fromJsonTree(jsonObj); + SseEventRunStartedData instance = thisAdapter.fromJsonTree(jsonObj); for (Map.Entry entry : jsonObj.entrySet()) { if (!openapiFields.contains(entry.getKey())) { if (entry.getValue().isJsonPrimitive()) { // primitive type @@ -307,18 +324,18 @@ else if (entry.getValue().getAsJsonPrimitive().isBoolean()) } /** - * Create an instance of ProcessRegistry given an JSON string + * Create an instance of SseEventRunStartedData given an JSON string * * @param jsonString JSON string - * @return An instance of ProcessRegistry - * @throws IOException if the JSON string is invalid with respect to ProcessRegistry + * @return An instance of SseEventRunStartedData + * @throws IOException if the JSON string is invalid with respect to SseEventRunStartedData */ - public static ProcessRegistry fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, ProcessRegistry.class); + public static SseEventRunStartedData fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, SseEventRunStartedData.class); } /** - * Convert an instance of ProcessRegistry to an JSON string + * Convert an instance of SseEventRunStartedData to an JSON string * * @return JSON string */ diff --git a/src/main/java/ai/reveng/model/ProcessDumpMetadata.java b/src/main/java/ai/reveng/model/SseEventStepFinishedData.java similarity index 72% rename from src/main/java/ai/reveng/model/ProcessDumpMetadata.java rename to src/main/java/ai/reveng/model/SseEventStepFinishedData.java index edc979b..dafdde1 100644 --- a/src/main/java/ai/reveng/model/ProcessDumpMetadata.java +++ b/src/main/java/ai/reveng/model/SseEventStepFinishedData.java @@ -47,82 +47,82 @@ import ai.reveng.invoker.JSON; /** - * ProcessDumpMetadata + * SseEventStepFinishedData */ @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class ProcessDumpMetadata { - public static final String SERIALIZED_NAME_SHA256 = "sha256"; - @SerializedName(SERIALIZED_NAME_SHA256) +public class SseEventStepFinishedData { + public static final String SERIALIZED_NAME_DATA = "data"; + @SerializedName(SERIALIZED_NAME_DATA) + @javax.annotation.Nullable + private Object data = null; + + public static final String SERIALIZED_NAME_EVENT_ID = "event_id"; + @SerializedName(SERIALIZED_NAME_EVENT_ID) @javax.annotation.Nonnull - private String sha256; + private Long eventId; public static final String SERIALIZED_NAME_TYPE = "type"; @SerializedName(SERIALIZED_NAME_TYPE) @javax.annotation.Nonnull private String type; - public static final String SERIALIZED_NAME_SIZE = "size"; - @SerializedName(SERIALIZED_NAME_SIZE) - @javax.annotation.Nonnull - private Integer size; - - public ProcessDumpMetadata() { + public SseEventStepFinishedData() { } - public ProcessDumpMetadata sha256(@javax.annotation.Nonnull String sha256) { - this.sha256 = sha256; + public SseEventStepFinishedData data(@javax.annotation.Nullable Object data) { + this.data = data; return this; } /** - * Get sha256 - * @return sha256 + * Get data + * @return data */ - @javax.annotation.Nonnull - public String getSha256() { - return sha256; + @javax.annotation.Nullable + public Object getData() { + return data; } - public void setSha256(@javax.annotation.Nonnull String sha256) { - this.sha256 = sha256; + public void setData(@javax.annotation.Nullable Object data) { + this.data = data; } - public ProcessDumpMetadata type(@javax.annotation.Nonnull String type) { - this.type = type; + public SseEventStepFinishedData eventId(@javax.annotation.Nonnull Long eventId) { + this.eventId = eventId; return this; } /** - * Get type - * @return type + * Get eventId + * @return eventId */ @javax.annotation.Nonnull - public String getType() { - return type; + public Long getEventId() { + return eventId; } - public void setType(@javax.annotation.Nonnull String type) { - this.type = type; + public void setEventId(@javax.annotation.Nonnull Long eventId) { + this.eventId = eventId; } - public ProcessDumpMetadata size(@javax.annotation.Nonnull Integer size) { - this.size = size; + public SseEventStepFinishedData type(@javax.annotation.Nonnull String type) { + this.type = type; return this; } /** - * Get size - * @return size + * Get type + * @return type */ @javax.annotation.Nonnull - public Integer getSize() { - return size; + public String getType() { + return type; } - public void setSize(@javax.annotation.Nonnull Integer size) { - this.size = size; + public void setType(@javax.annotation.Nonnull String type) { + this.type = type; } /** @@ -138,9 +138,9 @@ public void setSize(@javax.annotation.Nonnull Integer size) { * * @param key name of the property * @param value value of the property - * @return the ProcessDumpMetadata instance itself + * @return the SseEventStepFinishedData instance itself */ - public ProcessDumpMetadata putAdditionalProperty(String key, Object value) { + public SseEventStepFinishedData putAdditionalProperty(String key, Object value) { if (this.additionalProperties == null) { this.additionalProperties = new HashMap(); } @@ -179,25 +179,25 @@ public boolean equals(Object o) { if (o == null || getClass() != o.getClass()) { return false; } - ProcessDumpMetadata processDumpMetadata = (ProcessDumpMetadata) o; - return Objects.equals(this.sha256, processDumpMetadata.sha256) && - Objects.equals(this.type, processDumpMetadata.type) && - Objects.equals(this.size, processDumpMetadata.size)&& - Objects.equals(this.additionalProperties, processDumpMetadata.additionalProperties); + SseEventStepFinishedData sseEventStepFinishedData = (SseEventStepFinishedData) o; + return Objects.equals(this.data, sseEventStepFinishedData.data) && + Objects.equals(this.eventId, sseEventStepFinishedData.eventId) && + Objects.equals(this.type, sseEventStepFinishedData.type)&& + Objects.equals(this.additionalProperties, sseEventStepFinishedData.additionalProperties); } @Override public int hashCode() { - return Objects.hash(sha256, type, size, additionalProperties); + return Objects.hash(data, eventId, type, additionalProperties); } @Override public String toString() { StringBuilder sb = new StringBuilder(); - sb.append("class ProcessDumpMetadata {\n"); - sb.append(" sha256: ").append(toIndentedString(sha256)).append("\n"); + sb.append("class SseEventStepFinishedData {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" eventId: ").append(toIndentedString(eventId)).append("\n"); sb.append(" type: ").append(toIndentedString(type)).append("\n"); - sb.append(" size: ").append(toIndentedString(size)).append("\n"); sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); sb.append("}"); return sb.toString(); @@ -220,35 +220,32 @@ private String toIndentedString(Object o) { static { // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(Arrays.asList("sha256", "type", "size")); + openapiFields = new HashSet(Arrays.asList("data", "event_id", "type")); // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(Arrays.asList("sha256", "type", "size")); + 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 ProcessDumpMetadata + * @throws IOException if the JSON Element is invalid with respect to SseEventStepFinishedData */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (jsonElement == null) { - if (!ProcessDumpMetadata.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format(Locale.ROOT, "The required field(s) %s in ProcessDumpMetadata is not found in the empty JSON string", ProcessDumpMetadata.openapiRequiredFields.toString())); + if (!SseEventStepFinishedData.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format(Locale.ROOT, "The required field(s) %s in SseEventStepFinishedData is not found in the empty JSON string", SseEventStepFinishedData.openapiRequiredFields.toString())); } } // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : ProcessDumpMetadata.openapiRequiredFields) { + for (String requiredField : SseEventStepFinishedData.openapiRequiredFields) { if (jsonElement.getAsJsonObject().get(requiredField) == null) { throw new IllegalArgumentException(String.format(Locale.ROOT, "The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); } } JsonObject jsonObj = jsonElement.getAsJsonObject(); - if (!jsonObj.get("sha256").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format(Locale.ROOT, "Expected the field `sha256` to be a primitive type in the JSON string but got `%s`", jsonObj.get("sha256").toString())); - } if (!jsonObj.get("type").isJsonPrimitive()) { throw new IllegalArgumentException(String.format(Locale.ROOT, "Expected the field `type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("type").toString())); } @@ -258,16 +255,16 @@ public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @SuppressWarnings("unchecked") @Override public TypeAdapter create(Gson gson, TypeToken type) { - if (!ProcessDumpMetadata.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'ProcessDumpMetadata' and its subtypes + if (!SseEventStepFinishedData.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'SseEventStepFinishedData' and its subtypes } final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(ProcessDumpMetadata.class)); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(SseEventStepFinishedData.class)); - return (TypeAdapter) new TypeAdapter() { + return (TypeAdapter) new TypeAdapter() { @Override - public void write(JsonWriter out, ProcessDumpMetadata value) throws IOException { + public void write(JsonWriter out, SseEventStepFinishedData value) throws IOException { JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); obj.remove("additionalProperties"); // serialize additional properties @@ -295,12 +292,12 @@ else if (entry.getValue() instanceof Character) } @Override - public ProcessDumpMetadata read(JsonReader in) throws IOException { + public SseEventStepFinishedData read(JsonReader in) throws IOException { JsonElement jsonElement = elementAdapter.read(in); validateJsonElement(jsonElement); JsonObject jsonObj = jsonElement.getAsJsonObject(); // store additional fields in the deserialized instance - ProcessDumpMetadata instance = thisAdapter.fromJsonTree(jsonObj); + SseEventStepFinishedData instance = thisAdapter.fromJsonTree(jsonObj); for (Map.Entry entry : jsonObj.entrySet()) { if (!openapiFields.contains(entry.getKey())) { if (entry.getValue().isJsonPrimitive()) { // primitive type @@ -327,18 +324,18 @@ else if (entry.getValue().getAsJsonPrimitive().isBoolean()) } /** - * Create an instance of ProcessDumpMetadata given an JSON string + * Create an instance of SseEventStepFinishedData given an JSON string * * @param jsonString JSON string - * @return An instance of ProcessDumpMetadata - * @throws IOException if the JSON string is invalid with respect to ProcessDumpMetadata + * @return An instance of SseEventStepFinishedData + * @throws IOException if the JSON string is invalid with respect to SseEventStepFinishedData */ - public static ProcessDumpMetadata fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, ProcessDumpMetadata.class); + public static SseEventStepFinishedData fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, SseEventStepFinishedData.class); } /** - * Convert an instance of ProcessDumpMetadata to an JSON string + * Convert an instance of SseEventStepFinishedData to an JSON string * * @return JSON string */ diff --git a/src/main/java/ai/reveng/model/SseEventStepStartedData.java b/src/main/java/ai/reveng/model/SseEventStepStartedData.java new file mode 100644 index 0000000..8c4b59d --- /dev/null +++ b/src/main/java/ai/reveng/model/SseEventStepStartedData.java @@ -0,0 +1,346 @@ +/* + * RevEng.AI API + * RevEng.AI is an AI-powered binary analysis platform for reverse engineering and malware analysis. It provides similarity search across executable binaries and functions, AI-driven decompilation, dynamic execution analysis, firmware unpacking, and integration with external threat intelligence sources like VirusTotal. + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package ai.reveng.model; + +import java.util.Objects; +import java.util.Locale; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; +import java.util.Locale; + +import ai.reveng.invoker.JSON; + +/** + * SseEventStepStartedData + */ +@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; + + 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_TYPE = "type"; + @SerializedName(SERIALIZED_NAME_TYPE) + @javax.annotation.Nonnull + private String type; + + public SseEventStepStartedData() { + } + + public SseEventStepStartedData data(@javax.annotation.Nullable Object data) { + this.data = data; + return this; + } + + /** + * Get data + * @return data + */ + @javax.annotation.Nullable + public Object getData() { + return data; + } + + public void setData(@javax.annotation.Nullable Object data) { + this.data = data; + } + + + public SseEventStepStartedData eventId(@javax.annotation.Nonnull Long eventId) { + this.eventId = eventId; + return this; + } + + /** + * Get eventId + * @return eventId + */ + @javax.annotation.Nonnull + public Long getEventId() { + return eventId; + } + + public void setEventId(@javax.annotation.Nonnull Long eventId) { + this.eventId = eventId; + } + + + public SseEventStepStartedData 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; + } + + /** + * 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 SseEventStepStartedData instance itself + */ + public SseEventStepStartedData 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; + } + SseEventStepStartedData sseEventStepStartedData = (SseEventStepStartedData) o; + return Objects.equals(this.data, sseEventStepStartedData.data) && + Objects.equals(this.eventId, sseEventStepStartedData.eventId) && + Objects.equals(this.type, sseEventStepStartedData.type)&& + Objects.equals(this.additionalProperties, sseEventStepStartedData.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, eventId, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SseEventStepStartedData {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" eventId: ").append(toIndentedString(eventId)).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) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(Arrays.asList("data", "event_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 SseEventStepStartedData + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!SseEventStepStartedData.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format(Locale.ROOT, "The required field(s) %s in SseEventStepStartedData is not found in the empty JSON string", SseEventStepStartedData.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : SseEventStepStartedData.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format(Locale.ROOT, "The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("type").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(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 (!SseEventStepStartedData.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'SseEventStepStartedData' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(SseEventStepStartedData.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, SseEventStepStartedData 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 SseEventStepStartedData read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + SseEventStepStartedData instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format(Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of SseEventStepStartedData given an JSON string + * + * @param jsonString JSON string + * @return An instance of SseEventStepStartedData + * @throws IOException if the JSON string is invalid with respect to SseEventStepStartedData + */ + public static SseEventStepStartedData fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, SseEventStepStartedData.class); + } + + /** + * Convert an instance of SseEventStepStartedData to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/ai/reveng/model/SseEventTextMessageContentData.java b/src/main/java/ai/reveng/model/SseEventTextMessageContentData.java new file mode 100644 index 0000000..d70178c --- /dev/null +++ b/src/main/java/ai/reveng/model/SseEventTextMessageContentData.java @@ -0,0 +1,346 @@ +/* + * RevEng.AI API + * RevEng.AI is an AI-powered binary analysis platform for reverse engineering and malware analysis. It provides similarity search across executable binaries and functions, AI-driven decompilation, dynamic execution analysis, firmware unpacking, and integration with external threat intelligence sources like VirusTotal. + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package ai.reveng.model; + +import java.util.Objects; +import java.util.Locale; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; +import java.util.Locale; + +import ai.reveng.invoker.JSON; + +/** + * SseEventTextMessageContentData + */ +@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; + + 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_TYPE = "type"; + @SerializedName(SERIALIZED_NAME_TYPE) + @javax.annotation.Nonnull + private String type; + + public SseEventTextMessageContentData() { + } + + public SseEventTextMessageContentData data(@javax.annotation.Nullable Object data) { + this.data = data; + return this; + } + + /** + * Get data + * @return data + */ + @javax.annotation.Nullable + public Object getData() { + return data; + } + + public void setData(@javax.annotation.Nullable Object data) { + this.data = data; + } + + + public SseEventTextMessageContentData eventId(@javax.annotation.Nonnull Long eventId) { + this.eventId = eventId; + return this; + } + + /** + * Get eventId + * @return eventId + */ + @javax.annotation.Nonnull + public Long getEventId() { + return eventId; + } + + public void setEventId(@javax.annotation.Nonnull Long eventId) { + this.eventId = eventId; + } + + + public SseEventTextMessageContentData 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; + } + + /** + * 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 SseEventTextMessageContentData instance itself + */ + public SseEventTextMessageContentData 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; + } + SseEventTextMessageContentData sseEventTextMessageContentData = (SseEventTextMessageContentData) o; + return Objects.equals(this.data, sseEventTextMessageContentData.data) && + Objects.equals(this.eventId, sseEventTextMessageContentData.eventId) && + Objects.equals(this.type, sseEventTextMessageContentData.type)&& + Objects.equals(this.additionalProperties, sseEventTextMessageContentData.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, eventId, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SseEventTextMessageContentData {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" eventId: ").append(toIndentedString(eventId)).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) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(Arrays.asList("data", "event_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 SseEventTextMessageContentData + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!SseEventTextMessageContentData.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format(Locale.ROOT, "The required field(s) %s in SseEventTextMessageContentData is not found in the empty JSON string", SseEventTextMessageContentData.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : SseEventTextMessageContentData.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format(Locale.ROOT, "The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("type").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(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 (!SseEventTextMessageContentData.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'SseEventTextMessageContentData' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(SseEventTextMessageContentData.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, SseEventTextMessageContentData 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 SseEventTextMessageContentData read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + SseEventTextMessageContentData instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format(Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of SseEventTextMessageContentData given an JSON string + * + * @param jsonString JSON string + * @return An instance of SseEventTextMessageContentData + * @throws IOException if the JSON string is invalid with respect to SseEventTextMessageContentData + */ + public static SseEventTextMessageContentData fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, SseEventTextMessageContentData.class); + } + + /** + * Convert an instance of SseEventTextMessageContentData to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/ai/reveng/model/ProcessDumps.java b/src/main/java/ai/reveng/model/SseEventTextMessageEndData.java similarity index 69% rename from src/main/java/ai/reveng/model/ProcessDumps.java rename to src/main/java/ai/reveng/model/SseEventTextMessageEndData.java index 94403a0..de69a10 100644 --- a/src/main/java/ai/reveng/model/ProcessDumps.java +++ b/src/main/java/ai/reveng/model/SseEventTextMessageEndData.java @@ -14,7 +14,6 @@ import java.util.Objects; import java.util.Locale; -import ai.reveng.model.ProcessDumpsData; import com.google.gson.TypeAdapter; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; @@ -48,58 +47,82 @@ import ai.reveng.invoker.JSON; /** - * ProcessDumps + * SseEventTextMessageEndData */ @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class ProcessDumps { - public static final String SERIALIZED_NAME_SUCCESS = "success"; - @SerializedName(SERIALIZED_NAME_SUCCESS) - @javax.annotation.Nonnull - private Boolean success; - +public class SseEventTextMessageEndData { public static final String SERIALIZED_NAME_DATA = "data"; @SerializedName(SERIALIZED_NAME_DATA) + @javax.annotation.Nullable + private Object data = null; + + public static final String SERIALIZED_NAME_EVENT_ID = "event_id"; + @SerializedName(SERIALIZED_NAME_EVENT_ID) @javax.annotation.Nonnull - private ProcessDumpsData data; + private Long eventId; + + public static final String SERIALIZED_NAME_TYPE = "type"; + @SerializedName(SERIALIZED_NAME_TYPE) + @javax.annotation.Nonnull + private String type; + + public SseEventTextMessageEndData() { + } + + public SseEventTextMessageEndData data(@javax.annotation.Nullable Object data) { + this.data = data; + return this; + } + + /** + * Get data + * @return data + */ + @javax.annotation.Nullable + public Object getData() { + return data; + } - public ProcessDumps() { + public void setData(@javax.annotation.Nullable Object data) { + this.data = data; } - public ProcessDumps success(@javax.annotation.Nonnull Boolean success) { - this.success = success; + + public SseEventTextMessageEndData eventId(@javax.annotation.Nonnull Long eventId) { + this.eventId = eventId; return this; } /** - * Get success - * @return success + * Get eventId + * @return eventId */ @javax.annotation.Nonnull - public Boolean getSuccess() { - return success; + public Long getEventId() { + return eventId; } - public void setSuccess(@javax.annotation.Nonnull Boolean success) { - this.success = success; + public void setEventId(@javax.annotation.Nonnull Long eventId) { + this.eventId = eventId; } - public ProcessDumps data(@javax.annotation.Nonnull ProcessDumpsData data) { - this.data = data; + public SseEventTextMessageEndData type(@javax.annotation.Nonnull String type) { + this.type = type; return this; } /** - * Get data - * @return data + * Get type + * @return type */ @javax.annotation.Nonnull - public ProcessDumpsData getData() { - return data; + public String getType() { + return type; } - public void setData(@javax.annotation.Nonnull ProcessDumpsData data) { - this.data = data; + public void setType(@javax.annotation.Nonnull String type) { + this.type = type; } /** @@ -115,9 +138,9 @@ public void setData(@javax.annotation.Nonnull ProcessDumpsData data) { * * @param key name of the property * @param value value of the property - * @return the ProcessDumps instance itself + * @return the SseEventTextMessageEndData instance itself */ - public ProcessDumps putAdditionalProperty(String key, Object value) { + public SseEventTextMessageEndData putAdditionalProperty(String key, Object value) { if (this.additionalProperties == null) { this.additionalProperties = new HashMap(); } @@ -156,23 +179,25 @@ public boolean equals(Object o) { if (o == null || getClass() != o.getClass()) { return false; } - ProcessDumps processDumps = (ProcessDumps) o; - return Objects.equals(this.success, processDumps.success) && - Objects.equals(this.data, processDumps.data)&& - Objects.equals(this.additionalProperties, processDumps.additionalProperties); + SseEventTextMessageEndData sseEventTextMessageEndData = (SseEventTextMessageEndData) o; + return Objects.equals(this.data, sseEventTextMessageEndData.data) && + Objects.equals(this.eventId, sseEventTextMessageEndData.eventId) && + Objects.equals(this.type, sseEventTextMessageEndData.type)&& + Objects.equals(this.additionalProperties, sseEventTextMessageEndData.additionalProperties); } @Override public int hashCode() { - return Objects.hash(success, data, additionalProperties); + return Objects.hash(data, eventId, type, additionalProperties); } @Override public String toString() { StringBuilder sb = new StringBuilder(); - sb.append("class ProcessDumps {\n"); - sb.append(" success: ").append(toIndentedString(success)).append("\n"); + sb.append("class SseEventTextMessageEndData {\n"); sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" eventId: ").append(toIndentedString(eventId)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); sb.append("}"); return sb.toString(); @@ -195,50 +220,51 @@ private String toIndentedString(Object o) { static { // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(Arrays.asList("success", "data")); + openapiFields = new HashSet(Arrays.asList("data", "event_id", "type")); // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(Arrays.asList("success", "data")); + 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 ProcessDumps + * @throws IOException if the JSON Element is invalid with respect to SseEventTextMessageEndData */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (jsonElement == null) { - if (!ProcessDumps.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format(Locale.ROOT, "The required field(s) %s in ProcessDumps is not found in the empty JSON string", ProcessDumps.openapiRequiredFields.toString())); + if (!SseEventTextMessageEndData.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format(Locale.ROOT, "The required field(s) %s in SseEventTextMessageEndData is not found in the empty JSON string", SseEventTextMessageEndData.openapiRequiredFields.toString())); } } // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : ProcessDumps.openapiRequiredFields) { + for (String requiredField : SseEventTextMessageEndData.openapiRequiredFields) { if (jsonElement.getAsJsonObject().get(requiredField) == null) { throw new IllegalArgumentException(String.format(Locale.ROOT, "The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); } } JsonObject jsonObj = jsonElement.getAsJsonObject(); - // validate the required field `data` - ProcessDumpsData.validateJsonElement(jsonObj.get("data")); + if (!jsonObj.get("type").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(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 (!ProcessDumps.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'ProcessDumps' and its subtypes + if (!SseEventTextMessageEndData.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'SseEventTextMessageEndData' and its subtypes } final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(ProcessDumps.class)); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(SseEventTextMessageEndData.class)); - return (TypeAdapter) new TypeAdapter() { + return (TypeAdapter) new TypeAdapter() { @Override - public void write(JsonWriter out, ProcessDumps value) throws IOException { + public void write(JsonWriter out, SseEventTextMessageEndData value) throws IOException { JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); obj.remove("additionalProperties"); // serialize additional properties @@ -266,12 +292,12 @@ else if (entry.getValue() instanceof Character) } @Override - public ProcessDumps read(JsonReader in) throws IOException { + public SseEventTextMessageEndData read(JsonReader in) throws IOException { JsonElement jsonElement = elementAdapter.read(in); validateJsonElement(jsonElement); JsonObject jsonObj = jsonElement.getAsJsonObject(); // store additional fields in the deserialized instance - ProcessDumps instance = thisAdapter.fromJsonTree(jsonObj); + SseEventTextMessageEndData instance = thisAdapter.fromJsonTree(jsonObj); for (Map.Entry entry : jsonObj.entrySet()) { if (!openapiFields.contains(entry.getKey())) { if (entry.getValue().isJsonPrimitive()) { // primitive type @@ -298,18 +324,18 @@ else if (entry.getValue().getAsJsonPrimitive().isBoolean()) } /** - * Create an instance of ProcessDumps given an JSON string + * Create an instance of SseEventTextMessageEndData given an JSON string * * @param jsonString JSON string - * @return An instance of ProcessDumps - * @throws IOException if the JSON string is invalid with respect to ProcessDumps + * @return An instance of SseEventTextMessageEndData + * @throws IOException if the JSON string is invalid with respect to SseEventTextMessageEndData */ - public static ProcessDumps fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, ProcessDumps.class); + public static SseEventTextMessageEndData fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, SseEventTextMessageEndData.class); } /** - * Convert an instance of ProcessDumps to an JSON string + * Convert an instance of SseEventTextMessageEndData to an JSON string * * @return JSON string */ diff --git a/src/main/java/ai/reveng/model/SseEventTextMessageStartData.java b/src/main/java/ai/reveng/model/SseEventTextMessageStartData.java new file mode 100644 index 0000000..501d166 --- /dev/null +++ b/src/main/java/ai/reveng/model/SseEventTextMessageStartData.java @@ -0,0 +1,346 @@ +/* + * RevEng.AI API + * RevEng.AI is an AI-powered binary analysis platform for reverse engineering and malware analysis. It provides similarity search across executable binaries and functions, AI-driven decompilation, dynamic execution analysis, firmware unpacking, and integration with external threat intelligence sources like VirusTotal. + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package ai.reveng.model; + +import java.util.Objects; +import java.util.Locale; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; +import java.util.Locale; + +import ai.reveng.invoker.JSON; + +/** + * SseEventTextMessageStartData + */ +@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; + + 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_TYPE = "type"; + @SerializedName(SERIALIZED_NAME_TYPE) + @javax.annotation.Nonnull + private String type; + + public SseEventTextMessageStartData() { + } + + public SseEventTextMessageStartData data(@javax.annotation.Nullable Object data) { + this.data = data; + return this; + } + + /** + * Get data + * @return data + */ + @javax.annotation.Nullable + public Object getData() { + return data; + } + + public void setData(@javax.annotation.Nullable Object data) { + this.data = data; + } + + + public SseEventTextMessageStartData eventId(@javax.annotation.Nonnull Long eventId) { + this.eventId = eventId; + return this; + } + + /** + * Get eventId + * @return eventId + */ + @javax.annotation.Nonnull + public Long getEventId() { + return eventId; + } + + public void setEventId(@javax.annotation.Nonnull Long eventId) { + this.eventId = eventId; + } + + + public SseEventTextMessageStartData 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; + } + + /** + * 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 SseEventTextMessageStartData instance itself + */ + public SseEventTextMessageStartData 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; + } + SseEventTextMessageStartData sseEventTextMessageStartData = (SseEventTextMessageStartData) o; + return Objects.equals(this.data, sseEventTextMessageStartData.data) && + Objects.equals(this.eventId, sseEventTextMessageStartData.eventId) && + Objects.equals(this.type, sseEventTextMessageStartData.type)&& + Objects.equals(this.additionalProperties, sseEventTextMessageStartData.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, eventId, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SseEventTextMessageStartData {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" eventId: ").append(toIndentedString(eventId)).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) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(Arrays.asList("data", "event_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 SseEventTextMessageStartData + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!SseEventTextMessageStartData.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format(Locale.ROOT, "The required field(s) %s in SseEventTextMessageStartData is not found in the empty JSON string", SseEventTextMessageStartData.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : SseEventTextMessageStartData.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format(Locale.ROOT, "The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("type").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(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 (!SseEventTextMessageStartData.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'SseEventTextMessageStartData' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(SseEventTextMessageStartData.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, SseEventTextMessageStartData 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 SseEventTextMessageStartData read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + SseEventTextMessageStartData instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format(Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of SseEventTextMessageStartData given an JSON string + * + * @param jsonString JSON string + * @return An instance of SseEventTextMessageStartData + * @throws IOException if the JSON string is invalid with respect to SseEventTextMessageStartData + */ + public static SseEventTextMessageStartData fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, SseEventTextMessageStartData.class); + } + + /** + * Convert an instance of SseEventTextMessageStartData to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/ai/reveng/model/SseEventTitleUpdatedData.java b/src/main/java/ai/reveng/model/SseEventTitleUpdatedData.java new file mode 100644 index 0000000..036c633 --- /dev/null +++ b/src/main/java/ai/reveng/model/SseEventTitleUpdatedData.java @@ -0,0 +1,346 @@ +/* + * RevEng.AI API + * RevEng.AI is an AI-powered binary analysis platform for reverse engineering and malware analysis. It provides similarity search across executable binaries and functions, AI-driven decompilation, dynamic execution analysis, firmware unpacking, and integration with external threat intelligence sources like VirusTotal. + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package ai.reveng.model; + +import java.util.Objects; +import java.util.Locale; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; +import java.util.Locale; + +import ai.reveng.invoker.JSON; + +/** + * SseEventTitleUpdatedData + */ +@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; + + 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_TYPE = "type"; + @SerializedName(SERIALIZED_NAME_TYPE) + @javax.annotation.Nonnull + private String type; + + public SseEventTitleUpdatedData() { + } + + public SseEventTitleUpdatedData data(@javax.annotation.Nullable Object data) { + this.data = data; + return this; + } + + /** + * Get data + * @return data + */ + @javax.annotation.Nullable + public Object getData() { + return data; + } + + public void setData(@javax.annotation.Nullable Object data) { + this.data = data; + } + + + public SseEventTitleUpdatedData eventId(@javax.annotation.Nonnull Long eventId) { + this.eventId = eventId; + return this; + } + + /** + * Get eventId + * @return eventId + */ + @javax.annotation.Nonnull + public Long getEventId() { + return eventId; + } + + public void setEventId(@javax.annotation.Nonnull Long eventId) { + this.eventId = eventId; + } + + + public SseEventTitleUpdatedData 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; + } + + /** + * 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 SseEventTitleUpdatedData instance itself + */ + public SseEventTitleUpdatedData 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; + } + SseEventTitleUpdatedData sseEventTitleUpdatedData = (SseEventTitleUpdatedData) o; + return Objects.equals(this.data, sseEventTitleUpdatedData.data) && + Objects.equals(this.eventId, sseEventTitleUpdatedData.eventId) && + Objects.equals(this.type, sseEventTitleUpdatedData.type)&& + Objects.equals(this.additionalProperties, sseEventTitleUpdatedData.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, eventId, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SseEventTitleUpdatedData {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" eventId: ").append(toIndentedString(eventId)).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) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(Arrays.asList("data", "event_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 SseEventTitleUpdatedData + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!SseEventTitleUpdatedData.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format(Locale.ROOT, "The required field(s) %s in SseEventTitleUpdatedData is not found in the empty JSON string", SseEventTitleUpdatedData.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : SseEventTitleUpdatedData.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format(Locale.ROOT, "The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("type").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(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 (!SseEventTitleUpdatedData.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'SseEventTitleUpdatedData' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(SseEventTitleUpdatedData.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, SseEventTitleUpdatedData 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 SseEventTitleUpdatedData read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + SseEventTitleUpdatedData instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format(Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of SseEventTitleUpdatedData given an JSON string + * + * @param jsonString JSON string + * @return An instance of SseEventTitleUpdatedData + * @throws IOException if the JSON string is invalid with respect to SseEventTitleUpdatedData + */ + public static SseEventTitleUpdatedData fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, SseEventTitleUpdatedData.class); + } + + /** + * Convert an instance of SseEventTitleUpdatedData to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/ai/reveng/model/SseEventToolCallArgsDeltaData.java b/src/main/java/ai/reveng/model/SseEventToolCallArgsDeltaData.java new file mode 100644 index 0000000..9644848 --- /dev/null +++ b/src/main/java/ai/reveng/model/SseEventToolCallArgsDeltaData.java @@ -0,0 +1,346 @@ +/* + * RevEng.AI API + * RevEng.AI is an AI-powered binary analysis platform for reverse engineering and malware analysis. It provides similarity search across executable binaries and functions, AI-driven decompilation, dynamic execution analysis, firmware unpacking, and integration with external threat intelligence sources like VirusTotal. + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package ai.reveng.model; + +import java.util.Objects; +import java.util.Locale; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; +import java.util.Locale; + +import ai.reveng.invoker.JSON; + +/** + * SseEventToolCallArgsDeltaData + */ +@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; + + 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_TYPE = "type"; + @SerializedName(SERIALIZED_NAME_TYPE) + @javax.annotation.Nonnull + private String type; + + public SseEventToolCallArgsDeltaData() { + } + + public SseEventToolCallArgsDeltaData data(@javax.annotation.Nullable Object data) { + this.data = data; + return this; + } + + /** + * Get data + * @return data + */ + @javax.annotation.Nullable + public Object getData() { + return data; + } + + public void setData(@javax.annotation.Nullable Object data) { + this.data = data; + } + + + public SseEventToolCallArgsDeltaData eventId(@javax.annotation.Nonnull Long eventId) { + this.eventId = eventId; + return this; + } + + /** + * Get eventId + * @return eventId + */ + @javax.annotation.Nonnull + public Long getEventId() { + return eventId; + } + + public void setEventId(@javax.annotation.Nonnull Long eventId) { + this.eventId = eventId; + } + + + public SseEventToolCallArgsDeltaData 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; + } + + /** + * 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 SseEventToolCallArgsDeltaData instance itself + */ + public SseEventToolCallArgsDeltaData 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; + } + SseEventToolCallArgsDeltaData sseEventToolCallArgsDeltaData = (SseEventToolCallArgsDeltaData) o; + return Objects.equals(this.data, sseEventToolCallArgsDeltaData.data) && + Objects.equals(this.eventId, sseEventToolCallArgsDeltaData.eventId) && + Objects.equals(this.type, sseEventToolCallArgsDeltaData.type)&& + Objects.equals(this.additionalProperties, sseEventToolCallArgsDeltaData.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, eventId, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SseEventToolCallArgsDeltaData {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" eventId: ").append(toIndentedString(eventId)).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) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(Arrays.asList("data", "event_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 SseEventToolCallArgsDeltaData + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!SseEventToolCallArgsDeltaData.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format(Locale.ROOT, "The required field(s) %s in SseEventToolCallArgsDeltaData is not found in the empty JSON string", SseEventToolCallArgsDeltaData.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : SseEventToolCallArgsDeltaData.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format(Locale.ROOT, "The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("type").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(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 (!SseEventToolCallArgsDeltaData.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'SseEventToolCallArgsDeltaData' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(SseEventToolCallArgsDeltaData.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, SseEventToolCallArgsDeltaData 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 SseEventToolCallArgsDeltaData read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + SseEventToolCallArgsDeltaData instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format(Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of SseEventToolCallArgsDeltaData given an JSON string + * + * @param jsonString JSON string + * @return An instance of SseEventToolCallArgsDeltaData + * @throws IOException if the JSON string is invalid with respect to SseEventToolCallArgsDeltaData + */ + public static SseEventToolCallArgsDeltaData fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, SseEventToolCallArgsDeltaData.class); + } + + /** + * Convert an instance of SseEventToolCallArgsDeltaData to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/ai/reveng/model/SseEventToolCallEndData.java b/src/main/java/ai/reveng/model/SseEventToolCallEndData.java new file mode 100644 index 0000000..ce5507a --- /dev/null +++ b/src/main/java/ai/reveng/model/SseEventToolCallEndData.java @@ -0,0 +1,346 @@ +/* + * RevEng.AI API + * RevEng.AI is an AI-powered binary analysis platform for reverse engineering and malware analysis. It provides similarity search across executable binaries and functions, AI-driven decompilation, dynamic execution analysis, firmware unpacking, and integration with external threat intelligence sources like VirusTotal. + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package ai.reveng.model; + +import java.util.Objects; +import java.util.Locale; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; +import java.util.Locale; + +import ai.reveng.invoker.JSON; + +/** + * SseEventToolCallEndData + */ +@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; + + 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_TYPE = "type"; + @SerializedName(SERIALIZED_NAME_TYPE) + @javax.annotation.Nonnull + private String type; + + public SseEventToolCallEndData() { + } + + public SseEventToolCallEndData data(@javax.annotation.Nullable Object data) { + this.data = data; + return this; + } + + /** + * Get data + * @return data + */ + @javax.annotation.Nullable + public Object getData() { + return data; + } + + public void setData(@javax.annotation.Nullable Object data) { + this.data = data; + } + + + public SseEventToolCallEndData eventId(@javax.annotation.Nonnull Long eventId) { + this.eventId = eventId; + return this; + } + + /** + * Get eventId + * @return eventId + */ + @javax.annotation.Nonnull + public Long getEventId() { + return eventId; + } + + public void setEventId(@javax.annotation.Nonnull Long eventId) { + this.eventId = eventId; + } + + + public SseEventToolCallEndData 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; + } + + /** + * 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 SseEventToolCallEndData instance itself + */ + public SseEventToolCallEndData 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; + } + SseEventToolCallEndData sseEventToolCallEndData = (SseEventToolCallEndData) o; + return Objects.equals(this.data, sseEventToolCallEndData.data) && + Objects.equals(this.eventId, sseEventToolCallEndData.eventId) && + Objects.equals(this.type, sseEventToolCallEndData.type)&& + Objects.equals(this.additionalProperties, sseEventToolCallEndData.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, eventId, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SseEventToolCallEndData {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" eventId: ").append(toIndentedString(eventId)).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) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(Arrays.asList("data", "event_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 SseEventToolCallEndData + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!SseEventToolCallEndData.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format(Locale.ROOT, "The required field(s) %s in SseEventToolCallEndData is not found in the empty JSON string", SseEventToolCallEndData.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : SseEventToolCallEndData.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format(Locale.ROOT, "The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("type").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(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 (!SseEventToolCallEndData.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'SseEventToolCallEndData' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(SseEventToolCallEndData.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, SseEventToolCallEndData 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 SseEventToolCallEndData read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + SseEventToolCallEndData instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format(Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of SseEventToolCallEndData given an JSON string + * + * @param jsonString JSON string + * @return An instance of SseEventToolCallEndData + * @throws IOException if the JSON string is invalid with respect to SseEventToolCallEndData + */ + public static SseEventToolCallEndData fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, SseEventToolCallEndData.class); + } + + /** + * Convert an instance of SseEventToolCallEndData to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/ai/reveng/model/SseEventToolCallResultData.java b/src/main/java/ai/reveng/model/SseEventToolCallResultData.java new file mode 100644 index 0000000..f31d453 --- /dev/null +++ b/src/main/java/ai/reveng/model/SseEventToolCallResultData.java @@ -0,0 +1,346 @@ +/* + * RevEng.AI API + * RevEng.AI is an AI-powered binary analysis platform for reverse engineering and malware analysis. It provides similarity search across executable binaries and functions, AI-driven decompilation, dynamic execution analysis, firmware unpacking, and integration with external threat intelligence sources like VirusTotal. + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package ai.reveng.model; + +import java.util.Objects; +import java.util.Locale; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; +import java.util.Locale; + +import ai.reveng.invoker.JSON; + +/** + * SseEventToolCallResultData + */ +@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; + + 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_TYPE = "type"; + @SerializedName(SERIALIZED_NAME_TYPE) + @javax.annotation.Nonnull + private String type; + + public SseEventToolCallResultData() { + } + + public SseEventToolCallResultData data(@javax.annotation.Nullable Object data) { + this.data = data; + return this; + } + + /** + * Get data + * @return data + */ + @javax.annotation.Nullable + public Object getData() { + return data; + } + + public void setData(@javax.annotation.Nullable Object data) { + this.data = data; + } + + + public SseEventToolCallResultData eventId(@javax.annotation.Nonnull Long eventId) { + this.eventId = eventId; + return this; + } + + /** + * Get eventId + * @return eventId + */ + @javax.annotation.Nonnull + public Long getEventId() { + return eventId; + } + + public void setEventId(@javax.annotation.Nonnull Long eventId) { + this.eventId = eventId; + } + + + public SseEventToolCallResultData 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; + } + + /** + * 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 SseEventToolCallResultData instance itself + */ + public SseEventToolCallResultData 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; + } + SseEventToolCallResultData sseEventToolCallResultData = (SseEventToolCallResultData) o; + return Objects.equals(this.data, sseEventToolCallResultData.data) && + Objects.equals(this.eventId, sseEventToolCallResultData.eventId) && + Objects.equals(this.type, sseEventToolCallResultData.type)&& + Objects.equals(this.additionalProperties, sseEventToolCallResultData.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, eventId, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SseEventToolCallResultData {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" eventId: ").append(toIndentedString(eventId)).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) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(Arrays.asList("data", "event_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 SseEventToolCallResultData + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!SseEventToolCallResultData.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format(Locale.ROOT, "The required field(s) %s in SseEventToolCallResultData is not found in the empty JSON string", SseEventToolCallResultData.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : SseEventToolCallResultData.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format(Locale.ROOT, "The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("type").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(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 (!SseEventToolCallResultData.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'SseEventToolCallResultData' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(SseEventToolCallResultData.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, SseEventToolCallResultData 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 SseEventToolCallResultData read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + SseEventToolCallResultData instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format(Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of SseEventToolCallResultData given an JSON string + * + * @param jsonString JSON string + * @return An instance of SseEventToolCallResultData + * @throws IOException if the JSON string is invalid with respect to SseEventToolCallResultData + */ + public static SseEventToolCallResultData fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, SseEventToolCallResultData.class); + } + + /** + * Convert an instance of SseEventToolCallResultData to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/ai/reveng/model/SseEventToolCallStartData.java b/src/main/java/ai/reveng/model/SseEventToolCallStartData.java new file mode 100644 index 0000000..5ded27c --- /dev/null +++ b/src/main/java/ai/reveng/model/SseEventToolCallStartData.java @@ -0,0 +1,346 @@ +/* + * RevEng.AI API + * RevEng.AI is an AI-powered binary analysis platform for reverse engineering and malware analysis. It provides similarity search across executable binaries and functions, AI-driven decompilation, dynamic execution analysis, firmware unpacking, and integration with external threat intelligence sources like VirusTotal. + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package ai.reveng.model; + +import java.util.Objects; +import java.util.Locale; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; +import java.util.Locale; + +import ai.reveng.invoker.JSON; + +/** + * SseEventToolCallStartData + */ +@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; + + 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_TYPE = "type"; + @SerializedName(SERIALIZED_NAME_TYPE) + @javax.annotation.Nonnull + private String type; + + public SseEventToolCallStartData() { + } + + public SseEventToolCallStartData data(@javax.annotation.Nullable Object data) { + this.data = data; + return this; + } + + /** + * Get data + * @return data + */ + @javax.annotation.Nullable + public Object getData() { + return data; + } + + public void setData(@javax.annotation.Nullable Object data) { + this.data = data; + } + + + public SseEventToolCallStartData eventId(@javax.annotation.Nonnull Long eventId) { + this.eventId = eventId; + return this; + } + + /** + * Get eventId + * @return eventId + */ + @javax.annotation.Nonnull + public Long getEventId() { + return eventId; + } + + public void setEventId(@javax.annotation.Nonnull Long eventId) { + this.eventId = eventId; + } + + + public SseEventToolCallStartData 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; + } + + /** + * 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 SseEventToolCallStartData instance itself + */ + public SseEventToolCallStartData 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; + } + SseEventToolCallStartData sseEventToolCallStartData = (SseEventToolCallStartData) o; + return Objects.equals(this.data, sseEventToolCallStartData.data) && + Objects.equals(this.eventId, sseEventToolCallStartData.eventId) && + Objects.equals(this.type, sseEventToolCallStartData.type)&& + Objects.equals(this.additionalProperties, sseEventToolCallStartData.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, eventId, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SseEventToolCallStartData {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" eventId: ").append(toIndentedString(eventId)).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) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(Arrays.asList("data", "event_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 SseEventToolCallStartData + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!SseEventToolCallStartData.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format(Locale.ROOT, "The required field(s) %s in SseEventToolCallStartData is not found in the empty JSON string", SseEventToolCallStartData.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : SseEventToolCallStartData.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format(Locale.ROOT, "The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("type").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(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 (!SseEventToolCallStartData.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'SseEventToolCallStartData' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(SseEventToolCallStartData.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, SseEventToolCallStartData 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 SseEventToolCallStartData read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + SseEventToolCallStartData instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format(Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of SseEventToolCallStartData given an JSON string + * + * @param jsonString JSON string + * @return An instance of SseEventToolCallStartData + * @throws IOException if the JSON string is invalid with respect to SseEventToolCallStartData + */ + public static SseEventToolCallStartData fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, SseEventToolCallStartData.class); + } + + /** + * Convert an instance of SseEventToolCallStartData to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/ai/reveng/model/SseEventToolConfirmationRequiredData.java b/src/main/java/ai/reveng/model/SseEventToolConfirmationRequiredData.java new file mode 100644 index 0000000..06b2bae --- /dev/null +++ b/src/main/java/ai/reveng/model/SseEventToolConfirmationRequiredData.java @@ -0,0 +1,346 @@ +/* + * RevEng.AI API + * RevEng.AI is an AI-powered binary analysis platform for reverse engineering and malware analysis. It provides similarity search across executable binaries and functions, AI-driven decompilation, dynamic execution analysis, firmware unpacking, and integration with external threat intelligence sources like VirusTotal. + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package ai.reveng.model; + +import java.util.Objects; +import java.util.Locale; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; +import java.util.Locale; + +import ai.reveng.invoker.JSON; + +/** + * SseEventToolConfirmationRequiredData + */ +@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; + + 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_TYPE = "type"; + @SerializedName(SERIALIZED_NAME_TYPE) + @javax.annotation.Nonnull + private String type; + + public SseEventToolConfirmationRequiredData() { + } + + public SseEventToolConfirmationRequiredData data(@javax.annotation.Nullable Object data) { + this.data = data; + return this; + } + + /** + * Get data + * @return data + */ + @javax.annotation.Nullable + public Object getData() { + return data; + } + + public void setData(@javax.annotation.Nullable Object data) { + this.data = data; + } + + + public SseEventToolConfirmationRequiredData eventId(@javax.annotation.Nonnull Long eventId) { + this.eventId = eventId; + return this; + } + + /** + * Get eventId + * @return eventId + */ + @javax.annotation.Nonnull + public Long getEventId() { + return eventId; + } + + public void setEventId(@javax.annotation.Nonnull Long eventId) { + this.eventId = eventId; + } + + + public SseEventToolConfirmationRequiredData 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; + } + + /** + * 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 SseEventToolConfirmationRequiredData instance itself + */ + public SseEventToolConfirmationRequiredData 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; + } + SseEventToolConfirmationRequiredData sseEventToolConfirmationRequiredData = (SseEventToolConfirmationRequiredData) o; + return Objects.equals(this.data, sseEventToolConfirmationRequiredData.data) && + Objects.equals(this.eventId, sseEventToolConfirmationRequiredData.eventId) && + Objects.equals(this.type, sseEventToolConfirmationRequiredData.type)&& + Objects.equals(this.additionalProperties, sseEventToolConfirmationRequiredData.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, eventId, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SseEventToolConfirmationRequiredData {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" eventId: ").append(toIndentedString(eventId)).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) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(Arrays.asList("data", "event_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 SseEventToolConfirmationRequiredData + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!SseEventToolConfirmationRequiredData.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format(Locale.ROOT, "The required field(s) %s in SseEventToolConfirmationRequiredData is not found in the empty JSON string", SseEventToolConfirmationRequiredData.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : SseEventToolConfirmationRequiredData.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format(Locale.ROOT, "The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("type").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(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 (!SseEventToolConfirmationRequiredData.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'SseEventToolConfirmationRequiredData' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(SseEventToolConfirmationRequiredData.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, SseEventToolConfirmationRequiredData 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 SseEventToolConfirmationRequiredData read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + SseEventToolConfirmationRequiredData instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format(Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of SseEventToolConfirmationRequiredData given an JSON string + * + * @param jsonString JSON string + * @return An instance of SseEventToolConfirmationRequiredData + * @throws IOException if the JSON string is invalid with respect to SseEventToolConfirmationRequiredData + */ + public static SseEventToolConfirmationRequiredData fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, SseEventToolConfirmationRequiredData.class); + } + + /** + * Convert an instance of SseEventToolConfirmationRequiredData to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/ai/reveng/model/StageEvent.java b/src/main/java/ai/reveng/model/StageEvent.java deleted file mode 100644 index e601538..0000000 --- a/src/main/java/ai/reveng/model/StageEvent.java +++ /dev/null @@ -1,352 +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 java.util.Locale; -import ai.reveng.model.AnalysisStage; -import ai.reveng.model.AnalysisStageStatus; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.Arrays; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; -import java.util.Locale; - -import ai.reveng.invoker.JSON; - -/** - * StageEvent - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class StageEvent { - public static final String SERIALIZED_NAME_STAGE = "stage"; - @SerializedName(SERIALIZED_NAME_STAGE) - @javax.annotation.Nonnull - private AnalysisStage stage; - - public static final String SERIALIZED_NAME_STATUS = "status"; - @SerializedName(SERIALIZED_NAME_STATUS) - @javax.annotation.Nonnull - private AnalysisStageStatus status; - - public static final String SERIALIZED_NAME_TIMESTAMP = "timestamp"; - @SerializedName(SERIALIZED_NAME_TIMESTAMP) - @javax.annotation.Nonnull - private String timestamp; - - public StageEvent() { - } - - public StageEvent stage(@javax.annotation.Nonnull AnalysisStage stage) { - this.stage = stage; - return this; - } - - /** - * Get stage - * @return stage - */ - @javax.annotation.Nonnull - public AnalysisStage getStage() { - return stage; - } - - public void setStage(@javax.annotation.Nonnull AnalysisStage stage) { - this.stage = stage; - } - - - public StageEvent status(@javax.annotation.Nonnull AnalysisStageStatus status) { - this.status = status; - return this; - } - - /** - * Get status - * @return status - */ - @javax.annotation.Nonnull - public AnalysisStageStatus getStatus() { - return status; - } - - public void setStatus(@javax.annotation.Nonnull AnalysisStageStatus status) { - this.status = status; - } - - - public StageEvent timestamp(@javax.annotation.Nonnull String timestamp) { - this.timestamp = timestamp; - return this; - } - - /** - * Get timestamp - * @return timestamp - */ - @javax.annotation.Nonnull - public String getTimestamp() { - return timestamp; - } - - public void setTimestamp(@javax.annotation.Nonnull String timestamp) { - this.timestamp = timestamp; - } - - /** - * 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 StageEvent instance itself - */ - public StageEvent 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; - } - StageEvent stageEvent = (StageEvent) o; - return Objects.equals(this.stage, stageEvent.stage) && - Objects.equals(this.status, stageEvent.status) && - Objects.equals(this.timestamp, stageEvent.timestamp)&& - Objects.equals(this.additionalProperties, stageEvent.additionalProperties); - } - - @Override - public int hashCode() { - return Objects.hash(stage, status, timestamp, additionalProperties); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class StageEvent {\n"); - sb.append(" stage: ").append(toIndentedString(stage)).append("\n"); - sb.append(" status: ").append(toIndentedString(status)).append("\n"); - sb.append(" timestamp: ").append(toIndentedString(timestamp)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(Arrays.asList("stage", "status", "timestamp")); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(Arrays.asList("stage", "status", "timestamp")); - } - - /** - * 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 StageEvent - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!StageEvent.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format(Locale.ROOT, "The required field(s) %s in StageEvent is not found in the empty JSON string", StageEvent.openapiRequiredFields.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : StageEvent.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException(String.format(Locale.ROOT, "The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // validate the required field `stage` - AnalysisStage.validateJsonElement(jsonObj.get("stage")); - // validate the required field `status` - AnalysisStageStatus.validateJsonElement(jsonObj.get("status")); - if (!jsonObj.get("timestamp").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format(Locale.ROOT, "Expected the field `timestamp` to be a primitive type in the JSON string but got `%s`", jsonObj.get("timestamp").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!StageEvent.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'StageEvent' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(StageEvent.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, StageEvent 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 StageEvent read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // store additional fields in the deserialized instance - StageEvent instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format(Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else if (entry.getValue().isJsonArray()) { - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); - } else { // JSON object - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; - } - - }.nullSafe(); - } - } - - /** - * Create an instance of StageEvent given an JSON string - * - * @param jsonString JSON string - * @return An instance of StageEvent - * @throws IOException if the JSON string is invalid with respect to StageEvent - */ - public static StageEvent fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, StageEvent.class); - } - - /** - * Convert an instance of StageEvent to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/ai/reveng/model/StageStatus.java b/src/main/java/ai/reveng/model/StageStatus.java deleted file mode 100644 index e979cca..0000000 --- a/src/main/java/ai/reveng/model/StageStatus.java +++ /dev/null @@ -1,349 +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 java.util.Locale; -import ai.reveng.model.AnalysisStage; -import ai.reveng.model.PipelineStageStatus; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.Arrays; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; -import java.util.Locale; - -import ai.reveng.invoker.JSON; - -/** - * StageStatus - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class StageStatus { - public static final String SERIALIZED_NAME_STAGE = "stage"; - @SerializedName(SERIALIZED_NAME_STAGE) - @javax.annotation.Nonnull - private AnalysisStage stage; - - public static final String SERIALIZED_NAME_STATUS = "status"; - @SerializedName(SERIALIZED_NAME_STATUS) - @javax.annotation.Nonnull - private PipelineStageStatus status; - - public static final String SERIALIZED_NAME_NUM_AHEAD = "num_ahead"; - @SerializedName(SERIALIZED_NAME_NUM_AHEAD) - @javax.annotation.Nonnull - private Integer numAhead; - - public StageStatus() { - } - - public StageStatus stage(@javax.annotation.Nonnull AnalysisStage stage) { - this.stage = stage; - return this; - } - - /** - * Get stage - * @return stage - */ - @javax.annotation.Nonnull - public AnalysisStage getStage() { - return stage; - } - - public void setStage(@javax.annotation.Nonnull AnalysisStage stage) { - this.stage = stage; - } - - - public StageStatus status(@javax.annotation.Nonnull PipelineStageStatus status) { - this.status = status; - return this; - } - - /** - * Get status - * @return status - */ - @javax.annotation.Nonnull - public PipelineStageStatus getStatus() { - return status; - } - - public void setStatus(@javax.annotation.Nonnull PipelineStageStatus status) { - this.status = status; - } - - - public StageStatus numAhead(@javax.annotation.Nonnull Integer numAhead) { - this.numAhead = numAhead; - return this; - } - - /** - * Get numAhead - * @return numAhead - */ - @javax.annotation.Nonnull - public Integer getNumAhead() { - return numAhead; - } - - public void setNumAhead(@javax.annotation.Nonnull Integer numAhead) { - this.numAhead = numAhead; - } - - /** - * 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 StageStatus instance itself - */ - public StageStatus 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; - } - StageStatus stageStatus = (StageStatus) o; - return Objects.equals(this.stage, stageStatus.stage) && - Objects.equals(this.status, stageStatus.status) && - Objects.equals(this.numAhead, stageStatus.numAhead)&& - Objects.equals(this.additionalProperties, stageStatus.additionalProperties); - } - - @Override - public int hashCode() { - return Objects.hash(stage, status, numAhead, additionalProperties); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class StageStatus {\n"); - sb.append(" stage: ").append(toIndentedString(stage)).append("\n"); - sb.append(" status: ").append(toIndentedString(status)).append("\n"); - sb.append(" numAhead: ").append(toIndentedString(numAhead)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(Arrays.asList("stage", "status", "num_ahead")); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(Arrays.asList("stage", "status", "num_ahead")); - } - - /** - * 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 StageStatus - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!StageStatus.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format(Locale.ROOT, "The required field(s) %s in StageStatus is not found in the empty JSON string", StageStatus.openapiRequiredFields.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : StageStatus.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException(String.format(Locale.ROOT, "The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // validate the required field `stage` - AnalysisStage.validateJsonElement(jsonObj.get("stage")); - // validate the required field `status` - PipelineStageStatus.validateJsonElement(jsonObj.get("status")); - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!StageStatus.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'StageStatus' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(StageStatus.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, StageStatus 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 StageStatus read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // store additional fields in the deserialized instance - StageStatus instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format(Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else if (entry.getValue().isJsonArray()) { - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); - } else { // JSON object - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; - } - - }.nullSafe(); - } - } - - /** - * Create an instance of StageStatus given an JSON string - * - * @param jsonString JSON string - * @return An instance of StageStatus - * @throws IOException if the JSON string is invalid with respect to StageStatus - */ - public static StageStatus fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, StageStatus.class); - } - - /** - * Convert an instance of StageStatus to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/ai/reveng/model/AppServicesDynamicExecutionSchemasDynamicExecutionStatus.java b/src/main/java/ai/reveng/model/StatusResponse.java similarity index 63% rename from src/main/java/ai/reveng/model/AppServicesDynamicExecutionSchemasDynamicExecutionStatus.java rename to src/main/java/ai/reveng/model/StatusResponse.java index be5d47a..21eec0c 100644 --- a/src/main/java/ai/reveng/model/AppServicesDynamicExecutionSchemasDynamicExecutionStatus.java +++ b/src/main/java/ai/reveng/model/StatusResponse.java @@ -20,7 +20,9 @@ import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import java.io.IOException; +import java.net.URI; import java.util.Arrays; +import java.util.UUID; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -47,19 +49,71 @@ import ai.reveng.invoker.JSON; /** - * AppServicesDynamicExecutionSchemasDynamicExecutionStatus + * StatusResponse */ @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class AppServicesDynamicExecutionSchemasDynamicExecutionStatus { +public class StatusResponse { + public static final String SERIALIZED_NAME_$_SCHEMA = "$schema"; + @SerializedName(SERIALIZED_NAME_$_SCHEMA) + @javax.annotation.Nullable + private URI $schema; + + public static final String SERIALIZED_NAME_CONVERSATION_UUID = "conversation_uuid"; + @SerializedName(SERIALIZED_NAME_CONVERSATION_UUID) + @javax.annotation.Nonnull + private UUID conversationUuid; + public static final String SERIALIZED_NAME_STATUS = "status"; @SerializedName(SERIALIZED_NAME_STATUS) @javax.annotation.Nonnull private String status; - public AppServicesDynamicExecutionSchemasDynamicExecutionStatus() { + public static final String SERIALIZED_NAME_TRACE_ID = "trace_id"; + @SerializedName(SERIALIZED_NAME_TRACE_ID) + @javax.annotation.Nullable + private String traceId; + + public StatusResponse() { + } + + public StatusResponse( + URI $schema + ) { + this(); + this.$schema = $schema; + } + + /** + * A URL to the JSON Schema for this object. + * @return $schema + */ + @javax.annotation.Nullable + public URI get$Schema() { + return $schema; + } + + + + public StatusResponse conversationUuid(@javax.annotation.Nonnull UUID conversationUuid) { + this.conversationUuid = conversationUuid; + return this; } - public AppServicesDynamicExecutionSchemasDynamicExecutionStatus status(@javax.annotation.Nonnull String status) { + /** + * Get conversationUuid + * @return conversationUuid + */ + @javax.annotation.Nonnull + public UUID getConversationUuid() { + return conversationUuid; + } + + public void setConversationUuid(@javax.annotation.Nonnull UUID conversationUuid) { + this.conversationUuid = conversationUuid; + } + + + public StatusResponse status(@javax.annotation.Nonnull String status) { this.status = status; return this; } @@ -77,6 +131,25 @@ public void setStatus(@javax.annotation.Nonnull String status) { this.status = status; } + + public StatusResponse traceId(@javax.annotation.Nullable String traceId) { + this.traceId = traceId; + return this; + } + + /** + * OpenTelemetry trace ID for this run. Use this to look up tool call spans in your trace backend. + * @return traceId + */ + @javax.annotation.Nullable + public String getTraceId() { + return traceId; + } + + public void setTraceId(@javax.annotation.Nullable String traceId) { + this.traceId = traceId; + } + /** * A container for additional, undeclared properties. * This is a holder for any undeclared properties as specified with @@ -90,9 +163,9 @@ public void setStatus(@javax.annotation.Nonnull String status) { * * @param key name of the property * @param value value of the property - * @return the AppServicesDynamicExecutionSchemasDynamicExecutionStatus instance itself + * @return the StatusResponse instance itself */ - public AppServicesDynamicExecutionSchemasDynamicExecutionStatus putAdditionalProperty(String key, Object value) { + public StatusResponse putAdditionalProperty(String key, Object value) { if (this.additionalProperties == null) { this.additionalProperties = new HashMap(); } @@ -131,21 +204,27 @@ public boolean equals(Object o) { if (o == null || getClass() != o.getClass()) { return false; } - AppServicesDynamicExecutionSchemasDynamicExecutionStatus appServicesDynamicExecutionSchemasDynamicExecutionStatus = (AppServicesDynamicExecutionSchemasDynamicExecutionStatus) o; - return Objects.equals(this.status, appServicesDynamicExecutionSchemasDynamicExecutionStatus.status)&& - Objects.equals(this.additionalProperties, appServicesDynamicExecutionSchemasDynamicExecutionStatus.additionalProperties); + StatusResponse statusResponse = (StatusResponse) o; + return Objects.equals(this.$schema, statusResponse.$schema) && + Objects.equals(this.conversationUuid, statusResponse.conversationUuid) && + Objects.equals(this.status, statusResponse.status) && + Objects.equals(this.traceId, statusResponse.traceId)&& + Objects.equals(this.additionalProperties, statusResponse.additionalProperties); } @Override public int hashCode() { - return Objects.hash(status, additionalProperties); + return Objects.hash($schema, conversationUuid, status, traceId, additionalProperties); } @Override public String toString() { StringBuilder sb = new StringBuilder(); - sb.append("class AppServicesDynamicExecutionSchemasDynamicExecutionStatus {\n"); + sb.append("class StatusResponse {\n"); + sb.append(" $schema: ").append(toIndentedString($schema)).append("\n"); + sb.append(" conversationUuid: ").append(toIndentedString(conversationUuid)).append("\n"); sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append(" traceId: ").append(toIndentedString(traceId)).append("\n"); sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); sb.append("}"); return sb.toString(); @@ -168,51 +247,60 @@ private String toIndentedString(Object o) { static { // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(Arrays.asList("status")); + openapiFields = new HashSet(Arrays.asList("$schema", "conversation_uuid", "status", "trace_id")); // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(Arrays.asList("status")); + openapiRequiredFields = new HashSet(Arrays.asList("conversation_uuid", "status")); } /** * Validates the JSON Element and throws an exception if issues found * * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to AppServicesDynamicExecutionSchemasDynamicExecutionStatus + * @throws IOException if the JSON Element is invalid with respect to StatusResponse */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (jsonElement == null) { - if (!AppServicesDynamicExecutionSchemasDynamicExecutionStatus.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format(Locale.ROOT, "The required field(s) %s in AppServicesDynamicExecutionSchemasDynamicExecutionStatus is not found in the empty JSON string", AppServicesDynamicExecutionSchemasDynamicExecutionStatus.openapiRequiredFields.toString())); + if (!StatusResponse.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format(Locale.ROOT, "The required field(s) %s in StatusResponse is not found in the empty JSON string", StatusResponse.openapiRequiredFields.toString())); } } // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : AppServicesDynamicExecutionSchemasDynamicExecutionStatus.openapiRequiredFields) { + for (String requiredField : StatusResponse.openapiRequiredFields) { if (jsonElement.getAsJsonObject().get(requiredField) == null) { throw new IllegalArgumentException(String.format(Locale.ROOT, "The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); } } JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("$schema") != null && !jsonObj.get("$schema").isJsonNull()) && !jsonObj.get("$schema").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(Locale.ROOT, "Expected the field `$schema` to be a primitive type in the JSON string but got `%s`", jsonObj.get("$schema").toString())); + } + if (!jsonObj.get("conversation_uuid").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(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("status").isJsonPrimitive()) { throw new IllegalArgumentException(String.format(Locale.ROOT, "Expected the field `status` to be a primitive type in the JSON string but got `%s`", jsonObj.get("status").toString())); } + if ((jsonObj.get("trace_id") != null && !jsonObj.get("trace_id").isJsonNull()) && !jsonObj.get("trace_id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(Locale.ROOT, "Expected the field `trace_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("trace_id").toString())); + } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @SuppressWarnings("unchecked") @Override public TypeAdapter create(Gson gson, TypeToken type) { - if (!AppServicesDynamicExecutionSchemasDynamicExecutionStatus.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'AppServicesDynamicExecutionSchemasDynamicExecutionStatus' and its subtypes + if (!StatusResponse.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'StatusResponse' and its subtypes } final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(AppServicesDynamicExecutionSchemasDynamicExecutionStatus.class)); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(StatusResponse.class)); - return (TypeAdapter) new TypeAdapter() { + return (TypeAdapter) new TypeAdapter() { @Override - public void write(JsonWriter out, AppServicesDynamicExecutionSchemasDynamicExecutionStatus value) throws IOException { + public void write(JsonWriter out, StatusResponse value) throws IOException { JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); obj.remove("additionalProperties"); // serialize additional properties @@ -240,12 +328,12 @@ else if (entry.getValue() instanceof Character) } @Override - public AppServicesDynamicExecutionSchemasDynamicExecutionStatus read(JsonReader in) throws IOException { + public StatusResponse read(JsonReader in) throws IOException { JsonElement jsonElement = elementAdapter.read(in); validateJsonElement(jsonElement); JsonObject jsonObj = jsonElement.getAsJsonObject(); // store additional fields in the deserialized instance - AppServicesDynamicExecutionSchemasDynamicExecutionStatus instance = thisAdapter.fromJsonTree(jsonObj); + StatusResponse instance = thisAdapter.fromJsonTree(jsonObj); for (Map.Entry entry : jsonObj.entrySet()) { if (!openapiFields.contains(entry.getKey())) { if (entry.getValue().isJsonPrimitive()) { // primitive type @@ -272,18 +360,18 @@ else if (entry.getValue().getAsJsonPrimitive().isBoolean()) } /** - * Create an instance of AppServicesDynamicExecutionSchemasDynamicExecutionStatus given an JSON string + * Create an instance of StatusResponse given an JSON string * * @param jsonString JSON string - * @return An instance of AppServicesDynamicExecutionSchemasDynamicExecutionStatus - * @throws IOException if the JSON string is invalid with respect to AppServicesDynamicExecutionSchemasDynamicExecutionStatus + * @return An instance of StatusResponse + * @throws IOException if the JSON string is invalid with respect to StatusResponse */ - public static AppServicesDynamicExecutionSchemasDynamicExecutionStatus fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, AppServicesDynamicExecutionSchemasDynamicExecutionStatus.class); + public static StatusResponse fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, StatusResponse.class); } /** - * Convert an instance of AppServicesDynamicExecutionSchemasDynamicExecutionStatus to an JSON string + * Convert an instance of StatusResponse to an JSON string * * @return JSON string */ diff --git a/src/main/java/ai/reveng/model/StreamEvents200ResponseInner.java b/src/main/java/ai/reveng/model/StreamEvents200ResponseInner.java new file mode 100644 index 0000000..f544127 --- /dev/null +++ b/src/main/java/ai/reveng/model/StreamEvents200ResponseInner.java @@ -0,0 +1,907 @@ +/* + * RevEng.AI API + * RevEng.AI is an AI-powered binary analysis platform for reverse engineering and malware analysis. It provides similarity search across executable binaries and functions, AI-driven decompilation, dynamic execution analysis, firmware unpacking, and integration with external threat intelligence sources like VirusTotal. + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package ai.reveng.model; + +import java.util.Objects; +import java.util.Locale; +import ai.reveng.model.EventCONTEXTCOMPACTED; +import ai.reveng.model.EventRUNCANCELLED; +import ai.reveng.model.EventRUNERROR; +import ai.reveng.model.EventRUNFINISHED; +import ai.reveng.model.EventRUNSTARTED; +import ai.reveng.model.EventSTEPFINISHED; +import ai.reveng.model.EventSTEPSTARTED; +import ai.reveng.model.EventTEXTMESSAGECONTENT; +import ai.reveng.model.EventTEXTMESSAGEEND; +import ai.reveng.model.EventTEXTMESSAGESTART; +import ai.reveng.model.EventTITLEUPDATED; +import ai.reveng.model.EventTOOLCALLARGSDELTA; +import ai.reveng.model.EventTOOLCALLEND; +import ai.reveng.model.EventTOOLCALLRESULT; +import ai.reveng.model.EventTOOLCALLSTART; +import ai.reveng.model.EventTOOLCONFIRMATIONREQUIRED; +import ai.reveng.model.SseEventToolConfirmationRequiredData; +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 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 java.util.Locale; + +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 StreamEvents200ResponseInner extends AbstractOpenApiSchema { + private static final Logger log = Logger.getLogger(StreamEvents200ResponseInner.class.getName()); + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!StreamEvents200ResponseInner.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'StreamEvents200ResponseInner' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.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)); + final TypeAdapter adapterEventRUNFINISHED = gson.getDelegateAdapter(this, TypeToken.get(EventRUNFINISHED.class)); + final TypeAdapter adapterEventRUNSTARTED = gson.getDelegateAdapter(this, TypeToken.get(EventRUNSTARTED.class)); + final TypeAdapter adapterEventSTEPFINISHED = gson.getDelegateAdapter(this, TypeToken.get(EventSTEPFINISHED.class)); + final TypeAdapter adapterEventSTEPSTARTED = gson.getDelegateAdapter(this, TypeToken.get(EventSTEPSTARTED.class)); + final TypeAdapter adapterEventTEXTMESSAGECONTENT = gson.getDelegateAdapter(this, TypeToken.get(EventTEXTMESSAGECONTENT.class)); + final TypeAdapter adapterEventTEXTMESSAGEEND = gson.getDelegateAdapter(this, TypeToken.get(EventTEXTMESSAGEEND.class)); + final TypeAdapter adapterEventTEXTMESSAGESTART = gson.getDelegateAdapter(this, TypeToken.get(EventTEXTMESSAGESTART.class)); + final TypeAdapter adapterEventTITLEUPDATED = gson.getDelegateAdapter(this, TypeToken.get(EventTITLEUPDATED.class)); + final TypeAdapter adapterEventTOOLCALLARGSDELTA = gson.getDelegateAdapter(this, TypeToken.get(EventTOOLCALLARGSDELTA.class)); + final TypeAdapter adapterEventTOOLCALLEND = gson.getDelegateAdapter(this, TypeToken.get(EventTOOLCALLEND.class)); + final TypeAdapter adapterEventTOOLCALLRESULT = gson.getDelegateAdapter(this, TypeToken.get(EventTOOLCALLRESULT.class)); + final TypeAdapter adapterEventTOOLCALLSTART = gson.getDelegateAdapter(this, TypeToken.get(EventTOOLCALLSTART.class)); + final TypeAdapter adapterEventTOOLCONFIRMATIONREQUIRED = gson.getDelegateAdapter(this, TypeToken.get(EventTOOLCONFIRMATIONREQUIRED.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, StreamEvents200ResponseInner value) throws IOException { + if (value == null || value.getActualInstance() == null) { + elementAdapter.write(out, null); + return; + } + + // check if the actual instance is of the type `EventCONTEXTCOMPACTED` + if (value.getActualInstance() instanceof EventCONTEXTCOMPACTED) { + JsonElement element = adapterEventCONTEXTCOMPACTED.toJsonTree((EventCONTEXTCOMPACTED)value.getActualInstance()); + elementAdapter.write(out, element); + return; + } + // check if the actual instance is of the type `EventRUNCANCELLED` + if (value.getActualInstance() instanceof EventRUNCANCELLED) { + JsonElement element = adapterEventRUNCANCELLED.toJsonTree((EventRUNCANCELLED)value.getActualInstance()); + elementAdapter.write(out, element); + return; + } + // check if the actual instance is of the type `EventRUNERROR` + if (value.getActualInstance() instanceof EventRUNERROR) { + JsonElement element = adapterEventRUNERROR.toJsonTree((EventRUNERROR)value.getActualInstance()); + elementAdapter.write(out, element); + return; + } + // check if the actual instance is of the type `EventRUNFINISHED` + if (value.getActualInstance() instanceof EventRUNFINISHED) { + JsonElement element = adapterEventRUNFINISHED.toJsonTree((EventRUNFINISHED)value.getActualInstance()); + elementAdapter.write(out, element); + return; + } + // check if the actual instance is of the type `EventRUNSTARTED` + if (value.getActualInstance() instanceof EventRUNSTARTED) { + JsonElement element = adapterEventRUNSTARTED.toJsonTree((EventRUNSTARTED)value.getActualInstance()); + elementAdapter.write(out, element); + return; + } + // check if the actual instance is of the type `EventSTEPFINISHED` + if (value.getActualInstance() instanceof EventSTEPFINISHED) { + JsonElement element = adapterEventSTEPFINISHED.toJsonTree((EventSTEPFINISHED)value.getActualInstance()); + elementAdapter.write(out, element); + return; + } + // check if the actual instance is of the type `EventSTEPSTARTED` + if (value.getActualInstance() instanceof EventSTEPSTARTED) { + JsonElement element = adapterEventSTEPSTARTED.toJsonTree((EventSTEPSTARTED)value.getActualInstance()); + elementAdapter.write(out, element); + return; + } + // check if the actual instance is of the type `EventTEXTMESSAGECONTENT` + if (value.getActualInstance() instanceof EventTEXTMESSAGECONTENT) { + JsonElement element = adapterEventTEXTMESSAGECONTENT.toJsonTree((EventTEXTMESSAGECONTENT)value.getActualInstance()); + elementAdapter.write(out, element); + return; + } + // check if the actual instance is of the type `EventTEXTMESSAGEEND` + if (value.getActualInstance() instanceof EventTEXTMESSAGEEND) { + JsonElement element = adapterEventTEXTMESSAGEEND.toJsonTree((EventTEXTMESSAGEEND)value.getActualInstance()); + elementAdapter.write(out, element); + return; + } + // check if the actual instance is of the type `EventTEXTMESSAGESTART` + if (value.getActualInstance() instanceof EventTEXTMESSAGESTART) { + JsonElement element = adapterEventTEXTMESSAGESTART.toJsonTree((EventTEXTMESSAGESTART)value.getActualInstance()); + elementAdapter.write(out, element); + return; + } + // check if the actual instance is of the type `EventTITLEUPDATED` + if (value.getActualInstance() instanceof EventTITLEUPDATED) { + JsonElement element = adapterEventTITLEUPDATED.toJsonTree((EventTITLEUPDATED)value.getActualInstance()); + elementAdapter.write(out, element); + return; + } + // check if the actual instance is of the type `EventTOOLCALLARGSDELTA` + if (value.getActualInstance() instanceof EventTOOLCALLARGSDELTA) { + JsonElement element = adapterEventTOOLCALLARGSDELTA.toJsonTree((EventTOOLCALLARGSDELTA)value.getActualInstance()); + elementAdapter.write(out, element); + return; + } + // check if the actual instance is of the type `EventTOOLCALLEND` + if (value.getActualInstance() instanceof EventTOOLCALLEND) { + JsonElement element = adapterEventTOOLCALLEND.toJsonTree((EventTOOLCALLEND)value.getActualInstance()); + elementAdapter.write(out, element); + return; + } + // check if the actual instance is of the type `EventTOOLCALLRESULT` + if (value.getActualInstance() instanceof EventTOOLCALLRESULT) { + JsonElement element = adapterEventTOOLCALLRESULT.toJsonTree((EventTOOLCALLRESULT)value.getActualInstance()); + elementAdapter.write(out, element); + return; + } + // check if the actual instance is of the type `EventTOOLCALLSTART` + if (value.getActualInstance() instanceof EventTOOLCALLSTART) { + JsonElement element = adapterEventTOOLCALLSTART.toJsonTree((EventTOOLCALLSTART)value.getActualInstance()); + elementAdapter.write(out, element); + return; + } + // check if the actual instance is of the type `EventTOOLCONFIRMATIONREQUIRED` + if (value.getActualInstance() instanceof EventTOOLCONFIRMATIONREQUIRED) { + JsonElement element = adapterEventTOOLCONFIRMATIONREQUIRED.toJsonTree((EventTOOLCONFIRMATIONREQUIRED)value.getActualInstance()); + 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, EventTOOLCALLRESULT, EventTOOLCALLSTART, EventTOOLCONFIRMATIONREQUIRED"); + } + + @Override + public StreamEvents200ResponseInner read(JsonReader in) throws IOException { + Object deserialized = null; + JsonElement jsonElement = elementAdapter.read(in); + + int match = 0; + ArrayList errorMessages = new ArrayList<>(); + TypeAdapter actualAdapter = elementAdapter; + + // deserialize EventCONTEXTCOMPACTED + try { + // validate the JSON object to see if any exception is thrown + EventCONTEXTCOMPACTED.validateJsonElement(jsonElement); + actualAdapter = adapterEventCONTEXTCOMPACTED; + match++; + log.log(Level.FINER, "Input data matches schema 'EventCONTEXTCOMPACTED'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format(Locale.ROOT, "Deserialization for EventCONTEXTCOMPACTED failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'EventCONTEXTCOMPACTED'", e); + } + // deserialize EventRUNCANCELLED + try { + // validate the JSON object to see if any exception is thrown + EventRUNCANCELLED.validateJsonElement(jsonElement); + actualAdapter = adapterEventRUNCANCELLED; + match++; + log.log(Level.FINER, "Input data matches schema 'EventRUNCANCELLED'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format(Locale.ROOT, "Deserialization for EventRUNCANCELLED failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'EventRUNCANCELLED'", e); + } + // deserialize EventRUNERROR + try { + // validate the JSON object to see if any exception is thrown + EventRUNERROR.validateJsonElement(jsonElement); + actualAdapter = adapterEventRUNERROR; + match++; + log.log(Level.FINER, "Input data matches schema 'EventRUNERROR'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format(Locale.ROOT, "Deserialization for EventRUNERROR failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'EventRUNERROR'", e); + } + // deserialize EventRUNFINISHED + try { + // validate the JSON object to see if any exception is thrown + EventRUNFINISHED.validateJsonElement(jsonElement); + actualAdapter = adapterEventRUNFINISHED; + match++; + log.log(Level.FINER, "Input data matches schema 'EventRUNFINISHED'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format(Locale.ROOT, "Deserialization for EventRUNFINISHED failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'EventRUNFINISHED'", e); + } + // deserialize EventRUNSTARTED + try { + // validate the JSON object to see if any exception is thrown + EventRUNSTARTED.validateJsonElement(jsonElement); + actualAdapter = adapterEventRUNSTARTED; + match++; + log.log(Level.FINER, "Input data matches schema 'EventRUNSTARTED'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format(Locale.ROOT, "Deserialization for EventRUNSTARTED failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'EventRUNSTARTED'", e); + } + // deserialize EventSTEPFINISHED + try { + // validate the JSON object to see if any exception is thrown + EventSTEPFINISHED.validateJsonElement(jsonElement); + actualAdapter = adapterEventSTEPFINISHED; + match++; + log.log(Level.FINER, "Input data matches schema 'EventSTEPFINISHED'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format(Locale.ROOT, "Deserialization for EventSTEPFINISHED failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'EventSTEPFINISHED'", e); + } + // deserialize EventSTEPSTARTED + try { + // validate the JSON object to see if any exception is thrown + EventSTEPSTARTED.validateJsonElement(jsonElement); + actualAdapter = adapterEventSTEPSTARTED; + match++; + log.log(Level.FINER, "Input data matches schema 'EventSTEPSTARTED'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format(Locale.ROOT, "Deserialization for EventSTEPSTARTED failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'EventSTEPSTARTED'", e); + } + // deserialize EventTEXTMESSAGECONTENT + try { + // validate the JSON object to see if any exception is thrown + EventTEXTMESSAGECONTENT.validateJsonElement(jsonElement); + actualAdapter = adapterEventTEXTMESSAGECONTENT; + match++; + log.log(Level.FINER, "Input data matches schema 'EventTEXTMESSAGECONTENT'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format(Locale.ROOT, "Deserialization for EventTEXTMESSAGECONTENT failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'EventTEXTMESSAGECONTENT'", e); + } + // deserialize EventTEXTMESSAGEEND + try { + // validate the JSON object to see if any exception is thrown + EventTEXTMESSAGEEND.validateJsonElement(jsonElement); + actualAdapter = adapterEventTEXTMESSAGEEND; + match++; + log.log(Level.FINER, "Input data matches schema 'EventTEXTMESSAGEEND'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format(Locale.ROOT, "Deserialization for EventTEXTMESSAGEEND failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'EventTEXTMESSAGEEND'", e); + } + // deserialize EventTEXTMESSAGESTART + try { + // validate the JSON object to see if any exception is thrown + EventTEXTMESSAGESTART.validateJsonElement(jsonElement); + actualAdapter = adapterEventTEXTMESSAGESTART; + match++; + log.log(Level.FINER, "Input data matches schema 'EventTEXTMESSAGESTART'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format(Locale.ROOT, "Deserialization for EventTEXTMESSAGESTART failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'EventTEXTMESSAGESTART'", e); + } + // deserialize EventTITLEUPDATED + try { + // validate the JSON object to see if any exception is thrown + EventTITLEUPDATED.validateJsonElement(jsonElement); + actualAdapter = adapterEventTITLEUPDATED; + match++; + log.log(Level.FINER, "Input data matches schema 'EventTITLEUPDATED'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format(Locale.ROOT, "Deserialization for EventTITLEUPDATED failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'EventTITLEUPDATED'", e); + } + // deserialize EventTOOLCALLARGSDELTA + try { + // validate the JSON object to see if any exception is thrown + EventTOOLCALLARGSDELTA.validateJsonElement(jsonElement); + actualAdapter = adapterEventTOOLCALLARGSDELTA; + match++; + log.log(Level.FINER, "Input data matches schema 'EventTOOLCALLARGSDELTA'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format(Locale.ROOT, "Deserialization for EventTOOLCALLARGSDELTA failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'EventTOOLCALLARGSDELTA'", e); + } + // deserialize EventTOOLCALLEND + try { + // validate the JSON object to see if any exception is thrown + EventTOOLCALLEND.validateJsonElement(jsonElement); + actualAdapter = adapterEventTOOLCALLEND; + match++; + log.log(Level.FINER, "Input data matches schema 'EventTOOLCALLEND'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format(Locale.ROOT, "Deserialization for EventTOOLCALLEND failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'EventTOOLCALLEND'", e); + } + // deserialize EventTOOLCALLRESULT + try { + // validate the JSON object to see if any exception is thrown + EventTOOLCALLRESULT.validateJsonElement(jsonElement); + actualAdapter = adapterEventTOOLCALLRESULT; + match++; + log.log(Level.FINER, "Input data matches schema 'EventTOOLCALLRESULT'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format(Locale.ROOT, "Deserialization for EventTOOLCALLRESULT failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'EventTOOLCALLRESULT'", e); + } + // deserialize EventTOOLCALLSTART + try { + // validate the JSON object to see if any exception is thrown + EventTOOLCALLSTART.validateJsonElement(jsonElement); + actualAdapter = adapterEventTOOLCALLSTART; + match++; + log.log(Level.FINER, "Input data matches schema 'EventTOOLCALLSTART'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format(Locale.ROOT, "Deserialization for EventTOOLCALLSTART failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'EventTOOLCALLSTART'", e); + } + // deserialize EventTOOLCONFIRMATIONREQUIRED + try { + // validate the JSON object to see if any exception is thrown + EventTOOLCONFIRMATIONREQUIRED.validateJsonElement(jsonElement); + actualAdapter = adapterEventTOOLCONFIRMATIONREQUIRED; + match++; + log.log(Level.FINER, "Input data matches schema 'EventTOOLCONFIRMATIONREQUIRED'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format(Locale.ROOT, "Deserialization for EventTOOLCONFIRMATIONREQUIRED failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'EventTOOLCONFIRMATIONREQUIRED'", e); + } + + if (match == 1) { + StreamEvents200ResponseInner ret = new StreamEvents200ResponseInner(); + ret.setActualInstance(actualAdapter.fromJsonTree(jsonElement)); + return ret; + } + + throw new IOException(String.format(Locale.ROOT, "Failed deserialization for StreamEvents200ResponseInner: %d classes match result, expected 1. Detailed failure message for oneOf schemas: %s. JSON: %s", match, errorMessages, jsonElement.toString())); + } + }.nullSafe(); + } + } + + // store a list of schema names defined in oneOf + public static final Map> schemas = new HashMap>(); + + public StreamEvents200ResponseInner() { + super("oneOf", Boolean.FALSE); + } + + public StreamEvents200ResponseInner(Object o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + static { + schemas.put("EventCONTEXTCOMPACTED", EventCONTEXTCOMPACTED.class); + schemas.put("EventRUNCANCELLED", EventRUNCANCELLED.class); + schemas.put("EventRUNERROR", EventRUNERROR.class); + schemas.put("EventRUNFINISHED", EventRUNFINISHED.class); + schemas.put("EventRUNSTARTED", EventRUNSTARTED.class); + schemas.put("EventSTEPFINISHED", EventSTEPFINISHED.class); + schemas.put("EventSTEPSTARTED", EventSTEPSTARTED.class); + schemas.put("EventTEXTMESSAGECONTENT", EventTEXTMESSAGECONTENT.class); + schemas.put("EventTEXTMESSAGEEND", EventTEXTMESSAGEEND.class); + schemas.put("EventTEXTMESSAGESTART", EventTEXTMESSAGESTART.class); + schemas.put("EventTITLEUPDATED", EventTITLEUPDATED.class); + schemas.put("EventTOOLCALLARGSDELTA", EventTOOLCALLARGSDELTA.class); + schemas.put("EventTOOLCALLEND", EventTOOLCALLEND.class); + schemas.put("EventTOOLCALLRESULT", EventTOOLCALLRESULT.class); + schemas.put("EventTOOLCALLSTART", EventTOOLCALLSTART.class); + schemas.put("EventTOOLCONFIRMATIONREQUIRED", EventTOOLCONFIRMATIONREQUIRED.class); + } + + @Override + public Map> getSchemas() { + return StreamEvents200ResponseInner.schemas; + } + + /** + * 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, EventTOOLCALLRESULT, EventTOOLCALLSTART, EventTOOLCONFIRMATIONREQUIRED + * + * It could be an instance of the 'oneOf' schemas. + */ + @Override + public void setActualInstance(Object instance) { + if (instance instanceof EventCONTEXTCOMPACTED) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof EventRUNCANCELLED) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof EventRUNERROR) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof EventRUNFINISHED) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof EventRUNSTARTED) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof EventSTEPFINISHED) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof EventSTEPSTARTED) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof EventTEXTMESSAGECONTENT) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof EventTEXTMESSAGEEND) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof EventTEXTMESSAGESTART) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof EventTITLEUPDATED) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof EventTOOLCALLARGSDELTA) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof EventTOOLCALLEND) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof EventTOOLCALLRESULT) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof EventTOOLCALLSTART) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof EventTOOLCONFIRMATIONREQUIRED) { + super.setActualInstance(instance); + return; + } + + throw new RuntimeException("Invalid instance type. Must be EventCONTEXTCOMPACTED, EventRUNCANCELLED, EventRUNERROR, EventRUNFINISHED, EventRUNSTARTED, EventSTEPFINISHED, EventSTEPSTARTED, EventTEXTMESSAGECONTENT, EventTEXTMESSAGEEND, EventTEXTMESSAGESTART, EventTITLEUPDATED, EventTOOLCALLARGSDELTA, EventTOOLCALLEND, 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, EventTOOLCALLRESULT, EventTOOLCALLSTART, EventTOOLCONFIRMATIONREQUIRED + * + * @return The actual instance (EventCONTEXTCOMPACTED, EventRUNCANCELLED, EventRUNERROR, EventRUNFINISHED, EventRUNSTARTED, EventSTEPFINISHED, EventSTEPSTARTED, EventTEXTMESSAGECONTENT, EventTEXTMESSAGEEND, EventTEXTMESSAGESTART, EventTITLEUPDATED, EventTOOLCALLARGSDELTA, EventTOOLCALLEND, EventTOOLCALLRESULT, EventTOOLCALLSTART, EventTOOLCONFIRMATIONREQUIRED) + */ + @SuppressWarnings("unchecked") + @Override + public Object getActualInstance() { + return super.getActualInstance(); + } + + /** + * Get the actual instance of `EventCONTEXTCOMPACTED`. If the actual instance is not `EventCONTEXTCOMPACTED`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `EventCONTEXTCOMPACTED` + * @throws ClassCastException if the instance is not `EventCONTEXTCOMPACTED` + */ + public EventCONTEXTCOMPACTED getEventCONTEXTCOMPACTED() throws ClassCastException { + return (EventCONTEXTCOMPACTED)super.getActualInstance(); + } + + /** + * Get the actual instance of `EventRUNCANCELLED`. If the actual instance is not `EventRUNCANCELLED`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `EventRUNCANCELLED` + * @throws ClassCastException if the instance is not `EventRUNCANCELLED` + */ + public EventRUNCANCELLED getEventRUNCANCELLED() throws ClassCastException { + return (EventRUNCANCELLED)super.getActualInstance(); + } + + /** + * Get the actual instance of `EventRUNERROR`. If the actual instance is not `EventRUNERROR`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `EventRUNERROR` + * @throws ClassCastException if the instance is not `EventRUNERROR` + */ + public EventRUNERROR getEventRUNERROR() throws ClassCastException { + return (EventRUNERROR)super.getActualInstance(); + } + + /** + * Get the actual instance of `EventRUNFINISHED`. If the actual instance is not `EventRUNFINISHED`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `EventRUNFINISHED` + * @throws ClassCastException if the instance is not `EventRUNFINISHED` + */ + public EventRUNFINISHED getEventRUNFINISHED() throws ClassCastException { + return (EventRUNFINISHED)super.getActualInstance(); + } + + /** + * Get the actual instance of `EventRUNSTARTED`. If the actual instance is not `EventRUNSTARTED`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `EventRUNSTARTED` + * @throws ClassCastException if the instance is not `EventRUNSTARTED` + */ + public EventRUNSTARTED getEventRUNSTARTED() throws ClassCastException { + return (EventRUNSTARTED)super.getActualInstance(); + } + + /** + * Get the actual instance of `EventSTEPFINISHED`. If the actual instance is not `EventSTEPFINISHED`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `EventSTEPFINISHED` + * @throws ClassCastException if the instance is not `EventSTEPFINISHED` + */ + public EventSTEPFINISHED getEventSTEPFINISHED() throws ClassCastException { + return (EventSTEPFINISHED)super.getActualInstance(); + } + + /** + * Get the actual instance of `EventSTEPSTARTED`. If the actual instance is not `EventSTEPSTARTED`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `EventSTEPSTARTED` + * @throws ClassCastException if the instance is not `EventSTEPSTARTED` + */ + public EventSTEPSTARTED getEventSTEPSTARTED() throws ClassCastException { + return (EventSTEPSTARTED)super.getActualInstance(); + } + + /** + * Get the actual instance of `EventTEXTMESSAGECONTENT`. If the actual instance is not `EventTEXTMESSAGECONTENT`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `EventTEXTMESSAGECONTENT` + * @throws ClassCastException if the instance is not `EventTEXTMESSAGECONTENT` + */ + public EventTEXTMESSAGECONTENT getEventTEXTMESSAGECONTENT() throws ClassCastException { + return (EventTEXTMESSAGECONTENT)super.getActualInstance(); + } + + /** + * Get the actual instance of `EventTEXTMESSAGEEND`. If the actual instance is not `EventTEXTMESSAGEEND`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `EventTEXTMESSAGEEND` + * @throws ClassCastException if the instance is not `EventTEXTMESSAGEEND` + */ + public EventTEXTMESSAGEEND getEventTEXTMESSAGEEND() throws ClassCastException { + return (EventTEXTMESSAGEEND)super.getActualInstance(); + } + + /** + * Get the actual instance of `EventTEXTMESSAGESTART`. If the actual instance is not `EventTEXTMESSAGESTART`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `EventTEXTMESSAGESTART` + * @throws ClassCastException if the instance is not `EventTEXTMESSAGESTART` + */ + public EventTEXTMESSAGESTART getEventTEXTMESSAGESTART() throws ClassCastException { + return (EventTEXTMESSAGESTART)super.getActualInstance(); + } + + /** + * Get the actual instance of `EventTITLEUPDATED`. If the actual instance is not `EventTITLEUPDATED`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `EventTITLEUPDATED` + * @throws ClassCastException if the instance is not `EventTITLEUPDATED` + */ + public EventTITLEUPDATED getEventTITLEUPDATED() throws ClassCastException { + return (EventTITLEUPDATED)super.getActualInstance(); + } + + /** + * Get the actual instance of `EventTOOLCALLARGSDELTA`. If the actual instance is not `EventTOOLCALLARGSDELTA`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `EventTOOLCALLARGSDELTA` + * @throws ClassCastException if the instance is not `EventTOOLCALLARGSDELTA` + */ + public EventTOOLCALLARGSDELTA getEventTOOLCALLARGSDELTA() throws ClassCastException { + return (EventTOOLCALLARGSDELTA)super.getActualInstance(); + } + + /** + * Get the actual instance of `EventTOOLCALLEND`. If the actual instance is not `EventTOOLCALLEND`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `EventTOOLCALLEND` + * @throws ClassCastException if the instance is not `EventTOOLCALLEND` + */ + public EventTOOLCALLEND getEventTOOLCALLEND() throws ClassCastException { + return (EventTOOLCALLEND)super.getActualInstance(); + } + + /** + * Get the actual instance of `EventTOOLCALLRESULT`. If the actual instance is not `EventTOOLCALLRESULT`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `EventTOOLCALLRESULT` + * @throws ClassCastException if the instance is not `EventTOOLCALLRESULT` + */ + public EventTOOLCALLRESULT getEventTOOLCALLRESULT() throws ClassCastException { + return (EventTOOLCALLRESULT)super.getActualInstance(); + } + + /** + * Get the actual instance of `EventTOOLCALLSTART`. If the actual instance is not `EventTOOLCALLSTART`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `EventTOOLCALLSTART` + * @throws ClassCastException if the instance is not `EventTOOLCALLSTART` + */ + public EventTOOLCALLSTART getEventTOOLCALLSTART() throws ClassCastException { + return (EventTOOLCALLSTART)super.getActualInstance(); + } + + /** + * Get the actual instance of `EventTOOLCONFIRMATIONREQUIRED`. If the actual instance is not `EventTOOLCONFIRMATIONREQUIRED`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `EventTOOLCONFIRMATIONREQUIRED` + * @throws ClassCastException if the instance is not `EventTOOLCONFIRMATIONREQUIRED` + */ + public EventTOOLCONFIRMATIONREQUIRED getEventTOOLCONFIRMATIONREQUIRED() throws ClassCastException { + return (EventTOOLCONFIRMATIONREQUIRED)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 StreamEvents200ResponseInner + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + // validate oneOf schemas one by one + int validCount = 0; + ArrayList errorMessages = new ArrayList<>(); + // validate the json string with EventCONTEXTCOMPACTED + try { + EventCONTEXTCOMPACTED.validateJsonElement(jsonElement); + validCount++; + } catch (Exception e) { + errorMessages.add(String.format(Locale.ROOT, "Deserialization for EventCONTEXTCOMPACTED failed with `%s`.", e.getMessage())); + // continue to the next one + } + // validate the json string with EventRUNCANCELLED + try { + EventRUNCANCELLED.validateJsonElement(jsonElement); + validCount++; + } catch (Exception e) { + errorMessages.add(String.format(Locale.ROOT, "Deserialization for EventRUNCANCELLED failed with `%s`.", e.getMessage())); + // continue to the next one + } + // validate the json string with EventRUNERROR + try { + EventRUNERROR.validateJsonElement(jsonElement); + validCount++; + } catch (Exception e) { + errorMessages.add(String.format(Locale.ROOT, "Deserialization for EventRUNERROR failed with `%s`.", e.getMessage())); + // continue to the next one + } + // validate the json string with EventRUNFINISHED + try { + EventRUNFINISHED.validateJsonElement(jsonElement); + validCount++; + } catch (Exception e) { + errorMessages.add(String.format(Locale.ROOT, "Deserialization for EventRUNFINISHED failed with `%s`.", e.getMessage())); + // continue to the next one + } + // validate the json string with EventRUNSTARTED + try { + EventRUNSTARTED.validateJsonElement(jsonElement); + validCount++; + } catch (Exception e) { + errorMessages.add(String.format(Locale.ROOT, "Deserialization for EventRUNSTARTED failed with `%s`.", e.getMessage())); + // continue to the next one + } + // validate the json string with EventSTEPFINISHED + try { + EventSTEPFINISHED.validateJsonElement(jsonElement); + validCount++; + } catch (Exception e) { + errorMessages.add(String.format(Locale.ROOT, "Deserialization for EventSTEPFINISHED failed with `%s`.", e.getMessage())); + // continue to the next one + } + // validate the json string with EventSTEPSTARTED + try { + EventSTEPSTARTED.validateJsonElement(jsonElement); + validCount++; + } catch (Exception e) { + errorMessages.add(String.format(Locale.ROOT, "Deserialization for EventSTEPSTARTED failed with `%s`.", e.getMessage())); + // continue to the next one + } + // validate the json string with EventTEXTMESSAGECONTENT + try { + EventTEXTMESSAGECONTENT.validateJsonElement(jsonElement); + validCount++; + } catch (Exception e) { + errorMessages.add(String.format(Locale.ROOT, "Deserialization for EventTEXTMESSAGECONTENT failed with `%s`.", e.getMessage())); + // continue to the next one + } + // validate the json string with EventTEXTMESSAGEEND + try { + EventTEXTMESSAGEEND.validateJsonElement(jsonElement); + validCount++; + } catch (Exception e) { + errorMessages.add(String.format(Locale.ROOT, "Deserialization for EventTEXTMESSAGEEND failed with `%s`.", e.getMessage())); + // continue to the next one + } + // validate the json string with EventTEXTMESSAGESTART + try { + EventTEXTMESSAGESTART.validateJsonElement(jsonElement); + validCount++; + } catch (Exception e) { + errorMessages.add(String.format(Locale.ROOT, "Deserialization for EventTEXTMESSAGESTART failed with `%s`.", e.getMessage())); + // continue to the next one + } + // validate the json string with EventTITLEUPDATED + try { + EventTITLEUPDATED.validateJsonElement(jsonElement); + validCount++; + } catch (Exception e) { + errorMessages.add(String.format(Locale.ROOT, "Deserialization for EventTITLEUPDATED failed with `%s`.", e.getMessage())); + // continue to the next one + } + // validate the json string with EventTOOLCALLARGSDELTA + try { + EventTOOLCALLARGSDELTA.validateJsonElement(jsonElement); + validCount++; + } catch (Exception e) { + errorMessages.add(String.format(Locale.ROOT, "Deserialization for EventTOOLCALLARGSDELTA failed with `%s`.", e.getMessage())); + // continue to the next one + } + // validate the json string with EventTOOLCALLEND + try { + EventTOOLCALLEND.validateJsonElement(jsonElement); + validCount++; + } catch (Exception e) { + errorMessages.add(String.format(Locale.ROOT, "Deserialization for EventTOOLCALLEND failed with `%s`.", e.getMessage())); + // continue to the next one + } + // validate the json string with EventTOOLCALLRESULT + try { + EventTOOLCALLRESULT.validateJsonElement(jsonElement); + validCount++; + } catch (Exception e) { + errorMessages.add(String.format(Locale.ROOT, "Deserialization for EventTOOLCALLRESULT failed with `%s`.", e.getMessage())); + // continue to the next one + } + // validate the json string with EventTOOLCALLSTART + try { + EventTOOLCALLSTART.validateJsonElement(jsonElement); + validCount++; + } catch (Exception e) { + errorMessages.add(String.format(Locale.ROOT, "Deserialization for EventTOOLCALLSTART failed with `%s`.", e.getMessage())); + // continue to the next one + } + // validate the json string with EventTOOLCONFIRMATIONREQUIRED + try { + EventTOOLCONFIRMATIONREQUIRED.validateJsonElement(jsonElement); + validCount++; + } catch (Exception e) { + errorMessages.add(String.format(Locale.ROOT, "Deserialization for EventTOOLCONFIRMATIONREQUIRED failed with `%s`.", e.getMessage())); + // continue to the next one + } + if (validCount != 1) { + throw new IOException(String.format(Locale.ROOT, "The JSON string is invalid for StreamEvents200ResponseInner with oneOf schemas: EventCONTEXTCOMPACTED, EventRUNCANCELLED, EventRUNERROR, EventRUNFINISHED, EventRUNSTARTED, EventSTEPFINISHED, EventSTEPSTARTED, EventTEXTMESSAGECONTENT, EventTEXTMESSAGEEND, EventTEXTMESSAGESTART, EventTITLEUPDATED, EventTOOLCALLARGSDELTA, EventTOOLCALLEND, EventTOOLCALLRESULT, EventTOOLCALLSTART, EventTOOLCONFIRMATIONREQUIRED. %d class(es) match the result, expected 1. Detailed failure message for oneOf schemas: %s. JSON: %s", validCount, errorMessages, jsonElement.toString())); + } + } + + /** + * Create an instance of StreamEvents200ResponseInner given an JSON string + * + * @param jsonString JSON string + * @return An instance of StreamEvents200ResponseInner + * @throws IOException if the JSON string is invalid with respect to StreamEvents200ResponseInner + */ + public static StreamEvents200ResponseInner fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, StreamEvents200ResponseInner.class); + } + + /** + * Convert an instance of StreamEvents200ResponseInner to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/ai/reveng/model/TTPSElement.java b/src/main/java/ai/reveng/model/TTPSElement.java deleted file mode 100644 index 3601539..0000000 --- a/src/main/java/ai/reveng/model/TTPSElement.java +++ /dev/null @@ -1,412 +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 java.util.Locale; -import ai.reveng.model.TTPSAttack; -import ai.reveng.model.TTPSOccurance; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; -import java.util.Locale; - -import ai.reveng.invoker.JSON; - -/** - * TTPSElement - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class TTPSElement { - public static final String SERIALIZED_NAME_NAME = "name"; - @SerializedName(SERIALIZED_NAME_NAME) - @javax.annotation.Nonnull - private String name; - - public static final String SERIALIZED_NAME_ATTACK = "attack"; - @SerializedName(SERIALIZED_NAME_ATTACK) - @javax.annotation.Nonnull - private List attack = new ArrayList<>(); - - public static final String SERIALIZED_NAME_OCCURRENCES = "occurrences"; - @SerializedName(SERIALIZED_NAME_OCCURRENCES) - @javax.annotation.Nonnull - private List occurrences = new ArrayList<>(); - - public static final String SERIALIZED_NAME_SCORE = "score"; - @SerializedName(SERIALIZED_NAME_SCORE) - @javax.annotation.Nonnull - private Integer score; - - public TTPSElement() { - } - - public TTPSElement 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 TTPSElement attack(@javax.annotation.Nonnull List attack) { - this.attack = attack; - return this; - } - - public TTPSElement addAttackItem(TTPSAttack attackItem) { - if (this.attack == null) { - this.attack = new ArrayList<>(); - } - this.attack.add(attackItem); - return this; - } - - /** - * Get attack - * @return attack - */ - @javax.annotation.Nonnull - public List getAttack() { - return attack; - } - - public void setAttack(@javax.annotation.Nonnull List attack) { - this.attack = attack; - } - - - public TTPSElement occurrences(@javax.annotation.Nonnull List occurrences) { - this.occurrences = occurrences; - return this; - } - - public TTPSElement addOccurrencesItem(TTPSOccurance occurrencesItem) { - if (this.occurrences == null) { - this.occurrences = new ArrayList<>(); - } - this.occurrences.add(occurrencesItem); - return this; - } - - /** - * Get occurrences - * @return occurrences - */ - @javax.annotation.Nonnull - public List getOccurrences() { - return occurrences; - } - - public void setOccurrences(@javax.annotation.Nonnull List occurrences) { - this.occurrences = occurrences; - } - - - public TTPSElement score(@javax.annotation.Nonnull Integer score) { - this.score = score; - return this; - } - - /** - * Get score - * @return score - */ - @javax.annotation.Nonnull - public Integer getScore() { - return score; - } - - public void setScore(@javax.annotation.Nonnull Integer score) { - this.score = score; - } - - /** - * 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 TTPSElement instance itself - */ - public TTPSElement 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; - } - TTPSElement ttPSElement = (TTPSElement) o; - return Objects.equals(this.name, ttPSElement.name) && - Objects.equals(this.attack, ttPSElement.attack) && - Objects.equals(this.occurrences, ttPSElement.occurrences) && - Objects.equals(this.score, ttPSElement.score)&& - Objects.equals(this.additionalProperties, ttPSElement.additionalProperties); - } - - @Override - public int hashCode() { - return Objects.hash(name, attack, occurrences, score, additionalProperties); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class TTPSElement {\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append(" attack: ").append(toIndentedString(attack)).append("\n"); - sb.append(" occurrences: ").append(toIndentedString(occurrences)).append("\n"); - sb.append(" score: ").append(toIndentedString(score)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(Arrays.asList("name", "attack", "occurrences", "score")); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(Arrays.asList("name", "attack", "occurrences", "score")); - } - - /** - * 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 TTPSElement - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!TTPSElement.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format(Locale.ROOT, "The required field(s) %s in TTPSElement is not found in the empty JSON string", TTPSElement.openapiRequiredFields.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : TTPSElement.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException(String.format(Locale.ROOT, "The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if (!jsonObj.get("name").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format(Locale.ROOT, "Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString())); - } - // ensure the json data is an array - if (!jsonObj.get("attack").isJsonArray()) { - throw new IllegalArgumentException(String.format(Locale.ROOT, "Expected the field `attack` to be an array in the JSON string but got `%s`", jsonObj.get("attack").toString())); - } - - JsonArray jsonArrayattack = jsonObj.getAsJsonArray("attack"); - // validate the required field `attack` (array) - for (int i = 0; i < jsonArrayattack.size(); i++) { - TTPSAttack.validateJsonElement(jsonArrayattack.get(i)); - }; - // ensure the json data is an array - if (!jsonObj.get("occurrences").isJsonArray()) { - throw new IllegalArgumentException(String.format(Locale.ROOT, "Expected the field `occurrences` to be an array in the JSON string but got `%s`", jsonObj.get("occurrences").toString())); - } - - JsonArray jsonArrayoccurrences = jsonObj.getAsJsonArray("occurrences"); - // validate the required field `occurrences` (array) - for (int i = 0; i < jsonArrayoccurrences.size(); i++) { - TTPSOccurance.validateJsonElement(jsonArrayoccurrences.get(i)); - }; - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!TTPSElement.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'TTPSElement' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(TTPSElement.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, TTPSElement 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 TTPSElement read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // store additional fields in the deserialized instance - TTPSElement instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format(Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else if (entry.getValue().isJsonArray()) { - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); - } else { // JSON object - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; - } - - }.nullSafe(); - } - } - - /** - * Create an instance of TTPSElement given an JSON string - * - * @param jsonString JSON string - * @return An instance of TTPSElement - * @throws IOException if the JSON string is invalid with respect to TTPSElement - */ - public static TTPSElement fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, TTPSElement.class); - } - - /** - * Convert an instance of TTPSElement to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} -